Dif betwen BDC call transaction and session method

Hi to all,
           This is my problem. I want to know, what is the difference between BDC call Transaction method and Session method. where the situation we can use these methods.
I will be thankfull to all.

Session Method :
   Asynchronous Processing.
   Transfers Data for Multiple Transactions
  Synchronous Database Update
  During Processing, No Transaction is started until the previous transction has been written to the database.
  A Batch Input Processing log is generated for each session
  Sessions can not be generated in Parallel.
  The Batch Input Porgram must not open a Session until it has closed the preceding Session.
Call Transaction :
   Synchronous Processing.
   Transfers Data for a single transaction.
   Synchronous and Asynchronous Database updating both Possible.
   The Program Specifies which kind of updating is desired.
  Seperate LUW for the transaction.
  The System Performs a database commit immediately before and after the  CALL TRANSACTION Using Statement.
No Batch Input Processing Log is generated.
These are the differences between session and call transaction method.
Call transaction is faster then session method. But usually we use session method in real time...because we can transfer large amount of data from internal table to database and if any errors in a session. Process will not complete until session get correct.

Similar Messages

  • Bdc(call transaction and session method)

    hi experts,
       i want to write for bdc program in which i have used call transaction and session method.please help me.
    thank you
    with regards,
    santosh

    Hi,
    See the Sample BDc Code for Vendor Master Upload:
    Look at the Include BDCRECX1 for Seesion and Call Transaction types:
    REPORT zmm_vendor_master_upload
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    ABAP Name   :   ZMM_VENDOR_MASTER_UPLOAD
    Description :   This Program is used to Upload the Vendor Master.
      Modification Log:
      Date         Programmer          Correction    Description
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_vendor OCCURS 0,
            bukrs(004),             " Company Code
            ekorg(004),             " Purchase Orgn
            ktokk(004),             " Account Group
    Address Screen
            anred(015),             " Title
            name1(035),                                         " Name1
            sortl(010),             " Sort Field
            name2(035),                                         " Name2
            name3(035),             " Contact Person1
            name4(035),             " Contact Person 2
            stras(035),             " Street
            pfach(010),             " PO Box
            ort01(035),             " City
            pstlz(010),             " Postal Code
            land1(003),             " Country
            spras(002),             " Language
            telf1(016),             " Telephone No
            telfx(031),             " Fax Number
            lfurl(132),             " URL-Mail Id
    Material Group Characteristics
           klart(003),             " Class Type '010'
           class(018),             " Class 'Vendor'
           mname_01(030),          " Characteristic
           mname_02(030),          " Characteristic
           mname_03(030),          " Characteristic
            mwert_01(030),          " Charct.Value
            mwert_02(030),          " Charct.Value
            mwert_03(030),          " Charct.Value
    Control Data
            emnfr(010),             " Manufact.Part No
    Bank Details
            banks_01(003),          " Country of Bank1
            banks_02(003),          " Country of Bank2
            bankl_01(015),          " Bank Key of 1
            bankl_02(015),          " Bank Key of 2
            bankn_01(018),          " Account No Bank1
            bankn_02(018),          " Account No Bank2
    Accounting Info
            akont(010),             " Reconcillation Account
            zuawa(003),             " Sort Key
            fdgrv(010),             " Cash Management Group
    Payment Transactions
            zterm(004),             " Payment terms
           reprf(001),             " Check Double Inv.
            zwels(010),             " Payment Method
            hbkid(005),             " House Bank
           xpore(001),             " Individ.Payment
    Correspondence
            mahns(001),             " Dunning Level
            xausz(001),             " Account Statement
    Withholding Tax Details
            qland(003),             " Withholding Tax Country
            witht_01(002),          " WH tax Type
           wt_withcd(002),        " WH Tax Code
           wt_subjct(001),        " Indicator:WH Tax
    Purchasing Data
            waers(005),             " Currency
            zterm1(004),            " Payment Terms
          END OF i_vendor.
    Data Variables & Constants
    CONSTANTS : c_x     VALUE 'X'.  " Flag
    Paramters
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
      PERFORM open_group.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_vendor
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Upload the Data from Internal Table
      LOOP AT i_vendor.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-KTOKK'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      i_vendor-bukrs.
        PERFORM bdc_field       USING 'RF02K-EKORG'
                                      i_vendor-ekorg.
        PERFORM bdc_field       USING 'RF02K-KTOKK'
                                      i_vendor-ktokk.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-SPRAS'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=KLAS'.
        PERFORM bdc_field       USING 'LFA1-ANRED'
                                      i_vendor-anred.
        PERFORM bdc_field       USING 'LFA1-NAME1'
                                      i_vendor-name1.
        PERFORM bdc_field       USING 'LFA1-SORTL'
                                      i_vendor-sortl.
        PERFORM bdc_field       USING 'LFA1-NAME2'
                                      i_vendor-name2.
        PERFORM bdc_field       USING 'LFA1-NAME3'
                                      i_vendor-name3.
        PERFORM bdc_field       USING 'LFA1-NAME4'
                                      i_vendor-name4.
        PERFORM bdc_field       USING 'LFA1-STRAS'
                                      i_vendor-stras.
        PERFORM bdc_field       USING 'LFA1-PFACH'
                                      i_vendor-pfach.
        PERFORM bdc_field       USING 'LFA1-ORT01'
                                      i_vendor-ort01.
        PERFORM bdc_field       USING 'LFA1-PSTLZ'
                                      i_vendor-pstlz.
        PERFORM bdc_field       USING 'LFA1-LAND1'
                                      i_vendor-land1.
        PERFORM bdc_field       USING 'LFA1-SPRAS'
                                      i_vendor-spras.
        PERFORM bdc_field       USING 'LFA1-TELF1'
                                      i_vendor-telf1.
        PERFORM bdc_field       USING 'LFA1-TELFX'
                                      i_vendor-telfx.
        PERFORM bdc_field       USING 'LFA1-LFURL'
                                      i_vendor-lfurl.
        PERFORM bdc_dynpro      USING 'SAPLCLCA' '0602'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RMCLF-KLART'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTE'.
        PERFORM bdc_field       USING 'RMCLF-KLART'
                                      '010'. "i_vendor-klart.
        PERFORM bdc_dynpro      USING 'SAPLCLFM' '0500'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RMCLF-CLASS(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=AUSW'.
        PERFORM bdc_field       USING 'RMCLF-CLASS(01)'
                                      'Vendor'."i_vendor-class.
        PERFORM bdc_dynpro      USING 'SAPLCTMS' '0109'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RCTMS-MWERT(03)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BACK'.
        PERFORM bdc_field       USING 'RCTMS-MNAME(01)'
                           'MATERIALGROUP'." i_vendor-mname_01.
        PERFORM bdc_field       USING 'RCTMS-MNAME(02)'
                           'MATERIALGROUP'." i_vendor-mname_02.
        PERFORM bdc_field       USING 'RCTMS-MNAME(03)'
                           'MATERIALGROUP'." i_vendor-mname_03.
        PERFORM bdc_field       USING 'RCTMS-MWERT(01)'
                                      i_vendor-mwert_01.
        PERFORM bdc_field       USING 'RCTMS-MWERT(02)'
                                      i_vendor-mwert_02.
        PERFORM bdc_field       USING 'RCTMS-MWERT(03)'
                                      i_vendor-mwert_03.
        PERFORM bdc_dynpro      USING 'SAPLCLFM' '0500'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RMCLF-CLASS(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENDE'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-ANRED'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0120'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-EMNFR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_field       USING 'LFA1-EMNFR'
                                      i_vendor-emnfr.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBK-BANKN(02)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=VW'.
        PERFORM bdc_field       USING 'LFBK-BANKS(01)'
                                      i_vendor-banks_01.
        PERFORM bdc_field       USING 'LFBK-BANKS(02)'
                                      i_vendor-banks_02.
        PERFORM bdc_field       USING 'LFBK-BANKL(01)'
                                      i_vendor-bankl_01.
        PERFORM bdc_field       USING 'LFBK-BANKL(02)'
                                      i_vendor-bankl_02.
        PERFORM bdc_field       USING 'LFBK-BANKN(01)'
                                      i_vendor-bankn_01.
        PERFORM bdc_field       USING 'LFBK-BANKN(02)'
                                      i_vendor-bankn_02.
       PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'LFBK-BANKS(01)'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=VW'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0210'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-FDGRV'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_field       USING 'LFB1-AKONT'
                                      i_vendor-akont.
        PERFORM bdc_field       USING 'LFB1-ZUAWA'
                                      i_vendor-zuawa.
        PERFORM bdc_field       USING 'LFB1-FDGRV'
                                      i_vendor-fdgrv.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0215'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-XPORE'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_field       USING 'LFB1-ZTERM'
                                      i_vendor-zterm.
        PERFORM bdc_field       USING 'LFB1-REPRF'
                                      c_x. "i_vendor-reprf.
        PERFORM bdc_field       USING 'LFB1-ZWELS'
                                      i_vendor-zwels.
        PERFORM bdc_field       USING 'LFB1-HBKID'
                                      i_vendor-hbkid.
        PERFORM bdc_field       USING 'LFB1-XPORE'
                                      c_x. "i_vendor-xpore.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0220'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB5-MAHNS'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_field       USING 'LFB5-MAHNS'
                                      i_vendor-mahns.
        PERFORM bdc_field       USING 'LFB1-XAUSZ'
                                      i_vendor-xausz.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBW-WT_SUBJCT(01)'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      i_vendor-qland.
        PERFORM bdc_field       USING 'LFBW-WITHT(01)'
                                      i_vendor-witht_01.
       PERFORM bdc_field       USING 'LFBW-WT_WITHCD(01)'
                                     i_vendor-wt_withcd.
        PERFORM bdc_field       USING 'LFBW-WT_SUBJCT(01)'
                                       c_x.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0310'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFM1-ZTERM'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_field       USING 'LFM1-WAERS'
                                      i_vendor-waers.
        PERFORM bdc_field       USING 'LFM1-ZTERM'
                                      i_vendor-zterm1.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0320'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-LIFNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM bdc_dynpro      USING 'SAPLSPO1' '0300'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=YES'.
    Call the Transaction
        PERFORM bdc_transaction USING 'XK01'.
      ENDLOOP.
    Close the BDc Session
      PERFORM close_group.
    Regards,
    Anji

  • Regarding updattion of record...in BDC call transaction and session method.

    Hi all,
       I am uploading 10 records in to sap . By using call transaction method . But after insertion of 5 record server suddenly shutdown. Then what happens . What we have to do
    and what about the updated 5 recs as well as remaining 5 recs.
    And if it happens in case of BDC-SESSION  then what is the status what we have to do..
    PLEZ GIVe reply soon...its urgent
    regards,
    anilreddy...

    Hi,
    If you are using call transaction , you will not get error messages for balance 5 records that not updated. you need to cross check with the transaction and rerun again.
    Session method is concerned no session will be created. system shutdown happened before the close_group,

  • About bdc call transaction and session method

    hi,
    can i know whether we could proceed with the bdc techniques without even copying and pasting in our program the perform statements from the recording process that we do for the particular transaction in TC SHDB.
    if we can pls send me a code for example.
    thanks in advance

    hi,
    check this example.
    For doing BDc Manually we have to analyse the transaction i.e. ex-XK01 we have to know the Screen numbers and screen fileds.
    first analyse the transaction and then write performs for bdc_filed and bdc_dynpro.
    REPORT  ZSR_BDC_CT_ERROR.
    DATA: BEGIN OF ITAB OCCURS 0,
             LIFNR LIKE RF02K-LIFNR,
             KTOKK LIKE RF02K-KTOKK,
             NAME1 LIKE LFA1-NAME1,
             SORTL LIKE LFA1-SORTL,
             LAND1 LIKE LFA1-LAND1,
             SPRAS LIKE LFA1-SPRAS,
          END OF ITAB.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           it_error like itab occurs 0 with header line,
           BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'z:\ct.txt'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = ITAB
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT ITAB.
    REFRESH BDCTAB.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                  ITAB-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  ITAB-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  ITAB-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  ITAB-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  ITAB-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  ITAB-SPRAS.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    CALL TRANSACTION 'XK01' USING BDCTAB MODE 'A' UPDATE 'A' MESSAGES INTO BDCMSG.
    *LOOP AT BDCMSG.
    if sy-subrc <> 0.
    move-corresponding itab to it_error.
    endif.
    READ TABLE BDCMSG WITH KEY MSGTYP = 'E'.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = BDCMSG-MSGID
       LANG            = 'EN'
       NO              = BDCMSG-MSGNR
       V1              = BDCMSG-MSGV1
       V2              = BDCMSG-MSGV2
       V3              = BDCMSG-MSGV3
       V4              = BDCMSG-MSGV4
    IMPORTING
       MSG             = BDCMSG-MSGV1
    EXCEPTIONS
      NOT_FOUND       = 1
      OTHERS          = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE :/ BDCMSG-MSGNR,BDCMSG-MSGV1.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    = BIN_FILESIZE
        filename                        = 'z:\cerror.txt'
       FILETYPE                        = 'ASC'
      APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      = FILELENGTH
      TABLES
        data_tab                        = it_error
      FIELDNAMES                      = FIELDNAMES
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  dynpro
    FORM BDC_DYNPRO  USING    P_P1
                          P_P2.
      CLEAR BDCTAB.
      BDCTAB-PROGRAM  = P_P1.
      BDCTAB-DYNPRO   = P_P2.
      BDCTAB-DYNBEGIN = 'X'.
      APPEND BDCTAB.
    ENDFORM.                    " dynpro
    *&      Form  bdc_field
          text
         -->P_P3  text
         -->P_P4  text
    FORM BDC_FIELD  USING    P_P3
                             P_P4.
      CLEAR BDCTAB.
      BDCTAB-FNAM = P_P3.
      BDCTAB-FVAL = P_P4.
      APPEND BDCTAB.
    ENDFORM.                    " bdc_field
    Session:
    REPORT  ZSR_BDC_SESSION.
    DATA: BEGIN OF ITAB OCCURS 0,
             LIFNR LIKE RF02K-LIFNR,
             KTOKK LIKE RF02K-KTOKK,
             NAME1 LIKE LFA1-NAME1,
             SORTL LIKE LFA1-SORTL,
             LAND1 LIKE LFA1-LAND1,
             SPRAS LIKE LFA1-SPRAS,
          END OF ITAB.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    *include bdcrecx1.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'z:\flatfiles\sr1.txt'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = ITAB
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *perform open_group.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
      DEST                      = FILLER8
       GROUP                     = 'SR'
      HOLDDATE                  = FILLER8
       KEEP                      = 'X'
       USER                      = SY-UNAME
      RECORD                    = FILLER1
      PROG                      = SY-CPROG
    IMPORTING
      QID                       =
    EXCEPTIONS
      CLIENT_INVALID            = 1
      DESTINATION_INVALID       = 2
      GROUP_INVALID             = 3
      GROUP_IS_LOCKED           = 4
      HOLDDATE_INVALID          = 5
      INTERNAL_ERROR            = 6
      QUEUE_ERROR               = 7
      RUNNING                   = 8
      SYSTEM_LOCK_ERROR         = 9
      USER_INVALID              = 10
      OTHERS                    = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT ITAB.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                  ITAB-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  ITAB-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  ITAB-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  ITAB-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  ITAB-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  ITAB-SPRAS.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
       TCODE                  = 'XK01'
      POST_LOCAL             = NOVBLOCAL
      PRINTING               = NOPRINT
      SIMUBATCH              = ' '
      CTUPARAMS              = ' '
      TABLES
        DYNPROTAB              = BDCTAB
    EXCEPTIONS
      INTERNAL_ERROR         = 1
      NOT_OPEN               = 2
      QUEUE_ERROR            = 3
      TCODE_INVALID          = 4
      PRINTING_INVALID       = 5
      POSTING_INVALID        = 6
      OTHERS                 = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    *perform bdc_transaction using 'XK01'.
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    *perform close_group.
    FORM BDC_DYNPRO  USING    VALUE(P_0069)
                              VALUE(P_0070).
      CLEAR BDCTAB.
      BDCTAB-PROGRAM  = P_0069.
      BDCTAB-DYNPRO   = P_0070.
      BDCTAB-DYNBEGIN = 'X'.
      APPEND BDCTAB.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    FORM BDC_FIELD  USING    VALUE(P_0074)
                             VALUE(P_0075).
    IF P_0075 IS NOT INITIAL.
        CLEAR BDCTAB.
        BDCTAB-FNAM = P_0074.
        BDCTAB-FVAL = P_0075.
        APPEND BDCTAB.
      ENDIF.
    ENDFORM.                    " bdc_field

  • What is difference bet  call transaction and session method in BDC

    hi
    what is difference bet  call transaction and session method in BDC
    thanks.

    Hi,
    Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    Thanks,
    Reward If Helpful.

  • Decision between call transaction and session method:BDC

    Hi,
    Kindly guide how to take decision between call transaction and session method?
    Thanks,
    Sanjay

    Hello Sanjay,
    here are some links which discuss the difference between them:
    http://scn.sap.com/thread/721344
    http://scn.sap.com/thread/166845
    Best regards,
    Laszlo

  • Regarding Call Transaction and Session Method in BDC.

    Hi,
    If there are 50 records and 25th row data is having error.
    What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?

    Hi Naresh,
    If you are using call transaction,
    if executed in Foreground, 24 records will be posted and for 25th you will have option to correct data or skip.
    if executed in background,
    if mode is N,  24 records are processed 25th is skipped and 26th onwards is processed again.
    if mode is E, 24 records will be posted and for 25th you will have option to correct data or skip.
    For Session also it should be same the difference is that the error would be there in sessionlog and you can re-process it.
    Hope it helps.
    Regards,
    Komal.

  • What is the diffreence between call transaction and session method

    hi gurus
    can any one suggest me
    what is the difference between call transaction and session methods
    in which cases we have to use teh call transaction and
    in which cases we have to use session method.
    thank you
    regards
    kals.

    CLASSICAL BATCH INPUT (Session Method)
    CALL TRANSACTION
    BATCH INPUT METHOD:
    This method is also called as &#8216;CLASSICAL METHOD&#8217;.
    Features:
    Asynchronous processing.
    Synchronous Processing in database update.
    Transfer data for more than one transaction.
    Batch input processing log will be generated.
    During processing, no transaction is started until the previous transaction has been written to the database.
    CALL TRANSACTION METHOD :
    This is another method to transfer data from the legacy system.
    Features:
    Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
    Updating the database can be either synchronous or asynchronous. The program specifies the update type.
    Transfer data for a single transaction.
    Transfers data for a sequence of dialog screens.
    No batch input processing log is generated.
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    Among the two methods call transaction is better compared to session bcoz data transfer is faster in it.
    Differences between call transaction and session.
    Session Method:
    1) Data is not updated in the database table until the session is processed.
    2) No sy-subrc is returned.
    3) Error log is created for error records.
    4) Updation is always synchronous.
    Call Transaction Method:
    1) Immediate updation in the database table.
    2) sy-subrc is returned.
    3)Error need to be handled explicitly.
    4) updation can be synchronous as well as asynchronous.
    2) ya u can use using the N mode no screen.
    3)u can't handle multiple transaction in call transaction.
    4) u can handle multiple transaction in session using the BDC_INSERT fm.
    5)When u go to SM35 u can able to see the error records.
    Which is best?
    That depends on your requirement. Both of them have there advantages.
    According to the situation u can choose any one of these.
    difference between batch input and call transaction in BDC Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically
    For session method,these are the function modules to b used.
    BDC_OPEN_GROUP
    BDC_INSERT
    BDC_CLOSE_GROUP
    For call transaction,this is the syntax.
    CALL TRANSACTION TCODE USING BDCDATA
    MODE A or E or N
    UPDATE A or S
    MESSAGES INTO MESSTAB.
    Take a scenario where we need to post documents in FB01 and the input file has say 2000 records (2000 documents, not line items in FB01 but 2000 records)
    In the BDC call transaction method
    We call the transaction FB01 2000 times (once for each record posting) and if the processing fails in record no 3 it can be captured and start with reocord 4.
    Eg: Loop at itab.
    call transaction FB01
    capture errors
    endloop.
    In the session method.
    We do not explicity call the transaction 2000 times, but all the records are appeneded into a session and this session is stored. The processinf of the session is done wwhenever the user wants it to be done. Hence the errors cannot be captured in the program itself
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    Batch Input Session method is asynchronous as told by others here. But the advantage of this is that you have all the error messages and the data for each transaction held persistantly. You don't have to code anything for processing them or writing the logs.
    But at the same time, the same feature can be disadvantageous if you need to react to an error or if there are too many errors to manually correct in a session. Since the session are created in the program and its execution is done seperately, you loose the trackability of such transactions.
    With a call transaction, what was a disadvantage above will become an advantage. Call transaction immediately gives you messages back and you can react to it in your program. But the disadvantage is that, if you have several hundreds of transactions to run, running them from within the program can be resource crunching affair. It will hamper the system performance and you cannot really distribute the load. Of course, you have some mechanisms with which you can overcome this, but you will have to code for it. Also, storing the messages and storing the errored transaction data etc will have to be handled by you in the program. Whereas, in batch input session, your program's job is to just create the session, after that everything is standard SAP system's responsibility.
    Ideally, you should do a call transaction if the resources are not a problem and if it fails, put the errored transaction into a session.
    You can decide based on the data volume that your BDC is processing. If data volume is high go for session else call transaction will do.The call transaction updates will be instantaneous where as session needs to be processed explictly after creation.
    Session Method
    1) Session method supports both small amount of data aswell as large amount of data
    2) data processing is asynchronus and data updation is synchronus.
    3) it process multiple apllication while perfomaning validations.
    4) in session method data will be updated in data base only after processing session only.
    5) system provide by default logfile for handling error records.
    6) it supports both foreground aswell as background process
    in bdc we use FM ...
    bdc_open_group " for creating Session
    bdc_insert " adding transaction and bdcdata table for updating database
    bdc_close_group " for closing Session
    Call Transaction
    1) Call transaction exclusively for small amout of data
    2) it supports only one apllication while perfoming validations
    3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.
    we can create logfile by using structure....BDCMSGCOLL
    4) it doesn't support background processing.
    5) data processing is synchronous and Data updation is Synchronous( default), in
    this method also supports daya updation in asynchronus process also.
    syntax:
    Call transaction <transaction-name> using BDCDATA
    mode <A/N/E>
    update <L/A/S>
    messages into BDCMSGCOLL.
    BDC:
    Batch Data Communication (BDC) is the process of transferring data from one SAP System to another SAP system or from a non-SAP system to SAP System.
    Features :
    BDC is an automatic procedure.
    This method is used to transfer large amount of data that is available in electronic medium.
    BDC can be used primarily when installing the SAP system and when transferring data from a legacy system (external system).
    BDC uses normal transaction codes to transfer data.
    Types of BDC :
    CLASSICAL BATCH INPUT (Session Method)
    CALL TRANSACTION
    BATCH INPUT METHOD:
    This method is also called as &#8216;CLASSICAL METHOD&#8217;.
    Features:
    Asynchronous processing.
    Synchronous Processing in database update.
    Transfer data for more than one transaction.
    Batch input processing log will be generated.
    During processing, no transaction is started until the previous transaction has been written to the database.
    CALL TRANSACTION METHOD :
    This is another method to transfer data from the legacy system.
    Features:
    Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
    Updating the database can be either synchronous or asynchronous. The program specifies the update type.
    Transfer data for a single transaction.
    Transfers data for a sequence of dialog screens.
    No batch input processing log is generated.
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    Check the following links:
    http://www.sap-img.com/bdc.htm
    See below example code :
    Call three FM : BDC_OPEN_GROUP,BDC_INSERT and BDC_CLOSE_GROUP.
    Once you execute the program and it creates the session at SM35 Transaction.
    Report : ZMPPC011
    Type : Data upload
    Author : Chetan Shah
    Date : 05/05/2005
    Transport : DV3K919557
    Transaction: ??
    Description: This ABAP/4 Program creates new Production Versions
    (C223). It accepts tab-delimited spreadsheet input and
    creates BDC sessions.
    Modification Log
    Date Programmer Request # Description
    06/10/2005 Chetan Shah DV3K919557 Initial coding
    report zmppc011 no standard page heading line-size 120 line-count 55
    message-id zz.
    pool of form routines
    include zmppn001.
    Define BDC Table Structure
    data: begin of itab_bdc_tab occurs 0.
    include structure bdcdata.
    data: end of itab_bdc_tab.
    Input record layout of Leagcy File
    data: begin of itab_xcel occurs 0,
    matnr(18) type c,
    werks(4) type c,
    alnag(2) type c,
    verid(4) type c,
    text1(40) type c,
    bstmi like mkal-bstmi,
    bstma like mkal-bstma,
    adatu(10) type c,
    bdatu(10) type c,
    stlal(2) type c,
    stlan(1) type c,
    serkz(1) type c,
    mdv01(8) type c,
    elpro(4) type c,
    alort(4) type c,
    end of itab_xcel.
    data: begin of lt_pp04_cache occurs 0,
    matnr like itab_xcel-matnr,
    werks like itab_xcel-werks,
    alnag like itab_xcel-alnag,
    plnnr like mapl-plnnr,
    arbpl like crhd-arbpl,
    ktext like crtx-ktext,
    end of lt_pp04_cache.
    data: v_ssnnr(4) type n,
    v_lines_in_xcel like sy-tabix,
    v_ssnname like apqi-groupid,
    v_trans_in_ssn type i,
    wa_xcel LIKE itab_xcel,
    l_tabix like sy-tabix,
    v_matnr like rc27m-matnr,
    v_plnnr like mapl-plnnr,
    v_plnal like mapl-plnal,
    v_tcode like sy-tcode value 'C223',
    v_plnty like plas-plnty value 'R',
    v_objty like crhd-objty value 'A',
    v_plpo_steus like plpo-steus value 'PP04',
    v_verwe like crhd-verwe value '0007'.
    Parameters
    selection-screen: skip 3.
    selection-screen: begin of block 1 with frame.
    parameters: p_name like rlgrap-filename
    default 'C:\My Documents\InputFile.txt'
    obligatory,
    bdc session name prefix
    p_bdcpfx(6) default 'ZPVCRT'
    obligatory,
    number for transction per BDC session
    p_trnssn type i
    default 2000 obligatory,
    retain the BDC session after successfull execution
    p_keep like apqi-qerase
    default 'X',
    user who will be executing BDC session
    p_uname like apqi-userid
    default sy-uname
    obligatory.
    selection-screen: end of block 1.
    possible entry list (F4 dropdown) for input file name
    at selection-screen on value-request for p_name.
    *-SELECT FILE FROM USERS LOCAL PC
    call function 'WS_FILENAME_GET'
    exporting
    DEF_FILENAME = ' '
    def_path = 'C:\Temp\'
    mask = ',.,..'
    mode = 'O'
    title = 'Select File '(007)
    importing
    filename = p_name
    RC =
    exceptions
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    others = 5.
    if sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    begin the show
    start-of-selection.
    read data from input file
    perform transfer_xcel_to_itab.
    loop at itab_xcel.
    hang on to xcel line num
    l_tabix = sy-tabix.
    each line in the xcel file marks begining of new prod.version defn
    if num-of-trnas-in-session = 0, create new BDC session
    if v_trans_in_ssn is initial.
    perform bdc_session_open.
    endif.
    begin new bdc script for rtg create trans
    fill in bdc-data for prod.version maintenance screens
    perform bdc_build_script.
    insert the bdc script as a BDC transaction
    perform bdc_submit_transaction.
    keep track of how many BDC transactions were inserted in the BDC
    session
    add 1 to v_trans_in_ssn.
    if the user-specified num of trans in BDC session is reached OR
    if end of input file is reached, close the BDC session
    if v_trans_in_ssn = p_trnssn or
    l_tabix = v_lines_in_xcel.
    perform bdc_session_close.
    clear v_trans_in_ssn.
    endif.
    endloop.
    top-of-page.
    call function 'Z_HEADER'
    EXPORTING
    FLEX_TEXT1 =
    FLEX_TEXT2 =
    FLEX_TEXT3 =
    FORM TRANSFER_XCEL_TO_ITAB *
    Transfer Xcel Spreadsheet to SAP Internal Table *
    form transfer_xcel_to_itab.
    Read the tab-delimited file into itab
    call function 'WS_UPLOAD'
    exporting
    filename = p_name
    filetype = 'DAT'
    IMPORTING
    filelength = flength
    tables
    data_tab = itab_xcel
    exceptions
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_table_width = 4
    invalid_type = 5
    no_batch = 6
    unknown_error = 7
    others = 8.
    if sy-subrc = 0.
    sort the data
    sort itab_xcel by matnr werks.
    clear v_lines_in_xcel.
    if no data in the file - error out
    describe table itab_xcel lines v_lines_in_xcel.
    if v_lines_in_xcel is initial.
    write: / 'No data in input file'.
    stop.
    endif.
    else.
    if file upload failed - error out
    write: / 'Error reading input file'.
    stop.
    endif.
    endform.
    FORM BDC_SESSION_OPEN *
    Open BDC Session *
    form bdc_session_open.
    create bdc session name = prefix-from-selectn-screen + nnnn
    add 1 to v_ssnnr.
    concatenate p_bdcpfx v_ssnnr into v_ssnname.
    open new bdc session
    call function 'BDC_OPEN_GROUP'
    exporting
    client = sy-mandt
    group = v_ssnname
    keep = p_keep
    user = p_uname
    exceptions
    client_invalid = 1
    destination_invalid = 2
    group_invalid = 3
    group_is_locked = 4
    holddate_invalid = 5
    internal_error = 6
    queue_error = 7
    running = 8
    system_lock_error = 9
    user_invalid = 10
    others = 11.
    endform.
    FORM BDC_BUILD_SCRIPT *
    Build BDC *
    form bdc_build_script.
    data: l_arbpl like crhd-arbpl,
    l_text1 like mkal-text1,
    l_mdv01 like mkal-mdv01,
    l_mapl like mapl.
    clear bdc-data itab - begin of new bdc transaction
    clear itab_bdc_tab.
    refresh itab_bdc_tab.
    read material cross reference tables to determine sap part#
    clear : v_matnr, v_plnnr, v_plnal.
    perform read_matnr_cross_ref using itab_xcel-matnr
    itab_xcel-werks
    changing v_matnr.
    determine the version description to use
    if itab_xcel-text1 is initial.
    l_text1 = itab_xcel-verid.
    else.
    l_text1 = itab_xcel-text1.
    endif.
    determine the routing group# and group ctr# to use
    perform read_routing .
    determine the production line to use
    if itab_xcel-mdv01 is initial.
    if not provided in the file then:
    prod line = work ctr on the last PP04 op of the rtg determined above
    perform read_wc_on_last_pp04 using v_plnnr v_plnal
    changing l_mdv01.
    NOTE: when executing the above form\routine, if v_plnnr is initial
    or v_plnal is initial, THEN l_mdv01 will automatically be
    returned blank (ie initial)
    else.
    l_mdv01 = itab_xcel-mdv01.
    endif.
    build bdc script
    perform bdc_build_script_record
    fill in initial screen
    using: 'X' 'SAPLCMFV' '1000',
    ' ' 'BDC_OKCODE' '=ENTE',
    ' ' 'MKAL-WERKS' itab_xcel-werks,
    ' ' 'MKAL-MATNR' v_matnr,
    ' ' 'MKAL_ADMIN-DISPO' space,
    ' ' 'MKAL-PLNNR' space,
    ' ' 'MKAL_ADMIN-STTAG' space,
    ' ' 'MKAL-PLNNG' space,
    ' ' 'MKAL-MDV01' space,
    ' ' 'MKAL-PLNNM' space,
    click create button on initial screen and go to detail screen
    'X' 'SAPLCMFV' '1000',
    ' ' 'BDC_OKCODE' '=CREA',
    fill in the detail screen and go back to initial screen
    'X' 'SAPLCMFV' '2000',
    ' ' 'BDC_OKCODE' '=CLOS',
    ' ' 'MKAL_EXPAND-MATNR' v_matnr,
    ' ' 'MKAL_EXPAND-VERID' itab_xcel-verid,
    ' ' 'MKAL_EXPAND-TEXT1' l_text1,
    ' ' 'MKAL_EXPAND-BSTMI' itab_xcel-bstmi,
    ' ' 'MKAL_EXPAND-BSTMA' itab_xcel-bstma,
    ' ' 'MKAL_EXPAND-ADATU' itab_xcel-adatu,
    ' ' 'MKAL_EXPAND-BDATU' itab_xcel-bdatu,
    ' ' 'MKAL_EXPAND-PLTYG' v_plnty,
    ' ' 'MKAL_EXPAND-PLNNG' v_plnnr,
    ' ' 'MKAL_EXPAND-ALNAG' v_plnal,
    ' ' 'MKAL_EXPAND-STLAL' itab_xcel-stlal,
    ' ' 'MKAL_EXPAND-STLAN' itab_xcel-stlan,
    ' ' 'MKAL_EXPAND-SERKZ' itab_xcel-serkz,
    ' ' 'MKAL_EXPAND-MDV01' l_mdv01,
    ' ' 'MKAL_EXPAND-ELPRO' itab_xcel-elpro,
    ' ' 'MKAL_EXPAND-ALORT' itab_xcel-alort,
    save the production version from initial screen
    'X' 'SAPLCMFV' '1000',
    ' ' 'BDC_OKCODE' '=SAVE'.
    endform.
    FORM BDC_SUBMIT_TRANSACTION *
    Submit BDC Session *
    form bdc_submit_transaction.
    Load BDC script as a trqansction in BDC session
    call function 'BDC_INSERT'
    exporting
    tcode = v_tcode
    tables
    dynprotab = itab_bdc_tab
    exceptions
    internal_error = 01
    not_open = 02
    queue_error = 03
    tcode_invalid = 04.
    endform.
    FORM BDC_BUILD_SCRIPT_RECORD *
    form bdc_build_script_record using dynbegin name value.
    clear itab_bdc_tab.
    if dynbegin = 'X'.
    move: name to itab_bdc_tab-program,
    value to itab_bdc_tab-dynpro,
    'X' to itab_bdc_tab-dynbegin.
    else.
    move: name to itab_bdc_tab-fnam,
    value to itab_bdc_tab-fval.
    shift itab_bdc_tab-fval left deleting leading space.
    endif.
    append itab_bdc_tab.
    endform.
    FORM BDC_SESSION_CLOSE *
    Close BDC Session *
    form bdc_session_close.
    close the session
    call function 'BDC_CLOSE_GROUP'
    exceptions
    not_open = 1
    queue_error = 2
    others = 3.
    skip 2.
    if sy-subrc ne 0.
    write: / 'Error Closing BDC Session ' , 'RETURN CODE: ', sy-subrc.
    else.
    write : / 'Session created:', v_ssnname,
    50 '# of transactions:', v_trans_in_ssn.
    endif.
    endform.
    *& Form read_routing_cache
    *FORM read_routing_cache USING pi_matnr
    pi_werks
    pi_alnag
    pi_verid
    pi_mdv01.
    DATA: BEGIN OF lt_plpo OCCURS 0,
    vornr LIKE plpo-vornr,
    objty LIKE crhd-objty,
    objid LIKE crhd-objid,
    arbpl LIKE crhd-arbpl,
    END OF lt_plpo,
    l_mapl_plnnr LIKE mapl-plnnr.
    determine the routing group#
    CLEAR lt_pp04_cache.
    chk if its in the cache first, if not then get it from MAPL table
    and put it in the cache
    READ TABLE lt_pp04_cache WITH KEY matnr = pi_matnr
    werks = pi_werks
    alnag = pi_alnag.
    IF sy-subrc = 0.
    do nothing - lt_pp04_cache header line has rtg#
    ELSE.
    get the routing group # from MAPL
    SELECT plnnr INTO l_mapl_plnnr
    FROM mapl UP TO 1 ROWS
    WHERE matnr = pi_matnr AND
    werks = pi_werks AND
    plnty = 'R' AND
    plnal = pi_alnag AND
    loekz = space.
    ENDSELECT.
    put it in the cache internal table
    IF NOT l_mapl_plnnr IS INITIAL.
    lt_pp04_cache-matnr = pi_matnr.
    lt_pp04_cache-werks = pi_werks.
    lt_pp04_cache-alnag = pi_alnag.
    lt_pp04_cache-plnnr = l_mapl_plnnr.
    APPEND lt_pp04_cache.
    ENDIF.
    ENDIF.
    if the rtg# was determined AND
    the work center was not determined yet AND
    work center was really needed for this line in the input file
    then
    read the work center from last PP04 operation on the routing
    update the cache accordingly
    IF NOT lt_pp04_cache-plnnr IS INITIAL AND
    lt_pp04_cache-arbpl IS INITIAL AND
    ( pi_verid IS INITIAL OR
    pi_mdv01 IS INITIAL ).
    read the last PP04 operation
    CLEAR lt_plpo.
    REFRESH lt_plpo.
    SELECT vornr eobjty eobjid e~arbpl
    INTO CORRESPONDING FIELDS OF TABLE lt_plpo
    FROM plas AS b
    INNER JOIN plpo AS c
    ON bplnty = cplnty AND
    bplnnr = cplnnr AND
    bzaehl = czaehl
    INNER JOIN crhd AS e
    ON carbid = eobjid
    WHERE b~plnty = v_plnty AND
    b~plnnr = lt_pp04_cache-plnnr AND
    b~plnal = lt_pp04_cache-alnag AND
    c~loekz = space AND
    c~steus = v_plpo_steus AND
    e~objty = v_objty AND
    e~werks = lt_pp04_cache-werks AND
    e~verwe = v_verwe.
    SORT lt_plpo BY vornr DESCENDING.
    READ TABLE lt_plpo INDEX 1.
    IF NOT lt_plpo-arbpl IS INITIAL.
    lt_pp04_cache-arbpl = lt_plpo-arbpl.
    read work center description
    SELECT SINGLE ktext INTO lt_pp04_cache-ktext
    FROM crtx WHERE objty = lt_plpo-objty AND
    objid = lt_plpo-objid AND
    spras = sy-langu.
    the following read will get the index of the correct record to be
    updated in the cache
    READ TABLE lt_pp04_cache
    WITH KEY matnr = pi_matnr
    werks = pi_werks
    alnag = pi_alnag.
    MODIFY lt_pp04_cache
    INDEX sy-tabix
    TRANSPORTING arbpl ktext.
    ENDIF.
    ENDIF.
    *ENDFORM. " read_last_pp04_operation_cache
    *& Form read_routing
    form read_routing.
    data: begin of lt_mapl occurs 0,
    plnnr like mapl-plnnr,
    plnal like mapl-plnal,
    end of lt_mapl,
    l_arbpl like crhd-arbpl.
    get all the rtg# and grp ctr# from MAPL
    select plnnr plnal
    into corresponding fields of table lt_mapl
    from mapl
    where matnr = v_matnr and
    werks = itab_xcel-werks and
    plnty = v_plnty and "Rate Routing
    loekz = space. "with del flag = OFF
    sort lt_mapl by plnal.
    if not itab_xcel-verid is initial.
    if the verid=0001 then use the 1st good rtg-grp# and grp-ctr#
    if itab_xcel-verid = '0001'.
    read table lt_mapl index 1.
    v_plnnr = lt_mapl-plnnr.
    v_plnal = lt_mapl-plnal.
    else.
    if the verid0001 then use the rtg-grp# and grp-ctr# of the routing
    whose work center on the last PP04 operation matches the given verid
    loop at lt_mapl.
    clear l_arbpl.
    get the work center from the last PP04 operation
    perform read_wc_on_last_pp04 using lt_mapl-plnnr
    lt_mapl-plnal
    changing l_arbpl.
    if itab_xcel-verid = l_arbpl.
    v_plnnr = lt_mapl-plnnr.
    v_plnal = lt_mapl-plnal.
    exit.
    endif.
    endloop.
    endif.
    else.
    do nothing
    endif.
    For version IDs that are other then '0000' or 'ZWIP' :--
    if itab_xcel-verid NE '0000' and
    itab_xcel-verid NE 'ZWIP'.
    if routing group# or group counter was not determined, make the
    valid-to date 99/99/9999 so that the BDC, on execution, errors out.
    if v_plnnr is initial or
    v_plnal is initial.
    itab_xcel-bdatu = '99/99/9999'.
    endif.
    endif.
    determine the routing group#
    CLEAR lt_pp04_cache.
    chk if its in the cache first, if not then get it from MAPL table
    and put it in the cache
    READ TABLE lt_pp04_cache WITH KEY matnr = pi_matnr
    werks = pi_werks
    alnag = pi_alnag.
    IF sy-subrc = 0.
    do nothing - lt_pp04_cache header line has rtg#
    ELSE.
    get the routing group # from MAPL
    put it in the cache internal table
    IF NOT l_mapl_plnnr IS INITIAL.
    lt_pp04_cache-matnr = pi_matnr.
    lt_pp04_cache-werks = pi_werks.
    lt_pp04_cache-alnag = pi_alnag.
    lt_pp04_cache-plnnr = l_mapl_plnnr.
    APPEND lt_pp04_cache.
    ENDIF.
    ENDIF.
    if the rtg# was determined AND
    the work center was not determined yet AND
    work center was really needed for this line in the input file
    then
    read the work center from last PP04 operation on the routing
    update the cache accordingly
    IF NOT lt_pp04_cache-plnnr IS INITIAL AND
    lt_pp04_cache-arbpl IS INITIAL AND
    ( pi_verid IS INITIAL OR
    pi_mdv01 IS INITIAL ).
    read the last PP04 operation
    CLEAR lt_plpo.
    REFRESH lt_plpo.
    SELECT vornr eobjty eobjid e~arbpl
    INTO CORRESPONDING FIELDS OF TABLE lt_plpo
    FROM plas AS b
    INNER JOIN plpo AS c
    ON bplnty = cplnty AND
    bplnnr = cplnnr AND
    bzaehl = czaehl
    INNER JOIN crhd AS e
    ON carbid = eobjid
    WHERE b~plnty = v_plnty AND
    b~plnnr = lt_pp04_cache-plnnr AND
    b~plnal = lt_pp04_cache-alnag AND
    c~loekz = space AND
    c~steus = v_plpo_steus AND
    e~objty = v_objty AND
    e~werks = lt_pp04_cache-werks AND
    e~verwe = v_verwe.
    SORT lt_plpo BY vornr DESCENDING.
    READ TABLE lt_plpo INDEX 1.
    IF NOT lt_plpo-arbpl IS INITIAL.
    lt_pp04_cache-arbpl = lt_plpo-arbpl.
    read work center description
    SELECT SINGLE ktext INTO lt_pp04_cache-ktext
    FROM crtx WHERE objty = lt_plpo-objty AND
    objid = lt_plpo-objid AND
    spras = sy-langu.
    the following read will get the index of the correct record to be
    updated in the cache
    READ TABLE lt_pp04_cache
    WITH KEY matnr = pi_matnr
    werks = pi_werks
    alnag = pi_alnag.
    MODIFY lt_pp04_cache
    INDEX sy-tabix
    TRANSPORTING arbpl ktext.
    ENDIF.
    ENDIF.
    endform. " read_last_pp04_operation_cache
    *& Form read_wc_on_last_pp04
    form read_wc_on_last_pp04 using pi_plnnr
    pi_plnal
    changing pe_arbpl.
    data: begin of lt_plpo occurs 0,
    vornr like plpo-vornr,
    objty like crhd-objty,
    objid like crhd-objid,
    arbpl like crhd-arbpl,
    end of lt_plpo.
    get all the PP04 operations for the given rtg# & grp-ctr#
    select vornr eobjty eobjid e~arbpl
    into corresponding fields of table lt_plpo
    from plas as b
    inner join plpo as c
    on bplnty = cplnty and
    bplnnr = cplnnr and
    bzaehl = czaehl
    inner join crhd as e
    on carbid = eobjid
    where b~plnty = v_plnty and "Rate Routing
    b~plnnr = pi_plnnr and
    b~plnal = pi_plnal and
    c~loekz = space and "Oper Del Flag = OFF
    c~steus = v_plpo_steus and "PP04
    e~objty = v_objty. "WC Obj Type = 'A'
    read the last operation
    sort lt_plpo by vornr descending.
    read table lt_plpo index 1.
    pe_arbpl = lt_plpo-arbpl.
    endform. " read_wc_on_last_pp04
    Goto LSMW-> Select Direct Input method in 1st step. These are the standard programs for data transfer.
    Otherwise goto SPRO->SAP Reference IMG-> Under this you'll find standard data transfer programs module wise.
    Regards,
    Sunil Kumar Mutyala

  • Difference b/w call transaction and session method

    hi there,
              whatz the major difference b/w call transaction and session method in BDC.
    thanks in advance
    dattu

    Vijay,
    Welcome to SDN
    <b>SESSION METHOD</b>
    Data is not updated in database table unless Session is processed.
    No sy-subrc is returned.
    Error log is created for error records.
    Updation in database table is always synchronous
    <b>CALL TRANSACTION</b>
    Immediate updation in database table.
    Sy-subrc is returned.
    Errors need to be handled explicitly
    Updation in database table can be synchronous Or Asynchronous.
    Chandra.

  • Can we use Call transaction and session method in same program ?

    Hi experts,
                     Is it suggested to use call Transaction and session method in the same Program ?
                     i have a doubt , why cant we use multiple call transactions in same program instead of session method if we have multiple transaction updations ?

    Hi Dengyong Zhang,
    we can use the call transation and session method in same program.
    However for better performance it's benificial to use call trasaction method of BDC. but if u want to upload very large amount of data then Session method is more preferable to use.
    Session method is one of the method of BDC.
    U can also use BAPI to upload the data in SAP but it's a different concept than BDC. Performance wise BAPI is more advantageous than BDC.

  • Call transaction , and session  method in the same program

    hi experts,
                Can anybody tell me in which cases we will use both call transaction and session methods in same program
    if possible send me example code.
    Regards
    Trinadh

    Hi Dengyong Zhang,
    we can use the call transation and session method in same program.
    However for better performance it's benificial to use call trasaction method of BDC. but if u want to upload very large amount of data then Session method is more preferable to use.
    Session method is one of the method of BDC.
    U can also use BAPI to upload the data in SAP but it's a different concept than BDC. Performance wise BAPI is more advantageous than BDC.

  • Error in CALL TRANSACTION and SESSION Method

    I have 8 records (1,2,3,4,5,6,7,8) to update into SAP database using CALL TRANSACTION and SESSION Method. If there is a error in 6th record. What happens in both call transaction and session method.
    Please let me know which records will process and what about the error record. How to process only the error record if all other records have updated into database.

    Hi Patil_sumeet,
    if your code for this is not protected secret of some federal agency, you may read [How to post code in SCN, and some things NOT to do...|How to post code in SCN, and some things NOT to do...; and then post relevant lines here.
    According to the facts presented until know it may have been better to ask Radio Eriwan
    Regards
    Clemens

  • I want to use both call transaction and session method in the same

    Hi,
              1. I want to use call transaction and session method in a single trans..how to do?
              2. I have 1000 records in it 500 records is updated using call transaction remaining 500 i hve to update with session how to do?
              3. Multiple transaction is possible in call transaction how?

    I suggest you try fulfilling your requirements yourself and come back with specific problems along the way.

  • Can we hav call transaction and session method for an application

    can we hav call transaction and session method for an application ?if yes how?

    Hi ,
    You can.  If Call Transaction fails, a batch input session can be created.
    Check this example-
    Call the transaction. Messages from Call Transaction are stored in the
    internal table messtab 
      CALL TRANSACTION 'LT01' USING bdc_tab MODE 'N' UPDATE 'S'
          MESSAGES INTO messtab.
      IF sy-subrc = 0.                                                 
    Call transaction successfull,  get the number of the Transfer Order that
    was created                                                        
        LOOP AT messtab.                                               
          IF messtab-dynumb = '0104' AND messtab-msgnr = '016'.        
            w_transportorderno = messtab-msgv1.                        
          ENDIF.                                                       
        ENDLOOP.
      ELSE.
    Call transaction failed, create a batch input session instead.
        PERFORM open_group.                        
        PERFORM bdc_insert USING 'LT01'.           
        PERFORM close_group.                       
    ENDIF.
    Regards,
    Sookshma

  • Call transaction and session method -urgent

    Hi,
       can anybody tell me the diffence between call transaction and session method .
    what are the advantage of each method and when we go for it.
    how to see log file in session method.
    i will really appricitate

    hi,
    check this code,
    REPORT ZTEST_ABCD NO STANDARD PAGE HEADING LINE-SIZE 255.
    *REPORT zabzon_bdc
          NO STANDARD PAGE HEADING LINE-SIZE 255.
    TYPES: BEGIN OF record,
          xbanl LIKE raifp3-xbanl,
           anln1 LIKE raifp2-anln1,
           anln2 LIKE raifp2-anln2,
           anbtr TYPE string,
           bldat TYPE string,
           budat TYPE string,
           bzdat TYPE string,
           sgtxt LIKE raifp2-sgtxt,
           monat LIKE raifp2-monat,
           blart LIKE raifp1-blart,
           gkont LIKE raifp2-gkont,
           bwasl LIKE raifp1-bwasl,
           xblnr LIKE raifp1-xblnr,
       END OF record.
    TYPES :BEGIN OF x_messages,
           index TYPE i,
           msgtyp(1),
           message(120),
           END OF x_messages.
    DATA: it_record TYPE STANDARD TABLE OF record,
          wa_record TYPE record.
    DATA : it_messages  TYPE STANDARD TABLE OF x_messages,
           wa_messages TYPE x_messages.
    DATA : it_bdcmsg TYPE STANDARD TABLE OF bdcmsgcoll,
           wa_bdcmsg TYPE bdcmsgcoll.
    DATA : bdcdata TYPE STANDARD TABLE OF bdcdata,
           wa_bdcdata TYPE bdcdata.
    DATA : it_excel TYPE STANDARD TABLE OF alsmex_tabline,
           wa_excel TYPE alsmex_tabline.
    DATA : fname TYPE string.
    DATA :l_index LIKE sy-tabix.
    data : str type string.
    *Selection screen.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_file1 TYPE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    *Selction-Screen F4 Help
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                field_name = 'p_file1'
           IMPORTING
                file_name  = p_file1.
    *START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM process_f1data.
      PERFORM execute_bdc.
           Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR wa_bdcdata.
      wa_bdcdata-program  = program.
      wa_bdcdata-dynpro   = dynpro.
      wa_bdcdata-dynbegin = 'X'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval .
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam = fnam.
      wa_bdcdata-fval = fval.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  process_f1data
          text
    -->  p1        text
    <--  p2        text
    FORM process_f1data.
      REFRESH it_excel.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename    = p_file1
                i_begin_col = 1
                i_begin_row = 1
                i_end_col   = 99
                i_end_row   = 1000
           TABLES
                intern      = it_excel.
      LOOP AT it_excel INTO wa_excel.
        CASE wa_excel-col .
         WHEN '1' .
           wa_record-xbanl = wa_excel-value.
          WHEN '1' .
            wa_record-anln1 = wa_excel-value.
          WHEN '2'.
            wa_record-anln2 = wa_excel-value.
          WHEN '3'.
            wa_record-anbtr = wa_excel-value.
          WHEN '4'.
            wa_record-bldat = wa_excel-value.
          WHEN '5'.
            wa_record-budat = wa_excel-value.
          WHEN '6'.
            wa_record-bzdat = wa_excel-value.
          WHEN '7'.
            wa_record-sgtxt = wa_excel-value.
          WHEN '8'.
            wa_record-monat = wa_excel-value.
          WHEN '9'.
            wa_record-blart = wa_excel-value.
          WHEN '10'.
            wa_record-gkont = wa_excel-value.
          WHEN '11'.
            wa_record-bwasl = wa_excel-value.
          WHEN '12'.
            wa_record-xblnr = wa_excel-value.
        ENDCASE.
        AT END OF row.
          CONDENSE : wa_record-anln1,wa_record-anln2,
                     wa_record-anbtr,wa_record-bldat,wa_record-budat,
                     wa_record-bzdat,wa_record-sgtxt,wa_record-monat,
                     wa_record-blart,wa_record-gkont,wa_record-bwasl,
                     wa_record-xblnr.
          APPEND  wa_record TO it_record.
          CLEAR  wa_record.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " process_f1data
    *&      Form  execute_bdc
          text
    -->  p1        text
    <--  p2        text
    FORM execute_bdc.
      LOOP AT it_record INTO wa_record.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=NEWA'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP3-XBANL'.
        PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                      'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '22.05.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-ANLN1'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
        PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                      wa_record-anln1.    "'3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '22.05.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-ANLN2'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
        PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                      wa_record-anln2.   "'0'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '22.05.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-ANBTR'.
       str = wa_record-anbtr.
        PERFORM bdc_field       USING 'RAIFP2-ANBTR'
                                      wa_record-anbtr.       "'45000'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '22.05.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-ANBTR'
                                     '45,000.00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP1-BLDAT'.
        PERFORM bdc_field       USING 'RAIFP1-BLDAT'
                                      wa_record-bldat.        "'01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '22.05.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-ANBTR'
                                     '45,000.00'.
       PERFORM bdc_field       USING 'RAIFP1-BLDAT'
                                     '01.04.2008'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP1-BUDAT'.
        PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                      wa_record-budat.    "'01.04.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-ANBTR'
                                     '45,000.00'.
       PERFORM bdc_field       USING 'RAIFP1-BLDAT'
                                     '01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '01.04.2008'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP1-BZDAT'.
        PERFORM bdc_field       USING 'RAIFP1-BZDAT'
                                      wa_record-bzdat.   "'01.04.2008'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-ANBTR'
                                     '45,000.00'.
       PERFORM bdc_field       USING 'RAIFP1-BLDAT'
                                     '01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP1-BZDAT'
                                     '01.04.2008'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-SGTXT'.
        PERFORM bdc_field       USING 'RAIFP2-SGTXT'
                                      wa_record-sgtxt.      "'test01'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=TAB02'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-ANLN1'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-ANBTR'
                                     '45,000.00'.
       PERFORM bdc_field       USING 'RAIFP1-BLDAT'
                                     '01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP1-BUDAT'
                                     '01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP1-BZDAT'
                                     '01.04.2008'.
       PERFORM bdc_field       USING 'RAIFP2-SGTXT'
                                     'test01'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-MONAT'.
        PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                      wa_record-monat.     "'01'.
       PERFORM bdc_field       USING 'RAIFP1-BLART'
                                     'AA'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                     '1'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP1-BLART'.
        PERFORM bdc_field       USING 'RAIFP1-BLART'
                                      wa_record-blart.    " 'AA'.
       PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                     '1'.
       PERFORM bdc_field       USING 'RAIFP1-BLART'
                                     'AA'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'RAIFP2-GKONT'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                     '1'.
       PERFORM bdc_field       USING 'RAIFP1-BLART'
                                     'AA'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP2-GKONT'.
        PERFORM bdc_field       USING 'RAIFP2-GKONT'
                                      wa_record-gkont.   "'1600'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                     '1'.
       PERFORM bdc_field       USING 'RAIFP1-BLART'
                                     'AA'.
       PERFORM bdc_field       USING 'RAIFP2-GKONT'
                                     '1600'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP1-BWASL'.
        PERFORM bdc_field       USING 'RAIFP1-BWASL'
                                      wa_record-bwasl.      "'100'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                     '1'.
       PERFORM bdc_field       USING 'RAIFP1-BLART'
                                     'AA'.
       PERFORM bdc_field       USING 'RAIFP2-GKONT'
                                     '1600'.
       PERFORM bdc_field       USING 'RAIFP1-BWASL'
                                     '100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RAIFP1-XBLNR'.
        PERFORM bdc_field       USING 'RAIFP1-XBLNR'
                                      wa_record-xblnr.   "'TEST01'.
        PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SAVE'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'RAIFP2-ANLN1'.
       PERFORM bdc_field       USING 'RAIFP3-XBANL'
                                     'X'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN1'
                                     '3100309'.
       PERFORM bdc_field       USING 'RAIFP2-ANLN2'
                                     '0'.
       PERFORM bdc_field       USING 'RAIFP2-MONAT'
                                     '1'.
       PERFORM bdc_field       USING 'RAIFP1-BLART'
                                     'AA'.
       PERFORM bdc_field       USING 'RAIFP2-GKONT'
                                     '1600'.
       PERFORM bdc_field       USING 'RAIFP1-BWASL'
                                     '100'.
       PERFORM bdc_field       USING 'RAIFP1-XBLNR'
                                     'TEST01'.
       PERFORM bdc_dynpro      USING 'SAPLAMDP' '0100'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=SHWD'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=SAVE'.
        CALL TRANSACTION 'ABZON' USING bdcdata
                                            MODE 'A'
                                            MESSAGES INTO it_bdcmsg.
        PERFORM collect_bdc_messages.
      ENDLOOP.
    ENDFORM.                    " execute_bdc
    *&      Form  collect_bdc_messages
          text
    -->  p1        text
    <--  p2        text
    FORM collect_bdc_messages.
      DATA: l_msg(100).
      LOOP AT it_bdcmsg INTO wa_bdcmsg.
        CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
                  id        = wa_bdcmsg-msgid
                  lang      = wa_bdcmsg-msgspra
                  no        = wa_bdcmsg-msgnr
                  v1        = wa_bdcmsg-msgv1
                  v2        = wa_bdcmsg-msgv2
             IMPORTING
                  msg       = l_msg
             EXCEPTIONS
                  not_found = 1
                  OTHERS    = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        CONDENSE l_msg.
        CLEAR wa_bdcmsg.
        wa_messages-index = l_index.
        wa_messages-msgtyp = wa_bdcmsg-msgtyp.
        wa_messages-message = l_msg.
        APPEND wa_messages TO it_messages.
        WRITE:/  wa_messages-message.
      ENDLOOP.
      l_index = l_index + 1.
      REFRESH it_bdcmsg.
    ENDFORM.                    " collect_bdc_messages
    regards
    siva

Maybe you are looking for

  • External Hard Drive changed permissions to 'read only'

    I have been searching everywhere for a solution to this with no luck, so I figured I would start my own post and see what comes of it. Computer: iMac Intel 24" /3.0ghz/4gb ram/1TB WD hard drive External Drive giving me issues: Western Digital 1.5TB (

  • MulticastSocket. To whom MC message was sent?

    Hi All, My scenarion is: 1. I created MulticastSocket on port XXXX. (Server side) 2. Socket was joined to Multicast groups 228.5.6.7 AND 228.5.6.8 (Server side) 3. Multicast message was sent from another PC to group 228.5.6.7 Client side) 4. Message

  • Very frustrating problem with mousepad, clicker, and cursor.

    Hi, guys. Anyone who could help me with this would have my sincere appreciation. Recently (in the last week), my three-year old MBP has been giving me ****. Sometimes the problem is around, sometimes it isn't, but tonight was the last straw. I can ha

  • New controller classes for Web IC views

    Hi Could anyone help out with the following:- I 'inherited' a customer's Web IC implementation to support recently.  The system hasn't been properly documented, I'm new to Web IC and they've just applied support packages to the system which has cause

  • Suggestions for tracks i can use on a 3 min sports promo?

    I am creating a 3 min sports promo for a client, they are willing to pay for the use of a well known pop or rock song from the last 10 years, i just need to find the right song and contact the publishers for using it, it will be used one time only at