Table control in ME51 BDC

Dear abaper
Can u Pl let me to how to handle table control in ME51 BDC.
if u have program send it to [email protected]
rgds,
Simha

Regarding Table comtrols in BDC...
Normally all the screns with table controls will have buttons to add(Insert) a Row, Delete a Row etc..
After adding data to 1st Row (it will have index 1)... press that insert button so a new Row is inserted again at 1st row..so this will have index 1.
So in this way you can hard code the index to one.
The advantage is that if there are many rows then you will not have to keep a track of how many rows are inserted and when to press the page down button.
I am giving a small example.... Just copy paste this example and run it in all mode...
Run it in all mode so that you can see what I am trying to do...
Note : this is an relatively easy method.. not the only method to do...
report ZTEST_BDC
no standard page heading line-size 255.
include bdcrecx1.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_CURSOR'
'RSRD1-DDTYPE'.
perform bdc_field using 'BDC_OKCODE'
'=CHANGE_RADIO'.
perform bdc_field using 'RSRD1-TBMA'
perform bdc_field using 'RSRD1-TBMA_VAL'
'EKPO'.
perform bdc_field using 'RSRD1-DDTYPE'
'X'.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_CURSOR'
'RSRD1-DDTYPE_VAL'.
perform bdc_field using 'BDC_OKCODE'
'=ADD'.
perform bdc_field using 'RSRD1-TBMA_VAL'
'EKPO'.
perform bdc_field using 'RSRD1-DDTYPE'
'X'.
perform bdc_field using 'RSRD1-DDTYPE_VAL'
'ztest_Str'.
perform bdc_dynpro using 'SAPLSED1' '0100'.
perform bdc_field using 'BDC_CURSOR'
'D_100-STRU'.
perform bdc_field using 'BDC_OKCODE'
'=GOON'.
perform bdc_field using 'D_100-DTEL'
perform bdc_field using 'D_100-STRU'
'X'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DD02D-DDTEXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'DD03P_D-FIELDNAME(01)'.
perform bdc_field using 'DD03P_D-FIELDNAME(01)'
'bukrs'.
perform bdc_field using 'DD03P_D-ROLLNAME(01)'
'bukrs'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'=WB_LINE_INSERT'.
perform bdc_field using 'DD02D-DDTEXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'DD03P_D-FIELDNAME(01)'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DD02D-DDTEXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'DD03P_D-ROLLNAME(01)'.
perform bdc_field using 'DD03P_D-FIELDNAME(01)'
'kostl'.
perform bdc_field using 'DD03P_D-ROLLNAME(01)'
'kostl'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'=WB_LINE_INSERT'.
perform bdc_field using 'DD02D-DDTEXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'DD03P_D-FIELDNAME(01)'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DD02D-DDTEXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'DD03P_D-ROLLNAME(01)'.
perform bdc_field using 'DD03P_D-FIELDNAME(01)'
'wrbtr'.
perform bdc_field using 'DD03P_D-ROLLNAME(01)'
'wrbtr'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'=WB_SAVE'.
perform bdc_field using 'DD02D-DDTEXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'DD03P_D-ROLLNAME(01)'.
perform bdc_dynpro using 'SAPLSTRD' '0100'.
perform bdc_field using 'BDC_CURSOR'
'KO007-L_DEVCLASS'.
perform bdc_field using 'BDC_OKCODE'
'=TEMP'.
perform bdc_field using 'KO007-L_AUTHOR'
'VARUN'.
perform bdc_dynpro using 'SAPLSD41' '2100'.
perform bdc_field using 'BDC_OKCODE'
'/EWB_CANCEL'.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_OKCODE'
'/EABR'.
perform bdc_field using 'BDC_CURSOR'
'RSRD1-DDTYPE_VAL'.
perform bdc_transaction using 'SE11'.
perform close_group.
I hope this helps.....
Please mark points if it helps..

Similar Messages

  • Table control resolution in BDC

    Hi
    All
    I have one doubt regarding table control resolution in BDC .I know how to handle table control like if i have 5 rows in my TABLE CONTROL.I write the logic according to this rows and if more than 5 rows are there in my flat file i extend the atble control.But this logic will fail in some other system if more than 5 rows are there in that syatem. But I have read from  some where that we can use ctu_params structure and if we pass default size as 'x' then it automatically take cares in every sysem.But my doubt is while writing the code initially how can  we write ie i mean how many rows i have to mention initially in my logic .
    Please tell me the answer to this question if you have already face this type of problem.
    Thanks and regards
    Venkateswar

    Hi,
    The numeber of lines of table control for BDC depend on screen resolution, but It can't be managed by program.
    So the better solution is to create a bdc doesn't depend on resolution.
    It can do that using always the first two lines of table control.
    When you start the simulation, first record has to be placed in first line of tc and the second in second one.
    Before placing the third record, it needs to place the second record to the top and so the third record can be placed in the second line.
    Before placing the next record, it needs to place the third record to the top and so the fourth record can be placed in the second line and so.
    In this way your BDC'll use alwways the first two lines of tc and your program won't depend on resolution.
    The problem is the transaction you need to simulate by BDC has to have a scroll functionality to allow to place the last record was elaborated to the top of tc, so the second line of tc can always be used to place the new record.
    If there isn't this functionality, it's better to use a BAPI instead of BDC.
    check these...
    http://www.abaplearning.com/index.php?option=com_fireboard&Itemid=2&func=view&id=11&catid=8
    BDC - standard screen resolution required?
    https://forums.sdn.sap.com/click.jspa?searchID=739193&messageID=823953
    Regards,
    Omkaram.

  • Table Control in a BDC

    Hi,
    I have a BDC program ( Trasaction C202 - To assign operations to compoents in the material Tab) which has a table control.
    Affter i do a P+  the record which becomes the first record in the table control is not constant. It keeps changing with different sets of data.
    How can i handle this P+..?
    Regards,
    Sriram.

    Hi Srirama,
    You follow your coding in that way:
    LOOP AT i_itemdata INTO wa_itemdata. [IN I_ITEMDAT TABLE YOU WILL GET ITEM DETAILS]
        l_index = l_index + 1.
        IF l_index > 16 . [YOU CHECK DEFAULT NO OF TABLE CONTROL DURING RECORDING]
          CLEAR l_index.
          PERFORM bdc_dynpro USING 'SAPMM06E' '0320'.[YOU CHANGE PROGRAM NAME & SCREEN NO ]
          PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.
          l_index = 1.
          l_index = l_index + 1.
        ENDIF.
    WRITE DOWN BDC RECORDING
    CONCATENATE 'EKPO-EMATN(' l_index ')' INTO l_field.     [CHANGE FIELD NAME ACC YOUR REQUIREMENT]
        PERFORM bdc_field     USING 'BDC_CURSOR' l_field.
    ENDLOOP.
    Hope this can solve your problems.
    Regards,
    Tutun

  • TABLE CONTROL USED IN BDC

    MAY ANY ONE SUGGEST ME THE IDEA OF TABLE CONTROL USED IN BDC

    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    check the below link also u may find answers for all your q's
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
    <b>ex----</b>
    *HANDLING TABLE CONTROL IN BDC
    DATA : BEGIN OF IT_DUMMY OCCURS 0,
           DUMMY(100) TYPE C,
           END OF IT_DUMMY.
    DATA : BEGIN OF IT_XK01 OCCURS 0,
           LIFNR(10) TYPE C,
           BUKRS(4)  TYPE C,
           EKORG(4)  TYPE C,
           KTOKK(4)  TYPE C,
           NAME1(30) TYPE C,
           SORTL(10) TYPE C,
           LAND1(3)  TYPE C,
           SPRAS(2)  TYPE C,
           AKONT(6)  TYPE C,
           FDGRV(2)  TYPE C,
           WAERS(3)  TYPE C,
           END OF IT_XK01,
           BEGIN OF IT_BANK OCCURS 0,
           BANKS(3)  TYPE C,
           BANKL(10) TYPE C,
           BANKN(10) TYPE C,
           KOINH(30) TYPE C,
           LIFNR(10) TYPE C,
           END OF IT_BANK.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       FILENAME                      = 'C:VENDOR.TXT'
       FILETYPE                      = 'ASC'
    TABLES
       DATA_TAB                      = IT_DUMMY.
    LOOP AT IT_DUMMY.
      IF IT_DUMMY-DUMMY+0(2) = '11'.
        IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
        IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
        IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
        IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
        IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
        IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
        IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
        IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
        IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
        IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
        IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
        APPEND IT_XK01.
      ELSE.
        IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
        IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
        IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
        IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
        IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
        APPEND IT_BANK.
      ENDIF.
    ENDLOOP.
    LOOP AT IT_XK01.
    REFRESH IT_BDCDATA.
    perform bdc_dynpro      using 'SAPMF02K' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-REF_LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  IT_XK01-LIFNR.
    perform bdc_field       using 'RF02K-BUKRS'
                                  IT_XK01-BUKRS.
    perform bdc_field       using 'RF02K-EKORG'
                                  IT_XK01-EKORG.
    perform bdc_field       using 'RF02K-KTOKK'
                                  IT_XK01-KTOKK.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-TELX1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-NAME1'
                                  IT_XK01-NAME1.
    perform bdc_field       using 'LFA1-SORTL'
                                  IT_XK01-SORTL.
    perform bdc_field       using 'LFA1-LAND1'
                                  IT_XK01-LAND1.
    perform bdc_field       using 'LFA1-SPRAS'
                                  IT_XK01-SPRAS.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-KOINH(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    DATA : FNAM(20) TYPE C,
           IDX      TYPE C.
      MOVE 1 TO IDX.
    LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
      CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-BANKS.
      CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-BANKL.
      CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-BANKN.
      CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-KOINH.
      IDX = IDX + 1.
    ENDLOOP.
    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'.
    perform bdc_field       using 'LFB1-AKONT'
                                  IT_XK01-AKONT.
    perform bdc_field       using 'LFB1-FDGRV'
                                  IT_XK01-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'
                                  IT_XK01-WAERS.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'WYT3-PARVW(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    CALL TRANSACTION 'XK01' USING IT_BDCDATA
                            MODE  'A'
                           UPDATE 'S'
                         MESSAGES INTO IT_BDCMSGCOLL.
    ENDLOOP.
    FORM BDC_DYNPRO USING PROG SCR.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM = PROG.
      IT_BDCDATA-DYNPRO  = SCR.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-FNAM = FNAM.
      IT_BDCDATA-FVAL  = FVAL.
      APPEND IT_BDCDATA.
    ENDFORM.

  • Regarding table control handling in BDC

    Hi,
    how to Handle table control in BDC ,how to handle resolution of table control in BDC?
    Pls send urgently

    Hi,
    chk this excellent link.
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Regards
    Anver
    if helped pls mark points

  • Determine Lines in Table Control During BDC

    Hello
    I am trying to determine the number of lines shown on a screen for a table control during a BDC session.  I know the number of lines shown in the table can be different as users can have different screen size, fonts, etc.  My goal is to know how many lines are on the screen in the table so then I know how far I have to page down before I can select the appropriate line I want and then proceed with the BDC.  Any help is greatly appreciated.  Thanks.

    Eric
    If you use CALL TRANSACTION to run your BDC you can resolve your problem passing the parameters OPTIONS FROM <your structure> with these informations:
    <your structure>-DISMODE = 'N'. "BackGround
    <your structure>-UPDMODE = 'S'. "Synchronous
    <your structure>-DEFSIZE = 'X'. "This field indicate that screen will be in standard size. So the lines you have in transaction SHDB will be always the same.
    *The <structure> will be like CTU_PARAMS.
    CALL TRANSACTION <tcode> OPTION FROM <your structure>.
    Have some ways to count the lines during the execution of BDC, but I need to find in my programs.

  • In BDC we need to read screen value of table control

    Dear All,
    I was doing a feasibility analysis. One BDC is there where we will have to insert records in table control based on some records of 1st column of table control already populated. We are unable to find a way for reading table control. The BDC is generating batch input session. Can you please suggest on this?
    Best wishes,
    Atanu

    Hi Atanu,
    with BDC, the only possibility is to do as Klaus suggested: you must replicate the SAP's logic in your program, you must know in advance how SAP fills this field. This is a very well known drawback of BDC. You may use the SQL trace to help you to know which tables are read. Ask functional people to help you.
    You may also use SAP GUI scripting, that's another technology (slower I think, and it can only work in dialog). It allows to do different actions between 2 screens. You must program it using OLE, or using external software (VBA for example).
    Sandra

  • What is the use of table control in bdc is it same in module pool table con

    Hi,
    What is the use of table control in bdc is it same in module pool table control?
    regards
    eswar

    Hi,
    Table control means it contains as table and it will scroll in vertical and horizontal.
    In module pool by using screen we can create new table control.
    But  BDC table control means here we can populate the data into the table control.
    i.e.if you take VA01 for sales order creation in the belwo of VA01 screen there is table control for the filling of material details so here we will write the code to populate the data into the table control screen.
    Thanks and regards,
    shyla

  • How Scroll Table control in BDC (TCode =  SR11)

    Hi Gurus,
    I'm trying to insert lines in a table control via batch.
    Unfortunately I must be able to insert more lines than the table control can show (4 lines at the same time).
    I am not able to get the good OkCode trough SHDB.
    I tried to add a line via OkCode 'P++' but it didnt worked.
    See below a sample of my code.
       IF NOT P_L_DATA-SA01 IS INITIAL.
         CLEAR L_C_INDEX.
         L_C_INDEX = L_INDEX.
         CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = '01'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = P_L_DATA-SA01.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         L_INDEX = L_INDEX + 1.
       ENDIF.
       IF NOT P_L_DATA-SA04 IS INITIAL.
         CLEAR L_C_INDEX.
         L_C_INDEX = L_INDEX.
         CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = '04'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = P_L_DATA-SA04.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         L_INDEX = L_INDEX + 1.
       ENDIF.
       IF NOT P_L_DATA-SA05 IS INITIAL.
         CLEAR L_C_INDEX.
         L_C_INDEX = L_INDEX.
         CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = '05'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = P_L_DATA-SA05.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         L_INDEX = L_INDEX + 1.
       ENDIF.
       IF NOT P_L_DATA-SA06 IS INITIAL.
         CLEAR L_C_INDEX.
         L_C_INDEX = L_INDEX.
         CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = '06'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
         L_VALUE = P_L_DATA-SA06.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         L_INDEX = L_INDEX + 1.
       ENDIF.
       L_FIELD = 'BDC_OKCODE'.
       L_VALUE = '/00'.
       PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
       IF L_INDEX = 5.
         L_PROG = 'SAPLSZRC'.
         L_DYN  = '0200'.
         PERFORM BDC_DYNPRO USING  L_PROG L_DYN.
         L_FIELD = 'BDC_CURSOR'.
         L_VALUE = 'ADRCITYCCS-BUKRS(04)'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         L_FIELD = 'BDC_OKCODE'.
         L_VALUE = 'P++'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
       ENDIF.
         L_PROG = 'SAPLSZRC'.
         L_DYN  = '0200'.
         PERFORM BDC_DYNPRO USING  L_PROG L_DYN.
         L_FIELD = 'BDC_CURSOR'.
         L_VALUE = 'ADRCITYCCS-BUKRS(02)'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
    the 5th line
       IF NOT P_L_DATA-SA07 IS INITIAL.
         CLEAR L_C_INDEX.
         L_C_INDEX = L_INDEX.
         CONCATENATE 'ADRCITYCCS-SPARTE(' '02' ')' INTO L_FIELD.
         L_VALUE = '07'.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         CONCATENATE 'ADRCITYCCS-BUKRS(' '02' ')' INTO L_FIELD.
         L_VALUE = P_L_DATA-SA07.
         PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
         L_INDEX = L_INDEX + 1.
       ENDIF.
       L_FIELD = 'BDC_OKCODE'.
       L_VALUE = '/00'.
       PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
       L_PROG = 'SAPLSZRC'.
       L_DYN  = '0200'.
       PERFORM BDC_DYNPRO USING  L_PROG L_DYN.
       L_FIELD = 'BDC_OKCODE'.
       L_VALUE = 'SAVE'.
       PERFORM BDC_FIELD  USING L_FIELD    L_VALUE.
    Any idea will be welcomed.
    Please try to be clear and precide as I always wen trought several posts wich just not match.
    Thanks

    Hi Niyaz,
    Sorry but there is no button to add lines to this table control during the bdc recording.
    The only way to enter more lines than the default number is to scroll the table control.
    Unfortunatly this scroll action is not recorded (no OkCode) during recording.
    Any idea gurus ???
    Regards

  • How to determine fixed line of table control using BDC program ?

    Dear All,
    I create program using BDC that contains table control.
    Unfortunately the table control line of BDC program will depend on the resolution of our PC setting.
    Sometime I have 2 lines, sometime 3 lines (in different PC).
    How to determine fixed line of table control?
    So it will never be confusing me whether I have 2 or 3 lines.
    Thnx - Regards,
    (Taufik K.)

    Hi Taufik,
    Check the table CTU_PARAMS and field DEFSIZE for setting fixed line of a table control.
    CALL TRANSACTION 'VA01' USING it_bdcdata
    OPTIONS FROM OPT
    MESSAGES INTO it_mesg.
    opt of type ctu_params.
    WA_CTU_PARAMS-DISMODE = 'N'. "no screen mode
    WA_CTU_PARAMS-UPDMODE = 'S'. "synchronus update
    WA_CTU_PARAMS-NOBINPT = 'X'.
    WA_CTU_PARAMS-NOBIEND = 'X'.
    WA_CTU_PARAMS-DEFSIZE = 'X'. "Default size
    Default size will play good role in terms of resoultion. in one system in table control you can see 10rows, but in others system it will show 20 records. it depends on resoultion. but when you set the default size then it will take same (default screen size) in all the systems when you run BDC.
    Reward if helps.
    Regards,
    Senthil
    Message was edited by: senthil kumar

  • Dynamic extending of table control in bdc

    hi frnds
              I want an example of dynamic extension of table control i.e
    for example:In xk01 there is table control with bank details.
                    i have to upload upto 10 bank details of a record. I have searched in forum.I got the hint of 'p+' but i cant understand that.so please send me sample code
    Thanks
    Raghav

    Hai,
    Chech this sample code.
    Check the below link.
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    THis is example to upload the Bank details of the Vendor which has the TC.
    REPORT zprataptable2
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : BEGIN OF itab OCCURS 0,
            i1 TYPE i,
            lifnr LIKE   rf02k-lifnr,
            bukrs LIKE   rf02k-bukrs,
            ekorg LIKE   rf02k-ekorg,
            ktokk LIKE   rf02k-ktokk,
            anred LIKE lfa1-anred,
            name1 LIKE lfa1-name1,
            sortl LIKE lfa1-sortl,
            land1 LIKE lfa1-land1,
            akont LIKE lfb1-akont,
            fdgrv LIKE lfb1-fdgrv,
             waers LIKE lfm1-waers,
            END OF itab.
    DATA : BEGIN OF jtab OCCURS 0,
            j1 TYPE i,
            banks LIKE lfbk-banks,
            bankl LIKE lfbk-bankl,
            bankn LIKE lfbk-bankn,
             END OF jtab.
    DATA : cnt(4) TYPE n.
    DATA : fdt(20) TYPE c.
    DATA : c TYPE i.
    INCLUDE bdcrecx1.
    START-OF-SELECTION.
      CALL FUNCTION 'WS_UPLOAD'
        EXPORTING
          filename = 'C:\first1.txt'
          filetype = 'DAT'
        TABLES
          data_tab = itab.
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                      = 'C:\second.txt'
         filetype                      = 'DAT'
        TABLES
          data_tab                      = jtab.
      LOOP AT itab.
        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'
                                      itab-lifnr.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      itab-bukrs.
        PERFORM bdc_field       USING 'RF02K-EKORG'
                                       itab-ekorg.
        PERFORM bdc_field       USING 'RF02K-KTOKK'
                                       itab-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-ANRED'
                                      itab-anred.
        PERFORM bdc_field       USING 'LFA1-NAME1'
                                      itab-name1.
        PERFORM bdc_field       USING 'LFA1-SORTL'
                                      itab-sortl.
        PERFORM bdc_field       USING 'LFA1-LAND1'
                                      itab-land1.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0120'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-KUNNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBK-BANKN(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        cnt = 0.
        LOOP AT jtab WHERE j1 = itab-i1.
          cnt = cnt + 1.
          CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
          PERFORM bdc_field  USING fdt jtab-banks.
          CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
          PERFORM bdc_field USING fdt jtab-bankl.
          CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
          PERFORM bdc_field   USING fdt jtab-bankn.
          IF cnt = 5.
            cnt = 0.
            PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'LFBK-BANKS(01)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=P+'.
            PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'LFBK-BANKN(02)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=ENTR'.
          ENDIF.
        ENDLOOP.
        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'.
        PERFORM bdc_field       USING 'LFB1-AKONT'
                                      itab-akont.
        PERFORM bdc_field       USING 'LFB1-FDGRV'
                                      itab-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'
                                      itab-waers.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0320'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-LIFNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_dynpro      USING 'SAPLSPO1' '0300'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=YES'.
        PERFORM bdc_transaction USING 'XK01'.
      ENDLOOP.
      PERFORM close_group.
    Header file:
    1     63190      0001     0001     0001     mr     bal188     b     in     31000     a1     inr
    2     63191      0001     0001     0001     mr     bal189     b     in     31000     a1     inr
    TC file:
    1     in     sb     11000
    1     in     sb     12000
    1     in     sb     13000
    1     in     sb     14000
    1     in     sb     15000
    1     in     sb     16000
    1     in     sb     17000
    1     in     sb     18000
    1     in     sb     19000
    1     in     sb     20000
    1     in     sb     21000
    1     in     sb     22000
    2     in     sb     21000
    2     in     sb     22000
    REPORT zmm_pr_upload_mat
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_pr OCCURS 0,
    Header Screen
            sno(3),               " SNo
            bsart(004),           " PR Type
            epstp(001),           " Item Category
            knttp(001),           " Account Assignment
            eeind(010),           " Delivery Date
           lpein(001),          " Category of Del Date
            werks(004),           " Plant
            lgort(004),           " Storage Location
            ekgrp(003),           " Purchasing Group
            matkl(009),           " Material Group
            bednr(010),           " Tracking No
            afnam(012),            " Requisitioner
    Item Details
            matnr(018),           " Material No
            menge(017),           " Quantity
           badat(010),
           frgdt(010),
            preis(014),           " Valuation Price
           waers(005),           " Currency
           peinh(005),
           wepos(001),
           repos(001),
            sakto(010),           " GL Account
            kostl(010),           " Cost Center
           bnfpo(005),
          END OF i_pr.
    Internal Table for header Data
    DATA: BEGIN OF it_header OCCURS 0,
            sno(3),               " SNo
            bsart(004),           " PR Type
            epstp(001),           " Item Category
            knttp(001),           " Account Assignment
            eeind(010),           " Delivery Date
            werks(004),           " Plant
            lgort(004),           " Storage Location
            ekgrp(003),           " Purchasing Group
            matkl(009),           " Material Group
            bednr(010),           " Tracking No
            afnam(012),            " Requisitioner
          END OF it_header.
    Internal Table for Item Data
    DATA: BEGIN OF it_item OCCURS 0,
            sno(3),               " SNo
            matnr(018),           " Material No
            menge(017),           " Quantity
            preis(014),           " Valuation Price
            sakto(010),           " GL Account
            kostl(010),           " Cost Center
          END OF it_item.
    Data Variables & Constants
    CONSTANTS : c_x             VALUE 'X'.  " Flag
    DATA : v_l(2),                          " Counter
           v_rowno(5),                      " Row No
           v_2(2),                          " Counter
           v_rows LIKE sy-srows,            " Rows in TC
           v_field(45).                     " String
    Parameters
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
      PERFORM open_group.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_pr
        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.
      SORT i_pr BY sno.
      LOOP AT i_pr.
        MOVE-CORRESPONDING i_pr TO it_item.
        APPEND it_item.
        CLEAR it_item.
        AT END OF sno.
          READ TABLE i_pr INDEX sy-tabix.
          MOVE-CORRESPONDING i_pr TO it_header.
          APPEND it_header.
          CLEAR it_header.
        ENDAT.
      ENDLOOP.
      SORT it_header BY sno.
      SORT it_item BY sno.
      v_rows = sy-srows - 6.
    Upload the Data from Internal Table
      LOOP AT it_header.
    Header Data
        PERFORM bdc_dynpro      USING 'SAPMM06B' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'EBAN-BEDNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'EBAN-BSART'
                                      it_header-bsart.
        PERFORM bdc_field       USING 'RM06B-EPSTP'
                                      it_header-epstp.
        PERFORM bdc_field       USING 'EBAN-KNTTP'
                                      it_header-knttp.
        PERFORM bdc_field       USING 'RM06B-EEIND'
                                      it_header-eeind.
       PERFORM bdc_field       USING 'RM06B-LPEIN'
                                     it_header-lpein.
        PERFORM bdc_field       USING 'EBAN-WERKS'
                                      it_header-werks.
        PERFORM bdc_field       USING 'EBAN-LGORT'
                                      it_header-lgort.
        PERFORM bdc_field       USING 'EBAN-EKGRP'
                                      it_header-ekgrp.
        PERFORM bdc_field       USING 'EBAN-MATKL'
                                      it_header-matkl.
        PERFORM bdc_field       USING 'EBAN-BEDNR'
                                      it_header-bednr.
        PERFORM bdc_field       USING 'EBAN-AFNAM'
                                      it_header-afnam.
    Item Details
        v_l = 0.
    To add no. of rows
        v_2 = 0 .
    As the screen is showing 13 rows defaulted to 130
        v_rowno = 130 .
        LOOP AT it_item WHERE sno = it_header-sno.
          v_l = v_l + 1.
          IF v_l = 14 .
            IF v_2 = 12 .
              v_2 = 12 .
              v_l = 2 .
    From second time onwards it is displaying 12 rows only
              v_rowno = v_rowno + 120 .
              PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RM06B-BNFPO'.
              PERFORM bdc_field       USING 'RM06B-BNFPO'
                                            v_rowno.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                '/00'.
            ELSE.
    V_2 initialized to 12 for second screen purpose
              v_2 = 12 .
              v_l = 2 .
              PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RM06B-BNFPO'.
              PERFORM bdc_field       USING 'RM06B-BNFPO'
                                            v_rowno .
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                '/00'.
            ENDIF.
          ENDIF.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CLEAR v_field.
          CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
          PERFORM bdc_field   USING v_field it_item-matnr.
          CLEAR v_field.
          CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
          PERFORM bdc_field   USING v_field it_item-menge.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0102'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'EBAN-PREIS'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'EBAN-PREIS'
                                      it_item-preis.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0505'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'EBKN-SAKTO'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'EBKN-SAKTO'
                                      it_item-sakto.
    Cost Center
          PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'COBL-KOSTL'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'COBL-KOSTL'
                                        it_item-kostl.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RM06B-BNFPO'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
    Call The Transaction
        PERFORM bdc_transaction USING 'ME51'.
      ENDLOOP.
    Close the BDC Session
      PERFORM close_group.
    with regards.
    sowjanya.b.

  • Hi All,What is the concept of table control in bdc

    Hi All,What is the concept of table control in bdc .Can u please explain in brief.How we have to handle the logic for va01 transaction .
    Thanks&regards.
    Bharat

    Hi Kaushik Datta ,
                              I already know for me51 ,but i am getting the problem for va01 while populating the item details in to the table control. The code which i have generated is :
    please see the code and tell me where i should increment  the counter for populating the item details
    report ZBKVA01Y
           no standard page heading line-size 255.
    include bdcrecx1.
    parameters: dataset(132) lower case.
       DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
      If it is nessesary to change the data section use the rules:
      1.) Each definition of a field exists of two lines
      2.) The first line shows exactly the comment
          '* data element: ' followed with the data element
          which describes the field.
          If you don't have a data element use the
          comment without a data element name
      3.) The second line shows the fieldname of the
          structure, the fieldname must consist of
          a fieldname and optional the character '_' and
          three numbers and the field length in brackets
      4.) Each field must be type C.
    DATA: BEGIN OF IT_DUMMY OCCURS 0,
          TEXT(1000),
          END OF IT_DUMMY.
    Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of IT_HEADER OCCURS 0,
    data element: AUART
            AUART_001(004),
    data element: VKORG
            VKORG_002(004),
    data element: VTWEG
            VTWEG_003(002),
    data element: SPART
            SPART_004(002),
    data element: BSTKD
            BSTKD_005(035),
    data element: BSTDK
            BSTDK_006(010),
    data element: KUNAG
            KUNNR_007(010),
    data element: KUNWE
            KUNNR_008(010),
    data element: ABHOZ
            ABHOV_009(008),
    data element: ABHOZ
            ABHOB_010(008),
    data element: PRSDT
            PRSDT_011(010),
    END OF IT_HEADER.
    DATA: BEGIN OF IT_ITEM OCCURS 0,
    data element: MATNR
            MABNR_01_012(018),
    data element: KWMENG
            KWMENG_01_013(019),
          end of IT_ITEM.
    *DATA: DATE(10) TYPE C.
    *DATA: I_DATE TYPE SY-DATUM.
    *DATA: I_YEAR(4) TYPE C,
         I_MONTH(2) TYPE C,
         I_DAY(2) TYPE C .
    *DATA:
    End generated data section ***
    start-of-selection.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
      FILENAME                      = ' '
      FILETYPE                      = ' '
      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_DUMMY
    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.
    *perform open_dataset using dataset.
    LOOP AT IT_DUMMY.
    IF IT_DUMMY-TEXT+0(1) = 'H'.
    IT_HEADER-AUART_001(004) = IT_DUMMY-TEXT+1(4).
    data element: VKORG
    IT_HEADER-VKORG_002(004) = IT_DUMMY-TEXT+5(4).
    data element: VTWEG
    IT_HEADER-VTWEG_003(002) = IT_DUMMY-TEXT+9(2).
    data element: SPART
    IT_HEADER-SPART_004(002) = IT_DUMMY-TEXT+11(2).
    data element: BSTKD
    IT_HEADER-BSTKD_005(035) = IT_DUMMY-TEXT+13(35).
    data element: BSTDK
    IT_HEADER-BSTDK_006(010) = IT_DUMMY-TEXT+48(8).
    data element: KUNAG
    IT_HEADER-KUNNR_007(010) = IT_DUMMY-TEXT+56(10).
    data element: KUNWE
    IT_HEADER-KUNNR_008(010) = IT_DUMMY-TEXT+66(10).
    data element: ABHOZ
    IT_HEADER-ABHOV_009(008) = IT_DUMMY-TEXT+76(6).
    data element: ABHOZ
    IT_HEADER-ABHOB_010(008) = IT_DUMMY-TEXT+82(6).
    data element: PRSDT
    IT_HEADER-PRSDT_011(010) = IT_DUMMY-TEXT+88(8).
    APPEND IT_HEADER.
    CLEAR  IT_HEADER.
    ELSEIF IT_DUMMY-TEXT+0(1) = 'I'.
    data element: MATNR
    IT_ITEM-MABNR_01_012(018) = IT_DUMMY-TEXT+1(18).
    data element: KWMENG
    IT_ITEM-KWMENG_01_013(019) = IT_DUMMY-TEXT+19(15).
    APPEND IT_ITEM.
    CLEAR  IT_ITEM.
    ENDIF.
    ENDLOOP.
    perform open_group.
    LOOP AT IT_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'
                                  IT_HEADER-AUART_001.
    perform bdc_field       using 'VBAK-VKORG'
                                  IT_HEADER-VKORG_002.
    perform bdc_field       using 'VBAK-VTWEG'
                                  IT_HEADER-VTWEG_003.
    perform bdc_field       using 'VBAK-SPART'
                                  IT_HEADER-SPART_004.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  IT_HEADER-BSTKD_005.
    perform bdc_field       using 'VBKD-BSTDK'
                                  IT_HEADER-BSTDK_006.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  IT_HEADER-KUNNR_007.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  IT_HEADER-KUNNR_008.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '04/05'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CHOO'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'VBAK-ABHOV'
                                  IT_HEADER-ABHOV_009.
    perform bdc_field       using 'VBAK-ABHOB'
                                  IT_HEADER-ABHOB_010.
    perform bdc_field       using 'VBKD-PRSDT'
                                  IT_HEADER-PRSDT_011.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-KWMENG(01)'.
    perform bdc_field       using 'RV45A-MABNR(01)'
                                  IT_ITEM-MABNR_01_012.
    perform bdc_field       using 'RV45A-KWMENG(01)'
                                  IT_ITEM-KWMENG_01_013.
    perform bdc_transaction using 'VA01'.
    *enddo.
    ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    Thanks&regards.
    Bharat .

  • BDC table control using Excel sheet upload

    Hi All,
    I am working BDC table control.I want to upload the From excel sheet.I am using the FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload the the data into my internal table.The data is populating in the internal table.
    Now i have problem tat how to populate this excel sheet data to the Bdc table control.
    Can nybody help me out.\[removed by moderator\]
    Thanks,
    Swapna.
    Edited by: Jan Stallkamp on Jul 25, 2008 10:57 AM

    after fetching data from EXCEL sheet, each column data (in excel sheet) will be uploaded to individual record into your internal table along with row number and column number, loop through that internal table and collect all your excel data into record format.pls refer the below code.
    data:
         i_excel    type alsmex_tabline occurs 0 with header line,
         l_row      type i value 1.
    data:
         begin of x_data occurs 0,
                kunnr     like RF02L-KUNNR,
                klimk(17) type c,
                CTLPC     like knkk-CTLPC,
          end  of x_data,
          begin of x_data1 occurs 0,
                data(106),
          end   of x_data1.
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       exporting
         filename                      = p_fname
         i_begin_col                   = 1
         i_begin_row                   = 1
         i_end_col                     = no.of columns in your excel file
         i_end_row                     = no.of rows in your file
       tables
         intern                        = i_excel.
    if sy-subrc = 0.
       loop at i_excel.
         if l_row <> i_excel-row.
            append x_data.
            clear x_data.
         endif.
         case i_excel-col.
            when 1.
              x_data-kunnr = i_excel-value.
            when 2.
              x_data-klimk = i_excel-value.
            when 3.
              x_data-CTLPC = i_excel-value.
         endcase.
         l_row = i_excel-row.
         clear i_excel.
         at last.
            append x_data.
         endat.
       endloop.
    endif.
    then loop through the internal table X_DATA, pass the data to your table control like.
    tbl_control-field1(1) = x_data-field1.
    tbl_control-field2(1) = x_data-field2.
    tbl_control-fieldn(1) = x_data-fieldn.
    Regards,
    Sreeram.

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

Maybe you are looking for

  • Creative Cloud is not downloading Adobe Muse?

    I have paid for Adobe Muse, but Creative Cloud is generating a download error.  It says "contact customer support," which seems to consist of endless links.  I have browsed and tried all suggested solutions and gotten nowhere.  Help?

  • Time-out issue Always on SQL 2012 Cluster

    Currently I'm working on a large deployment of a SharePoint 2013 environment (stretched farm over 2 DC's). We are using a SQL 2012 alwayson multisubnet cluster (each DC has 1 SQL node). During the installation of SharePoint we encountered several con

  • Itunes doen't want to play wma file already on computer

    I just got a mac and copies a folder from my PC to my mac, some of it contains MP3's which itunes recognises places in library and plays, but the wma file it won't do anything with, it wont import, cant drag and drop into itunes and wont play it, onl

  • InDesign CC 2014 version release roadmap

    We are running InDesign CC 2014, is there a version release roadmap including timings?

  • Keeps telling me to update firmware

    I'm running v7.3.2 but I keep getting update firmware warning via the Airport Utility. When I let it check for which update to install I don't see any version more recent than what I already have. What's the deal with this? On a separate topic ... I'