Wednesday, 14 March 2012

Standard Programs

1) Standard program to import standard script into Transport request : RSTXTRAN
2) Program to download spool to pdf : RSTXPDFT4
3) Program to download sap script and script texts : RSTXSCRP

BALVBT01
Example SAP program for displying multiple ALV reports on one page
BCALV_GRID_DEMO ALV Dialog grid demo (4.6)

BRF_COPY_IMPL_CLASSES
Copy standard implementing classes to your new application class. See BRF related transactions

SHOWCOLO
Displays all colours available

SHOWICON
Displays all icon available

RGUGBR00
Substitution/Validation and rules utility

RKCTSEAR
Search source code of various programs for up to two strings. Also see RPR_ABAP_SOURCE_SCAN or use search in source functionality via SE80

RPCIFU01
Display File

RPCIFU03
Download Unix File to PC

RPCIFU04
Upload PC File to Unix File

RPR_ABAP_SOURCE_SCAN
Search ABAP code for a string. Much more flexible than RSRSCAN1 or RKCTSEAR

RSBDCBTC
Submit a BDC job with an internal batch number and wait for the end of the batch input session

RSBDCDRU
Prints the contents of a Batch Input session. No options for error transactions only

RSBDCOS0
Execute OS Command (Logged in SYSLOG and Trace Files)

RSBDCSUB
Process batch input sessions automatically

RSBTCDEL
Delete batch jobs

RSCONN01
SAPconnect: Start Email Send Process

RSCSAUTH
Maintain/Restore Authorization Groups

RSINCL00
Extended ABAP Program Reference List

RSMODRES Restore enhancement projects after upgarde

RSORAREL
Check Oracle Version

RSPARAM
Display all instance parameters

RSPO0041
Delete Old Spool Requests

RSSNAPDL
Reorganization Program for Table SNAP of Short Dumps

RSTRANSP
Transport Report Variants

RSTXFCON
SAPscript: Conversion of Page Format for Forms

RSTXPDFT4
Convert spool request to PDF document

RSTXPDFT5
GUI download of a spool request

RSTXSCRP
SAPscript Export to Dataset / SAPscript Import from Dataset (Upload and download SAPScript layout sets)

RSTXTRAN
Transfer standard Texts(SAPscript texts) to a transport request

RSUSR003
Check the Passwords of Users SAP* and DDIC in All Clients

RSUSR006
List of Users with Incorrect Logons

RSVARFIT
Adjust Variants to Modified Selections

RSVTPROT
Evaluation of change logs

RSWBO052
Change Object Directory Entries

RSWBO060
Include Objects in a Transport Request

SAPMSUU0
Program for user maintenance(SU01), Maybe useful if you do not have access to the actual SU01 transaction code.

Thursday, 8 March 2012

BAPI to change the date formate and FN module to separate the string

1) to change the date formate

data : date like sy-datum,
data1(10) type c.
call function 'CONVERT_DATE_TO_INTERNAL'
exporting
date_external = date1
importing
date_internal = date
exceptions
date_external_is_invalid = 1
others = 2.


http://anu-sapdiary.blogspot.com.au/2008/03/function-modules-for-date-conversion.html


2) to divide the string into 2.

   CALL FUNCTION 'HR_HK_STRING_INTO_2_LINES'
    EXPORTING
      source_str      = ldf_pay_terms
      len_of_1st_line = lcf_thirty
      len_of_2nd_line = lcf_thirty
    IMPORTING
      1st_line_str    = ldf_pay_terms1
      2nd_line_str    = ldf_pay_terms2
    EXCEPTIONS
      error           = 1
      OTHERS          = 2.

  CONDENSE: ldf_pay_terms1,
            ldf_pay_terms2.
  ldf_length = STRLEN( ldf_pay_terms1 ).
  ldf_length1 = STRLEN( ldf_pay_terms2 ).

Wednesday, 7 March 2012

Print program for Order confirmation(Form entry and print parameters)

report  zet05r0003.

*&---------------------------------------------------------------------*
*& Declare Data Object                                                 *
*&                                                                     *
*&---------------------------------------------------------------------*
include zet05r0003top.

include zet05r0003f01.

*---------------------------------------------------------------------*
*       FORM ENTRY
*---------------------------------------------------------------------*
form entry using prf_return_code type sy-subrc
                 prf_us_screen   type c.              "#EC CALLED

  data: ldf_return type sy-subrc.

  gdf_xscreen = prf_us_screen.
  perform processing_outp using prf_us_screen
                       changing ldf_return.
  if ldf_return ne 0.
    prf_return_code = 1.
  else.
    prf_return_code = 0.
  endif.

endform.                    "entry

**************************************************************************
 
*&---------------------------------------------------------------------*
*&  Include           ZEL03R0010F01
*&---------------------------------------------------------------------*
*& renew date   transport No  change by         contents               *
*& 18.11.2011   EJ3K941377    702068010     Change print params        *
*& 21.12.2011    EJ3K943103   Swapna Narra  Fix for Email Functionality*
*&---------------------------------------------------------------------*
*&      Form  processing
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      -->PRF_SCREEN  prf_screen(us_screen)
*&      <--PRF_RETURN  prf_return(return_code)
*&---------------------------------------------------------------------*

form processing_outp  using    prf_screen type c
                 changing prf_return type sy-subrc.
*Smartform Call
  perform output_list using    prf_screen
                      changing prf_return.

endform.                    " processing

*&---------------------------------------------------------------------*
*&      Form  output_list
*&---------------------------------------------------------------------*
*       To Display the Smartform for Display
*----------------------------------------------------------------------*
*      -->PRF_SCREEN  prf_screen(us_screen)
*      <--PRF_RETURN  prf_return(return_code)
*----------------------------------------------------------------------*
form output_list  using    prf_screen  type c
                 changing  prf_return  type sy-subrc.
*Local Variables
  data: lds_control_param              type ssfctrlop.
  data: lds_composer_param             type ssfcompop.
  data: lds_recipient                  type swotobjid.
  data: lds_sender                     type swotobjid.
  data: ldf_form                       type tdsfname.
  data: ldf_fm_name                    type rs38l_fnam.
  data: lds_addr_key                   type addr_key.
*Local Constants.
  constants: lcf_blank(1value ''.

* If no reference key is passed, it'll be handled as an exception and exit the processing.
  if nast-objky is initial.
    perform nast_prot_updt.
*Exit from the Subroutine
    exit.
  endif.

  if prf_return = 0.
*In Case No Error Exists move the Name of Smartform.
    move tnapr-sform to ldf_form.
    perform get_data changing lds_addr_key
                             prf_return  .
*Setting the Print Parameters.
    perform set_print_param using    lds_addr_key
                            changing lds_control_param
                                     lds_composer_param
                                     lds_recipient
                                     lds_sender
                                     prf_return.

*Function Module Call for the Smartform.
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname           = ldf_form
      importing
        fm_name            = ldf_fm_name
      exceptions
        no_form            = 1
        no_function_module = 2
        others             = 3.
    if sy-subrc <> 0.
*Error Handling
      prf_return = sy-subrc.
      if prf_screen = lcf_blank.
*Error Logging is Performed
        perform protocol_update.
      endif.
    endif.
  endif.

*In Case There are no Errors the Smartform Handling is done here.
  if prf_return = 0.
*   call smartform
    call function ldf_fm_name
      exporting
        control_parameters = lds_control_param
        mail_recipient     = lds_recipient
        mail_sender        = lds_sender
        output_options     = lds_composer_param
        user_settings      = lcf_blank
        i_nast             = nast
      exceptions
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        others             = 5.
    if sy-subrc <> 0.
*Error handling
      prf_return = sy-subrc.

      if prf_screen = lcf_blank.
*Error Logging is Performed
        perform protocol_update.
      endif.
*Get SmartForm protocol and store it in the NAST protocoll
      perform add_smfrm_prot.
    endif.
  endif.
endform.                    " output_list

*---------------------------------------------------------------------*
*       FORM PROTOCOL_UPDATE                                          *
*---------------------------------------------------------------------*
*       The messages are collected for the processing protocol.       *
*---------------------------------------------------------------------*

form protocol_update.

  check gdf_xscreen = space.

*Funtion Module Call for Error Logging
  perform nast_prot_updt.

endform.                    "PROTOCOL_UPDATE

*&---------------------------------------------------------------------*
*&      Form  ADD_SMFRM_PROT
*&---------------------------------------------------------------------*
form add_smfrm_prot.

  data: ldt_errortab             type tsferror.
  field-symbols: <fs_errortab>   type line of tsferror.
  constants: lcf_e(1)            value 'E'.

*Get smart form protocoll
  call function 'SSF_READ_ERRORS'
    importing
      errortab = ldt_errortab.

* add smartform protocoll to nast protocoll
  loop at ldt_errortab assigning <fs_errortab>.

*Updating the Error Log
    call function 'NAST_PROTOCOL_UPDATE'
      exporting
        msg_arbgb              = <fs_errortab>-msgid
        msg_nr                 = <fs_errortab>-msgno
        msg_ty                 = <fs_errortab>-msgty
        msg_v1                 = <fs_errortab>-msgv1
        msg_v2                 = <fs_errortab>-msgv2
        msg_v3                 = <fs_errortab>-msgv3
        msg_v4                 = <fs_errortab>-msgv4
      exceptions
        message_type_not_valid = 1
        no_sy_message          = 2
        others                 = 3.
    if sy-subrc <> 0.
      message id sy-msgid type lcf_e number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
  endloop.

endform.                               " ADD_SMFRM_PROT

*&---------------------------------------------------------------------*
*&      Form  SET_PRINT_PARAM
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      -->  prs_addr_key
*&      <--  prs_control_param
*&      <--  prs_composer_param
*&      <-- prs_recipient
*&      <-- prs_sender
*&      <-- prf_return
*&---------------------------------------------------------------------*

form set_print_param using    prs_addr_key       type addr_key
                     changing prs_control_param  type ssfctrlop
                              prs_composer_param type ssfcompop
                              prs_recipient      type swotobjid
                              prs_sender         type swotobjid
                              prf_return         type sy-subrc.
*Local Declarations.
  data: lds_itcpo     type itcpo.
  data: ldf_repid     type sy-repid.
  data: ldf_device    type tddevice.
*Program Name
  ldf_repid = sy-repid.
*Local Constants.
  constants: lcf_x(1value 'X'.
*Smartform Conditions.
  call function 'WFMC_PREPARE_SMART_FORM'
    exporting
      pi_nast       = nast
      pi_addr_key   = prs_addr_key
      pi_repid      = ldf_repid
    importing
      pe_returncode = prf_return
      pe_itcpo      = lds_itcpo
      pe_device     = ldf_device
      pe_recipient  = prs_recipient
      pe_sender     = prs_sender.

  if prf_return = 0.
*Setting up the Display of Smartform.
    move-corresponding lds_itcpo to prs_composer_param.
    concatenate prs_composer_param-tdcovtitle
             space
             nast-objky
             into prs_composer_param-tdtitle.

*   prs_composer_param-tdnewid = lcf_x  .                  "<EJ3K941377
    prs_control_param-device      = ldf_device.
    prs_control_param-no_dialog   = lcf_x.
    prs_control_param-preview     = gdf_xscreen.
    prs_control_param-getotf      = lds_itcpo-tdgetotf.
    prs_control_param-langu       = nast-spras.
  endif.
endform.                               " SET_PRINT_PARAM

*&---------------------------------------------------------------------*
*&      Form  nast_prot_updt
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form nast_prot_updt.
  constants: lcf_e(1value 'E'.
  call function 'NAST_PROTOCOL_UPDATE'
    exporting
      msg_arbgb              = syst-msgid
      msg_nr                 = syst-msgno
      msg_ty                 = syst-msgty
      msg_v1                 = syst-msgv1
      msg_v2                 = syst-msgv2
      msg_v3                 = syst-msgv3
      msg_v4                 = syst-msgv4
    exceptions
      message_type_not_valid = 1
      no_sy_message          = 2
      others                 = 3.
  if sy-subrc <> 0.
    message id sy-msgid type lcf_e number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.



endform.                    "nast_prot_updt
*&---------------------------------------------------------------------*
*&      Form  GET_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_LDS_ADDR_KEY  text
*----------------------------------------------------------------------*
form get_data  changing prf_addr_key type addr_key
                        prf_retcode  type sy-subrc.
  data: ldt_mess type standard table of vbfs,
        lds_mess like vbfs.
  databegin of ldt_vbdpa occurs 0.        "Internal table for items
          include structure vbdpa.
  dataend of ldt_vbdpa.
  data :lds_vbco3         type vbco3.

  lds_vbco3-mandt = sy-mandt.
  lds_vbco3-spras = nast-spras.
  lds_vbco3-vbeln = nast-objky.
  lds_vbco3-kunde = nast-parnr.
  lds_vbco3-parvw = nast-parvw.

  call function 'RV_DOCUMENT_PRINT_VIEW'
    exporting
      comwa                       = lds_vbco3
    importing
      kopf                        = vbdka
    tables
      pos                         = ldt_vbdpa
      mess                        = ldt_mess
    exceptions
      fehler_bei_datenbeschaffung = 1.
  if sy-subrc ne 0.
    perform protocol_update.
    prf_retcode = 1.
    exit.
  else.
    loop at ldt_mess into lds_mess.
      sy-msgid = lds_mess-msgid.
      sy-msgno = lds_mess-msgno.
      sy-msgty = lds_mess-msgty.
      sy-msgv1 = lds_mess-msgv1.
      sy-msgv2 = lds_mess-msgv2.
      sy-msgv3 = lds_mess-msgv3.
      sy-msgv4 = lds_mess-msgv4.
      perform protocol_update.
    endloop.
  endif.
* fill address key --> necessary for emails
  prf_addr_key-addrnumber = vbdka-adrnr.
  prf_addr_key-persnumber = vbdka-adrnp.
  prf_addr_key-addr_type  = vbdka-address_type.
endform.                    " GET_DATA

Wednesday, 29 February 2012

HOw to add the Profiles in the Outlook

GO to Control pannel-----> Mail setup------>double click--->show profiles-->enter profile nme and the details---->save.


to put delegated:
outlook--->tools--->delegates--->add

Tuesday, 28 February 2012

To declare the selection option table

  TYPESBEGIN OF gts_pfunc,
        sign TYPE char1,
        option TYPE char2,
        low TYPE  vbpa-parvw,
        high TYPE vbpa-parvw,
       END OF gts_pfunc.
      
       REFRESH gdt_pfunc.
  lds_pfunc-sign = gcf_i.
  lds_pfunc-option = gcf_eq.
  lds_pfunc-low = gcf_we.
  APPEND lds_pfunc TO gdt_pfunc.
  lds_pfunc-low = gcf_ze.
  APPEND lds_pfunc TO gdt_pfunc.
  lds_pfunc-low = gcf_sb.
  APPEND lds_pfunc TO gdt_pfunc.