Skip to Content
author's profile photo Former Member
Former Member

BDC Table Control

Hi

Q> What is table control in BDC.

Q> Difference Between BDC and BAPI.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 17, 2008 at 07:34 AM

    Sujit,

    hope you are new to SDN.welcome to sdn.

    here i want let you know that before throwing such kind of thread please try to search by giving appropiate term in search box am sure you will get thousand of answer.

    hope you would not be hurt but its a fact!

    Amit.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 17, 2008 at 07:37 AM

    hi,

    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm

    this below program is for tcode me21n(purchase order).it will contain a table control.

    check this code and flat file.

    report ZBH_PURORDER no standard page heading line-size 255.

    PARAMETERS:P_FILE LIKE IBIPPARMS-PATH.

    DATA FILENAME TYPE STRING.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    program_name = sy-cprog

    dynpro_number = sy-dynnr

    IMPORTING

    file_name = P_FILE.

    START-OF-SELECTION.

    FILENAME = P_FILE.

    DATA:BEGIN OF XTAB OCCURS 0,

    TYP,

    DES(255) TYPE C,

    END OF XTAB.

    DATA:BEGIN OF ITAB OCCURS 0,

    SUPERFIELD LIKE MEPO_TOPLINE-SUPERFIELD,

    EKORG LIKE MEPO1222-EKORG,

    EKGRP LIKE MEPO1222-EKGRP,

    BUKRS LIKE MEPO1222-BUKRS,

    END OF ITAB.

    DATA:BEGIN OF JTAB OCCURS 0,

    N(4) TYPE C,

    EMATN LIKE MEPO1211-EMATN,

    MENGE(13) TYPE C,

    NETPR(13) TYPE C,

    NAME1 LIKE MEPO1211-NAME1,

    END OF JTAB.

    DATA:BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

    DATA:DELIMITER VALUE '*'.

    DATA A TYPE I.

    DATA M(4) TYPE N.

    DATA L_FNAM(30) TYPE C.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = FILENAME

    FILETYPE = 'ASC'

    TABLES

    DATA_TAB = XTAB.

    LOOP AT XTAB.

    IF XTAB-TYP = 'H'.

    SPLIT XTAB-DES AT DELIMITER INTO ITAB-SUPERFIELD ITAB-EKORG ITAB-EKGRP

    ITAB-BUKRS.

    JTAB-N = JTAB-N + 1.

    APPEND ITAB.

    ELSEIF XTAB-TYP = 'I'.

    SPLIT XTAB-DES AT DELIMITER INTO JTAB-EMATN JTAB-MENGE JTAB-NETPR

    JTAB-NAME1.

    APPEND JTAB.

    ENDIF.

    ENDLOOP.

    CALL FUNCTION 'BDC_OPEN_GROUP'

    EXPORTING

    CLIENT = SY-MANDT

    GROUP = 'PORDER'

    KEEP = 'X'

    USER = SY-UNAME.

    LOOP AT ITAB.

    A = SY-TABIX.

    REFRESH BDCTAB.

    perform bdc_dynpro using 'SAPLMEGUI' '0014'.

    perform bdc_field using 'BDC_CURSOR'

    'MEPO_TOPLINE-SUPERFIELD'.

    perform bdc_field using 'MEPO_TOPLINE-BSART'

    'NB'.

    perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'

    ITAB-SUPERFIELD.

    perform bdc_field using 'MEPO_TOPLINE-BEDAT'

    '09.02.2007'.

    perform bdc_field using 'DYN_6000-LIST'

    ' 1'.

    perform bdc_field using 'BDC_OKCODE'

    '=MEV4000BUTTON'.

    perform bdc_dynpro using 'SAPLMEGUI' '0014'.

    perform bdc_field using 'MEPO_TOPLINE-BSART'

    'NB'.

    perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'

    ITAB-SUPERFIELD.

    perform bdc_field using 'MEPO_TOPLINE-BEDAT'

    '09.02.2007'.

    perform bdc_field using 'BDC_CURSOR'

    'MEPO1222-EKORG'.

    perform bdc_field using 'MEPO1222-EKORG'

    ITAB-EKORG.

    perform bdc_field using 'MEPO1222-EKGRP'

    ITAB-EKGRP.

    perform bdc_field using 'MEPO1222-BUKRS'

    ITAB-BUKRS.

    perform bdc_field using 'DYN_6000-LIST'

    ' 1'.

    perform bdc_field using 'BDC_OKCODE'

    '=MEV4001BUTTON'.

    perform bdc_dynpro using 'SAPLMEGUI' '0014'.

    perform bdc_field using 'MEPO_TOPLINE-BSART'

    'NB'.

    perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'

    ITAB-SUPERFIELD.

    perform bdc_field using 'MEPO_TOPLINE-BEDAT'

    '09.02.2007'.

    perform bdc_field using 'MEPO1222-EKORG'

    ITAB-EKORG.

    perform bdc_field using 'MEPO1222-EKGRP'

    ITAB-EKGRP.

    perform bdc_field using 'MEPO1222-BUKRS'

    ITAB-BUKRS.

    M = 1.

    LOOP AT JTAB.

    IF JTAB-N = A.

    WRITE:/ JTAB.

    CONCATENATE 'MEPO1211-EMATN(' M ')' INTO L_FNAM.

    perform bdc_field using 'BDC_CURSOR'

    L_FNAM.

    perform bdc_field using L_FNAM

    JTAB-EMATN.

    CONCATENATE 'MEPO1211-MENGE(' M ')' INTO L_FNAM.

    perform bdc_field using L_FNAM

    JTAB-MENGE.

    CONCATENATE 'MEPO1211-NETPR(' M ')' INTO L_FNAM.

    perform bdc_field using L_FNAM

    JTAB-NETPR.

    CONCATENATE 'MEPO1211-NAME1(' M ')' INTO L_FNAM.

    perform bdc_field using L_FNAM

    JTAB-NAME1.

    M = M + 1.

    ENDIF.

    ENDLOOP.

    perform bdc_field using 'DYN_6000-LIST'

    ' 1'.

    perform bdc_field using 'BDC_OKCODE'

    '/00'.

    perform bdc_dynpro using 'SAPLMEGUI' '0014'.

    perform bdc_field using 'MEPO_TOPLINE-BSART'

    'NB'.

    perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'

    ITAB-SUPERFIELD.

    perform bdc_field using 'MEPO_TOPLINE-BEDAT'

    '09.02.2007'.

    perform bdc_field using 'MEPO1222-EKORG'

    ITAB-EKORG.

    perform bdc_field using 'MEPO1222-EKGRP'

    ITAB-EKGRP.

    perform bdc_field using 'MEPO1222-BUKRS'

    ITAB-BUKRS.

    perform bdc_field using 'DYN_6000-LIST'

    ' 1'.

    perform bdc_field using 'BDC_CURSOR'

    'MEPO1319-MATKL'.

    perform bdc_field using 'MEPO1319-SPINF'

    'X'.

    perform bdc_field using 'BDC_OKCODE'

    '=MESAVE'.

    CALL FUNCTION 'BDC_INSERT'

    EXPORTING

    TCODE = 'ME21N'

    TABLES

    DYNPROTAB = BDCTAB.

    ENDLOOP.

    CALL FUNCTION 'BDC_CLOSE_GROUP'.

    FORM BDC_DYNPRO USING PROGRAM DYNPRO.

    CLEAR BDCTAB.

    BDCTAB-PROGRAM = PROGRAM.

    BDCTAB-DYNPRO = DYNPRO.

    BDCTAB-DYNBEGIN = 'X'.

    APPEND BDCTAB.

    ENDFORM.

    FORM BDC_FIELD USING FNAM FVAL.

    CLEAR BDCTAB.

    BDCTAB-FNAM = FNAM.

    BDCTAB-FVAL = FVAL.

    APPEND BDCTAB.

    ENDFORM.

    FLAT FILE:

    H1171611000001*1000

    ICPU116000*1000

    ILEY BOARD1010000*1000

    IMOUSE66000*1000

    H1171711000001*1000

    ICPU580000*1000

    H1171701000001*1000

    IMOUSE33000*1000

    ILEY BOARD1010000*1000

    Look at the below links for example programs

    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm

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

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

    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm

    Handling of table control in BDC check these links:

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

    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm

    http://arthur_ong.tripod.com/xab023.htm

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

    reward if hlpful.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.