Simple doubt in BDC  Call Transaction Method

Hi Friends,
  When i try to call vk13 transaction and pass the screen field values for the second screen and execute it it is displaying properly.But when i try to pass the different value in the bcddata internal table it is changing properly but in the screen it not updating that value.Alawly the screen fields are taking the values passed the first time.But in the internal table which we are oassing to the calltransaction it is changing correctly but not in the corresponding screen fields. Why it is happening so. Can any one help me out of this problem.
Thanks in Advance.

I am not passing through the selection screen . It is like iteractive report. when i select the particular line in the list output then the screen fields should take the values from that selected line. First time when i select the line it is taking properly.
But next time when i select the line the content of the i_bdc_tbl is changing correctly but when it enter in to the transaction it is not taking the values from the i_bdc_tbl. Simply it is displaying the screen fields with the old values. It is not updating the screen fields with the values from the i_bdc_tbl. Why the screen fields are not replaced with the value of i_bdc_tbl? Why it is not getting refreshed with the new values?
Just i am posting the bdc portion of my code here. So you can help me out on this.
AT LINE-SELECTION.
  SELECT SINGLE kozgf FROM t685 INTO v_kozgf
                      WHERE kschl = wa_report-kschl.
  SELECT kolnr kotabnr FROM t682i INTO TABLE i_t682i
                 WHERE kozgf = v_kozgf.
  SORT i_t682i BY kolnr.
  READ TABLE i_t682i WITH KEY kotabnr = wa_report-tabna+1(3)
       TRANSPORTING NO FIELDS.
  CHECK sy-subrc = 0.
  v_index = sy-tabix.
  REFRESH i_bdc_tbl.
  l_tabix = '01'.
  PERFORM f_vk13.
  CONCATENATE 'RV13' wa_report-tabna  INTO v_bdc_val_field.
  PERFORM bdc_dynpro      USING v_bdc_val_field '1000'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                'F004-LOW'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '=ONLI'.
  CREATE DATA v_rec  TYPE (wa_report-tabna).
  ASSIGN v_rec->* TO <wa_table>.
  SELECT SINGLE *  FROM (wa_report-tabna) INTO <wa_table>
  WHERE kschl = wa_report-kschl AND matnr = wa_report-matnr AND knumh = wa_report-objectid.
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = wa_report-tabna
    TABLES
      dfies_tab      = lwa_tabna
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.
  READ TABLE lwa_tabna WITH KEY fieldname = 'KSCHL'.
  p1 = sy-tabix + 1.
  READ TABLE lwa_tabna WITH KEY fieldname = 'MATNR'.
  p2 = sy-tabix.
  LOOP AT lwa_tabna.
    v_field = lwa_tabna-fieldname.
    IF lwa_tabna-position BETWEEN p1 AND p2.
      ASSIGN COMPONENT lwa_tabna-position OF STRUCTURE <wa_table> TO <fld>.
      PERFORM f_vk13_s2 USING lwa_tabna-fieldname <fld>.
    ENDIF.
  ENDLOOP.
  PERFORM bdc_field       USING 'RV130-DATAM'
                                   wa_report-fdate_value_new.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                'ONLI'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                'F001'.
  CALL TRANSACTION 'VK13' USING i_bdc_tbl
                          MODE  'A'.
FORM f_vk13.
  DATA: l_tabix(2) TYPE c.
*Condition type
  PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                'RV13A-KSCHL'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '/00'.
  PERFORM bdc_field       USING 'RV13A-KSCHL'
                                 wa_report-kschl.
*Key combination
  PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                'RV130-SELKZ(01)'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '=WEIT'.
  PERFORM bdc_field       USING 'RV130-SELKZ(01)'
  l_tabix = v_index.
  SHIFT l_tabix RIGHT.
  OVERLAY l_tabix WITH '00'.
  CONCATENATE 'RV130-SELKZ(' l_tabix ')' INTO v_bdc_field.
  PERFORM bdc_field       USING v_bdc_field
                                'X'.
ENDFORM.                                                    "f_vk13
      FORM BDC_DYNPRO
      This form accepts the program name and screen number
      and places the values into the I_BDC_TBL internal table.
FORM bdc_dynpro USING program dynpro.
  CLEAR wa_bdc_tbl.
  wa_bdc_tbl-program  = program.
  wa_bdc_tbl-dynpro   = dynpro.
  wa_bdc_tbl-dynbegin = 'X'.
  APPEND wa_bdc_tbl TO i_bdc_tbl.
ENDFORM.                    "BDC_DYNPRO
      FORM F_BDC_FIELD
    This form accepts the field name and the corresponding value
    for that field and places them into the I_BDC_TBL internal table.
FORM bdc_field USING fnam fval.
  CLEAR wa_bdc_tbl.
  MOVE fnam TO wa_bdc_tbl-fnam.
  MOVE fval TO wa_bdc_tbl-fval.
  APPEND wa_bdc_tbl TO i_bdc_tbl.
ENDFORM.                    "BDC_FIELD
*&      Form  f_vk13_s2
      text
-->  p1        text
<--  p2        text
FORM f_vk13_s2 USING p_fieldname p_fld.
  CONCATENATE wa_report-tabna '-' p_fieldname INTO v_bdc_val_field.
  CHECK NOT p_fld IS INITIAL.
  PERFORM bdc_field USING v_bdc_val_field p_fld.
ENDFORM.                                                    " f_vk13_s2
Thanks.

Similar Messages

  • Error in BDC CALL TRANSACTION METHOD..

    hai i got an error in  doing BDC  CALL TRANSACTION METHOD
    Error:diffrent number of parameters in  FORM  and PERFORM(routine :FILL_SCREEN_DETAILS:,number of formal parameters :3,number of actual parameters:1)
    PROGRAM
    REPORT  ZDEMO_UPLOAD_COST_CENTER_DATA.
    DATA:BEGIN OF WA_DATA,
    KOKRS TYPE KOKRS,"CONTROLLING AREA
    KOSTL TYPE KOSTL,"COST CENTER
    DATAB TYPE DATAB,"START DATE
    DATBI TYPE DATBI,"END DATE
    KTEXT TYPE KTEXT,"NAME
    LTEXT TYPE LTEXT,"DESCRIPTION
    VERAK TYPE VERAK,"PERSON RESPONSIBLE
    KOSAR TYPE KOSAR, "COST CENTER CATEGORY
    KHINR TYPE KHINR,"HIERARCHY AREA
    BUKRS TYPE BUKRS,"COMPANY CODE
    GSBER TYPE GSBER,"BUISINESS AREA
    END OF WA_DATA.
    *TYPES:IT_DATA TYPE STANDARD TABLE OF TY_DATA.
    DATA:IT_DATA LIKE TABLE OF WA_DATA,
          IT_BDCDATA LIKE TABLE OF BDCDATA,
          WA_BDCDATA LIKE LINE OF IT_BDCDATA,
          IT_BDCMSGCOLL LIKE TABLE OF BDCMSGCOLL,
          WA_BDCMSGCOLL LIKE LINE OF IT_BDCMSGCOLL.
    DATA :V_FILE TYPE STRING.
    CONSTANTS :C_KS01(4) TYPE C  VALUE 'KS01',
                C_X(1) TYPE C VALUE 'X',
                C_A(1) TYPE C VALUE 'A'.
    SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    PARAMETER :PA_FILE LIKE FC03TAB-PL00_FILE OBLIGATORY.
    SELECTION-SCREEN:END OF BLOCK B1.
    *AT SELECTION SCREEN ON VALUE REQUEST
    * EVENT TO BE TRIGGERED WHEN WE PRESS F4.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_FILE.
    PERFORM GET_F4_FOR_FILE USING PA_FILE.
    *         START-OF-SELECTION
    START-OF-SELECTION.
    *WE NEED TO MOVE THE PA_FILE INTO ANOTHER VARIABLE OF TYPE STRING
    *AS WE ARE GOING TO USE THE SAME IN THE FM:GUI_UPLOAD THERE THE FILE TYPE IS STRING
    V_FILE = PA_FILE.
    PERFORM UPLOAD_FILE_T0_ITAB USING V_FILE CHANGING IT_DATA.
    *FILL THE SCREEN AND FIELD DETAILS
    LOOP AT IT_DATA INTO WA_DATA.
    REFRESH IT_BDCDATA.
    *FIRST SCREEN DETAILS
    PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1''0200''X'.
    *CURSOR DETAILS
    PERFORM FILL_FIELD_DETAILS USING 'BDC_CURSOR''CSKSZ-KOKRS'.
    *OK CODE DETAILS
    PERFORM FILL_FIELD_DETAILS USING 'BDC_OKCODE''/00'.
    *CONTROLLING AREA
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KOKRS' WA_DATA-KOKRS.
    *COST CENTER DETAILS
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KOSTL' WA_DATA-KOSTL.
    * START DATE
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-DATAB_ANFO' WA_DATA-DATAB.
    *END DATE
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-DATBI_ANFO' WA_DATA-DATBI.
    *NEXT SCREEN DETAILS
    PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1''0299''X'.
    *OKCODE DETAILS
    PERFORM FILL_FIELD_DETAILS USING 'BDC_OKCODE''=BU'.
    *SUBSCRN FIELD DETAILS
    PERFORM FILL_FIELD_DETAILS USING 'BDC_SUBSCR''BDC-SUBSCR'.
    *CURSOR DETAILS
    PERFORM FILL_FIELD_DETAILS USING 'BDC_CURSOR''CSKSZ-WAERS'.
    *NAME
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KTEXT' WA_DATA-KTEXT.
    *DESCRIPTION
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-LTEXT' WA_DATA-LTEXT.
    *PERSON RESPONSIBLE
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-VERAK' WA_DATA-VERAK.
    *COST CENTER CATEGORY
    PERFORM FILL_FIELD_DETAILS USING'CSKSZ-KOSAR' WA_DATA-KOSAR.
    *HIERARCHY AREA
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KHINR' WA_DATA-KHINR.
    *COMPANY CODE
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-BUKRS' WA_DATA-BUKRS.
    *BUISINESS AREA
    PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-GSBER' WA_DATA-GSBER.
    *CALL THE TRANSACTION
    CALL TRANSACTION C_KS01 USING IT_BDCDATA
                              MODE C_A "ALL SCREENS
                                       "N-NO SCREENS
                                       "E-ERROR SCREENS ONLY
                              UPDATE 'A' "ASYNCHRONOUS
                                          "SYNCHRONOUS
                              MESSAGES INTO IT_BDCMSGCOLL.
    ENDLOOP.
    * FORM FILL SCREEN_DETAILS
    FORM FILL_SCREEN_DETAILS  USING PROGRAM LIKE BDCDATA-PROGRAM
                           DYNPRO LIKE BDCDATA-DYNPRO
                           DYNBEGIN LIKE BDCDATA-DYNBEGIN.
    CLEAR WA_BDCDATA.
    WA_BDCDATA-PROGRAM = PROGRAM.
    WA_BDCDATA-DYNPRO = DYNPRO.
    WA_BDCDATA-DYNBEGIN = DYNBEGIN.
    APPEND WA_BDCDATA TO IT_BDCDATA.
    ENDOFRM.
    * FORM FILL_FIELD_DETAILS
    FORM FILL_FIELD_DETAILS USING FNAM FVAL.
    CLEAR WA_BDCDATA.
    WA_BDCDATA-FNAM = FNAM.
    WA_BDCDATA-FVAL = FVAL.
    APPEND WA_BDCDATA TO IT_BDCDATA.
    ENDFORM.
    * FORM GETE_F4_FOR_FILE
    *DISPLAY ALL THE  FILES IN THE SYSTEM FOR SELECTION
    *P_PA_FILE NAME OF THE FILE
    FORM GET_F4_FOR_FILE USING P_PA_FILE.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    *  EXPORTING
    *    PROGRAM_NAME        = SYST-REPID
    *    DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = 'PA_FILE'
    *    STATIC              = ' '
    *    MASK                = ' '
       CHANGING
         FILE_NAME           = PA_FILE.
    *  EXCEPTIONS
    *    MASK_TOO_LONG       = 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.
    * FORM UPLOAD_FILE_TO_ITAB
    * FP_V_FILE = FILE NAME
    *FP_IT_DATA =  INTERNAL TABLE TO STORE THE DATA
    FORM UPLOAD_FILE_TO_ITAB USING FP_V_FILE CHANGING FP_IT_DATA LIKE IT_DATA.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FP_V_FILE
      HAS_FIELD_SEPARATOR           = ' X'
      TABLES
        DATA_TAB                      =FP_IT_DATA.
    ENDFORM.
    Edited by: saifudheenc on Aug 7, 2010 5:09 PM

    hi
    try to add spaces between parameters :
    example:
    PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1' '0200' 'X'.
    regards,darek

  • Local mode update in bdc -Call transaction method

    what is LOCAL MODE UPDATE in BDC- Call transaction methods ?

    Hi,
    Try to understand from the below CODE
    CALL TRANSACTION 'ZBDCSINGLE' USING IT_BDCDATA MODE 'A' UPDATE 'S' MESSAGES INTO IT_BDCMSGCOLL.
    REFRESH IT_BDCDATA.
    Cheers!!

  • 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...

  • Holder(A008) is not maintaing in HRP1001 (BDC - Call Transaction Method)

    Dear Friends,
    Holder (A008) in HRP1001 is not maintained for some hiried persons through BDC - Call Transaction Method.
    Except Holder update eveything is updated in the hrp1001.
    When we hire a perosn through PA40, then its automatically maintaining Holder ( A008 ) in HRP1001. But for the same case through BDC program with Call Transaction method, its not maintaining Holder.
    What can be reason behind not updating holder in HRP1001. How we can maintain Holder in this case.
    Thanks
    Rav
    Edited by: Rav Jordan on Jan 10, 2012 8:03 AM

    Hi Keshav,
    Thanks for your response.
    After running
       CALL TRANSACTION 'PA40' USING BDCDATA
                               MODE CTUMODE " 'A'
                             UPDATE 'A'
                           MESSAGES INTO MESSTAB.
    if sy-subrc eq '0'.
    i am selecting perner created from pa0002.
    now to update holder i am using fucntion module.
         WA_HOLD-AEDTM = SY-DATUM.
          WA_HOLD-UNAME = SY-UNAME.
          WA_HOLD-OBJID = P_PLANS.
          WA_HOLD-BEGDA = DT.
          WA_HOLD-ENDDA = '99991231'.
          WA_HOLD-OTYPE = 'S'.
          WA_HOLD-PLVAR = '01'.
          WA_HOLD-RSIGN = 'A'.
          WA_HOLD-RELAT = '008'.
          WA_HOLD-SCLAS = 'P'.
          WA_HOLD-SOBID = GD_PERNR.
          CALL FUNCTION 'RH_INSERT_INFTY'
            EXPORTING
             FCODE                     = 'INSE'
             VTASK                     =  'A'
      ORDER_FLG                 = 'X'
      COMMIT_FLG                = 'X'
      AUTHY                     = 'X'
      PPPAR_IMP                 =
      OLD_TABNR                 = ' '
      REPID                     = ' '
      FORM                      = ' '
      KEEP_LUPD                 =
      WORKF_ACTV                = 'X'
            TABLES
              INNNN                     = WA_HOLD
      ILFCODE                   =
    EXCEPTIONS
      NO_AUTHORIZATION          = 1
      ERROR_DURING_INSERT       = 2
      REPID_FORM_INITIAL        = 3
      CORR_EXIT                 = 4
      BEGDA_GREATER_ENDDA       = 5
      OTHERS                    = 6
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    endif.
    This also not updating holder in the hrp1001 postion in the table.
    May i know where to do change in the code so that holder can be maintained.
    Thanks
    Rav

  • Handling Warning pop up windows in BDC call transaction method

    Hi All,
    Iam using a BDC to automate the Costing Process i.e. Transaction CK40N using call transaction method. In a particular Screen after i perform the execute action, a warning pop up window appears. Only if I click on OK, the execution continues or else it will not proceed. How to handle this situation in case a warning pop up window appears based on the input which is given? In other words a Dynamic warning message. Thanks in advance....
    Regards,
    Nirmal

    Hello,
    U can either use NO_DIALOG or SUPPRESS DIALOG to avaid this,.
    Regards,
    Vasanth

  • Screen no change in BDC call transaction method

    Hi experts
    Greetings!
    I have a BDC created in call transaction method for t-code FB01.
    Data passed successfully to the first screen but when it navigates to the second screen I am not able to pass any data.
    After debugging I found that the issue was because of the DYNPRO value.
    It was 8500 when I created this recording but now the screen number shows 350.
    Is is possible that screen nos change because of any support stack or OSS notes implementation.
    In run time i tried to change the value to 350 and it works fine..
    Thanks
    Jay

    Hi,
    LSMW Direct input method is better for your quiry. Becasuse i wrote BDC for FB01 but not working properly.
    So i used LSMW, helped me a lot. Progmra name is RFBIBL00. Or else i will export and send you if you want. It can handle multiple line items upto 950.
    Thanks,
    Sriram

  • Hi all, BDC call transaction METHOD, trapping ERRORS

    hi
    i have developed BDC (recording via call transaction method) for VB01. 
    could u please tell me how to display records having errors after running recording or to give index of records having errors.
    and is it possible to give transaction code for recording since my bdc is executable program.
    plase answer both the questions.
    thanx

    Here is the flow that Raja is explaining to you.
    DATA: v_index LIKE sy-tabix.
    LOOP AT itab.
      v_index = sy-tabix.
    *-- prepare the BDC data
      CALL TRANSACTION 'VB01' USING bdcdata
                               MODE 'N'
                              MESSAGES INTO bdcmsgcoll.
      READ TABLE bdcmsgcoll WITH KEY msgtyp = 'E'.
      IF sy-subrc = 0.
    *-- Error occured for the record with index <b>v_index</b>
      ELSE.
    *-- unless there is a success message with this number,
    *   it is not succesfull because 'No data for screen xxx'
    *   will not show up as an error message type, but will be
    *  a success message type
        READ TABLE bdcmsgcoll WITH KEY msgnr = '312'.
        IF sy-subrc = 0.
    *-- success
        ELSE.
    *-- error with index <b>v_index</b>
        ENDIF.
      ENDIF.
    ENDLOOP.
    As you can see, now you have the index of the record where the error occured. Now this will become complicated if you are combining several records into one transaction call. In that case you need to find how you can know all the records that you just accumulated.
    As an example, let us say you have an internal table with external number, customer, material, quantity and at every new external number, you want to create a sales order. Until you get a new external number, you will not do the call transaction because until then it will be items of the same sales order. So in this case, after the call transaction, you will have get all the records that belong to making this sales order by using the external number and then prepare your messages.
    I hope this is clear.
    Srinivas
    Message was edited by: Srinivas Adavi

  • In bdc call transaction method which one ll prefer synchronous or asynchron

    hi could anybody tel me
    call transaction method which one is preferred synchronous or asynchronous..?
    what ll happen if we do other method..?
    foreground or background which one ll prefer..?
    what ll happen if we do otehr method..?
    on which condition we have to use synchronous and asynchronous
    on which condition we have to use foreground and background
    thanx
    kals.

    Hi,
    if you haven't done yet please visit for general information:
    http://help.sap.com/saphelp_nw70/helpdata/en/d2/f8f3393bef4604e10000000a11402f/frameset.htm
    for further information:
    http://help.sap.com/saphelp_nw70/helpdata/en/69/c2501a4ba111d189750000e8322d00/frameset.htm
    This will hopefully answer your question.
    Regards
    Bernd

  • How can we update mk01 with BDC call transaction method

    can any one send the sample code for upload of MK01 using call transaction method.
    its urgent..

    Use the following code.
    *& Report  ZMK01_VA01                                                  *
    REPORT  Z_MK01                              .
    SOURCE INTERNAL TABLE
    DATA: BEGIN OF T_SOURCE OCCURS 0,
            LIFNR TYPE LIFNR,
            EKORG TYPE EKORG,
            KTOKK TYPE KTOKK,
            NAME1 TYPE NAME1,
            SORTL TYPE SORTL,
            LAND1 TYPE LAND1,
            WAERS TYPE WAERS,
          END OF T_SOURCE.
    *DATA: E_MESSAGE TYPE C.
    ERROR MESSAGE TABLE
    DATA: T_ERRORMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    TARGET TABLE LIKE BDCDATA
    DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    TO UPLOAD DATA FROM LEGACY SYSTEM
          CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
            CODEPAGE                      = ' '
             FILENAME                      = 'D:\MK01.TXT'
             FILETYPE                      = 'DAT'
          IMPORTING
            FILELENGTH                    =
            TABLES
              data_tab                      = T_SOURCE
           EXCEPTIONS
             CONVERSION_ERROR              = 1
             FILE_OPEN_ERROR               = 2
             FILE_READ_ERROR               = 3
             INVALID_TYPE                  = 4
             NO_BATCH                      = 5
             UNKNOWN_ERROR                 = 6
             INVALID_TABLE_WIDTH           = 7
             GUI_REFUSE_FILETRANSFER       = 8
             CUSTOMER_ERROR                = 9
             NO_AUTHORITY                  = 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.
    TRANSFERING DATA FROM INTERNAL SOURCE TABLE TO TARGET TABLE
    LOOP AT T_SOURCE.
    REFRESH BDCDATA.
    perform bdc_dynpro      using 'SAPMF02K' '0107'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  T_SOURCE-LIFNR.
    perform bdc_field       using 'RF02K-EKORG'
                                  T_SOURCE-EKORG.
    perform bdc_field       using 'RF02K-KTOKK'
                                  T_SOURCE-KTOKK.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-LAND1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-NAME1'
                                  T_SOURCE-NAME1.
    perform bdc_field       using 'LFA1-SORTL'
                                  T_SOURCE-SORTL.
    perform bdc_field       using 'LFA1-LAND1'
                                  T_SOURCE-LAND1.
    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' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFM1-WAERS'
                                  T_SOURCE-WAERS.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    CALL TRANSACTION 'MK01' USING BDCDATA MODE 'A' MESSAGES INTO T_ERRORMSG.
    ENDLOOP.
    LOOP AT T_ERRORMSG.
    WRITE:/ 'MESSAGE TYPE',T_ERRORMSG-MSGTYP,
             'FIELDNAME WERE ERROR OCCURED', T_ERRORMSG-FLDNAME.
    *CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      ID              = T_ERRORMSG-MSGID
      LANG            = SY-LANGU
      NO              = T_ERRORMSG-MSGNR
      V1              = T_ERRORMSG-MSGV1
      V2              = T_ERRORMSG-MSGV2
      V3              = T_ERRORMSG-MSGV3
      V4              = T_ERRORMSG-MSGV4
    IMPORTING
      MSG             = E_MESSAGE
    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:/ E_MESSAGE.
    ENDLOOP.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.
    With Regards
    K Srinivas

  • Error Capturing in BDC Call Transaction Method

    How does the Errors in BDC Call Transactin is captured ....can you please give same examples of using BDCMSGCOLL and FORMAT_MESSAGES..
    Please explain clearly when to used these in real time..
    Thankyou

    hi,
    Here is hte sample code
            call transaction  'ME22' using  it_bdc
                    options from x_ctu_params
                    messages into lt_message.
           clear w_success.
           if sy-subrc <> 0.
           w_success = 'N'.
           endif.
            loop at lt_message where msgtyp = 'E' or
                                     msgtyp = 'A'.
            endloop.
            if sy-subrc = 0.
              perform format_messages tables lt_message
                                      using lv_msg lv_lines.
    *         To append error messages
              perform append_message tables lt_message
                                            return
                                     using  lv_msg.
            else.
              if w_success = 'N'.
              perform format_messages tables lt_message
                                      using lv_msg lv_lines.
              perform append_message_err tables lt_message
                                            return
                                     using  lv_msg.
              else.
              perform format_messages tables lt_message
                                      using lv_msg lv_lines.
    *         To append success messages
              perform append_message tables lt_message
                                            return
                                     using  lv_msg.
              endif.
            endif.
            refresh: it_bdc,
                     lt_message.
          endat.
        endloop.
      endif.
    form format_messages tables  pt_messages structure bdcmsgcoll
                         using   pv_msg pv_lines.
      clear : pv_lines,pt_messages,pv_msg.
      describe table pt_messages lines pv_lines.
      read table pt_messages index pv_lines.
      check not pt_messages-msgid is initial.
    *-- Function module to format the message given
      call function 'FORMAT_MESSAGE'
           exporting
                id        = pt_messages-msgid
                lang      = sy-langu
                no        = pt_messages-msgnr
                v1        = pt_messages-msgv1
                v2        = pt_messages-msgv2
                v3        = pt_messages-msgv3
                v4        = pt_messages-msgv4
           importing
                msg       = pv_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  into pv_msg.
      endif.
    endform.                    " format_messages
    Regards,
    Richa

  • BDC call transaction method

    Should 'call transaction' be called inside the loop or outside the loop in BDC?

    Hi Sangeeta,
    It depends on the scenario in which  your going to call the transaction. Consider a situation in which I was required to write a BDC program for Task List dependency editor (IA06 transaction). Every Task List can have a number of operations and operation can have suboperations. I was required to call the transaction for only the Task List Number and not for individual operations and suboperations. In such a scenario , we populate the BDCDATA internal table inside a loop . The process of calling the transaction can be done in the loop itself (using some flags and ON CHANGE and IF statements) or after the Task List Number changes exit the loop(using the EXIT statement) and then do the call transaction. So its just the ease with which you can implement your logic, that you call the transaction inside the loop or outside the loop. The only thing to be remembered is that BDCDATA internal table should be populated before you call the transaction.

  • 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.

  • BDC Call Transaction - Doc.No not getting generated in Message Internal tab

    Dear All,
    I am using BDC Call Transaction method for uploading data for transaction, Iam able to successfully capture the Error messages, sucess messages and the transaction number is also displayed for the bdc run in Mode A, but in case of scheduling the job in background, the Error messages are displayed but the transaction number is not captured in the message Internal table( BDCMSGCOLL).
    Kindly look into the matter and revert back for any further info.
    Regards
    Naresh

    Hi,
    Please try using the following kind of code in 'CALL TRANSACTION'
        opt-dismode = 'E'.     " Exclusive mode
        opt-defsize = 'X'.
        opt-updmode = 'S'.
        opt-nobinpt = ' '.
        CALL TRANSACTION transaction_code USING ft OPTIONS FROM opt
                                                                             MESSAGES INTO t_bdcmsgcoll .
    Hope this will work.
    Thanks,
    Leo

  • Improve performance of bdc call transaction

    Hi all,
    I am performing a batch update of tax codes in a BDC call transaction program. This particular code takes about 3 minutes to process 2,600 entries. I have tried almost everything but is there a way to improve / make it run faster?
    I have a feeling it has something to do with the form "do_transaction", but I really don't know anymore.
    Thank you in advance.
    Attached is the code:
    *& Report  ZFI_CHANGEWTAX
    *&  Description: Change Doctors Withholding Tax Code (EI)
    *&  Using BDC Call Transaction Method
    *&  Created by : mpena
    *&  Created on : 07/15/2009
    *&  Modification History
    *&  Seq  Changed on
    *&       Changed by
    *&  001   07/15/2009
    *&        mpena         Initial Development
    *&  002   07/20/2009
    *&        mpena         Logic modification
    *&                      Testing
    *&  003   07/20/2009
    *&        mpena         Call function parameter modification
    *&  004   07/22/2009
    *&        mpena         Report generation
    *&                      Performance improvements
    REPORT zfi_changewtax
           NO STANDARD PAGE HEADING
           MESSAGE-ID zfk02msg.
    TYPES: BEGIN OF t_tax,
           lifnr LIKE lfa1-lifnr,                "account number
           wt_withcd LIKE lfbw-wt_withcd,        "current tax code
           wt_withcd_new LIKE lfbw-wt_withcd,    "new tax code (left blank at default)
           END OF t_tax.
    DATA:  wa_tax TYPE t_tax,
           i_tax TYPE STANDARD TABLE OF t_tax,
           it_bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE,
           lin TYPE i.
    -------Selection Screen Design -
    SELECTION-SCREEN:
    SKIP 1,
    BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
    PARAMETERS: p_ktokk LIKE lfa1-ktokk DEFAULT 'DOCT' OBLIGATORY,
                p_bukrs LIKE lfbw-bukrs DEFAULT 'SL' OBLIGATORY,
                p_wtax LIKE lfbw-wt_withcd OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    INITIALIZATION.
      aaa = 'Change Tax Code to specified value'.
    TOP-OF-PAGE.
      WRITE:
      / 'Update of taxes successful on:', sy-datum, sy-uzeit,
      / 'Generated by:', sy-uname,
      / 'Company Code:', p_bukrs, 'Vendor Group:', p_ktokk.
      SKIP 1.
      ULINE.
      WRITE:
      / 'Account Number', 20 'Old Withholding Tax Code', 50 'New Withholding Tax Code'.
      ULINE.
    START-OF-SELECTION.
      SELECT lfa1~lifnr
             lfbw~wt_withcd
      INTO TABLE i_tax
      FROM lfa1 INNER JOIN lfbw
        ON lfa1lifnr = lfbwlifnr
        WHERE lfbw~bukrs EQ p_bukrs
        AND lfbw~witht EQ 'EI'.
      IF sy-subrc EQ 0.
        DESCRIBE TABLE i_tax LINES lin.
      ENDIF.
    Update i_tax with new value of wt_witchd, then display for comparison.
    After write: if old and new tax are the same, tax update was not successful for that specific account
    or inputted tax type is the same as the old one.
      LOOP AT i_tax INTO wa_tax.
        wa_tax-wt_withcd_new = p_wtax.
        MODIFY i_tax FROM wa_tax.
        WRITE:
        / wa_tax-lifnr,
        20 wa_tax-wt_withcd,
        50 wa_tax-wt_withcd_new.
        CLEAR wa_tax.
      ENDLOOP.
      PERFORM do_transaction USING p_bukrs p_wtax.
    *&      Form  do_transaction
         Extracted from ZFKO2 recording accessible in shdb.
    FORM do_transaction USING v_bukrs v_wtax.
      MESSAGE i000 WITH lin.
      LOOP AT i_tax INTO wa_tax.
        REFRESH it_bdcdata.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0106'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-D0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RF02K-LIFNR'
                                      wa_tax-lifnr.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      v_bukrs.
        PERFORM bdc_field       USING 'RF02K-D0610'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBW-WT_WITHCD(01)'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      'PH'.
        PERFORM bdc_field       USING 'LFBW-WT_WITHCD(01)'
                                      v_wtax.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=UPDA'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-QLAND'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      'PH'.
        CALL TRANSACTION 'FK02' USING it_bdcdata
                                MODE   'N'
                                UPDATE 'A'.
      ENDLOOP.
      MESSAGE i001.
    ENDFORM.                    "do_transaction
           form for bdc dynpro
    FORM bdc_dynpro USING program
                          dynpro.
      it_bdcdata-program = program.
      it_bdcdata-dynpro = dynpro.
      it_bdcdata-dynbegin = 'X'.
      APPEND it_bdcdata.
      CLEAR it_bdcdata.
    ENDFORM.                    "bdc_dynpro
           form for bdc field
    FORM bdc_field  USING fnam
                          fval.
      it_bdcdata-fnam = fnam.
      it_bdcdata-fval = fval.
      APPEND it_bdcdata.
      CLEAR it_bdcdata.
    ENDFORM.                    "bdc_field

    You might want to try using a BAPI instead of a call transaction.   I believe "BAPI_VENDOR_SAVECHARVALREPLICA" will work for you.  Calling a BAPI is just like calling a function module.   After you call the bapi remember to commit it with the function module "BAPI_TRANSACTION_COMMIT".

Maybe you are looking for

  • Attempting to work with documents and sandbox

    I am working on a document organizer and I am trying to integrate such features into the sandbox model. However I have run into a snag - the app cannot access ~/Documents or if a user has dropbox ~/Dropbox. From the list of entitlements it does not a

  • Outlook 2013-Calendar Access issue(Permission)

    Dear Support, i'm facing a problem with outlook 2013. my exchange server is 2010 and i have lots of clients using MS Office 2007,2010 and 2013. from Outlook 2010 and 2007 i can not open a calendar of any other user without their permission with shari

  • My MacBookAir 11 Mid 2012 OSX 10.8.4 is intermittently restarting since an OS update.

    I updated my MacBookAir 11 Mid 2012 from Lion a month or so ago & have ever since had this issue with the system intermitently freezing & restarting.  I then decided to finally upgarde to Mountain Lion.  Still the issue persisted so then I decided to

  • How do I adjust SUPER-sensitive click-wheel???  It's driving me nuts!

    How do I adjust SUPER-sensitive click-wheel??? It's driving me nuts! There has to be a way to tone it down. I didn't see anything in the settings or on iTunes with it plugged in. I've compared it to many others and mine is horrible. I can't even clic

  • Flash Player doesn't work on Window 7 mobile phone

    The Adobe Flash Player does not work on the Windows 7 mobile phone when you are randomly surfing the Internet. Pandora Internet Radio does not work at all, or any Internet Radio site.  This is really a shame, that Microsoft and Adobe would allow a pr