How to handle table control in lsmw recording method

hi expert please tell me the procedure for how to handle table control in lsmw recording method
Locked for same reason as how to upload data for me01 using LSMW BDC METHOD
Edited by: Matt on May 9, 2011 8:52 AM

Sri,
just search in SDN search box by giving table control in lsmw you will get hell lot of threads for same.
Amit.

Similar Messages

  • How to handle table controls using LSMW

    Hi All,
    how to use LSMW to handle table control like header and item details eg. VA01 , ME21 etc. To handle these kind of trnasactions can we use LSMW instead BDC to upload data. Please let me know.
    Thanks in advance.
    Regards,
    Kalpana

    Hi Kalpana,
    You can have your own custom programs for LSMW if the standard DI/BI IDOC , BAPI dont meet your requirements.
    Its little bit complex. You need to register you custom program in table through SM30.
    SDX0 - Program Definition ( BI or DI )
    SDX1 - Program Assignment
    SDX2 - Declaring Structures
    SDX3 - Declaring field identifiers for structures
    You can goto SM30 and can view the standard BI/DI programs definition by using the four digit Obejct Number...
    <b>AS</b>

  • How to handle Table control in BDC? Difference between BDC & LSMW?

    Hi
    How to handle Table control in BDC? Difference between BDC & LSMW?
    Regards,
    Raghu

    Hi ,
    the diff b/w normal BDC and with table control is that with table control u can enter as many lineitems as u want..so during recording if u r entering 3 line items..then the program will show (1), (2) and (3) with that.
    chane that fixed no to variable.
    check that sample code.
    in this for new customer...any no of items can be entered.
    LOOP AT t_cusdata.
        REFRESH t_bdcdata.
        ON CHANGE OF t_cusdata-kunnr.
    initial screen.
          PERFORM bdc_dynpro      USING 'SAPMV10A' '0100'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'MV10A-VTWEG'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
          PERFORM bdc_field       USING 'MV10A-KUNNR'
                                  t_cusdata-kunnr.
          PERFORM bdc_field      USING 'MV10A-VKORG'
                                  t_cusdata-vkorg.     "'HCL'.
          PERFORM bdc_field       USING 'MV10A-VTWEG'
                                  t_cusdata-vtweg.     "'HL'.
          DATA: fnam(20) TYPE c,
                fnam1(20) TYPE c,
                idx(2) TYPE c.
          MOVE 1 TO idx.
          LOOP AT t_matdata WHERE kunnr = t_cusdata-kunnr.
            PERFORM bdc_dynpro      USING 'SAPMV10A' '0200'.
            CONCATENATE 'MV10A-KDMAT(' idx ')' INTO fnam.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          fnam.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '/00'.
            CONCATENATE 'MV10A-MATNR(' idx ')' INTO fnam1.
            PERFORM bdc_field       USING fnam1
                                          t_matdata-matnr.      "'FIN50'.
            PERFORM bdc_field       USING fnam
                                          t_matdata-kdmat.  "'ABCD'.
            idx = idx + 1.
          ENDLOOP.
          PERFORM bdc_dynpro      USING 'SAPMV10A' '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'MV10A-MATNR(01)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=SICH'.
          CALL TRANSACTION 'VD51' USING t_bdcdata MODE 'A' .
                                        UPDATE 'S' MESSAGES INTO t_err_mes.
    Regards,
    Sonika

  • How to handle table control in BDC while uploading item details for anorder

    How to handle table control in BDC while uploading item details for an order?
    What is the use of CTU_PARAMS structure in BDC?
    In Finance I have done some changes to the layout set by coping to a zscript(duning letter) and how can assign the print program?
    What is the process to test the finance script?
    How can I see the print preview whether it is coming correctly or not?
    Thanks in advance.
    Regards.
    Abhilash.

    hi,
    for the bdc control refer the following link:
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    ctu_params:
    refer to the link
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/dataTransfers-LSMW%2CALE%2C+BDC
    reward if useful,
    thanks and regards

  • How to handle Table control in BDC

    How to handle Table control in BDC

    HI,
    Table Control in BDC
    HI,
    Refer the link:
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    The concept is easy: it has to indicate the index of the table control in the field name, so if you have to populate the first record of table control:
    BDC-FIELDNAME = <FIELDNAME>(01).
    If you fill the second row:
    BDC-FIELDNAME = <FIELDNAME>(02).
    and so....
    Now the problem is usually on how many records you have to load, because u can fill only the rows of table control available in the screen, If you have more records than it can be displayed yuo have to simulate the command to go next page.
    The number of recod can be displayed can depend on pc resolution and many program haven't command to go to next page (in this case it could be impossible create a BDC program9.
    A way to create a bdc program resolution indipendent is to work on the first and second row.
    - Place the first hit in the first row of bdc;
    - Place the second insert in the second row of bdc;
    - Place the last hit to the top of table control;
    - Place the next hit in the second row;
    - Place the last hit to the top of table control;
    - Place the next hit in the second row;
    - .... and so
    For more info: Search in SDN with TABLE CONTROL IN BDC.
    Will get a lot of related links.
    <b>Reward points if this Helps.
    Manish</b>

  • How to use table control in LSMW

    Hello All,
    I have requirement to use LSMW , in my using transaction have table control ,I need to pass values in table control . how to use table control in LSMW .Can any one give me the solution for this.
    Best regards,
    Satya.

    Note: The recording function records a fixed screen sequence. It cannot be used for migrating data containing a variable number of items or for transactions with dynamic screen sequences!
    Tip: It is possible to create a recording via SHDB, generate a program out of this recording, and adopt the program to your needs and registrate the program to be able to use it in LSMW.
    That’s means, for creation of project and WBS Elements is not possible through
    1. LSMW-BDC (For both CJ01 and CJ20n)
    2. LSMW-BAPI (Method: Maintain is not listed )
    3. LSME-Standard Batch Direct Input.
    It’s possible through programmatically(SE38.) either using BAPI Or BDC.
    Thanks,

  • Handling table control in lsmw

    hi,
    i need a help to handel table control in lsmw.
    i have created two source structure zheader and zitem.
    then at the time of maintain structure relations its taking only one structure . means i am able to assign only zheader structure. how can i assign both the strucure zheader and zitem here ?
    Thanks.
    Regards,
    Pooja Joshi.

    LSMW in table controls
    How to use table control in LSMW
    LSMW
    Handling Table controls in LSMW

  • How to handle Table controls with XD01 in BDC

    How to handle Table controls with XD01 in BDC - If there are more than 5/6 records in Table control. - Can any one explain it with a piece of code plz..
    Thanks & Regards,
    Krishna Chaitanya

    Hi
    check this code...viz for xko1....
    DATA: BEGIN OF it_xk01 OCCURS 0,
            f1(1),
            f2(5),
            f3(5),
            f4(9),
            f5(9),
          END OF it_xk01.
    DATA: v_count(2) VALUE '00',
          v_koinh(14),
          v_banks(14),
          v_bankn(14),
          v_bankl(14),
          it_bdcdata TYPE STANDARD TABLE OF bdcdata WITH HEADER LINE,
          wa_ctuparams type ctu_params.
    PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_f4.
    START-OF-SELECTION.
      PERFORM upload_data.
    END-OF-SELECTION.
      LOOP AT it_xk01.
        IF it_xk01-f1 = 'H'.
          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-KTOKK'
                                        it_xk01-f2.
        ENDIF.
        IF it_xk01-f1 = 'N'.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'LFA1-PSTLZ'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=VW'.
          PERFORM bdc_field       USING 'LFA1-ANRED'
                                        'Mr'.
          PERFORM bdc_field       USING 'LFA1-NAME1'
                                        it_xk01-f2.
          PERFORM bdc_field       USING 'LFA1-SORTL'
                                        it_xk01-f3.
          PERFORM bdc_field       USING 'LFA1-PSTLZ'
                                        it_xk01-f4.
          PERFORM bdc_field       USING 'LFA1-LAND1'
                                        it_xk01-f5.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0120'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'LFA1-KUNNR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=VW'.
        ENDIF.
        IF it_xk01-f1 = 'I'.
          v_count = v_count + 1.
          IF v_count le 5.
          CONCATENATE 'LFBK-KOINH(' v_count ')' INTO v_koinh.
          CONCATENATE 'LFBK-BANKS(' v_count ')' INTO v_banks.
          CONCATENATE 'LFBK-BANKN(' v_count ')' INTO v_bankn.
          CONCATENATE 'LFBK-BANKL(' v_count ')' INTO v_bankl.
          CONDENSE v_koinh NO-GAPS.
          CONDENSE v_banks NO-GAPS.
          CONDENSE v_bankl NO-GAPS.
          CONDENSE v_bankn NO-GAPS.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                         v_koinh.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING  v_banks
                                        it_xk01-f2.
          PERFORM bdc_field       USING  v_bankl
                                        it_xk01-f3.
          PERFORM bdc_field       USING  v_bankn
                                        it_xk01-f4.
          PERFORM bdc_field       USING  v_koinh
                                        it_xk01-f5.
          else.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                         v_koinh.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=P+'.
          v_count = 1.
          PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                         v_koinh.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CONCATENATE 'LFBK-KOINH(' v_count ')' INTO v_koinh.
          CONCATENATE 'LFBK-BANKS(' v_count ')' INTO v_banks.
          CONCATENATE 'LFBK-BANKN(' v_count ')' INTO v_bankn.
          CONCATENATE 'LFBK-BANKL(' v_count ')' INTO v_bankl.
          CONDENSE v_koinh NO-GAPS.
          CONDENSE v_banks NO-GAPS.
          CONDENSE v_bankl NO-GAPS.
          CONDENSE v_bankn NO-GAPS.
          PERFORM bdc_field       USING  v_banks
                                        it_xk01-f2.
          PERFORM bdc_field       USING  v_bankl
                                        it_xk01-f3.
          PERFORM bdc_field       USING  v_bankn
                                        it_xk01-f4.
          PERFORM bdc_field       USING  v_koinh
                                        it_xk01-f5.
          ENDIF.
        ENDIF.
        CLEAR it_xk01.
      ENDLOOP.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                         v_koinh.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
      perform bdc_dynpro      using 'SAPLSPO1' '0300'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=YES'.
      wa_ctuparams-DISMODE = 'A'.
      wa_ctuparams-UPDMODE = 'S'.
      wa_ctuparams-DEFSIZE = 'X'.
      CALL TRANSACTION 'XK01' USING it_bdcdata  MODE 'A'
                                                 UPDATE 'S'.
    options from wa_ctuparams.
    MODE 'A'
                                                UPDATE 'S'.
    *&      Form  upload_data
          text
    FORM upload_data .
      DATA: lv_infile TYPE string.
      lv_infile = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = lv_infile
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = it_xk01.
      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.                    " upload_data
    *&      Form  get_f4
          text
    FORM get_f4 .
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
        FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_file.
    ENDFORM.                                                    " get_f4
           Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR it_bdcdata.
      it_bdcdata-program  = program.
      it_bdcdata-dynpro   = dynpro.
      it_bdcdata-dynbegin = 'X'.
      APPEND it_bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
    IF FVAL <> NODATA.
      CLEAR it_bdcdata.
      it_bdcdata-fnam = fnam.
      it_bdcdata-fval = fval.
      APPEND it_bdcdata.
    ENDIF.
    ENDFORM.                    "BDC_FIELD
    *H     0302
    *N     sdng     dddsj     500020     IN
    *I     IN     ICICI     734897597     xyz
    *I     IN     SBH     768346687     abc
    *I     IN     SBI     345687346     fgh
    *I     IN     SBH     763846878     ujhgf
    *I     IN     HSBC     797893778     fvdg
    *I     IN     HDFC     723678638     fdgf
    *I     IN     4444     435645646     fgfg
    *I     IN     3400     763468768     gfgfg

  • Hi abapers how to handle table control in bdc

    hi experts please guide me
    how to handle table control in bdc? could u please explain me briefly  
    thanks and regards

    sayeed,
    Go thru this code it may help you. check bold code for the table control..
    report zsunil_bdc
    no standard page heading line-size 255.
    INTERNAL TABLES *
    DATA: BEGIN OF IT_KNA1 OCCURS 0,
    CUSTOMER LIKE RF02D-KUNNR,
    COMPANY_CODE LIKE RF02D-BUKRS,
    ACCOUNT_GROUP LIKE RF02D-KTOKD,
    TITLE LIKE KNA1-ANRED,
    NAME LIKE KNA1-NAME1,
    SEARCH_TERM LIKE KNA1-SORTL,
    STREET LIKE KNA1-STRAS,
    CITY LIKE KNA1-ORT01,
    POSTAL_CODE LIKE KNA1-PSTLZ,
    COUNTRY LIKE KNA1-LAND1,
    LANGUAGE_KEY LIKE KNA1-SPRAS,
    CNTRY LIKE KNBK-BANKS,
    BANK_KEY LIKE KNBK-BANKL,
    BANK_ACCOUNT LIKE KNBK-BANKN,
    REC_ACCOUNT LIKE KNB1-AKONT,
    END OF IT_KNA1.
    DATA: IT_BDCDATA TYPE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA: IT_MESSAGES TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    SELECTION SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER P_FILE TYPE RLGRAP-FILENAME DEFAULT 'C:\CUSTOMER.TXT'
    OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION SCREEN *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    PERFORM HELP_FILE USING P_FILE.
    START OF SELECTION *
    START-OF-SELECTION.
    *UPLOADING THE FILE FROM WORKSTATION
    PERFORM UPLOAD_FILE USING P_FILE.
    *POPULATING DATA.
    PERFORM POPULATE_FILE.
    *& Form HELP_FILE
    text
    -->P_P_FILE text
    form HELP_FILE 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. " HELP_FILE
    *& Form UPLOAD_FILE
    text
    -->P_P_FILE text
    form UPLOAD_FILE using p_p_file.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'P_P_FILE'
    FILETYPE = 'DAT'
    ITEM = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    LINE_EXIT = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    SILENT = 'S'
    IMPORTING
    FILESIZE =
    CANCEL =
    ACT_FILENAME =
    ACT_FILETYPE =
    TABLES
    data_tab = IT_KNA1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform. " UPLOAD_FILE
    *& Form POPULATE_FILE
    text
    --> p1 text
    <-- p2 text
    form POPULATE_FILE .
    DATA: L_STRING TYPE STRING,
    L_COUNTER(2) TYPE N,
    V_INDEX TYPE SY-TABIX.
    LOOP AT IT_KNA1.
    V_INDEX = SY-TABIX.
    AT NEW CUSTOMER.
    READ TABLE IT_KNA1 INDEX V_INDEX.
    IF SY-SUBRC = 0.
    perform bdc_dynpro using 'SAPMF02D' '0105'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02D-KTOKD'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02D-KUNNR'
    IT_KNA1-CUSTOMER.
    perform bdc_field using 'RF02D-BUKRS'
    IT_KNA1-COMPANY_CODE.
    perform bdc_field using 'RF02D-KTOKD'
    IT_KNA1-ACCOUNT_GROUP.
    *PERFORM BDC_FIELD USING 'RF02D-D0130'
    'X'.
    perform bdc_dynpro using 'SAPMF02D' '0110'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-SPRAS'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNA1-ANRED'
    IT_KNA1-TITLE.
    perform bdc_field using 'KNA1-NAME1'
    IT_KNA1-NAME.
    perform bdc_field using 'KNA1-SORTL'
    IT_KNA1-SEARCH_TERM.
    perform bdc_field using 'KNA1-STRAS'
    IT_KNA1-STREET.
    perform bdc_field using 'KNA1-ORT01'
    IT_KNA1-CITY.
    perform bdc_field using 'KNA1-PSTLZ'
    IT_KNA1-POSTAL_CODE.
    perform bdc_field using 'KNA1-LAND1'
    IT_KNA1-COUNTRY.
    perform bdc_field using 'KNA1-SPRAS'
    IT_KNA1-LANGUAGE_KEY.
    perform bdc_dynpro using 'SAPMF02D' '0120'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-LIFNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPMF02D' '0130'.
    PERFORM BDC_FIELD USING 'RF02D-D0130'
    'X'.
    perform bdc_field using 'BDC_CURSOR'
    'KNBK-BANKN(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02D' '0210'.
    perform bdc_field using 'BDC_CURSOR'
    'KNB1-AKONT'.
    perform bdc_field using 'BDC_OKCODE'
    '=UPDA'.
    perform bdc_field using 'KNB1-AKONT'
    IT_KNA1-REC_ACCOUNT.
    perform bdc_dynpro using 'SAPLRSFH' '0100'.
    perform bdc_field using 'BDC_OKCODE'
    '/EBACK'.
    perform bdc_field using 'BDC_CURSOR'
    'RSIODYNP4-LOW(01)'.
    ENDIF.
    ENDAT.
    L_COUNTER = L_COUNTER + 1.
    CLEAR L_STRING.
    CONCATENATE 'KNBK-BANKS(' L_COUNTER ')' INTO L_STRING.
    PERFORM BDC_FIELD USING L_STRING
    IT_KNA1-CNTRY.
    CLEAR L_STRING.
    CONCATENATE 'KNBK-BANKL(' L_COUNTER ')' INTO L_STRING.
    PERFORM BDC_FIELD USING L_STRING
    IT_KNA1-BANK_KEY.
    CLEAR L_STRING.
    CONCATENATE 'KNBK-BANKN(' L_COUNTER ')' INTO L_STRING.
    PERFORM BDC_FIELD USING L_STRING
    IT_KNA1-BANK_ACCOUNT.
    AT END OF CUSTOMER.
    READ TABLE IT_KNA1 INDEX V_INDEX.
    IF SY-SUBRC = 0.
    CALL TRANSACTION 'FD01' USING IT_BDCDATA MODE 'A' UPDATE 'S' MESSAGES
    INTO IT_MESSAGES.
    IF SY-SUBRC <> 0.
    PERFORM EMPLOYEEID_ERROR.
    *ELSE.
    ENDIF.
    WRITE: SY-SUBRC.
    perform message_format_write.
    *ENDIF.
    *WRITE: SY-SUBRC.
    CLEAR IT_BDCDATA.
    REFRESH IT_BDCDATA.
    ENDIF.
    ENDAT.
    ENDLOOP.
    endform. " POPULATE_FILE
    *& Form bdc_dynpro
    text
    -->P_0224 text
    -->P_0225 text
    form bdc_dynpro using value(p_0224)
    value(p_0225).
    IT_BDCDATA-PROGRAM = P_0224.
    IT_BDCDATA-DYNPRO = P_0225.
    IT_BDCDATA-DYNBEGIN = 'X'.
    APPEND IT_BDCDATA.
    CLEAR IT_BDCDATA.
    endform. " bdc_dynpro
    *& Form bdc_field
    text
    -->P_0229 text
    -->P_0230 text
    form bdc_field using value(p_0229)
    value(p_0230).
    IT_BDCDATA-FNAM = P_0229.
    IT_BDCDATA-FVAL = P_0230.
    APPEND IT_BDCDATA.
    CLEAR IT_BDCDATA.
    endform. " bdc_field
    *& Form EMPLOYEEID_ERROR
    text
    --> p1 text
    <-- p2 text
    form EMPLOYEEID_ERROR .
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    DEST = FILLER8
    GROUP = 'Z50583_REC1'
    HOLDDATE = FILLER8
    KEEP = 'X'
    USER = SY-UNAME
    RECORD = FILLER1
    PROG = SY-CPROG
    IMPORTING
    QID =
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = 'FD01'
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    SIMUBATCH = ' '
    CTUPARAMS = ' '
    TABLES
    dynprotab = IT_BDCDATA
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 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. " EMPLOYEEID_ERROR
    *& Form message_format_write
    text
    --> p1 text
    <-- p2 text
    form message_format_write .
    DATA: L_MSG(200).
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = SY-MSGID
    LANG = SY-LANGU
    NO = SY-MSGNO
    V1 = SY-MSGV1
    V2 = SY-MSGV2
    V3 = SY-MSGV3
    V4 = SY-MSGV4
    IMPORTING
    MSG = L_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    WRITE: / L_MSG.
    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. " message_format_write
    ~~Guduri

  • Handling Table controls in LSMW

    Hi All,
             Need a help regarding LSMW.Is it possible to handle table control using LSMW if the rows are dynamically changing or do we need to use BDC ?
    appropriate answers will be rewarded.
    Thanks,
    Sandeep

    hai sandeep,
       check this link...
    LSMW TABLE CONTROL
    http://www.jt77.com/development1/programming-15871.html

  • How to handle table control in PO change

    Hi All,
    R/3 is sending PO details and Vendor is using third party front end to access the PO.He has changed the PO and these changes need to be reflected in the PO. Data is coming from external sytem to R/3 through IDOC. I need to handle the changes in the PO at the ITEM level. It has the table control. I don't know about table control. Kindly help me inorder to update the PO for a particular tab in PO item(ME22N).
    I have checked the process code : ORDH and FM: MPN30_IDOC_INPUT_ORDCAD
    Regards
    Kannaiah
    Rewards for helpful answers

    Hi Ravikanth,
    Thanks for the reply.
    I checked the PO item for the fields which need to be updated. I am unable to find some fields in the FM which i had mentioned. Shall I need to use any Userexit or include for this. If yes, can you tell me the user exit for this. I have checked the following exits: AMPL0001 
    LMEDR001 
    LMELA002 
    LMELA010 
    LMEQR001 
    LMEXF001 
    LWSUS001 
    M06B0001 
    M06B0002 
    M06B0003 
    M06B0004 
    M06B0005 
    M06E0004 
    M06E0005 
    ME590001 
    MEETA001 
    MEFLD004 
    MELAB001 
    MEQUERY1 
    MEVME001 
    MM06E001 
    MM06E003 
    MM06E004 
    MM06E005 
    MM06E007 
    MM06E008 
    MM06E009 
    MM06E010 
    MMAL0001 
    MMAL0002 
    MMAL0003 
    MMDA0001
    MMFAB001
    MRFLB001

  • In BDC'S how to handle Table control

    Hi,
         I want to know the concept and code for BDC's in Table control steps(MM01,VA01) and coding.Please its very Urgent.

    Hi Raghavendra,
    Go through this program mm01.
    rePORT ymmbdcmm01
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    *&        Table Declarations                                          *
    TABLES:rmmg1,makt,mara,mvke, marc,mbew,t100.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    *&        Data Declarations                                           *
    DATA:
         BEGIN OF t_data OCCURS 0,
               data TYPE string,
         END   OF t_data.
    DATA:BEGIN OF it_mess OCCURS 0,
      msgtyp(5),
       lms(200),
       msgv1(50),
      END OF it_mess.
    DATA: BEGIN OF it_itab OCCURS 0,
            matnr TYPE rmmg1-matnr,
            mbrsh TYPE rmmg1-mbrsh,
            mtart TYPE rmmg1-mtart,
            werks TYPE rmmg1-werks,
            lgort TYPE rmmg1-lgort,
            vkorg TYPE rmmg1-vkorg,
            vtweg TYPE rmmg1-vtweg,
            maktx TYPE makt-maktx,
            meins TYPE mara-meins,
            matkl TYPE mara-matkl,
            spart TYPE mara-spart,
          GEWEI TYPE MARA-GEWEI,
            dwerk TYPE mvke-dwerk,
            versg TYPE mvke-versg,
            mtpos TYPE mvke-mtpos,
            mtvfp TYPE marc-mtvfp,
            tragr TYPE mara-tragr,
            ladgr TYPE marc-ladgr,
            sernp TYPE marc-sernp,
            txline(25), "added
          kordb ,
            mprof TYPE mara-mprof,
            ekgrp TYPE marc-ekgrp,
            dismm TYPE marc-dismm,
            dispo TYPE marc-dispo,
            disls TYPE marc-disls,
            mabst(13) TYPE c,
            beskz TYPE marc-beskz,
            sobsl TYPE marc-sobsl,
            lgpro TYPE marc-lgpro,
            dzeit TYPE c,
            plifz(3) TYPE c,
            webaz TYPE c,
            fhori TYPE marc-fhori,
            eisbe TYPE c,
            strgr(2) TYPE c,
            vrmod TYPE c,
            vint1(3),
            vint2(3),
            wzeit(3),
            sbdkz TYPE marc-sbdkz,
            bklas TYPE mbew-bklas,
           vprsv TYPE mbew-vprsv,
            verpr(11),
           peinh TYPE c,
            ekalr TYPE mbew-ekalr,
            losgr TYPE c,
            RGEKZ(1),
            fevor(3),
          END OF it_itab.
    *decl of internal table of table control for BDCDATA & BDCMSGCOLL
    DATA : BEGIN OF bdcdata OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdcdata.
    DATA:it_msgtab TYPE STANDARD TABLE OF  bdcmsgcoll WITH HEADER LINE,
         it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
    DATA : fld(50) TYPE c,
           cnt(2) TYPE n,
          l_mstring(150).
    START-OF-SELECTION.
    *&        File uploading  from  xlsheet  to sap                                          *
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw
          i_filename               =  'C:\Documents and Settings\sapthamm\Desktop\mm02.xls'
        TABLES
          i_tab_converted_data     = it_itab
       EXCEPTIONS
          conversion_failed        = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *&        Splitting the Internal Table                                *
      LOOP AT t_data.
        SPLIT t_data-data AT cl_abap_char_utilities=>horizontal_tab INTO
           it_itab-matnr
           it_itab-mbrsh
           it_itab-mtart
           it_itab-werks
           it_itab-lgort
           it_itab-vkorg
           it_itab-vtweg
           it_itab-maktx
           it_itab-meins
           it_itab-matkl
           it_itab-spart
           it_itab-GEWEI
           it_itab-dwerk
           it_itab-versg
           it_itab-mtpos
           it_itab-mtvfp
           it_itab-tragr
           it_itab-ladgr
           it_itab-sernp
           it_itab-mprof
           it_itab-ekgrp
           it_itab-dismm
           it_itab-dispo
           it_itab-disls
           it_itab-mabst
           it_itab-beskz
           it_itab-sobsl
           it_itab-lgpro
           it_itab-dzeit
           it_itab-plifz
           it_itab-webaz
           it_itab-fhori
           it_itab-eisbe
           it_itab-strgr
           it_itab-vrmod
           it_itab-vint1
           it_itab-vint2
           it_itab-wzeit
           it_itab-sbdkz
           it_itab-bklas
        it_itab-vprsv
          it_itab-peinh
           it_itab-ekalr
           it_itab-losgr
        APPEND it_itab.
        CLEAR: it_itab,
               t_data-data.
      ENDLOOP.
    *perform open_dataset using dataset.
    *perform open_group.
    *do.
    *read dataset dataset into it_itab.
    *if sy-subrc <> 0. exit. endif.
    *&        it_itabing of Material Type-HALB                                  *
      LOOP AT it_itab.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '0060'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RMMG1-MATNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RMMG1-MATNR'
                                      it_itab-matnr.
        PERFORM bdc_field       USING 'RMMG1-MBRSH'
                                      it_itab-mbrsh.
        PERFORM bdc_field       USING 'RMMG1-MTART'
                                      it_itab-mtart.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '0070'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MSICHTAUSW-DYTXT(17)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=P+'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(01)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(02)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(04)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(05)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(06)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(08)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(09)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(12)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(13)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(14)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(15)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(17)'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '0070'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MSICHTAUSW-DYTXT(09)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(01)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(02)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(06)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(07)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(08)'
                                      'X'.
        PERFORM bdc_field       USING 'MSICHTAUSW-KZSEL(09)'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '0080'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RMMG1-VTWEG'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_field       USING 'RMMG1-WERKS'
                                      it_itab-werks.
        PERFORM bdc_field       USING 'RMMG1-LGORT'
                                      it_itab-lgort.
        PERFORM bdc_field       USING 'RMMG1-VKORG'
                                      it_itab-vkorg.
        PERFORM bdc_field       USING 'RMMG1-VTWEG'
                                      it_itab-vtweg.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4004'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MARA-SPART'.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARA-MATKL'
                                      it_itab-matkl.
        PERFORM bdc_field       USING 'MARA-SPART'
                                      it_itab-spart.
        PERFORM bdc_field       USING 'MARA-GEWEI'
                                      'kg'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4004'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARA-SPART'
                                      it_itab-spart.
        PERFORM bdc_field       USING 'MVKE-DWERK'
                                      it_itab-dwerk.
        PERFORM bdc_field       USING 'MARA-MATKL'
                                      it_itab-matkl.
        PERFORM bdc_field       USING 'MVKE-SKTOF'
                                      'X'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MG03STEUER-TAXKM(02)'.
        PERFORM bdc_field       USING 'MG03STEUER-TAXKM(01)'
                                      '0'.
        PERFORM bdc_field       USING 'MG03STEUER-TAXKM(02)'
                                      '1'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4200'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
    *perform bdc_field       using 'MAKT-MAKTX'
                                 it_itab-MAKTX_040.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'MG03STEUER-TAXKM(05)'.
        PERFORM bdc_field       USING 'MG03STEUER-TAXKM(03)'
                                      '1'.
        PERFORM bdc_field       USING 'MG03STEUER-TAXKM(04)'
                                      '1'.
        PERFORM bdc_field       USING 'MG03STEUER-TAXKM(05)'
                                      '0'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARA-SPART'
                                      it_itab-spart.
        PERFORM bdc_field       USING 'MVKE-DWERK'
                                      it_itab-dwerk.
        PERFORM bdc_field       USING 'MARA-MATKL'
                                      it_itab-matkl.
        PERFORM bdc_field       USING 'MVKE-SKTOF'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MVKE-MTPOS'.
        PERFORM bdc_field       USING 'MVKE-VERSG'
                                      it_itab-versg.
        PERFORM bdc_field       USING 'MVKE-MTPOS'
                                      it_itab-mtpos.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARA-GEWEI'
                                      'KG'.
        PERFORM bdc_field       USING 'MARC-MTVFP'
                                      it_itab-mtvfp.
        PERFORM bdc_field       USING 'MARA-TRAGR'
                                      it_itab-tragr.
        PERFORM bdc_field       USING 'MARC-LADGR'
                                      it_itab-ladgr.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MARC-SERNP'.
        PERFORM bdc_field       USING 'MARC-SERNP'
                                      it_itab-sernp.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4040'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=LTEX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_dynpro      USING 'SAPLSTXX' '1100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RSTXT-TXLINE(02)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=TXVB'.
        PERFORM bdc_field       USING 'RSTXT-TXLINE(02)'
                                      'pcb assembly'.
        PERFORM bdc_dynpro      USING 'SAPLSTXX' '1100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RSTXT-TXLINE(02)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=TXBA'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4040'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SP09'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARC-EKGRP'
                                      it_itab-ekgrp.
        PERFORM bdc_field       USING 'MARA-MATKL'
                                      it_itab-matkl.
        PERFORM bdc_field       USING 'MARC-KORDB'
                                      'X'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MARA-MPROF'.
        PERFORM bdc_field       USING 'MARA-MPROF'
                                      it_itab-mprof.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARC-EKGRP'
                                      it_itab-ekgrp.
        PERFORM bdc_field       USING 'MARC-DISMM'
                                      it_itab-dismm.
        PERFORM bdc_field       USING 'MARC-DISPO'
                                      it_itab-dispo.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MARC-MABST'.
        PERFORM bdc_field       USING 'MARC-DISLS'
                                      it_itab-disls.
        PERFORM bdc_field       USING 'MARC-MABST'
                                      it_itab-mabst.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARC-BESKZ'
                                      it_itab-beskz.
        PERFORM bdc_field       USING 'MARC-SOBSL'
                                      it_itab-sobsl.
        PERFORM bdc_field       USING 'MARC-LGPRO'
                                      it_itab-lgpro.
        if it_itab-sernp = 'TJSL'.
        PERFORM bdc_field       USING 'MARC-RGEKZ'
        ELSE.
        PERFORM bdc_field       USING 'MARC-RGEKZ'
                                      '1'.
        ENDIF.
        PERFORM bdc_field       USING 'MARC-DZEIT'
                                      it_itab-dzeit.
        PERFORM bdc_field       USING 'MARC-PLIFZ'
                                      it_itab-plifz.
        PERFORM bdc_field       USING 'MARC-WEBAZ'
                                      it_itab-webaz.
        PERFORM bdc_field       USING 'MARC-FHORI'
                                      it_itab-fhori.
        PERFORM bdc_field       USING 'MARC-EISBE'
                                      it_itab-eisbe.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARC-PERKZ'
                                      'M'.
        PERFORM bdc_field       USING 'MARC-STRGR'
                                      it_itab-strgr.
        PERFORM bdc_field       USING 'MARC-VRMOD'
                                      it_itab-vrmod.
        PERFORM bdc_field       USING 'MARC-VINT1'
                                      it_itab-vint1.
        PERFORM bdc_field       USING 'MARC-VINT2'
                                      it_itab-vint2.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MARC-WZEIT'.
        PERFORM bdc_field       USING 'MARC-MTVFP'
                                      it_itab-mtvfp.
        PERFORM bdc_field       USING 'MARC-WZEIT'
                                      it_itab-wzeit.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MARC-SBDKZ'.
        PERFORM bdc_field       USING 'MARC-SBDKZ'
                                      it_itab-sbdkz.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
         PERFORM bdc_field       USING 'MARC-FEVOR'
                                       '001'.
        PERFORM bdc_field       USING 'MARC-LGPRO'
                                      it_itab-lgpro.
        PERFORM bdc_field       USING 'MARC-SERNP'
                                      it_itab-sernp.
        PERFORM bdc_field       USING 'MARC-DZEIT'
                                      it_itab-dzeit.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
    *perform bdc_field       using 'MARA-IPRKZ'
                                  it_itab-IPRKZ.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-GEWEI'
                                      'KG'.
        PERFORM bdc_field       USING 'MARC-SERNP'
                                      it_itab-sernp.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MARA-SPART'
                                      it_itab-spart.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MBEW-VPRSV'.
        PERFORM bdc_field       USING 'MBEW-BKLAS'
                                      it_itab-bklas.
    *perform bdc_field       using 'MBEW-EKLAS'
                                 it_itab-EKLAS.
        PERFORM bdc_field       USING 'MBEW-VPRSV'
                                      'v'.
        PERFORM bdc_field       USING 'MBEW-PEINH'
                                      '1'.
    perform bdc_field       using 'MBEW-VERPR'
                                  it_itab-VERPR.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MAKT-MAKTX'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'MARA-MEINS'
                                      it_itab-meins.
        PERFORM bdc_field       USING 'MBEW-EKALR'
                                      'X'.
        PERFORM bdc_field       USING 'MARC-AWSLS'
                                      '000001'.
        PERFORM bdc_field       USING 'MARC-LOSGR'
                                      '1'.
        PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'MAKT-MAKTX'
                                      it_itab-maktx.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'MBEW-ZPLPR'.
    *perform bdc_field       using 'MBEW-ZPLPR'
                                 '6000'.
        PERFORM bdc_field       USING 'MBEW-BKLAS'
                                      it_itab-bklas.
        PERFORM bdc_field       USING 'MBEW-VPRSV'
                                      'V'.
        PERFORM bdc_field       USING 'MBEW-PEINH'
                                       '1'.
        PERFORM bdc_dynpro      USING 'SAPLSPO1' '0300'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=YES'.
        CALL TRANSACTION 'MM01' USING bdcdata MODE 'A'
                                              UPDATE 'S'
                                             MESSAGES  INTO it_msgtab.
        CLEAR bdcdata[].
        CLEAR it_itab.
    PERFORM error.
      ENDLOOP.
    *&        Declaration of Error Handling                               *
       i
       it_msgtab1-msgv1 =  it_msgtab-msgv1.
       it_msgtab1-msgv2 =  it_msgtab-msgv2.
       it_msgtab1-msgv3 =  it_msgtab-msgv3.
       APPEND it_msgtab1.
    ENDLOOP.
    download error message to a file by using function module
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
       BIN_FILESIZE                    =
          filename                        = 'C:\Documents and Settings\sapthamm\Desktop\error.xls'
         filetype                        = 'ASC'
       APPEND                          = ' '
         write_field_separator           = 'X'
       HEADER                          = '00'
       TRUNC_TRAILING_BLANKS           = ' '
       WRITE_LF                        = 'X'
       COL_SELECT                      = ' '
       COL_SELECT_MASK                 = ' '
       DAT_MODE                        = ' '
       CONFIRM_OVERWRITE               = ' '
       NO_AUTH_CHECK                   = ' '
       CODEPAGE                        = ' '
       IGNORE_CERR                     = ABAP_TRUE
       REPLACEMENT                     = '#'
       WRITE_BOM                       = ' '
       TRUNC_TRAILING_BLANKS_EOL       = 'X'
       WK1_N_FORMAT                    = ' '
       WK1_N_SIZE                      = ' '
       WK1_T_FORMAT                    = ' '
       WK1_T_SIZE                      = ' '
       WRITE_EOL                       = ABAP_TRUE
    IMPORTING
       FILELENGTH                      =
        TABLES
          data_tab                        = it_mess
       FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  BDC_DYNPRO
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
    IF FVAL <> .
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDIF.
    ENDFORM.                    "BDC_FIELD
      form error.
      LOOP AT it_msgtab.
        IF it_msgtab-msgtyp = 'E'.
          SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
                                    AND   arbgb = it_msgtab-msgid
                                    AND   msgnr = it_msgtab-msgnr.
          IF sy-subrc = 0.
            l_mstring = t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
              REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
              REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
              REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
            ENDIF.
            CONDENSE l_mstring.
            it_mess-msgtyp = it_msgtab-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = it_msgtab-msgv1.
            APPEND it_mess.
           WRITE: / it_msgtab-msgtyp, l_mstring(150).
          ELSE.
           WRITE: / it_msgtab.
            it_mess-msgtyp = it_msgtab-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = it_msgtab-msgv1.
            APPEND it_mess.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    LOOP AT it_msgtab.
    Rewords some points.
    rgds,
    P.Naganjana reddy

  • How  to handle table controls in BDC

    Hi All,
    Can u please help me out in my BDC program which involves header data and the item data which is to be filled in a Table Control of a particular transaction .If anyone can send me already existing code it would be of great help..
    Thanks in Advance
    Kishore

    Hi Kishore
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    regards
    SAmeer

  • How to handle Table control  (pls read question)

    Hi All,
          I am writing code for CA21 Tcode , i am getting values into table control using P+ successfully but problem is i have to select 1st entry in table control and it will go to other screen and come back and select 2nd entry ....like that it will do until all entries in table control is over .
    Can any one pls send any code for this logic.
    Regards,
    Sudhakar Reddy.A

    Hi ,
    This should done dynamically with out user interaction .
    Regards,
    Sudhakar Reddy A

  • How can we handle table control parameter in lsmw

    hi guru,
    please tell me  how can we handle table control parameter in lsmw.
    thanks & regards
    subhasis.

    Hi,
    we  create table control program (module pool) this program use in LSMW,
    we mention the transaction code ,write ur  table control program name.
    This is use full for u
    Reguards,
    lakshmi

Maybe you are looking for

  • ABAP OO Tutorial

    Is there an on-line ABAP OO Tutorial? If yes, can someone point me to it? Thanks!

  • IPod doesn't restore ... An unknown error (1439)

    I am trying to restore a iPod via iTunes and am receiving this error message - iPod "iPod" could not be restored. An unknown error (1439) When I put the iPod into disk mode and try to access it via Windows Explorer I get this error - Please insert a

  • Heading for Report appearing more than once

    Hi All, I am running a report, the report contain more than 1 lakhs records, how can I avoid the heading of the report to repeat, because as of now heading information is repeating for 50 records. Please advice how to proceed on this issue. Thanks, M

  • Parameter mapping warnings

    I am using sp12, and am wondering if something has changed with parameter mapping, because I am using the same method I used when I was on sp9, but am now getting compilation warnings about my parameter mapping. I have an action with a string paramet

  • Metadata in Flash Galleries

    I like the way flickr show the title and description in thier flash slideshows. It would be great if lightroom added this ability. For each image to view title and description and then have another button in the gallery for metadata.