Problem in J1IJ BDC

Hi,
I have created a BDC program for J1IJ. While  excise invoice selection, I record with pressing the page down of keyboad the conde comes as below.
perform bdc_dynpro      using 'SAPMJ1IJ' '0500'.
perform bdc_field          using 'BDC_CURSOR'
                                                 'LRG23D-EXNUM(01)'.
perform bdc_field           using 'BDC_OKCODE'
                                                  '=EXIN'.
perform bdc_dynpro      using 'SAPMJ1IK' '0300'.
perform bdc_field           using 'BDC_CURSOR'
                                                  'EXC_TAB-LIFNR(01)'.
perform bdc_field          using 'BDC_OKCODE'
                                                  '/00'.
perform bdc_dynpro      using 'SAPMJ1IK' '0300'.
perform bdc_field           using 'BDC_CURSOR'
                                        'EXC_TAB-LIFNR(01)'.
perform bdc_field       using 'BDC_OKCODE'
                                              '/00'.
perform bdc_dynpro      using 'SAPMJ1IK' '0300'.
perform bdc_field       using 'BDC_CURSOR'
                              'EXC_TAB-DOCYR(09)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ENTE'.
perform bdc_field       using 'EXC_TAB-SEL_OPT(09)'
                              'X'.
while recording it works  the page down it records as '/00'  but when iam again executing it it is not doing the page dowan  even as per reply in many thread  i try by changing the '/00'   with '=P'  and =P+'',   that also not working  can give any hint how the keyboard page down to be trigger with J1IJ.
regards,
zafar

Hi,
I have already try with '=P+', but with this it is not working, also that filter concept is also not working systems is not record the check box which i have selected for line selection.
when I record the transaction for page down it is shwoing OK-Code as '/00'.  which is generally for enter.
perform bdc_dynpro using 'SAPMJ1IK' '0300'.
perform bdc_field using 'BDC_CURSOR'
'EXC_TAB-LIFNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.                                                                               "page down
perform bdc_dynpro using 'SAPMJ1IK' '0300'.
perform bdc_field using 'BDC_CURSOR'
'EXC_TAB-LIFNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.                                                                                "page down
Even I try by changing the cursor postion to last record of current page.
regards,
zafar
Edited by: zafar karnalkar on Jan 20, 2012 11:46 AM

Similar Messages

  • MULTIPLE ITEM PROBLEM IN VL31N BDC

    hI FRIENDS ,
        I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
    CODE IS AS FOLLOWS:.........
    FUNCTION y_synie_bdcinbdly.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(CTU) LIKE  APQI-PUTACTIVE DEFAULT 'X'
    *"     VALUE(MODE) LIKE  APQI-PUTACTIVE DEFAULT 'N'
    *"     VALUE(UPDATE) LIKE  APQI-PUTACTIVE DEFAULT 'L'
    *"     VALUE(GROUP) LIKE  APQI-GROUPID OPTIONAL
    *"     VALUE(USER) LIKE  APQI-USERID OPTIONAL
    *"     VALUE(KEEP) LIKE  APQI-QERASE OPTIONAL
    *"     VALUE(HOLDDATE) LIKE  APQI-STARTDATE OPTIONAL
    *"     VALUE(NODATA) LIKE  APQI-PUTACTIVE DEFAULT '/'
    *"     VALUE(EXTNID) LIKE  MAKT-MAKTG
    *"     VALUE(VENDORNO) LIKE  LFA1-LIFNR
    *"     VALUE(PONUMBER) LIKE  EKKO-EBELN
    *"     VALUE(ITEMNUMBER) LIKE  LIPS-VGPOS
    *"     VALUE(MATERIAL) LIKE  MAKT-MAKTG
    *"     VALUE(DLYQTY) LIKE  LIPS-LFIMG
    *"     VALUE(BTCHNO) LIKE  LIPS-CHARG
    *"     VALUE(POSLR) LIKE  EKES-EBELP OPTIONAL
    *"  EXPORTING
    *"     VALUE(SUBRC) LIKE  SYST-SUBRC
    *"     VALUE(INDELYNO) LIKE  SY-MSGV2
    *"     VALUE(MSG1) LIKE  SY-MSGV1
    *"     VALUE(MSG2) LIKE  SY-MSGV2
    *"     VALUE(MSG3) LIKE  SY-MSGV3
    *"     VALUE(MSG4) LIKE  SY-MSGV4
    *"  TABLES
    *"      MESSTAB STRUCTURE  BDCMSGCOLL
    *"      ERRTAB STRUCTURE  YSYNERRMSGS
    *"      INDLYTAB STRUCTURE  YSYN_QTYTAB
    Updated by ANAND SYNISE 19.1.2007
      DATA: BEGIN OF bdctab OCCURS 0.
              INCLUDE STRUCTURE bdcdata.
      DATA: END OF bdctab.
      DATA: datenow(10) TYPE c,
            fldvar(30)  TYPE c,
            fldno       TYPE i,
            flditoc(6)  TYPE c,
            qty(13)     TYPE c.
      DATA maxposnr LIKE lips-posnr.
      DATA testposnr TYPE posnr.
      DATA itemnoint TYPE i.
      CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
      CLEAR bdctab.
      REFRESH bdctab.
      PERFORM open_group      USING group user keep holddate ctu.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '4007'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'RV50A-VERUR_LA'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '/00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-LIFNR'.
           bdctab-fval = vendorno.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LV50C-BSTNR'.
           bdctab-fval = ponumber.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-VERUR_LA'.
           bdctab-fval = extnid.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=MKAL_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIKP-BLDAT'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=POPO_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-POSNR(01)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '0111'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'RV50A-PO_MATNR'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = 'WEIT'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-PO_MATNR'.
           bdctab-fval = material.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=POLO_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-POSNR(01)'.
           APPEND bdctab.
    *ADDED BY ANAND ON 22-01-2007
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval =  ITEMNUMBER .     "ITEMNUMBER = LIPS-VGPOS
           APPEND bdctab.
    ************ENDED***********************
    ADDED BY MILIND 19.01.2007
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval =  poslr .
           APPEND bdctab.
    *    ENDED * *
       CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
           bdctab-fval = ''.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '/00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-CHARG(01)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
          QTY = INDLYTAB-DLYQTY.
            qty = dlyqty.
           bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
           bdctab-fval = QTY.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIPS-CHARG(01)'.
    *     BDCTAB-FVAL = INDLYTAB-BTCHNO.
           bdctab-fval = btchno.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=SICH_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-MATNR(02)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
      CALL TRANSACTION 'VL31N' USING bdctab MODE 'N'  MESSAGES INTO messtab.
      subrc = sy-subrc.
      PERFORM close_group USING     ctu.
      CLEAR bdctab.
      REFRESH bdctab.
      IF sy-subrc EQ 0.
        indelyno = sy-msgv2.
      ENDIF.
      LOOP AT messtab.
        MOVE: messtab-msgid TO errtab-msgid,
              messtab-msgnr TO errtab-msgnr,
              messtab-msgv1 TO errtab-msg1,
              messtab-msgv2 TO errtab-msg2,
              messtab-msgv3 TO errtab-msg3,
              messtab-msgv4 TO errtab-msg4.
        APPEND ERRtab.
      ENDLOOP.
      LOOP AT errtab.
        SELECT SINGLE text FROM t100
          INTO errtab-errmsg
          WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
          AND sprsl EQ sy-langu.
        MODIFY errtab.
      ENDLOOP.
    ENDFUNCTION.

    Hi,
    Check this code:
    REPORT Z_CUSTOMER_UPLOAD .
                  D A T A         D E C L A R A T I O N S                *
    DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_CUSTOMER.
    DATA:BEGIN OF IT_success OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_success.
    DATA:BEGIN OF IT_error OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_error.
    DATA: L_INDEX TYPE SY-TABIX.
    DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
    IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    ERROR MESSAGE TABLE
    DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : C_S TYPE C VALUE 'S',
            C_E TYPE C VALUE 'E'.
    *DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
         IT_ERROR LIKE IT_CUSTOMER  OCCURS 0.
    DATA : V_RECTOT TYPE I,
            V_RECERR TYPE I,
            V_RECSUC TYPE I.
                  S E L E C T I O N  -  S C R E E N                      *
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER        : P_FILE LIKE RLGRAP-FILENAME .
    SELECTION-SCREEN : END OF BLOCK B1.
               A T  S E L E C T I O N  -  S C R E E N                    *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    to get F4 help for p_file
      PERFORM F4_FILENAME USING P_FILE.
                S T A R T   O F   S E L E C T I O N                      *
    START-OF-SELECTION.
    Uploading data from flat file into it_tab
      PERFORM BDC_UPLOAD USING P_FILE.
      PERFORM PROCESS_DATA.
      PERFORM POPULATE_BDC.
                E N D  O F   S E L E C T I O N                           *
    *END-OF-SELECTION.
    PERFORM DISPLAY_REPORT.
    *&      Form  F4_FILENAME
          text
         -->P_P_FILE  text
    FORM F4_FILENAME USING    P_P_FILE.
    DATA:L_FILE TYPE IBIPPARMS-PATH.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = L_FILE .
       P_P_FILE = L_FILE.
    ENDFORM.                    " F4_FILENAME
    *&      Form  BDC_UPLOAD
          text
         -->P_P_FILE  text
    FORM BDC_UPLOAD USING    P_P_FILE.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = P_P_FILE
        I_BEGIN_COL                   = 1
        I_BEGIN_ROW                   = 1
        I_END_COL                     = 8
        I_END_ROW                     = 1000
      TABLES
        INTERN                        = IT_DATA
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 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.
    ENDFORM.                    " BDC_UPLOAD
    *&      Form  PROCESS_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA.
    SORT IT_DATA BY ROW COL.
      LOOP AT IT_DATA.
    CASE IT_DATA-COL.
    WHEN 1.
    IT_CUSTOMER-KUNNR   = IT_DATA-VALUE.
    WHEN 2.
    IT_CUSTOMER-VKORG   = IT_DATA-VALUE.
    WHEN 3.
    IT_CUSTOMER-VTWEG   = IT_DATA-VALUE.
    WHEN 4.
    IT_CUSTOMER-MATNR   = IT_DATA-VALUE.
    WHEN 5.
    IT_CUSTOMER-KDMAT   = IT_DATA-VALUE.
    WHEN 6.
    IT_CUSTOMER-MEGRU   = IT_DATA-VALUE.
    WHEN 7.
    IT_CUSTOMER-LPRIO   = IT_DATA-VALUE.
    WHEN 8.
    IT_CUSTOMER-ANTLF   = IT_DATA-VALUE.
    APPEND IT_CUSTOMER.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  POPULATE_BDC
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_BDC.
    DATA:L_COUNTER TYPE N,
             L_STRING TYPE STRING.
    LOOP AT IT_CUSTOMER.
    AT NEW KUNNR.
    CLEAR L_COUNTER.
          L_INDEX = SY-TABIX.
          READ TABLE IT_CUSTOMER INDEX L_INDEX.
    perform bdc_dynpro      using 'SAPMV10A' '0100'.
    perform bdc_field       using 'MV10A-KUNNR'
                                  IT_CUSTOMER-KUNNR.
    perform bdc_field       using 'MV10A-VKORG'
                                  IT_CUSTOMER-VKORG.
    perform bdc_field       using 'MV10A-VTWEG'
                                  IT_CUSTOMER-VTWEG.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    ENDAT.
    L_COUNTER = L_COUNTER + 1.
        CLEAR L_STRING.
    perform bdc_dynpro      using 'SAPMV10A' '0200'.
    CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using L_STRING
                            IT_CUSTOMER-MATNR.
    CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using     L_STRING
                                     IT_CUSTOMER-KDMAT.
    CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using   L_STRING
                                    IT_CUSTOMER-MEGRU.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *-- For Page down in Call Transaction Mode
        IF L_COUNTER = 14.
          CLEAR L_COUNTER.
          PERFORM BDC_DYNPRO      USING 'SAPMV45A' '4001'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=P+'.
        ENDIF.
    perform bdc_dynpro      using 'SAPMV10A' '0200'.
    CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using L_STRING
                              IT_CUSTOMER-SELKZ.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SELE'.
    perform bdc_dynpro      using 'SAPMV10A' '0300'.
    perform bdc_field       using 'MV10A-KDMAT'
                                  IT_CUSTOMER-KDMAT.
    perform bdc_field       using 'MV10A-LPRIO'
                                  IT_CUSTOMER-LPRIO.
    perform bdc_field       using 'MV10A-ANTLF'
                                  IT_CUSTOMER-ANTLF.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/EBACK'.
    at end of kunnr.
    READ TABLE IT_CUSTOMER INDEX L_INDEX.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
          MESSAGES INTO IT_MESSAGES.
          CLEAR IT_BDC.
          REFRESH IT_BDC.
    ENDAT.
      IF NOT IT_MESSAGES[] IS INITIAL.
        PERFORM FORMAT_MESSAGE.
      ENDIF.
    ENDLOOP.
    ENDFORM.                    " POPULATE_BDC
    *&      Form  bdc_dynpro
          text
         -->P_0273   text
         -->P_0274   text
    FORM bdc_dynpro USING    VALUE(P_0273)
                             VALUE(P_0274).
    IT_BDC-PROGRAM = P_0273.
    IT_BDC-DYNPRO = P_0274.
    IT_BDC-DYNBEGIN = 'X'.
      APPEND IT_BDC.
      CLEAR IT_BDC.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0278   text
         -->P_RECORD_KUNNR_001  text
    FORM bdc_field USING    VALUE(P_0278)
                           VALUE(P_0279).
    IT_BDC-FNAM = P_0278.
      IT_BDC-FVAL = P_0279.
      APPEND IT_BDC.
      CLEAR IT_BDC.
    ENDFORM.                    " bdc_field
    *&      Form  FORMAT_MESSAGE
          text
    -->  p1        text
    <--  p2        text
    FORM FORMAT_MESSAGE.
    DATA: L_MSG(100).
      LOOP AT IT_MESSAGES.
      READ TABLE IT_CUSTOMER INDEX L_INDEX.
        CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
                  ID        = IT_MESSAGES-MSGID
                  LANG      = SY-LANGU
                  NO        = IT_MESSAGES-MSGNR
                  V1        = IT_MESSAGES-MSGV1
                  V2        = IT_MESSAGES-MSGV2
                  V3        = IT_MESSAGES-MSGV3
                  V4        = IT_MESSAGES-MSGV4
             IMPORTING
                  MSG       = L_MSG
             EXCEPTIONS
                  NOT_FOUND = 1
                  OTHERS    = 2.
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        write:/ l_msg.
      ENDLOOP.
    ENDFORM.                    " FORMAT_MESSAGE
    reward if helpful,
    keerthi

  • Problem while doing bdc for fv60

    Hi frends,
       I got problem while doing BDC for fv60 tcode.i have given
    header items:
    vendor number
    invoice date
    posting date
    amount
    item data:
    g/l acc no: 100000
    amount 1000 whatever
    these are all given in recording
    in recording after all giving this data if we click on park it is telling "parking not possibe duiring batch input".
    can any body tell me the process for recording shdb and after that in bdc how can we give multiple line items for fv60
    thanks,
    naveen.

    I don't think you can use FV60 in batch input. Your options are to use transaction FBV1 or bapi BAPI_INCOMINGINVOICE_PARK.
    Rob

  • Problem in fv50 BDC  working  manually  giving err for BDC

    Hi all,
    I have one problem in fv50 BDC when I park document manually it works fine but when I try to park through  my BDC it gives error
    Parking not possible during batch input
    Message no. FP140
    Procedure
    In Customizing, you can control whether an error message is issued.
    my Question is.
    how can i make it a warning message?
    Thanks in Advance
    Sachin Gautam

    hi,
    have you tried F-63 too?
    A.

  • Problem in the BDC program to upload the data from a flat file.

    Hi,
    I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
    1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
    2) Finally after the data is uploaded, following messages need to be displayed:-
    a) Total Number of records successfully uploaded.
    b) Session Name
    c) Number of Sessions created.
    Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
    It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
    Thanks,

    Here is an example program,  if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value.  This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
    REPORT zrich_0001.
    TYPES: BEGIN OF ttab,
            rec TYPE string,
           END OF ttab.
    TYPES: BEGIN OF tdat,
           fld1(10) TYPE c,
           fld2(10) TYPE c,
           fld3(10) TYPE c,
           fld4(10) TYPE c,
           END OF tdat.
    DATA: itab TYPE TABLE OF ttab.
    data: xtab like line of itab.
    DATA: idat TYPE TABLE OF tdat.
    data: xdat like line of idat.
    DATA: file_str TYPE string.
    DATA: delimitor TYPE string.
    PARAMETERS: p_file TYPE localfile.
    PARAMETERS: p_del(5) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      DATA: ifiletab TYPE filetable.
      DATA: xfiletab LIKE LINE OF ifiletab.
      DATA: rc TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = ifiletab
          rc         = rc.
      READ TABLE ifiletab INTO xfiletab INDEX 1.
      IF sy-subrc = 0.
        p_file = xfiletab-filename.
      ENDIF.
    START-OF-SELECTION.
      TRANSLATE p_del TO UPPER CASE.
      CASE p_del.
        WHEN 'TAB'.
          delimitor = cl_abap_char_utilities=>horizontal_tab.
        WHEN others.
          delimitor = p_del.
      ENDCASE.
      file_str = p_file.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = file_str
        CHANGING
          data_tab = itab.
      LOOP AT itab into xtab.
        CLEAR xdat.
        SPLIT xtab-rec AT delimitor INTO xdat-fld1
                                         xdat-fld2
                                         xdat-fld3
                                         xdat-fld4.
        APPEND xdat to idat.
      ENDLOOP.
      LOOP AT idat into xdat.
        WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
      ENDLOOP.
    Regards,
    Rich Heilman

  • Problem in J1IJ if material transfer from one storage location to another

    Hi,
         We have one problem  we have one material WMBMOTOR   while purchasing material we have taken excise duty thorugh J1Ig and while GR loocation was STCK   after that I have transfer the material to another location SDLV  with MB1B movement type 311  now my stock is at location SDLV,    but   after making delivery  when i am selecting the RG23D selection thorigh J1IJ  the excise invoice is not coming for selection in J1IJ  what can be the problem   
       zafar
    Edited by: zafar_karnalkar on Aug 13, 2010 11:38 AM

    Hi,
      Ref to the below details from Note 1413497  in this a ref. note given as 693562 include MJ1KO01,   and in 693562 note a correction instruction given as 282511
      Can u plz explain what exactly we need to do whether we have to add include MJ1IKO01 in J1IJ program or anything else.
    regards,
      zafar

  • Problem in doing BDC for XK01

    Hi all,
    i am doing BDC for XK01 with Line Item for Bank Details(Table Control..)
    With 3 Internal table
    IT_dummy to get the flat file
    IT_vend  for Header details
    IT_bank  for Item Details
    in this there is a Nested loop
    Loop at it_vend.
    perform bdc
    loop at it_bank.
    concatenate................
    endloop.
    endloop.
    because of the above nested loops..it's bit slow..
    & i am trying to do with a single internal table..
    The problem is..
    with the header data it's not picking all the item data(it's picking only one..)..help me in resolving the problem..
    Below the code..
    REPORT  ZMM_BDCTC1 NO STANDARD PAGE HEADING LINE-SIZE 255.
    PARAMETER:P_FILE TYPE RLGRAP-FILENAME.
    DATA BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF IT_DUMMY OCCURS 0,
          TYP,
          DES(255) TYPE C,
          END OF IT_DUMMY.
    DATA:DELIMITER VALUE ',',
         cnt(4) TYPE N,
         L_FNAM(30) TYPE C,
         FILENAME TYPE STRING.
    TYPES:BEGIN OF TY_FINAL,
          N(4) TYPE C,
          LIFNR TYPE RF02K-LIFNR,
          BUKRS TYPE RF02K-BUKRS,
          EKORG TYPE RF02K-EKORG,
          KTOKK TYPE RF02K-KTOKK,
          NAME1 TYPE LFA1-NAME1,
          SORTL TYPE LFA1-SORTL,
          LAND1 TYPE LFA1-LAND1,
          AKONT TYPE LFB1-AKONT,
          FDGRV TYPE LFB1-FDGRV,
          WAERS LIKE LFM1-WAERS,
          M(4) TYPE C,
          BANKS TYPE LFBK-BANKS,
          BANKL TYPE LFBK-BANKL,
          BANKN TYPE LFBK-BANKN,
          KOINH TYPE LFBK-KOINH,
          END OF TY_FINAL.
    DATA: IT_FINAL TYPE TABLE OF TY_FINAL,
          WA_FINAL TYPE TY_FINAL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
    IMPORTING
       FILE_NAME           = P_FILE.
         FILENAME = P_FILE.
         CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
             filename                      = FILENAME
            FILETYPE                      = 'ASC'
           tables
             data_tab                      = IT_DUMMY.
    START-OF-SELECTION.
    LOOP AT it_dummy.
        IF it_dummy-typ = 'H'.
          SPLIT  it_dummy-des AT delimiter INTO WA_FINAL-lifnr "Populating Header Table
                                                WA_FINAL-bukrs
                                                WA_FINAL-ekorg
                                                WA_FINAL-ktokk
                                                WA_FINAL-name1
                                                WA_FINAL-sortl
                                                WA_FINAL-land1
                                                WA_FINAL-akont
                                                WA_FINAL-fdgrv
                                                WA_FINAL-waers.
          WA_FINAL-N = WA_FINAL-N + 1.
          WA_FINAL-M = WA_FINAL-M + 1.
        ELSEIF it_dummy-typ = 'I'.
          SPLIT it_dummy-des AT delimiter INTO WA_FINAL-BANKS
                                               WA_FINAL-BANKL
                                               WA_FINAL-BANKN
                                               WA_FINAL-KOINH.
          APPEND WA_FINAL TO IT_FINAL.
        ENDIF.
      ENDLOOP.
    LOOP AT IT_FINAL INTO WA_FINAL.
    WRITE:/ WA_FINAL-N,
            WA_FINAL-LIFNR,
            WA_FINAL-BUKRS,
            WA_FINAL-EKORG,
            WA_FINAL-KTOKK,
            WA_FINAL-NAME1,
            WA_FINAL-SORTL,
            WA_FINAL-LAND1,
            WA_FINAL-AKONT,
            WA_FINAL-FDGRV,
            WA_FINAL-WAERS,
            WA_FINAL-M,
            WA_FINAL-BANKS,
            WA_FINAL-BANKL,
            WA_FINAL-BANKN,
            WA_FINAL-KOINH.
    ENDLOOP.
    data: WA_FINAL1 like line of IT_FINAL.
    clear WA_FINAL1.
    ******************BDC STARTS***********************
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT      = SY-MANDT
    GROUP       = 'ZMM_BDCTAB'
    KEEP        = 'X'
    USER        = SY-UNAME.
    Clear wa_final.
    LOOP AT IT_FINAL INTO WA_FINAL.
    WA_FINAL1 = WA_FINAL.
    CLEAR BDCDATA[].
    AT NEW N.
    cnt = 1.
    perform bdc_dynpro      using 'SAPMF02K' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  WA_FINAL1-LIFNR.
    perform bdc_field       using 'RF02K-BUKRS'
                                  WA_FINAL1-BUKRS.
    perform bdc_field       using 'RF02K-EKORG'
                                  WA_FINAL1-EKORG.
    perform bdc_field       using 'RF02K-KTOKK'
                                  WA_FINAL1-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'
                                  WA_FINAL1-NAME1.
    perform bdc_field       using 'LFA1-SORTL'
                                  WA_FINAL1-SORTL.
    perform bdc_field       using 'LFA1-LAND1'
                                  WA_FINAL1-LAND1.
    perform bdc_dynpro      using 'SAPMF02K' '0120'. "ERROR CLEARED
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-KOINH(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    ENDAT.
    *ENDON.
    IF WA_FINAL1-N = WA_FINAL1-M.
    CONCATENATE  'LFBK-BANKS(' cnt ')'  INTO L_FNAM.
    perform bdc_field       using L_FNAM
                                  WA_FINAL1-BANKS.
    CONCATENATE  'LFBK-BANKL(' cnt ')'  INTO L_FNAM.
    perform bdc_field       using L_FNAM
                                  WA_FINAL1-BANKL.
    CONCATENATE  'LFBK-BANKN(' cnt ')'  INTO L_FNAM.
    perform bdc_field       using L_FNAM
                                  WA_FINAL1-BANKN.
    CONCATENATE  'LFBK-KOINH(' cnt ')'  INTO L_FNAM.
    perform bdc_field       using L_FNAM
                                  WA_FINAL1-KOINH.
    *ENDDO.
    cnt = cnt + 1.
    ENDIF.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPMF02K' '0210'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-FDGRV'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *AT NEW LIFNR.
    perform bdc_field       using 'LFB1-AKONT'
                                  WA_FINAL1-AKONT.
    perform bdc_field       using 'LFB1-FDGRV'
                                  WA_FINAL1-FDGRV.
    perform bdc_dynpro      using 'SAPMF02K' '0215'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-ZTERM'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0220'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB5-MAHNA'.
    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'
                                  WA_FINAL1-WAERS.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    AT END OF M.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE     = 'XK01'
    TABLES
    DYNPROTAB = BDCDATA.
    ENDAT.
    CLEAR WA_FINAL1.
    CLEAR WA_FINAL.
    ENDLOOP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    *********************BDC ENDS***********************
           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 <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
    ENDIF.
    ENDFORM.
    Flat File is..
    HAAA45,1000,1000,0002,NAME45,N,IN,31000,A1,USD
    IIN,1000,1021,Name45
    IIN,1000,1022,Name45
    HAAA50,1000,1000,0002,NAME50,N,IN,31000,A1,USD
    IIN,1000,1023,Name50
    IIN,1000,1024,Name50

    Regarding avoiding the loop I have a suggestion, though I have not tried this .
    SAP help says " Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions. " .
    Above implies you can load all records in the itab bdc_tab when doing call transaction. Say, your bdc_tabl has 30 records for 1 pass of the transaction. You need to update 10 vendor records. You simply load up all 300 records into bdc_tab. After every 30 record loads, you simulate a 'SAVE' press in your program but do not leave the transaction. Rather you simulate the keystroke that takes you to the first screen of XK01 after the save if not aready there, and start loading up the next transaction.

  • Problem in the BDC Table Control for the T.Code VA01

    Hi,
      I faced probelm in the BDC of the VA01. In the Table Control
    the records are entered upto 12 line items. after 13th line item overwrites the first record. How to solve the Problem.
    Please help me.

    or use this
    Internal table definition *
    data : begin of bdcdata occurs 0.
            include structure bdcdata.
    data : end of bdcdata.
    data: begin of messtab occurs 0.
            include structure bdcmsgcoll.
    data: end of messtab.
    data: v_chr_opengrp type c,
          r_matnr like mara-matnr,                       "variable for material conversion
          r_werks like marc-werks,                       "variable for plant
          v_str_fname   type string.
    data: begin of count2,
          inrec(9) type n,                               " input I_MATERIAL count
          create(9) type n,                              " create count
          error(9) type n,                               " error count
          bdc(9) type n,                                 " count of BDC creates
          end of count2.
    types: begin of ty_source,
    partn_numb(10) type n ,"Customer Number 1
    ref(035),
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    material like vbap-matnr,
    reqqty(018),
    reqdate(010),
    end of ty_source,
    begin of ty_header ,
    partn_numb(10) ,"Customer Number 1
    ref(035),
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    end of ty_header,
    begin of ty_item,
    partn_numb(10) ,"Customer Number 1
    ref(035),
    material like vbap-matnr,
    reqqty(018),
    reqdate(010),
    end of ty_item.
    data : msg(240) type c, " Return Message
    e_rec(8) type c, " Error Records Counter
    rec_no(8) type c, " Records Number Indicator
    s_rec(8) type c, " Successful Records Counter
    t_rec(8) type c, " Total Records Counter
    v_matnr like mara-matnr.
    data: val(2) type n value 01.
    data : begin of bdc_itab occurs 0.
            include structure bdcdata.
    data : end of bdc_itab.
    data : t_source type standard table of ty_source   with header line,
    t_header type standard table of ty_header initial size 1,
    t_item type standard table of ty_item initial size 1,
    t_target type standard table of bdcdata initial size 1.
    data : w_source type ty_source,
    w_source1 type ty_source,
    w_header type ty_header,
    w_item type ty_item,
    w_target type bdcdata,
    count type i,
    count1 type n.
    Variable Declaration
    data: w_fname type string,
    fnam(20),
    date1(10),
    i(2) type n,
    v_count type i,
    v_group type apqi-groupid.
    *& selection screen
    selection-screen :begin of block bl1 with frame title  text-001.
    parameters : p_fname type rlgrap-filename,                         "Input file
                 p_update(1) default 'N',                              "Input for update mode
                 p_bdcgrp(12) default 'SD_ORDERS'.                     "Input for session name
    selection-screen end of block bl1.
    **&SELECTION SCREEN VALIDATIONS
    at selection-screen on value-request for p_fname.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          program_name  = 'ZMATERIAL'
          dynpro_number = '1000'
          field_name    = 'P_FNAME'
        changing
          file_name     = p_fname.
    *& Start of selection
    start-of-selection.
      if  p_fname is initial.
        message i016(rp) with 'Please enter a file name'.
        leave list-processing.
      else.
        move p_fname to  v_str_fname.
      endif.
      call function 'GUI_UPLOAD'
        exporting
          filetype                = 'ASC'
          filename                = v_str_fname
          has_field_separator     = 'X'
        tables
          data_tab                = t_source
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      sort t_source by ref partn_numb.
      loop at t_source into w_source.
        add 1 to count2-inrec.
        w_source1 = w_source.
       AT NEW PARTN_NUMB.  "10/31 KVB
        at new ref.
          w_header-doc_type = w_source1-doc_type..
          w_header-sales_org = w_source1-sales_org .            "'0001'
          w_header-distr_chan = w_source1-distr_chan.           "'01'
          w_header-division = w_source1-division.               " '01'
          w_header-purch_no = w_source1-purch_no.
          w_header-partn_numb = w_source1-partn_numb.
          w_header-ref = w_source1-ref.
          append w_header to t_header.
        endat.
        w_item-partn_numb = w_source1-partn_numb.
        w_item-material = w_source1-material.
        w_item-reqqty = w_source1-reqqty.
        w_item-ref = w_source1-ref.
        w_item-reqdate = w_source1-reqdate.
        append w_item to t_item.
        clear :w_item,w_header.
      endloop.
      loop at t_header into w_header.
        perform bdc_dynpro      using         'SAPMV45A'                  '0101'       .
        perform bdc_field       using         'BDC_CURSOR'                'VBAK-SPART'.
        perform bdc_field       using         'BDC_OKCODE'                '/00'.
        perform bdc_field       using         'VBAK-AUART'                w_header-doc_type.
        perform bdc_field       using         'VBAK-VKORG'                w_header-sales_org.
        perform bdc_field       using         'VBAK-VTWEG'                w_header-distr_chan.
        perform bdc_field       using         'VBAK-SPART'                w_header-division.
        perform bdc_dynpro      using         'SAPMV45A'                  '4001'     .
        perform bdc_field       using         'BDC_OKCODE'                '/00'.
        perform bdc_field       using         'BDC_CURSOR'               'VBKD-BSTKD'.
        perform bdc_field       using         'VBKD-BSTKD'                w_header-purch_no.
        perform bdc_field       using         'KUWEV-KUNNR'               w_header-partn_numb.
        i = 1.
        loop at t_item into w_item where partn_numb = w_header-partn_numb
                                         and ref = w_header-ref.
          at new partn_numb.
            clear count1.
            count = 0.
          endat.
          count = count + 1.
          if count gt 5.
            clear i.
            i = 2.
            perform bdc_dynpro      using 'SAPMV45A' '4001'      .
            perform bdc_field       using 'BDC_OKCODE' '=POAN'.
          endif.
          count1 = count1 + 1.
          concatenate 'VBAP-POSNR(' i ')' into fnam.
          perform bdc_field       using  fnam
                                        count1.
          concatenate 'RV45A-MABNR(' i ')' into fnam.
          perform bdc_field    using fnam                            w_item-material.
          concatenate 'RV45A-KWMENG(' i ')' into fnam.
          perform bdc_field       using  fnam                        w_item-reqqty..
          concatenate 'RV45A-ETDAT(' i ')' into fnam.
          perform bdc_field       using  fnam                         w_item-reqdate.
          concatenate 'VBKD-BSTKD_E(' i ')' into fnam.
          perform bdc_field       using  fnam                         w_item-ref.
          i = i + 1.
          clear:  w_item.
        endloop.
        clear w_header.
        perform bdc_dynpro      using 'SAPMV45A' '4001'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=SICH'.
        perform post_transaction.
        refresh bdc_itab.
        clear   bdc_itab.
      endloop.
    *endloop.
    end-of-selection.
      perform finalization.
           Start new screen                                              *
    form bdc_dynpro using program dynpro.
      clear bdc_itab.
      bdc_itab-program  = program.
      bdc_itab-dynpro   = dynpro.
      bdc_itab-dynbegin = 'X'.
      append bdc_itab.
    endform.                    "bdc_dynpro
           Insert field                                                  *
    form bdc_field using fnam fval.
      if fval <> ''.
        clear bdc_itab.
        bdc_itab-fnam = fnam.
        bdc_itab-fval = fval.
        append bdc_itab.
      endif.
    endform.                    "bdc_field
    **&      Form  get_filename
          text
    -->  p1        text
    <--  p2        text
    *form get_filename .
    *call function 'WS_FILENAME_GET'
       exporting
         def_filename     = space
         def_path         = file
         mask             = ',.,..'
         mode             = 'N'
         title            = text-015
       importing
         filename         = file
       exceptions
         inv_winsys       = 1
         no_batch         = 2
         selection_cancel = 3
         selection_error  = 4
         others           = 5.
    *endform.                    " get_filename
    *&      Form  post_transaction
          text
    -->  p1        text
    <--  p2        text
    form post_transaction .
      refresh messtab.
      clear   messtab.
      call transaction  'VA01' using bdc_itab
                  mode   p_update
                update  'S'
              messages into messtab.
      read table messtab with key msgtyp = 'E'.
      if sy-subrc eq 0.
        perform process_error_messages.
        add 1 to count2-bdc.
        if v_chr_opengrp is initial.
          perform bdc_open_group.
        endif.
        call function 'BDC_INSERT'
          exporting
            tcode          = 'VA01'
          tables
            dynprotab      = bdc_itab
          exceptions
            internal_error = 1
            not_open       = 2
            queue_error    = 3
            tcode_invalid  = 4
            others         = 5.
        if sy-subrc <> 0.
          case sy-subrc.
            when 1.
              write: / 'Internal error'.
            when 2.
              write: / 'Not open error'.
            when 3.
              write: / 'queue error'.
            when 4.
              write: / 'tcode invalid error'.
            when others.
              write: / 'other error'.
          endcase.
        endif.
      else.
        add +1 to count2-create.
        format intensified off.
        format color col_normal.
        format color col_normal off.
      endif.
      clear   bdc_itab.
      refresh bdc_itab.
    endform.                    " post_transaction
    *&      Form  finalization
          text
    -->  p1        text
    <--  p2        text
    form finalization .
      if v_chr_opengrp = 'X'.
        call function 'BDC_CLOSE_GROUP'
          exceptions
            not_open    = 1
            queue_error = 2
            others      = 3.
      endif.
      get time.
      skip 2.
      write: / 'Time', sy-uzeit.
      skip.
      format color col_total on.
      write: / 'Total Records: ',           40 count2-inrec.
      write: / 'PERNR not of Emp Group 6 ', 40 count2-error.
      write: / 'Records Created: ',         40 count2-create.
      write: / 'BDC Create in group: ',     40 count2-bdc.
      if v_chr_opengrp = 'X'.
        skip 1.
        format intensified on.
        format color col_negative on.
        write: / 'PLEASE USE TRANSACTION "SM35" ',
                 'TO PROCESS THE GENERATED BDC SESSION ... ',
                 p_bdcgrp.
      endif.
    endform.                    " finalization
    *&      Form  bdc_open_group
          text
    -->  p1        text
    <--  p2        text
    form bdc_open_group .
      call function 'BDC_OPEN_GROUP'
        exporting
          client              = sy-mandt
          group               = p_bdcgrp
          holddate            = sy-datum
          keep                = 'X'
          user                = sy-uname
        exceptions
          client_invalid      = 1
          destination_invalid = 2
          group_invalid       = 3
          group_is_locked     = 4
          holddate_invalid    = 5
          internal_error      = 6
          queue_error         = 7
          running             = 8
          system_lock_error   = 9
          user_invalid        = 10
          others              = 11.
      if sy-subrc eq 0.
        v_chr_opengrp = 'X'.
      endif.
    endform.                    " bdc_open_group
    *&      Form  process_error_messages
          text
    -->  p1        text
    <--  p2        text
    form process_error_messages .
      data: begin of loc_aux_message.
              include structure message.
      data: end of loc_aux_message.
      data : msgno type sy-msgno.
      loop at messtab.
        move messtab-msgnr to msgno.
        call function 'WRITE_MESSAGE'
          exporting
            msgid  = messtab-msgid
            msgno  = msgno
            msgty  = messtab-msgtyp
            msgv1  = messtab-msgv1
            msgv2  = messtab-msgv2
            msgv3  = messtab-msgv3
            msgv4  = messtab-msgv4
          importing
            messg  = loc_aux_message
          exceptions
            others = 1.
        if sy-subrc eq 0.
          format color col_negative on.
          write: /10 loc_aux_message.
          format color col_negative off.
        else.
          format color col_negative on.
          write: /10 t_source-partn_numb.
          write: / 'Error creating message'.
          format color col_negative off.
          exit.
        endif.
      endloop.
    endform.                    " process_error_messages

  • PROBLEM IN QP01 BDC ( 19TH LINE ITEM IS NOT TAKING)

    DEAR ALL,
    I am working on a bdc of QP01 for inspection plan, my bdc is working prperly , problem is that  in sceen there r 18 lines for line  items , but i have 30 line items. after 18 line items no data is picking. and a message is coming no input data is there for screen no 0150. i tried a lot  and unable to solve . if anybody can solve my problem . i send u the part of my code.
    LOOP AT ITAB.
    CHECK ITAB-MATNR = ITAB1-MATNR.
    if flag = 1.
      ** QUALITATIVE **
    if itab-QUALITAT = 'X' AND itab-QUANTITAT = ''.
    IF I ge 18.
    *CONCATENATE  'RQPAS-SEL_FLG(' I ')' INTO SCR.
    *perform bdc_field       using SCR
    X = '17'..
    CONCATENATE  'RQPAS-SEL_FLG(' X ')' INTO SCR.
    perform bdc_field       using SCR
    X1 = '18'..
    CONCATENATE  'RQPAS-SEL_FLG(' X ')' INTO SCR.
    perform bdc_field       using SCR
    X2 = '340'.
    CONCATENATE  'RQPAS-SEL_FLG(' X1 ')' INTO SCR.
    perform bdc_field       using SCR
        PERFORM BDC_DYNPRO      USING 'SAPLQPAA' '0150'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RQPAS-QUALITAT(02)'.
       PERFORM BDC_FIELD       USING 'RQPAS-ENTRY_ACT'
                                     '1'.
                                       i.
       PERFORM BDC_FIELD       USING 'RQPAS-AB_MKNR'
                                ITAB-MERKNR         .
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
    endif.
    perform bdc_dynpro      using 'SAPLQPAA' '0150'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'PLMKB-VERWMERKM(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RQPAS-ENTRY_ACT'
                                  '1'.
    k = i - 1.
    CONCATENATE  'RQPAS-SEL_FLG(' k ')' INTO SCR.
    perform bdc_field       using SCR
    CONCATENATE  'RQPAS-SEL_FLG(' i ')' INTO SCR.
    perform bdc_field       using SCR
                                  'X'.
    ***perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    ***'=QMLM'.
    CONCATENATE  'PLMKB-VERWMERKM(' I ')' INTO SCR.
    perform bdc_field       using   scr      "'PLMKB-VERWMERKM(01)'
                                 'DS-TH-01'.
    itab-VERWMERKM.
    CONCATENATE  'PLMKB-KURZTEXT(' I ')' INTO SCR.
    perform bdc_field       using   scr
    itab-KURZTEXT.
    regards
    banaja

    but i want to try it out by modifying the existing code.
    please provide me guidelines to solve this problem.

  • Problem with creating BDC program

    Hi All,
    I was trying to create a BDC program for transaction SE63 (language translation). I am doing it for text modules translation. For this, screen contains two fields, one is source language and another is target language and both are input disabled. We can input entries only through F4 help.
    Now the problem is while doing recording through transaction SHDB, it is not recognizing the F4 help and so i am not able to make any entry in that through BDC. Since field is input disabled so I can not make the entries directly.
    Can anyone please help me, how to make entries in this type of field through BDC?
    Regards,
    Akhil

    Thanks Keshav for your valueble reply but this function module is giving me error saying go to SE63 for translation. Can you mull over any other option and suggest me the same.

  • A problem about CS02 BDC

    Hi,
    I wrote a bdc about modification BOM's quantity of line item with ECM number. following is code:
    report ZCS02_BDC
           no standard page heading line-size 255.
    BDC table
    DATA: t_bdc       LIKE bdcdata  OCCURS 0 WITH HEADER LINE,
               t_bdcmsg LIKE bdcmsgcoll  OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_log OCCURS 0,
                   information(289) TYPE c,   "返回信息
               END OF t_log.
    DATA: v_mode TYPE c VALUE 'N'.
    perform fm_set_bdc  tables t_bdc using 'X' 'SAPLCSDI'  '0100'.
    perform fm_set_bdc:
      tables t_bdc using ' ' 'BDC_CURSOR' 'RC29N-AENNR',
      tables t_bdc using ' ' 'BDC_OKCODE' '/00',
      tables t_bdc using ' ' 'RC29N-MATNR' '1224',
      tables t_bdc using ' ' 'RC29N-STLAN' '2',
    tables t_bdc using ' ' 'RC29N-AENNR' '500000000084',
    tables t_bdc using ' ' 'RC29N-DATUV' '09.10.2008',
    tables t_bdc using 'X' 'SAPLCSDI' '0150',
    tables t_bdc using ' ' 'BDC_CURSOR' 'RC29P-MENGE(02)',
    tables t_bdc using ' ' 'BDC_OKCODE' '=FCBU',
    tables t_bdc using ' ' 'RC29P-MENGE(01)' '2',
    tables t_bdc using ' ' 'RC29P-MENGE(02)' '3',
    tables t_bdc using 'X' 'SAPLCSDI' '0130',
    tables t_bdc using ' ' 'BDC_OKCODE' '/EENDE'.
    CALL TRANSACTION 'CS02'
             USING    t_bdc
             MODE     'N' "Background performance
             UPDATE   'S' "local updata
             MESSAGES INTO t_bdcmsg. "all message table
    READ TABLE t_bdcmsg WITH KEY msgtyp = 'S'
                                                        msgid = 'V1'
                                                        msgnr = '311'.
    "批导入成功的标志,可以自己debug表t_bdcmsg中去找.
    IF sy-subrc EQ 0.
      CONCATENATE  '' '修改成功' INTO t_log.
      APPEND t_log.
      CLEAR t_log.
    ELSE.
      LOOP AT t_bdcmsg.
        IF t_bdcmsg-msgtyp = 'E'
            OR t_bdcmsg-msgv1 <> ''
            OR t_bdcmsg-msgv2 <> ''
            OR t_bdcmsg-msgv3 <> ''
            OR t_bdcmsg-msgv4 <> ''.
          MESSAGE ID  t_bdcmsg-msgid
                  TYPE  t_bdcmsg-msgtyp
                  NUMBER  t_bdcmsg-msgnr
                  WITH t_bdcmsg-msgv1
               t_bdcmsg-msgv2
               t_bdcmsg-msgv3
               t_bdcmsg-msgv4
               INTO t_log-information.
          CONCATENATE  '出错:' t_log-information INTO t_log-information.
          APPEND t_log.
          CLEAR t_log.
        ENDIF.
      ENDLOOP.
    ENDIF.
    LOOP AT t_log.                          "显示出错信息
      WRITE:/ t_log-information.
    ENDLOOP.
    *perform close_group.
    FORM  fm_set_bdc TABLES t_bdc STRUCTURE bdcdata
            USING u_sign TYPE c
                  u_par1
                  u_par2.
      CLEAR: t_bdc.
      IF u_sign = 'X'.
        t_bdc-program = u_par1.
        t_bdc-dynpro = u_par2.
        t_bdc-dynbegin = u_sign.
      ELSE.
        t_bdc-fnam = u_par1.
        t_bdc-fval = u_par2.
      ENDIF.
      APPEND t_bdc.
    ENDFORM.                    "fm_set_bdc
    excuted the code,display 'error:Date 24.10.2008 copied from change number'
    why didn't  this warning skip in BDC?
    How to solve this problem?
    Best Regards.
    Pangyanting

    Hi
    I dont see any internal table in the code looping...you are executing the same values which are taken from recording..
    For Example:
    perform fm_set_bdc_field tables t_bdc using 'RC29N-MATNR'
    '0000013107'. " this is the value given during recording
    perform fm_set_bdc_field tables t_bdc using 'RC29N-MATNR'
    itab-matnr. "it should be replaced like this,so the material number you want to upload will be entered in the field.
    You are getting sy-subrc = 0,because it is creating with the same values again.
    Further here is the sample code for BDC:
    REPORT  ZZPSALES_BDC1.
    types: begin of itab,
           b1(4) type c,
           b2(4) type c,
           b3(2) type c,
           b4(2) type c,
           b5(10) type c,
           b6(10),
           b7(10) type C,
           b8(10) type c,
           b9(8) type c,
           b10(8) type c,
           end of itab,
           begin of itab1,
           b8(10) type c,
           i1(15) type c,
           i2(4) type c,
           i3(4) type c,
           i4(15) type c,
           end of itab1.
    data: wa_itab type itab occurs 1 with header line.
    data: wa_itab1 type itab1 occurs 1 with header line.
    DATA: I_BDCDATA TYPE BDCDATA OCCURS 1 WITH HEADER LINE.
    data: it_itab type alsmex_tabline occurs 1 with header line,
          it_itab1 type alsmex_tabline occurs 1 with header line .
    parameters: file1 type rlgrap-filename default 'C:\Documents and Settings\pri\Desktop\open SO1.xls' lower case.
    DATA: CNT TYPE N,
          cnt1 type n.
    DATA:FNAM(20) TYPE C.
    DATA: SAPDATE(10) TYPE C.
    at selection-screen.
    at selection-screen on value-request for file1.
      CALL FUNCTION 'F4_FILENAME'
    *    EXPORTING
    *      PROGRAM_NAME        = SYST-CPROG
    **      DYNPRO_NUMBER       = SYST-DYNNR
    **      FIELD_NAME          = ' '
       IMPORTING
         FILE_NAME           = file1.
    start-of-selection.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       EXPORTING
         FILENAME                      = file1
         I_BEGIN_COL                   = 2
         I_BEGIN_ROW                   = 9
         I_END_COL                     = 11
         I_END_ROW                     = 10
       TABLES
         INTERN                        = it_itab
    *  EXCEPTIONS
    *    INCONSISTENT_PARAMETERS       = 1
    *    UPLOAD_OLE                    = 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.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = file1
        I_BEGIN_COL                   = 1
        I_BEGIN_ROW                   = 22
        I_END_COL                     = 5
        I_END_ROW                     = 25
      TABLES
        INTERN                        = it_itab1
    * EXCEPTIONS
    *   INCONSISTENT_PARAMETERS       = 1
    *   UPLOAD_OLE                    = 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 it_itab.
    case it_itab-col.
    when '1'.
      wa_itab-b1 = it_itab-value.
    when '2'.
      wa_itab-b2 = it_itab-value.
    when '3'.
      wa_itab-b3 = it_itab-value.
    when '4'.
      wa_itab-b4 = it_itab-value.
    when '5'.
      wa_itab-b5 = it_itab-value.
    when '6'.
      wa_itab-b6 = it_itab-value.
    when '7'.
      wa_itab-b7 = it_itab-value.
    when '8'.
      wa_itab-b8 = it_itab-value.
    when '9'.
      wa_itab-b9 = it_itab-value.
    when '10'.
      wa_itab-b10 = it_itab-value.
    append wa_itab.
    endcase.
    endloop.
    loop at it_itab1.
    case it_itab1-col.
      when '1'.
        wa_itab1-b8 = it_itab1-value.
      when '2'.
        wa_itab1-i1 = it_itab1-value.
      when '3'.
        wa_itab1-i2 = it_itab1-value.
      when '4'.
        wa_itab1-i3 = it_itab1-value.
      when '5'.
        wa_itab1-i4 = it_itab1-value.
      append wa_itab1.
      endcase.
      endloop.
    CLEAR SY-TABIX.
    loop at wa_itab.
    refresh i_bdcdata.
    perform bdc_dynpro      using 'SAPMV45A' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'VBAK-AUART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'VBAK-AUART'
                                  WA_ITAB-B1.
    perform bdc_field       using 'VBAK-VKORG'
                                  WA_ITAB-B2.
    perform bdc_field       using 'VBAK-VTWEG'
                                  WA_ITAB-B3.
    perform bdc_field       using 'VBAK-SPART'
                                  WA_ITAB-B4.
    CNT = 1.
    CLEAR WA_ITAB1.
    LOOP AT WA_ITAB1 WHERE B8 = WA_ITAB-B8.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  WA_ITAB-B8. "observe here, we are giving customized fields.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  WA_ITAB-B5.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  WA_ITAB-B6.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '06/25/2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    concatenate 'RV45A-KWMENG(0' CNT ')' INTO FNAM.
    perform bdc_field       using 'BDC_CURSOR'
                                  FNAM.
    CONCATENATE 'RV45A-MABNR(0' CNT ')' INTO FNAM.
    perform bdc_field       using FNAM
                                  WA_ITAB1-I1.
    CONCATENATE 'RV45A-KWMENG(0' CNT ')' INTO FNAM.
    perform bdc_field       using FNAM
                                  WA_ITAB1-I2.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ITEM'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  WA_ITAB-B8.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  WA_ITAB-B5.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  WA_ITAB-B6.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '06/25/2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    perform bdc_field       using 'VBKD-ZTERM'
                                  'N45'.
    perform bdc_field       using 'VBKD-INCO1'
                                  'FOB'.
    perform bdc_field       using 'VBKD-INCO2'
                                  'New York'.
    concatenate 'RV45A-KWMENG(0' cnt ')' into fnam.
    perform bdc_field       using 'BDC_CURSOR'
                                  FNAM.
    READ TABLE WA_ITAB1." INDEX '0' .
    IF SY-TABIX = 1.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=T\06'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-KWMENG'.
    *perform bdc_field       using 'RV45A-KWMENG'
    *                              WA_ITAB1-I2.
    *perform bdc_field       using 'VBAP-VRKME'
    *                              'EA'.
    perform bdc_field       using 'RV45A-ETDAT'
                                  wa_itab-b7.
    *perform bdc_field       using 'RV45A-PRGBZ'
    *                              'D'.
    ENDIF.
    perform bdc_dynpro      using 'SAPMV45A' '5003'.
    perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'KOMV-KBETR(07)'.
    perform bdc_field       using 'KOMV-KSCHL(07)'
                                  WA_ITAB1-I3.
    perform bdc_field       using 'KOMV-KBETR(07)'
                                  WA_ITAB1-I4.
    perform bdc_dynpro      using 'SAPMV45A' '5003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=HEAD'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'KOMV-KSCHL(08)'.
    perform bdc_dynpro      using 'SAPMV45A' '4002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=S\BACK'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'VBKD-PRSDT'.
    perform bdc_field       using 'VBAK-AUDAT'
                                  '06/18/2008'.
    perform bdc_field       using 'VBAK-VKBUR'
                                  '0002'.
    perform bdc_field       using 'VBAK-WAERK'
                                  'USD'.
    perform bdc_field       using 'VBKD-PRSDT'
                                  '06/18/2008'.
    perform bdc_field       using 'VBKD-KDGRP'
                                  'A1'.
    *perform bdc_dynpro      using 'SAPMV45A' '5003'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '=S\BACK'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'KOMV-KSCHL(08)'.
    cnt = cnt + 1.
    ENDLOOP.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=KKNT'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  WA_ITAB-B8.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  WA_ITAB-B5.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  WA_ITAB-B6.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '06/30/2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    perform bdc_field       using 'VBKD-ZTERM'
                                  'N45'.
    perform bdc_field       using 'VBKD-INCO1'
                                  'FOB'.
    perform bdc_field       using 'VBKD-INCO2'
                                  'New York'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-MABNR(02)'.
    perform bdc_dynpro      using 'SAPMV45A' '4002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-TXT_VBELN'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-PS_POSID'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-PS_POSID'
                                  WA_ITAB-B9.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=KFPL'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  WA_ITAB-B8.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  WA_ITAB-B5.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  WA_ITAB-B6.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '06/30/2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    perform bdc_field       using 'VBKD-ZTERM'
                                  'N45'.
    perform bdc_field       using 'VBKD-INCO1'
                                  'FOB'.
    perform bdc_field       using 'VBKD-INCO2'
                                  'New York'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-MABNR(02)'.
    perform bdc_dynpro      using 'SAPLCNMS' '1300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MLSTS-AUFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=GO'.
    perform bdc_field       using 'MLSTS-SELPS'
                                  'X'.
    perform bdc_field       using 'MLSTS-PSPNR'
                                  WA_ITAB-B10.
    perform bdc_dynpro      using 'SAPLCNMS' '1310'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MRKS'.
    perform bdc_dynpro      using 'SAPLCNMS' '1310'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=GET'.
    perform bdc_dynpro      using 'SAPLV60F' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=S\BACK'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'FPLA-BEDAT'.
    perform bdc_field       using 'FPLA-BEDAT'
                                  '06/30/2008'.
    perform bdc_field       using 'FPLA-BEDAR'
                                  '07'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  WA_ITAB-B8.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  WA_ITAB-B5.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  WA_ITAB-B6.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '06/30/2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    perform bdc_field       using 'VBKD-ZTERM'
                                  'N45'.
    perform bdc_field       using 'VBKD-INCO1'
                                  'FOB'.
    perform bdc_field       using 'VBKD-INCO2'
                                  'New York'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-MABNR(02)'.
    perform bdc_dynpro      using 'SAPLSPO2' '0101'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=OPT1'.
    CALL TRANSACTION 'VA01' USING i_bdcdata MODE 'A'.
    endloop.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR i_bdcdata.
      i_bdcdata-program  = PROGRAM.
      i_bdcdata-dynpro   = DYNPRO.
      i_bdcdata-dynbegin = 'X'.
      APPEND i_bdcdata.
    ENDFORM.
    *        Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR i_bdcdata.
        i_bdcdata-fnam = FNAM.
        i_bdcdata-fval = FVAL.
        APPEND i_bdcdata.
      ENDIF.
    ENDFORM.
    Regards,
    Vishwa.

  • Problem In Converting BDC recording to program

    Hi to all,
    I have recorded ZMM01 using t-code MM01 to create material with accounting codes. Here i am able to create material with accounting codes. But when I am converting that into program there i am getting problem(not creating any material and not showing any error). So please guide me.
    Any help would be appreciated .

    Have you tried executing your BDC program in debug mode with mode A? Also, are you trapping errors in BDCMSGCOLL structure?
    Thanks,
    Santosh

  • Problem with ke51 bdc

    hello friends .
                           I am doing an bdc for ke51, my recording is all fine and so is the program according to the recording but I am getting one problem.
            on the first screen where we put the profit center the previously loaded profit center is coming and then i am getting the error tat the profit center is already created.
           what to do is this case , i am also trying to clear that screen field but its not helping.         pls help its very urgent ....

    Hi Amit,
    try with this code ( place your screen number and field values )
         PERFORM BDC_DYNPRO      USING 'programname' 'screen number'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'PRCT_V-PRCTR '
                                        SPACE.
          PERFORM BDC_FIELD       USING 'PRCT_V-PRCTR '
                                        place ur value.
    this will solve ur problem.
    regards,
    muralidhar.

  • Problem in executing BDC through interface.

    Hello,
    We have developed an interface program for creating notifications through BDC in IW21 . Standard notification transaction IW21 has been enhanced with a screen table control for entering certain data.We have recorded the transaction IW21 in SHDB for developing BDC program for notification creation. When ever this interface is executed ,notification is getting created succesfully without populating the values in the screen table control. But when we executed through debugger then all the data is getting updated in screen table control.
    Can anyone guess the problem and suggest the solution.
    Thanks in Advance.
    Vamsi

    Hi Vamsi/Neelima,
    Have a wait command after commit work.
    COMMIT WORK AND WAIT .
    or you can have just WAIT command after execution of transaction.
    Cheers,
    Varun

  • Problem during lsmw - bdc

    HI,
    There is reqirment from client to change the aternate bom text in mass.
    Now problem is using lsmw  or bdc value is not getting change during recording.  this problem is specific to this field stext (alternate bom text) only.
    BOM's were created using maste recipe, so i had tried to change the bom using master recipe, here data is change succefully using lsmw but problem is  inactive bom's, because inactive bom's can not be change using c202.
    Any input regarding above issue
    Regards,
    Dhaval

    I just did a quick recording to see if I could change the Alt.Text in BOM header & I was able to.
    Below is the values of recording (only partial i.e. from the time I was in header screen & when I clicked Alt. Text). Please ensure you click on Alternative Long Text during your recording & then enter at least 2 lines of text as that is one of the pre-requisite. You can ask your abaper to compare the below with your recording to see if is the same & incorporate the below in your BDC program. It should work fine.
    SAPLCSDI     2110     X                                                                               
    BDC_OKCODE     =LTKO
                                                                BDC_SUBSCR     SAPLCSDI                                0800STLKOPF
                                                                BDC_CURSOR     RC29K-EXSTL
                                                                BDC_SUBSCR     SAPLCSDI                                1110SUBPAGE
                                                                RC29K-STKTX     'Test value which I stored first'
                                                                RC29K-BMENG     1
                                                                RC29K-STLST     1
    SAPLSTXX     1100     X                                                                               
    BDC_CURSOR     RSTXT-TXLINE(03)
                                                                BDC_OKCODE     =EDNP
                                                                RSTXT-TXLINE(02)     'Test value which I changed during rec'                                                                               
    RSTXT-TXLINE(03) 'This is second line of text'                                                                               
    SAPLSTXX     1100     X                                                                               
    BDC_CURSOR     RSTXT-TXLINE(04)
                                                                BDC_OKCODE     =TXBA

Maybe you are looking for

  • Unable to install IDM 11.1.1.6.0..Issue with  ASInstance ..not empty....

    Hello IDM experts, please help me. I have Oracle Linux 5.7 64 bit installed on Oracle Virtual box 4.1.10. I have valid IP address and Domain name and I am able to ping both. I have successfully installed database 11GR2 (11.2.0.1.0) for 64 bit linux.

  • Script to export IDCS3 to PDF utilizing text from document as file name

    I have written a few very very basic scripts so I really only know enough to be dangerous. I tried searching the forums first but couldn't find a situation quite like this one. I have an IDCS3 file that is using data merge to create multiple files. A

  • Time Siries AGO Error

    Hi, When i try to use the AGO function in time sieries i am getting below error. State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22040] To use AGO function, the storage level of the qu

  • FF 3.6.17 update failed do to internet prob. FF is now locked from this update & future ones it seems

    Hi There, My system > Mac G3 PB, PowerPC 500mhz., 1gb RAM, 40gb. HDD, OSX-10.4.11 FF 3.6.17 update dload file was deleted do to possible corruption issues because of internet probs. It was deleted from the Applications/Firefox/Contents/MacOS/Updates/

  • Print Services?

    I am curious if this is even possible. I have need for a print routine using (I think) a PrintStream to generate some printer output (duh). I am using Graphics2D routines throughout my Pageable() code and everything works great. I am generating three