Bdc two transactions at a time

Hello frendz,
How do i call two transactions in bdc simultaneously in one bdc program.
Can anyone send me steps or document for the same(to do above process for pb10, pb30, 9005 and 9007).
Pls help me its urgent.
Regards,
Ameet

Hi ameet,
                 U can call two Transaction in BDC program by using Call transaction Method But one by one it ll process
like :
         1. Fisrt upload ur source file it may be Excel Sheet or Text to ur program (it_data internal table)
         2. u r having recorded code (it should be seperate for each transaction)
         2. what are all the data required for First transaction u can pass and finish
         3. what are all the data required for Second transaction u can pass and finish..thats all
Refer the following code:
here called
1. perform bdc_transaction using 'F-58'
2.perform bdc_transaction using 'FBZ5'.
*&   Report   ZPAYMENT2 For Payment with printout Data
                                  upload  Using  BDC.
*&         Payment with printout Data upload Using  BDC.
*&           TCODE: F-58.
*&           METHOD: CALL TRANSACTION.
REPORT ZPAYMENT2  no standard page heading line-size 255.
Table Bkpf for Accounting Document Header
Table Bsak for Clear item
Table Bsik for open  item
Tables:Bkpf,Bsak,Bsik,t001.
      logic   for posted
1. User can give either reference no or Acct doc no. REference Doc
                                                 takes preceedance
2. If REference no is gvien
*     2.1 Fetch all the records from bkpf table with field
*          'BUKRS' = comp code
*          'XBLNR' = refernce doc no
*          'BLART' = 'RE'(hardcode)
*     2.2 Search for that accounting document(BELNR and GJAHR) for that
                   Vendor in BSAK (cleared item ) and BSIK (open item)
*          2.2.1 if the document is not there in both tables
*                    Show error as 'the document doesnt exists'
*          2.2.2 if the document is there in BSAK (cleard item)
*          Show error as ' There is no open items for the doc'
*          2.2.3 if ther documet is there in bsik (open item)
*          Assign the acct doc no to that record and *process it.
*          Note : No Document will not be there in both tables.
3. If Account doc is given
*     3.1 if the document is not there in both tables
*               Show error as 'the document doesnt exists'
*     3.2 if the document is there in BSAK (cleard item)
*               Show error as ' There is no open items for the doc'
*     3.2 if ther documet is there in bsik (open item)
*          Assign the acct doc no to that record and process it.
          Note : Document should be posted only when all the line
                  items are valid
      If there is any items with error then the document should not be
                                                            posted.
INCLUDE BDC*******************************
include zbdcinclude.
   DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
Generated data section with specific formatting - DO NOT CHANGE  ***
TYPES: BEGIN OF file_format,
           New_doc(2),      "1.New document
          Comp_code(4),    "2.Cmpany code
           Pay_method(1),   "3.Payment method
           Hous_bank(5),    "4.Housing bank
           Check_lot(4),    "5.Check lot
           Post_date(10),   "6.Posting date
           Doc_date(10),    "7.Document date
           ref_text(15),    "  Reference Text
           doc_htext(25),   "8.Document header text
           Branch(4),       "9.Business area (bank)
           Amount1(16),     "10.Amount in document currency
           Bank_AccTxt(50), "11.Bank account text
           Vendor_no(10),   "12.Vendor number
           Ref_doc(16),     "13.Reference document number
           Acc_docu(10),    "14.Account document number
           Partial(2),      "15.Partial payment indicator
           Pay_Amount(15),  "16.Payment amount
           Item_text(50),   "17.Item text
           Bank_no(4),      "18.Bank number
       End of file_format.
  "File format for select the account document number
TYPES: Begin of file_format1,
         acc_doc(10),    "1.Account document number
         fiscal_lay(4),  "2.Fiscal layer
         cmp_code(4),    "3.Company code
         Ref_dno(16),    "4.Reference document number
         doc_type(2),    "5.Document type
      End of file_format1.
TYPES: Begin of file_format2,
        acc_dno(10),    "1.Account document number
        fiscal_lay(4),  "2.Fiscal layer
       End of file_format2.
  "Work area
TYPES: Begin of file_format3.
       include type file_format.
       include type file_format2.
TYPES: End of file_format3.
TYPES: Begin of l_opayf1.
       include type opayf.
TYPES: End of l_opayf1.
data:l_opayf type l_opayf1.
Constants:
    comp_code(4) type c value '5000'.
DATA: IT_Ndoc TYPE STANDARD TABLE OF file_format3,
      WA_DATATAB4  TYPE file_format3,
      print_opt    type OPAYF.
  "Work area
DATA: WA_DATATAB1 TYPE file_format1,
      WA_DATATAB2 TYPE file_format2,
      WA_DATATAB3 TYPE file_format2.
******Internal table generated *****************
DATA: IT_DATA TYPE STANDARD TABLE OF file_format,
      WA_DATATAB  TYPE file_format,
      WA_DATATABH TYPE file_format.
DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA,
      NO_OF_LINES TYPE F,
      xbelnr type bkpf-belnr.
data:cnt type i value 1,
     status(02),
     status1(02).
End generated data section ***
START OF SELECTION ************
START-OF-SELECTION.
  PERFORM LOAD_FILE_DATA.
  PERFORM REPORT_HEADER.
PERFORM PROCESS_DATA.
  DESCRIBE TABLE IT_DATA LINES NO_OF_LINES.
      READ THE INTERNAL TABLE                                      *
        .PERFORM THE BDC.......
*FORM PROCESS_DATA.
LOOP AT it_data into wa_datatab.
        LINE_NO = sy-tabix.
        add 1 to line_no . "Because header is deleted from excel
IF Wa_datatab-New_doc = 'X'.
   IF wa_datatab-New_doc = 'X' and status <> 'X' and
      status1 = 'S' and sy-tabix <> 1.
            PERFORM PROCESS_BDC.
            Status = ''.
            Status1 = ''.
            Clear   it_ndoc.
            Refresh it_ndoc.
            Clear Wa_datatabH.
   Endif.
    "Check initial screen entry and some fiels
      IF    wa_datatab-vendor_no  is initial or
           wa_datatab-comp_code  is initial or
            wa_datatab-Pay_method is initial or
            wa_datatab-Hous_bank  is initial or
            wa_datatab-Check_lot  is initial or
            wa_datatab-Amount1    is initial .
          write:/2 line_no,20 'E',25 'Enter initial screen entry first'.
          Status = 'X'.
      Else.
      "Read the header data store in work area
          READ TABLE IT_DATA INDEX CNT INTO Wa_datatabH.
            perform validate_data1.
      ENDIF.
ELSE.
            perform validate_data2.
    "Allow onely partial partial payment
     IF wa_datatab-Partial = 'X' or wa_datatab-Partial = 'x'.
          IF   Wa_datatab-ref_doc    is initial and
               wa_datatab-acc_docu    is initial.
          write:/2 line_no,20 'E',25 'Enter ref_no or acc_no'.
          Status = 'X'.
          ELSE.
    "Select the document number from account heaser table(bkpf)
        IF not wa_datatab-ref_doc is initial.
select  single belnr gjahr bukrs xblnr blart from bkpf into wa_datatab1
                                where ( blart = 'RE' or blart = 'KR' )
                                               and
                                     bukrs =  comp_code and
                                     xblnr =  wa_datatab-ref_doc.
        Else.
            IF not wa_datatab-acc_docu is initial.
select  single belnr gjahr bukrs xblnr blart from bkpf into wa_datatab1
                                 where ( blart = 'RE' or blart = 'KR' )
                                                and
                                      bukrs =  comp_code and
                                      belnr =  wa_datatab-acc_docu.
            ENDIF.
        ENDIF.
   "Check the document number is exist or not in acc header(bkpf)
       IF wa_datatab1-acc_doc is initial.
          write:/2 line_no,20 'E',25 'The document doesnot exit',
                   wa_datatab1-acc_doc.
          status = 'X'.
        Else.
   "Select the document number from clear item table(bsak)
          select single belnr gjahr from bsak into wa_datatab2
                    where lifnr = wa_datatabH-vendor_no     and
                          gjahr = wa_datatab1-fiscal_lay   and
                          belnr = wa_datatab1-acc_doc      and
                          bukrs = comp_code.
  "Select the document number from open item table(bsik)
          select single belnr gjahr from bsik into wa_datatab3
                    where lifnr = wa_datatabH-vendor_no     and
                          gjahr = wa_datatab1-fiscal_lay   and
                          belnr = wa_datatab1-acc_doc      and
                          bukrs = comp_code.
   "Check the document number is exist or not  in both table
        IF ( wa_datatab2-acc_dno is initial OR
             wa_datatab2-fiscal_lay is initial ) and
            ( wa_datatab3-fiscal_lay   is initial OR
             wa_datatab3-acc_dno  is initial ).
            write:/2 line_no,20 'E',25 'The document doesnot exit',
                     wa_datatab1-acc_doc.
            status = 'X'.
          Else.
  "Check the document number is exist or not in clear item table(bsak)
            IF not wa_datatab2-acc_dno  is initial and
               not wa_datatab2-fiscal_lay is initial.
     write:/2 line_no, 'E',25 'There is no open items for the document',
                       wa_datatab1-acc_doc.
              status = 'X'.
            Else.
  "Check the document number is exist or not in open item table(bsik)
                 IF not wa_datatab3-acc_dno    is initial and
                    not wa_datatab3-fiscal_lay is initial.
                    Status1 = 'S'.
                move-corresponding  wa_datatab  to wa_datatab4.
                move-corresponding  wa_datatab3 to wa_datatab4.
                   APPEND wa_datatab4 to IT_NDOC.
                 ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      ENDIF.
  ENDIF.
ENDIF.
    CLEAR wa_datatab.
    CLEAR wa_datatab1.
    CLEAR wa_datatab2.
    CLEAR wa_datatab3.
    CLEAR wa_datatab4.
    add 1 to cnt.
  ENDLOOP.
*ENDFORM.
IF status <> 'X' and status1 = 'S'.
PERFORM  PROCESS_BDC.
Endif.
PERFORM WRITE_ERR_FILE.
     FORM PROCESS_BDC.
FORM PROCESS_BDC.
DATA:
      search_line(2) type n,
      search_line1(2) type n,
      FIELD_NAME(20) TYPE C,
      line_indx(3) type n.
      add 1 to line_indx.
       perform bdc_dynpro      using 'SAPMF05A' '0129'.
       perform bdc_field       using 'BDC_OKCODE'
                                     '/ENV'.
       perform bdc_field       using 'BDC_CURSOR'
                                     'BSEG-WRBTR'.
       perform bdc_dynpro      using 'SAPMF05A' '0130'.
       perform bdc_field       using 'BDC_CURSOR'
                                     'OPAYF-PSTAP'.
       perform bdc_field       using 'BDC_OKCODE'
                                     '=MW'.
       perform bdc_field       using 'OPAYF-BUKRS'
                                  comp_code.
       perform bdc_field       using 'OPAYF-RZAWE'
                                  wa_datatabH-Pay_method.
       perform bdc_field       using 'OPAYF-HBKID'
                                  wa_datatabH-Hous_bank.
       perform bdc_field       using 'OPAYF-PSTAP'
                                  wa_datatabH-Check_lot.
       perform bdc_dynpro      using 'SAPMF05A' '0129'.
       perform bdc_field       using 'BDC_CURSOR'
                                     'BKPF-XBLNR'.
       perform bdc_field       using 'BDC_OKCODE'
                                     '=PA'.
       perform bdc_field       using 'BKPF-BLDAT'
                                  wa_datatabH-Doc_date.
       perform bdc_field       using 'BKPF-BUDAT'
                                  wa_datatabH-Post_date.
       perform bdc_field       using 'BKPF-XBLNR'
                                  wa_datatabH-ref_text.
       perform bdc_field       using 'BKPF-BKTXT'
                                  wa_datatabH-doc_htext.
       perform bdc_field       using 'BSEG-WRBTR'
                                  wa_datatabH-Amount1.
       perform bdc_field       using 'BSEG-GSBER'
                                  Wa_datatabH-Branch.
       perform bdc_field       using 'BSEG-SGTXT'
                                  wa_datatabH-Bank_AccTxt.
       perform bdc_field       using 'OPAYF-LIFNR'
                                 wa_datatabH-vendor_no.
     perform bdc_field       using 'RF05A-XPOS1(01)'
                                    record-XPOS1_01_012.
       perform bdc_field       using 'RF05A-XPOS1(03)'
                                     'X'.
       perform bdc_dynpro      using 'SAPMF05A' '0730'.
       perform bdc_field       using 'BDC_CURSOR'
                                     'RF05A-VONWT(01)'.
       perform bdc_field       using 'BDC_OKCODE'
                                     '=SL2'.
       perform bdc_dynpro      using 'SAPMF05A' '0608'.
       perform bdc_field       using 'BDC_CURSOR'
                                     'RF05A-XPOS1(04)'.
       perform bdc_field       using 'BDC_OKCODE'
                                     '=ENTR'.
     perform bdc_field       using 'RF05A-XPOS1(01)'
                                record-XPOS1_01_010.
       perform bdc_field       using 'RF05A-XPOS1(04)'
                                     'X'.
     Enter item document number in search screen
       perform bdc_dynpro      using 'SAPMF05A' '0731'.
       perform bdc_field       using 'BDC_CURSOR'
                                     'RF05A-SEL01(01)'.
     Loop at IT_NDOC into wa_datatab4.
      add  1 to search_line.
      CONCATENATE 'RF05A-SEL01(' search_line  ')' INTO FIELD_NAME.
      perform bdc_field       using FIELD_NAME
                                    wa_datatab4-acc_dno.
      if search_line = 10.  "if items are more than 10
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_dynpro      using 'SAPMF05A' '0731'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RF05A-SEL01(01)'.
        search_line = 0.
      endif.
    Endloop.
       perform bdc_field       using 'BDC_OKCODE'
                                     '=PA'.
     Enter the amount of partial payments
       perform bdc_dynpro      using 'SAPDF05X' '3100'.
       perform bdc_field       using 'BDC_OKCODE'
                                    '=PART'.
       search_line = 1.
   Loop at IT_NDOC into wa_datatab4
            where  Partial = 'X' or  Partial = 'x'.
       search_line = sy-tabix.
                  "select the item as first item
       perform bdc_dynpro      using 'SAPDF05X' '3100'.
       perform bdc_field       using 'BDC_OKCODE'
                                     '/00'.
       perform bdc_field       using 'RF05A-ABPOS'
                                      search_line.
       perform bdc_dynpro      using 'SAPDF05X' '3100'.
       perform bdc_field       using 'BDC_OKCODE'
                                           '/00'.
       perform bdc_field       using 'DF05B-PSZAH(01)'
                                    wa_datatab4-Pay_Amount.
   Endloop.
    Simulate the all
      perform bdc_dynpro      using 'SAPDF05X' '3100'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BS'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'DF05B-PSZAH(01)'.
   Give the line number and Item text
Loop at IT_NDOC into wa_datatab4.
       add 1 to line_indx.
   Click the detial icon
     perform bdc_dynpro      using 'SAPMF05A' '0700'.
     perform bdc_field       using 'BDC_CURSOR'
                                   'RF05A-NEWBS'.
     perform bdc_field       using 'BDC_OKCODE'
                                  '=PI'.
   Chose the line item
     perform bdc_dynpro      using 'SAPMF05A' '0610'.
     perform bdc_field       using 'BDC_CURSOR'
                                  '*BSEG-BUZEI'.
     perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
     perform bdc_field       using '*BSEG-BUZEI'
                                    line_indx.
    Enter the text and click document over view (AB)
     perform bdc_dynpro      using 'SAPMF05A' '0302'.
     perform bdc_field       using 'BDC_CURSOR'
                                   'BSEG-SGTXT'.
     perform bdc_field       using 'BDC_OKCODE'
                                   '=AB'.
     perform bdc_field       using 'BSEG-SGTXT'
                              wa_datatab4-Item_text.
Endloop.
*Save or post
    perform bdc_dynpro      using 'SAPMF05A' '0700'.
    perform bdc_field       using 'BDC_CURSOR'
                              'RF05A-NEWBS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
  perform bdc_field       using 'BDC_OKCODE'
                                 '=D'.
    perform bdc_transaction using 'F-58'.
    get parameter id 'BLN' field xbelnr.
  inserted by ganesh*******************
  perform bdc_dynpro      using 'SAPMFCHK' '0750'.
  perform bdc_field       using 'BDC_CURSOR'
                                'OPAYF-PSTAP'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=DRUK'.
  perform bdc_field       using 'BKPF-BELNR'
                                    xbelnr.
  perform bdc_field       using 'OPAYF-BUKRS'
                                   '5000'.
  perform bdc_field       using 'BKPF-GJAHR'
                                wa_datatab4-fiscal_lay.
  perform bdc_field       using 'OPAYF-RZAWE'
                               wa_datatabH-Pay_method.
  perform bdc_field       using 'OPAYF-PSTAP'
                               wa_datatabH-Check_lot.
l_opayf-bukrs = '5000'.
l_opayf-PPRIZ = 'DEFA'.
l_opayf-PPRIA = 'DEFA'.
l_opayf-PSTAP =  wa_datatabH-Check_lot.
l_opayf-PSOFO = 'X'.
l_opayf-RZAWE = wa_datatabH-Pay_method.
*CALL FUNCTION 'FORM_PRINT_AFTER_POSTING'
    EXPORTING
         i_belnr      = xbelnr
         i_gjahr      = wa_datatab4-fiscal_lay
         i_opayf      = L_OPAYF
        I_REPRI      =
   EXCEPTIONS
        ADDR_MISSING = 1
        CANCEL       = 2
        OTHERS       = 3
*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   YT042I.
   endloop.
*CLEAR L_OPAYF.
perform bdc_dynpro      using 'SAPLF028' '0101'.
perform bdc_field       using 'OPAYF-ABPOS'
                              wa_datatabH-Bank_no.
perform bdc_field       using 'BDC_OKCODE'
                               '=PI'.
perform bdc_dynpro      using 'SAPLF028' '0101'.
perform bdc_field       using 'BDC_CURSOR'
                               'T042I-HBKID(01)'.
perform bdc_field       using 'BDC_OKCODE'
                               '=PI'.
perform bdc_dynpro      using 'SAPMFCHK' '0750'.
perform bdc_field       using 'BDC_OKCODE'
                               '/n'.
perform bdc_dynpro      using 'SAPMFCHK' '0750'.
perform bdc_field       using 'BDC_OKCODE'
                               '/n'.
  perform bdc_transaction using 'FBZ5'.
    if not xbelnr is initial.
      clear allmessages.
      allmessages-line_no = line_no.
      allmessages-msg_type = 'S'.
      concatenate
         'Document '
         xbelnr
         ' created successfully.'
      into
         allmessages-msg_desc.
      append allmessages.
      perform write_to_screen.
     perform print_cheque.
    endif.
    clear xbelnr.
    set parameter id 'BLN' field xbelnr.
ENDFORM.
      FORM HEADER_DETAILS                                           *
FORM REPORT_HEADER.
  new-line.
  uline.
  WRITE :  AT 10 '  BDC to upload Custemer master data Extending',
              70 'Date : ',
              80 SY-DATUM.
  NEW-LINE.
  WRITE : AT 70 'Time : ',
             80 SY-UZEIT.
  uline.
  WRITE : AT 2 ' LINE NO  ',
            15 'MSG TYPE  ',
            25 '     DESCRIPTION'.
  ULINE.
ENDFORM.
   FORM LOAD FILE DATA
FORM LOAD_FILE_DATA.
  refresh: IT_DATA,
           ALLMESSAGES.
  clear: IT_DATA,
         ALLMESSAGES.
  data: IT_RAW TYPE TRUXS_T_TEXT_DATA.
Load the GL Master File to the Internal table
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
     EXPORTING
    I_FIELD_SEPERATOR        =
       i_line_header            =  'X'
       i_tab_raw_data           =  it_raw       " WORK TABLE
       i_filename               =  p_file
     TABLES
       i_tab_converted_data     = IT_DATA[]    "ACTUAL DATA
    EXCEPTIONS
       conversion_failed        = 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.
    STOP.
  ENDIF.
ENDFORM.
   FORM convert into internal format (unpack)
form convert_internal changing field.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
       EXPORTING
            INPUT  = field
       IMPORTING
            OUTPUT = field.
endform.
   FORM validate data
form validate_data1.
  perform convert_internal changing wa_datatabh-vendor_no.
perform convert_internal changing wa_datatabh-COMP_CODE.
endform.
form validate_data2.
perform convert_internal changing wa_datatab-ref_doc.
perform convert_internal changing wa_datatab-Acc_docu.
endform.
   FORM WRITE ERROR MESSAGE TO SCREEN
FORM WRITE_TO_SCREEN.
NEW-LINE.
write : AT  2 line_no ,
        AT 25 ALLMESSAGES-MSG_DESC.
        IF ALLMESSAGES-MSG_TYPE = 'E'.
          WRITE: AT 17 ALLMESSAGES-MSG_TYPE COLOR COL_NEGATIVE.
        ELSE.
          WRITE: AT 17 ALLMESSAGES-MSG_TYPE.
        ENDIF.
ENDFORM.
   FORM WRITE ERROR MESSAGE TO SCREEN
form print_cheque.
  clear print_opt.
  print_opt-BUKRS = comp_code.
  print_opt-RZAWE = wa_datatabH-Pay_method.
  print_opt-HBKID = wa_datatabH-Hous_bank.
  print_opt-PSTAP = wa_datatabH-Check_lot.
  print_opt-PPRIZ = 'DEFA'.  "default printer
  print_opt-PPRIA = 'DEFA'.  "default printer
  print_opt-PSOFO = 'X'.  "print imm
  print_opt-PESPR = 'X'.  "Text in receipient lang
  print_opt-LIFNR = wa_datatabH-vendor_no.
  select single * from t001 where bukrs = comp_code.
CALL FUNCTION 'GL_ACCOUNT_FOR_PAYMENT'
     EXPORTING
          I_BUKRS = comp_code
          I_HBKID = wa_datatabH-Hous_bank
          I_LAND1 = t001-land1
          I_WAERS = 'INR'
          I_ZLSCH = wa_datatabH-pay_method.
   IMPORTING
        E_HKONT =
        E_HKTID =
CALL FUNCTION 'PAYMENT_FORM_PRINT'
     EXPORTING
          I_OPAYF = print_opt
          I_VBLNR = xbelnr
endform.
Regards,
ganesh

Similar Messages

  • In which method i can upload data to two transactions at a time and how ?

    Hi,
    Can any body tell me  <b>In which method i can upload datas to two transactions at a time and how</b>
    Pls tell me the steps if possible.
    Thanks
    Prabhudutta

    Hi,
    I hope u are talking abt BDC,
    If it is BDC's Then you can use both the methods.
    Call Transaction or
    Session Method.
    Ex ..if already a vendor exists then call transaction xk02
    if vendor no is not yet created then call transaction xk01.
    hope this helps.
    santhosh

  • Handling two transactions in session method at a time

    Hi frnds
    now im facing problem in handling two transactions in session method fs00,fspo
    at a time.
    i want some info.on how to handle two transactions at a time
    thanx

    Use the function module in the following sequence.
    BDC_OPEN_GROUP.
    BDC_INSERT. " for the first TCODE
    BDC_INSERT. "  for the second TCODE
    BDC_CLOSE_GROUP.
    This will solve your problem.
    Reward if helpfull.
    Thanks and regards,
    Veerendranath Maddula.

  • Can we record two transactions and use for  a Call-transaction BDC?

    can we record two transactions and upload data using Call-transaction method in BDC ?IF not why?

    Hi Prakash,
    Here i used two transactions.
    REPORT zra_gl_cr NO STANDARD PAGE HEADING LINE-SIZE 255.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    DATA:messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA:messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF i_mess OCCURS 0,
      l_mstring(480),
      msgnr(5),
      msgv1(15),
      END OF i_mess.
    DATA:i_mess1 LIKE i_mess OCCURS 0 WITH HEADER LINE.
    DATA: l_mstring(480),l_mstring1(480).
    DATA: BEGIN OF it_itab OCCURS 0,
          saknr(10),    "G/L a/c number.
          bukrs(4),     "Company Code.
          ktoks(4),     "G/L a/c group.
          xplacct(1),   "P&L statement account.
          xbilk(1),     "Balance sheet account.
          txt20_ml(20), "G/L a/c short text.
          txt50_ml(50), "G/L a/c long text.
          waers(5),     "Account currency.
          MWSKZ(2),
          mitkz(1),     "Reconciliation a/c for a/c type.
          xopvw(1),     "Open item management
          xkres(1),     "Line item display.
          zuawa(3),     "Sort Key.
          fstag(4),     "Field status group.
          xintb(1),     "Post automatically only.
          hbkid(5),     "House bank.
          hktid(5),     "Account id.
          vzskz(2),     "Interest indicator
          END OF it_itab.
    DATA: hdate LIKE sy-datum.
                          Selection Screen                       *****
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(15) text-103. " FOR FIELD P_FILE1.
    SELECTION-SCREEN POSITION 25.
    PARAMETERS : p_file1 LIKE rlgrap-filename.
    SELECTION-SCREEN END OF LINE.
                          Initialization                         *****
    INITIALIZATION.
                       At Selection Screen                       *****
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
    Perform file_selection will help to select the location of the file
      PERFORM file_selection.
                       Start-Of-Selection                        *****
    START-OF-SELECTION.
    Perform data_upload will help to upload the data from the flat file
    to the internal table.
      PERFORM data_upload.
    PERFORM open_group.
       Peform bdc_upload will help to upload the data from the internal
       table into its respective fields.
    PERFORM bdc_fspo.
      PERFORM bdc_upload.
      PERFORM exp_log.
    PERFORM close_group.
       Perform display_log will prepare a log for the data that has been
       uploaded
       PERFORM display_log.
                        End-Of-Selection                           ****
    END-OF-SELECTION.
    *&      Form  file_selection
          To select the location of the file
    FORM file_selection .
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = ' '
          def_path         = 'C:\'
          mask             = ',.txt,.xls.'
          mode             = 'O'
          title            = 'Open a excel file'
        IMPORTING
          filename         = p_file1
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
    ENDFORM.                    " file_selection
    *&      Form  data_upload
         To upload the data from the file location to the internal table.
    FORM data_upload .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw
          i_filename               =  p_file1
        TABLES
          i_tab_converted_data     = it_itab
       EXCEPTIONS
          conversion_failed        = 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.
    ENDFORM.                    " data_upload
    *&      Form  bdc_upload
    To upload the data from the internal table into its respective fields.
    FORM bdc_upload .
      LOOP AT it_itab.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ACC_CRE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_KEY-SAKNR'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                  it_itab-SAKNR.
    perform bdc_field       using 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                  it_itab-BUKRS.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=2102_GROUP'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-KTOKS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                  it_itab-XPLACCT.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=2102_BS_PL'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-XBILK'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                 it_itab-XPLACCT.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                  it_itab-XBILK.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                  it_itab-XBILK.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                  it_itab-TXT20_ML.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                 it_itab-TXT50_ML.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-BILKT'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-BILKT'
                                  it_itab-saknr.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=TAB02'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_COA-KTOKS'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                       it_itab-ktoks.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                       it_itab-txt20_ml.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                       it_itab-txt50_ml.
        perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-BILKT'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-BILKT'
                                  it_itab-saknr.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TAB02'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-KTOKS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                     it_itab-KTOKS.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-KTOKS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                 it_itab-XBILK.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                  it_itab-TXT20_ML.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                  it_itab-TXT50_ML.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-BILKT'
                                 it_itab-saknr.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                  it_itab-waers.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                  it_itab-MWSKZ.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  it_itab-mitkz.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-XOPVW'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                  it_itab-XOPVW.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                  it_itab-XKRES.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                 it_itab-ZUAWA.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                       it_itab-xplacct.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                       it_itab-xbilk.
           IF it_itab-xbilk = 'X'.
       PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=TAB03'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'GLACCOUNT_SCREEN_CCODE-WAERS'.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                      it_itab-waers.
         PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                  it_itab-xopvw.
         PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  it_itab-mitkz.
       ENDIF.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                      it_itab-xkres.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                      it_itab-zuawa.
       PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=SAVE'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'GLACCOUNT_SCREEN_CCODE-FSTAG'.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                      it_itab-fstag.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                      it_itab-xintb.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-HBKID'
                                      it_itab-hbkid.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-HKTID'
                                      it_itab-hktid.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-VZSKZ'
                                      it_itab-vzskz.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TAB03'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-WAERS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                  it_itab-WAERS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                  it_itab-MWSKZ.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  it_itab-MITKZ.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                 it_itab-ZUAWA.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-FSTAG'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                 it_itab-FSTAG.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-FSTAG'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                  it_itab-FSTAG.
       PERFORM bdc_transaction USING 'FS00'.
        CALL TRANSACTION 'FS00' USING bdcdata MODE 'A'
                                              UPDATE 'S'
                                             MESSAGES  INTO messtab1.
        PERFORM mess1.
        REFRESH bdcdata[].
      ENDLOOP.
    ENDFORM.                    " bdc_upload
    *&      Form  bdc_fspo
          text
    FORM bdc_fspo .
      LOOP AT it_itab.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ACC_CRE'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_KEY-SAKNR'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                      it_itab-saknr.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-KTOPL'
                                      '1000'.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=2102_GROUP'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_COA-KTOKS'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                      it_itab-ktoks.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                       it_itab-xplacct.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                      it_itab-xbilk.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SAVE'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                       it_itab-ktoks.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                       it_itab-xplacct.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_COA-TXT50_ML'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                       it_itab-txt20_ml.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                       it_itab-txt50_ml.
    *perform bdc_transaction using 'FSP0'.
        CALL TRANSACTION 'FSP0' USING bdcdata MODE 'A'
                                              UPDATE 'S'
                                             MESSAGES  INTO messtab.
        PERFORM mess.
        REFRESH bdcdata[].
      ENDLOOP.
    ENDFORM.                    " bdc_fspo
    *&      Form  mess
          text
    -->  p1        text
    <--  p2        text
    FORM mess .                                                 "fsp0
      LOOP AT messtab.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = messtab-msgid
            lang      = messtab-msgspra
            no        = messtab-msgnr
            v1        = messtab-msgv1
            v2        = messtab-msgv2
            v3        = messtab-msgv3
            v4        = messtab-msgv4
          IMPORTING
            msg       = l_mstring
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        CONDENSE l_mstring.
        i_mess1-l_mstring = l_mstring(250).
        i_mess1-msgnr = messtab1-msgnr.
        i_mess1-msgv1 = messtab1-msgv1.
        APPEND i_mess1.
      ENDLOOP.
    ENDFORM.                    " mess
    *&      Form  mess1
          text
    -->  p1        text
    <--  p2        text
    FORM mess1 .                                                "fs00
      LOOP AT messtab1.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = messtab1-msgid
            lang      = messtab1-msgspra
            no        = messtab1-msgnr
            v1        = messtab1-msgv1
            v2        = messtab1-msgv2
            v3        = messtab1-msgv3
            v4        = messtab1-msgv4
          IMPORTING
            msg       = l_mstring1
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        CONDENSE l_mstring1.
        i_mess-l_mstring = l_mstring1(250).
        i_mess-msgnr = messtab1-msgnr.
        i_mess-msgv1 = messtab1-msgv1.
        APPEND i_mess.
      ENDLOOP.
    ENDFORM.                                                    " mess1
    *&      Form  exp_log
          text
    -->  p1        text
    <--  p2        text
    FORM exp_log .
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'c:\temp\error_fsp0.txt'
          filetype = 'DAT'
        TABLES
          data_tab = i_mess1.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'c:\temp\error_fs00.txt'
          filetype = 'DAT'
        TABLES
          data_tab = i_mess.
    ENDFORM.                    " exp_log
    *&      Form  bdc_dynpro
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "BDC_Field
    ********Rewards some points.

  • Two transactions in one BDC

    Hi Experts......
          Could anyone help me how to call two transactions in one BDC Report.I know that it is possible through BDC Session Method. Could you please provide me the procedure...?
    Thanks & Regards,
    Sai..

    Hi,
    take all the fields to internal table and then use like this.
    Loop at it_table to wa_table.
    *************for first Transaction
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=INS'.
    perform bdc_transaction using 'TCODE'." first t code
    *****************for second transactions
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=INS'.
    perform bdc_transaction using 'TCODE'." this t code is second one
    endloop.
    try this, i hope you can succeed.
    Regards,
    Arjun.
    Edited by: mallikarjuna goud on Dec 17, 2008 10:35 AM

  • Plz tell me BDC  CALL TRANSACTION steps with simple example

    hi,
    plz tell me the steps
    BDC  CALL TRANSACTION steps with simple example

    Hi,
    BATCH DATA COMMUNICATION
    About Data Transfer In R/3 System
    When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
    In the process of replacing current applications and transferring application data, two situations might occur:
    ? The first is when application data to be replaced is transferred at once, and only once.
    ? The second situation is to transfer data periodically from external systems to SAP and vice versa.
    ? There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
    The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called ?batch input? or ?batch data communication?.
    1. SESSION METHOD
    2. CALL TRANSACTION
    3. DIRECT INPUT
    Advantages offered by BATCH INPUT method:
    1. Can process large data volumes in batch.
    2. Can be planned and submitted in the background.
    3. No manual interaction is required when data is transferred.
    4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.
    To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a ?data transfer? program must map the data from the external system into the data structure required by the SAP batch input program.
    The batch input program must build all of the input to execute the SAP transaction.
    Two main steps are required:
    ? To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
    ? To pass the table to SAP for processing.
    Prerequisite for Data Transfer Program
    Writing a Data Transfer Program involves following prerequisites:
    Analyzing data from local file
    Analyzing transaction
    Analyzing transaction involves following steps:
    ? The transaction code, if you do not already know it.
    ? Which fields require input i.e., mandatory.
    ? Which fields can you allow to default to standard values.
    ? The names, types, and lengths of the fields that are used by a transaction.
    ? Screen number and Name of module pool program behind a particular transaction.
    To analyze a transaction::
    ? Start the transaction by menu or by entering the transaction code in the command box.
    (You can determine the transaction name by choosing System ? Status.)
    ? Step through the transaction, entering the data will be required for processing your batch input data.
    ? On each screen, note the program name and screen (dynpro) number.
    (dynpro = dyn + pro. Dyn = screen, pro = number)
    ? Display these by choosing System ? Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
    The technical info pop-up shows not only the field information but also the program and screen.
    ? For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
    Note the following information:
    - The field name for batch input, which you?ll find in its own box.
    - The length and data type of the field. You can display this information by double clicking on the Data Element field.
    ? Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
    Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
    In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
    You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
    Once you have program name, screen number, field name (screen field name), you can start writing.
    DATA TRANSFER program.
    Declaring internal table
    First Integral Table similar to structure like local file.
    Declaring internal table like BDCDATA
    The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
    The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
    This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
    ? Create a BDCDATA structure
    ? Write the structure out to a session or process it with CALL TRANSACTION USING; and then
    ? Create a BDCDATA structure for the next transaction that is to be processed.
    Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
    The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
    ? Data that is entered into screen fields.
    ? Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
    The BDCDATA structure contains the following fields:
    ? PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
    ? DYNPRO: Screen Number. Set this field only in the first record for the screen.
    ? DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to ? ? (blank) for all other records.)
    ? FNAM: Field Name. The FNAM field is not case-sensitive.
    ? FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
    Transferring data from local file to internal table
    Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
    Population of BDCDATA
    For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
    All these five initial steps are necessary for any type of BDC interface.
    DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.
    First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
    SESSION METHOD
    About Session method
    In this method you transfer data from internal table to database table through sessions.
    In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
    Unless session is processed, the data is not transferred to database table.
    BDC_OPEN_GROUP
    You create the session through program by BDC_OPEN_GROUP function.
    Parameters to this function are:
    ? User Name: User name
    ? Group: Name of the session
    ? Lock Date: The date on which you want to process the session.
    ? Keep: This parameter is passed as ?X? when you want to retain session after
    processing it or ? ? to delete it after processing.
    BDC_INSERT
    This function creates the session & data is transferred to Session.
    Parameters to this function are:
    ? Tcode: Transaction Name
    ? Dynprotab: BDC Data
    BDC_CLOSE_GROUP
    This function closes the BDC Group. No Parameters.
    Some additional information for session processing
    When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
    However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.
    If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
    CALL TRANSACTION
    About CALL TRANSACTION
    A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>
    Messages into <MSGTAB>.
    Parameter ? 1 is transaction code.
    Parameter ? 2 is name of BDCTAB table.
    Parameter ? 3 here you are specifying mode in which you execute transaction
    A is all screen mode. All the screen of transaction are displayed.
    N is no screen mode. No screen is displayed when you execute the transaction.
    E is error screen. Only those screens are displayed wherein you have error record.
    Parameter ? 4 here you are specifying update type by which database table is updated.
    S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
    A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
    Parameter ? 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:
    1. Tcode: Transaction code
    2. Dyname: Batch point module name
    3. Dynumb: Batch input Dyn number
    4. Msgtyp: Batch input message type (A/E/W/I/S)
    5. Msgspra: Batch input Lang, id of message
    6. Msgid: Message id
    7. MsgvN: Message variables (N = 1 - 4)
    For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).
    Steps for CALL TRANSACTION method
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)
    4. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>.
    Refresh BDCTAB.
    Endloop.
    (To populate BDCTAB, You need to transfer each and every field)
    The major differences between Session method and Call transaction are as follows:
    SESSION METHOD CALL TRANSACTION
    1. Data is not updated in database table unless Session is processed. Immediate updation in database table.
    2. No sy-subrc is returned. Sy-subrc is returned.
    3. Error log is created for error records. Errors need to be handled explicitly
    4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.
    Error Handling in CALL TRANSACTION
    When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
    Steps for the error handling in CALL TRANSACTION
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. Internal table BDCMSG like BDCMSGCOLL
    4. Internal table similar to Ist internal table
    (Third and fourth steps are for error handling)
    5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
    6. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tr.code> using <Bdctab>
    Mode <A/N/E>
    Update <S/A>
    Messages <BDCMSG>.
    Perform check.
    Refresh BDCTAB.
    Endloop.
    7 Form check.
    IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).
    Call function Format_message.
    (This function is called to store the message given by system and to display it along with record)
    Append itab2.
    Display the record and message.
    DIRECT INPUT
    Thanks &regards,
    Sravani

  • Radio button in bdc multiple transaction

    hi,
        i m working on two dependent transactions in bdc(using call transaction method) on ie01 and ko01 transactions where in in the selction screen i used two radio buttons under one group for calling each transaction,but i m unable to call ko01 transaction when i click to ko01 radiobutton and press execute its going into ie01 transaction,can any one explain how we can write the code to call two transactions seperately and upload data seperatly for both under single radio button group in single pgm......

    Hi Raj,
         Can you please send me the BDC code which you have written for tcode ko01.  I am getting the following problem in BDC code for uploading internal orders in KO01 tcode.
       I want to enable a field in BDC program for ko01 tcode.
    In this tcode, based on order type the business area field is enabling and disabling. If it is enabled then we have to enter business area bcaz its a mandatory field. Business area will be disabled if system generates a value into that field based on order type.
    How can do it in BDC program of this disabling and enabling technique.
    I want to enable the business area irrespective of order type and i will pass the value to it,bcaz in my flat file business area value is given for all order types.
    Its an urgent issue.
    Thanks in Advance.
    Regards,
    Swapna

  • Pulling out two records at a time

    I have a TABLE with multiple records in it, of which i want to pull out two records at a time (as if they were one record), of those records that meet the WHERE criteria. Order is not important. Basically, i have a TABLE of things that wither need processing or have been processed already. I can process two at a time. (In a related search, that i am not up to yet, i can do 20 at a time.) How would i go about doing that?
    My first thought was a CTE with ROW_NUMBER() RN, using CONNECT BY RN = PRIOR RN + 2, and have a sub-query (or joined TABLE) pull out the second record:
    WITH Moo (SELECT ... ROW_NUMBER RN FROM Table WHERE ...)
    SELECT ..., (SELECT ... FROM FROM Moo Moo2 WHERE Moo2.Id = Moo.Id + 1)
    FROM Moo CONNECT BY Id = PRIOR Id + 2;
    Or a join. Is there a better way to approach it?

    Pretty much everything you just said is wrong.
    >
    I generally keep away from CURSORs, as i want the DB to handle the set processing for me, as opposed to a CURSOR which tells the DB how to do it's job.
    >
    If you do any DB queries then you are using cursors. You have the wrong idea about them. All result sets are obtained using a cursor. A cursor does NOT tell a DB how to do a job; that is what the query and execution plan do.
    >
    (And, Tom Kyt's mantra of "You should do it in a single SQL statement if at all possible") But that's just a rule of thumb.
    >
    No - that isn't a rule of thumb. That is exactly what you should do if possible which is what I said. But I also said
    >
    Well the general use is to use SQL instead of PL/SQL but since you already need to use a function you might as well make that function as efficient as possible.
    >
    If you are already using a function then you should get the most bang for the buck from it and make it as efficient as possible.
    >
    If the CURSOR is the most efficient, so be it. But as you point out, if i'm already going to use a CURSOR, i might as well do all the work in the CURSOR LOOP. Why bother switching contexts.
    >
    All queries are done using cursors. It isn't a question of whether they are more efficient; it is the only way possible. I think you are referring to a user creating an explicit cursor and performing explicit manipulation of that cursor. That isn't normally what you want to do.
    A cursor loop is the slowest way to process results especially if all you are doing is row-by-row processing to perform essentially SQL-related work. PL/SQL should be used for the transactional part of the processing. In your case that transactional use is consolidating two records together for specialized processing.
    As for context switches if you perform any PL/SQL you are going to have a context switch: functions, procedures, triggers. The function you already planned to use would have caused a context switch. What I am saying is that if you are going to perform a context switch then you want to maximize the amount of work (transactional work) done in the PL/SQL engine so that you minimize the context switching.
    You still haven't explained exactly why 2 records at a time is any more ideal than 1 or if you could also process 50, 100, or 10000 at a time. Is the limit what needs to be passed somewhere else? What is the reason for a max of two? What exactly are you doing with the data to prepare it before you have to pass it on?
    Bulk collect processing is more efficient, with fewer context switches, if you process 20, 50, or 100 records in the loop at a time.
    See Chap 13 Using Pipelined and parallel Table Functions in the Data Cartridge Dev Guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm

  • Restrict to use of two transaction concurrently in ABAP program

    Hi,
    We have requirement to restrict a user could not using two transaction
    at the same time. how could i achieve this. Please throw some light on this.

    Hi
    --> create a lock object from SE11
    Ex :  lock object name is EZLOCK
         -->Click on Create
         -->Give the table name
         --> Lock mode (Write, read, Exclusive not cumulative)
         --> Give the Lock parameters
    -->save --> activate --> Then system will generate to function module
                          1. ENQUEUE_EZLOCK (for locking)
                          2. DEQUEUE_EZLOCK (For Unlocking)
    --> you need to call these function module in respective areas
    ex: In PAI of the screen call ENQUEUE F.M and in
        the exit perfroms use DEQUEUE F.M
    Ex code to use the f.m's
    *To avoid acces of multiple users at a time
      CALL FUNCTION 'ENQUEUE_EZCONIC'
        EXPORTING
          mode_zpicci    = 'E'
          zpicnum        = g_fffc
        EXCEPTIONS
          foreign_lock   = 1
          system_failure = 2
          OTHERS         = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        LEAVE TO SCREEN 1000.
      ENDIF.
    *To unlock the trascation
        CALL FUNCTION 'DEQUEUE_EZCONIC'.
    Thanks & Regards
    Mallikharjuna Reddy

  • Program does BDC for transaction F-52 or f-53

    Hi GuruI am functional person and working with a developer in a program . The program does BDC for transaction F-52 or f-53 . I am uploading a file ,so that the program picks it and o either F-52 or F-53 based on condition. When i try to upload the program with mulitple record ,i am getting the message difference is too large to clear . If i execute the same program without doing any changes again i can see few more records getting posted . when i do next time remaining records are posted . Insted of getting posted in one ,I have to execute the program more than once .can any one help me out why this is happening

    i think you should ask  your programmer to use transaction SM35 to process the BDC in foreground mode (first changing the mode to A). I would think you will see what's going wrong then. There are a few transactions that look different in foreground mode than in background and you will see where the difference is if you use this method to process

  • Infocubes - TRANSACTIONAL - STANDARD - REAL TIME

    <h3>Some clarity has to be brought in to these three types of CUBES.
    <h5>
    I am using SALES ANALYSIS & SALES BUDGET here as an example.
    <h1>Assumptions & Scenario:
    <h5>1. Sales Budget is prepared once a year, Division / Group / Category / Material wise (may be customerwise, but does not really matter). Once the budget is approved, it more or less remains static, with very little changes. Budgeting is done for Quantity to be sold as well as an approximate unit cost.
    <h5>
    2. Sales Analysis captures the actual sales in the same order Division / Group / Category / Material wise but now the quantity and the unit price are actual values.
    <h5>
    3. Assume that the accounting period for this organization is January to December for a calendar year, and the Sales budget is finalized and approved in November for the next Accounting year. Example, sales budget for Jan, 2010 - Dec, 2010 is finalized and approved in November, 2009.
    <h5>
    4. Review and fine tuning and updates to Sales budget is carried out once in three months for the next quarter. In the case in Mid March, Mid Jun, Mid Sep.
    <h1>BI Requirement:
    <h5>1. Actual sales figures are always compared with Sales Budget and also compared with Last years Actuals.
    <h2>
    Solution Scenario - I.
    <h5>
    Maintain Sales Budget figures in a separate INFOCUBE, FACTS being quantity and value, Dimensions being Division / Group / Category / Material . (since there is very little update to this cube, SHOULD WE CALL IT STANDARD or REALTIME or TRANSACTIONAL)
    <h5>
    Maintain Actual sales in another INFOCUBE, again FACTS being quantity and value, Dimensions being Division / Group / Category / Material . Because of the Data Volume, we want to update this cube on nightly basis, using DELTA. Should we call this STANDARD or TRANSACTIONAL ?
    <h5>
    All the reports, queries will JOIN (dont know how) both the cubes and display BUDGET and ACTUALS in adjacent collumns.
    <h2>_Solution Scenario -II._
    <h5>
    Since the BUDGET figures and ACTUAL figures are always viewed together, create a single INFOCUBE for this department.
    <h5>
    FACTS being BudgetQuantity, BudgetAmount, ActualQuantity and ActualAmount. (include if you want, some computational fields to show Percentage of Variance which can also be done at the query level). DIMENSIONS remain the same as SCENARIO - I.
    <h5>
    You will note immediately that TWO OF THE FACTS are almost STATIC while two of the FACTS are updated everyday.
    <h5>
    What would you call this type of CUBE? TRASACTIONAL / STANDARD / REALTIME ?
    <h5>
    Difference between STANDARD and REALTIME cubes being the way the INDICES are maintained. (Hope my understanding is correct, one designed for better performance for RETRIEVAL and the other for UPDATE).
    <h5>
    In all the cases (Transactional / Standard / Real time) the data is moved from R/3 to PSA and then to the INFOCUBE. so why use the term REAL TIME. And cubes are always built based on Business Transactions, so why use the term TRANSACTIONAL?
    <h5>
    The term "Real Time" somehow conveys the idea that the CUBE Gets updated, when a transaction is Committed in R/3 database. The Help document also is Ambiguous. If the data is moved from R/3 to Data Source and then to PSA and finally reaches Infocube, then  what is REAL TIME?
    <h5>
    I think it would benefit everyone in SAP BI domain, if these things are explained in plain english.
    <h5>
    I apologize for writing such a long QUESTION , but hope it will help many of you,
    <h3>
    Thanks,
    <h5>
    Gold
    Edited by: HornigoldA on Jan 21, 2010 2:33 PM --- I just edited it to make it more readable with MARKUPS

    <h3>Some clarity has to be brought in to these three types of CUBES.
    <h5>
    I am using SALES ANALYSIS & SALES BUDGET here as an example.
    <h1>Assumptions & Scenario:
    <h5>1. Sales Budget is prepared once a year, Division / Group / Category / Material wise (may be customerwise, but does not really matter). Once the budget is approved, it more or less remains static, with very little changes. Budgeting is done for Quantity to be sold as well as an approximate unit cost.
    <h5>
    2. Sales Analysis captures the actual sales in the same order Division / Group / Category / Material wise but now the quantity and the unit price are actual values.
    <h5>
    3. Assume that the accounting period for this organization is January to December for a calendar year, and the Sales budget is finalized and approved in November for the next Accounting year. Example, sales budget for Jan, 2010 - Dec, 2010 is finalized and approved in November, 2009.
    <h5>
    4. Review and fine tuning and updates to Sales budget is carried out once in three months for the next quarter. In the case in Mid March, Mid Jun, Mid Sep.
    <h1>BI Requirement:
    <h5>1. Actual sales figures are always compared with Sales Budget and also compared with Last years Actuals.
    <h2>
    Solution Scenario - I.
    <h5>
    Maintain Sales Budget figures in a separate INFOCUBE, FACTS being quantity and value, Dimensions being Division / Group / Category / Material . (since there is very little update to this cube, SHOULD WE CALL IT STANDARD or REALTIME or TRANSACTIONAL)
    <h5>
    Maintain Actual sales in another INFOCUBE, again FACTS being quantity and value, Dimensions being Division / Group / Category / Material . Because of the Data Volume, we want to update this cube on nightly basis, using DELTA. Should we call this STANDARD or TRANSACTIONAL ?
    <h5>
    All the reports, queries will JOIN (dont know how) both the cubes and display BUDGET and ACTUALS in adjacent collumns.
    <h2>_Solution Scenario -II._
    <h5>
    Since the BUDGET figures and ACTUAL figures are always viewed together, create a single INFOCUBE for this department.
    <h5>
    FACTS being BudgetQuantity, BudgetAmount, ActualQuantity and ActualAmount. (include if you want, some computational fields to show Percentage of Variance which can also be done at the query level). DIMENSIONS remain the same as SCENARIO - I.
    <h5>
    You will note immediately that TWO OF THE FACTS are almost STATIC while two of the FACTS are updated everyday.
    <h5>
    What would you call this type of CUBE? TRASACTIONAL / STANDARD / REALTIME ?
    <h5>
    Difference between STANDARD and REALTIME cubes being the way the INDICES are maintained. (Hope my understanding is correct, one designed for better performance for RETRIEVAL and the other for UPDATE).
    <h5>
    In all the cases (Transactional / Standard / Real time) the data is moved from R/3 to PSA and then to the INFOCUBE. so why use the term REAL TIME. And cubes are always built based on Business Transactions, so why use the term TRANSACTIONAL?
    <h5>
    The term "Real Time" somehow conveys the idea that the CUBE Gets updated, when a transaction is Committed in R/3 database. The Help document also is Ambiguous. If the data is moved from R/3 to Data Source and then to PSA and finally reaches Infocube, then  what is REAL TIME?
    <h5>
    I think it would benefit everyone in SAP BI domain, if these things are explained in plain english.
    <h5>
    I apologize for writing such a long QUESTION , but hope it will help many of you,
    <h3>
    Thanks,
    <h5>
    Gold
    Edited by: HornigoldA on Jan 21, 2010 2:33 PM --- I just edited it to make it more readable with MARKUPS

  • How to stop the activity clipboard linkage between two transactions?

    Hi Experts,
    We are using CRM 2007. In CRM, since there is no check that the agent needs to work on transactions related to once customer at a time, our agents are able to work on different different transactions belonging to different customers one after another.
    As a result, transactions belonging to two different customers are getting linked in the Activity Clipboard of interaction Record as well as Service Order transactions.
    We need to place a check so that before the link is created, we can compare the customers of the two transactions and if they differ, we should not create the link. Can you please guide me where is the best place to put such a check?
    As per my analysis, we need to stop the doc flow being created if the transactions have different sold to/customer.
    Any pointers/suggestions?
    Thanks
    Rohit

    Hi Rohit
    Did you manage to get any solution to this?
    if you have, would appreciate if you could share the solution.
    Rgds
    Rusyinni

  • How to set the BDC Call transaction Program in Background

    Hi All,
            I have a requirement. If i execute a BDC Call Transaction Program in Background it is showing 0 seconds means it is not executing. Normally it is working properly. If execute in background it is not executing. But my client wnats to execute in background. How can i overcome this could you please suggest me?
    Thanks in Advance

    hi
    To schedule the processing of session in backgroud you can use report RSBDCSUB.
    You can do in two ways -
    Ist Method
    Define a batch job in SM36 with two steps -
    First Step - Your Custom Program ( with a variant )
    Second Step - RSBDCSUB ( With a variant having
    the session name ).
    2nd Method
    In your program after BDC_CLOSE_GROUP add a line.
    SUBMIT RSBDCSUB WITH MAPPE EQ <SESSION_NAME>.
    Scedule you program as a batch job in SM36 ( Single Step ). ( You can also test the program by running in online mode . After your programs executes , go and see in SM35. You will see that your session created in being processed or has been processed in background).
    In Both ways the session created by BDC_OPEN_GROUP will be processed in background
    You would have to create a job on the fly to do this. This example shows how to kick off a background job via an ABAP program.
    report zrich_0004 .
    data:   sdate type sy-datum,
            stime type sy-uzeit,
            l_valid,
            ls_params like pri_params,
            l_jobcount like tbtcjob-jobcount,
            l_jobname  like tbtcjob-jobname.
    start-of-selection.
    Get Print Parameters
      call function 'GET_PRINT_PARAMETERS'
           exporting
                no_dialog      = 'X'
           importing
                valid          = l_valid
                out_parameters = ls_params.
    Open Job
      l_jobname = 'ZRICH_0005'.
      call function 'JOB_OPEN'
           exporting
                jobname  = l_jobname
           importing
                jobcount = l_jobcount.
    Submit report to job
      submit zrich_0005   
           via job     l_jobname
               number  l_jobcount
           to sap-spool without spool dynpro
               spool parameters ls_params
                  and return.
    Schedule and close job.
      call function 'JOB_CLOSE'
           exporting
                jobcount  = l_jobcount
                jobname   = l_jobname
                strtimmed = 'X.
    regards
    Satish

  • Error Records in BDC Call transaction

    Hi.....
         I am new to BDC concept... Can any of u tell me how to collect error records in BDC  Call transaction... I already collected error messages through BDCMSGCOL... but  i dont know how to collect those error records... here i am using two different flat files for header and line item...  and kindly tell me if there is an error in line item how to get it so with relevent header details...
    thanks,

    Hi,
          LOOP AT t_bdcmsgcoll INTO w_bdcmsgcoll.
            PERFORM f_format_msg USING w_bdcmsgcoll CHANGING w_return.
         ENDLOOP.
    Form format_msg 
      DATA : l_mstring(480).
      CALL FUNCTION 'FORMAT_MESSAGE'                          
        EXPORTING
          id        = w_bdcmsgcoll-msgid
          lang      = w_bdcmsgcoll-msgspra
          no        = w_bdcmsgcoll-msgnr
          v1        = w_bdcmsgcoll-msgv1
          v2        = w_bdcmsgcoll-msgv2
          v3        = w_bdcmsgcoll-msgv3
          v4        = w_bdcmsgcoll-msgv4
        IMPORTING
          msg       = l_mstring
        EXCEPTIONS
          not_found = 1
          OTHERS    = 2.
    End format_msg 
    you can use the l_mstring to process further and pass to the bapiret2 table
    Regards,
    Vijaya

  • Reg Vendor master upload using BDC Call Transaction Method

    Hi All,
    Thanks in advance.
    I am uploading vendor master data using bdc call transaction method for XK01. In that  i am getting an error message that the fields " smtp_addr" ( for email) and "time_zone" (for time zone) doesnot exist on the screen '0110' ( this is the second screen) . the field timezone will be displayed on the screen only when we go for communications button and select the URL field .
    Do anybody have the solution for this problem. if possible can you give me the code for that screen.

    Create a recording via SM35 (menu go to=>recording), this will generate automatically the code for filling your bdcdata-table...

Maybe you are looking for

  • Is there a way to get the history from find my iphone?

    My iPhone disappeared from my car while it was valet parked at the airport. I did a find my phone when I realized I had left it in the car, and it showed the location to be valet parking lot. I assumed all was well, did a remote lock operation, and e

  • Preview Default Print Setting "Fit to Page" Problem

    Preview.app in Snow Leopard has removed the option to print without scaling, and recreating this behaviour with the remaining options is quite complex and requires 4 extra steps. Steps to Reproduce: 1. Open a document in Preview.app, such as a PDF, o

  • Hide SYNC_KEY?

    Hi, can i hide the column SYNC_KEY? How? Thanks,

  • Crystal Reports Server XI R2 PGP?

    Hi All Could any one let me know please if their is a way to Schedule an excel file to be encrypted via PGP before it is sent out via the server please? Many thanks in advance for any response Kind regards Simon

  • Addition of discount % if Material received after delivery date

    Hi,   I have a requirement, in PO we add the delivery date now user want to if material received after the delivery date  then 2% discount to be added on the base value of material, Can we configur this in system. regards, zafar