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.

Similar Messages

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

  • Table control resolution

    Hi all,
    how to clear the problem of table control resolution.
    bye.

    Hi Pavan,
    Check this code :-
    data: lws_cnt type char2,
    lws_field type char15.
    LOOP AT i_invoicing_plan INTO wa_invoicing_plan.
    lws_cnt = sy-tabix.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = lws_cnt
    IMPORTING
    output = lws_cnt .
    CONCATENATE 'FPLT-AFDAT(' lws_cnt ')' INTO lws_field.
    CONCATENATE wa_invoicing_plan-date+6(2)
    wa_invoicing_plan-date+4(2)
    wa_invoicing_plan-date+0(4) INTO lws_date
    SEPARATED BY '.'.
    PERFORM bdc_field USING lws_field lws_date.
    CONCATENATE 'FPLT-FPROZ(' lws_cnt ')' INTO lws_field.
    lws_perct = wa_invoicing_plan-percentage.
    CONDENSE lws_perct.
    PERFORM bdc_field USING lws_field lws_perct.
    ENDLOOP.
    While calling the transaction give like this:
    DATA: opt TYPE ctu_params.
    opt-dismode = 'N'.
    opt-updmode = 'A'.
    opt-defsize = 'X'.
    CALL TRANSACTION tcode
    USING i_bdcdata OPTIONS FROM opt MESSAGES INTO i_messages.
    LOOP AT i_messages.
    ENDLOOP.
    <b>Reward points if helpful</b>
    Thanks,
    Sachin

  • 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

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

  • 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

  • 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

  • Screen Resolution in table control bdc

    Hi ,
    Im working on bdc table control using call transaction method for vk11 and mek1.While uploading data for vk11 for the first time it is taking all the records of the input file and if i do the same for the second time by changing the amount value it is taking only 24 records .(i.e if the input file contains only 24 records it wil update else if it has 25 records or more it not updating even single record and it is showing error " No batch input data for screen sapmv13A ..)...this issue is with the production server......................whereas in development and quality servers there is no problem....................
    what migh be the problem and how to solve it?
    can anyone plz help me on this

    if its a problem in screen resolution then while recording through SHDB mark the check box default size
    or
    to make the bdc execute in standard screen size check the code below
    data x_ctuparams type ctu_params.
    x_ctuparams-defsize = 'X'. " This would freeze the resolution in any system
    x_ctuparams-dismode = 'N'.
    x_ctuparams-updmode = 'S'.
    call transaction <TCODE> using it_bdcdata options from x_ctuparams.
    So whatever is the screen size of the users front-end, the BDC will execute in standard screen size

  • How to create screen resolution in bdc table control

    hi gurus
    can anyone suggest me
    how to create screen resolution in bdc table control
    thanks&regards
    mark.

    Hi ,
    Using CTU_PARAMS table for screen resolution .
    For this sample code.
    This is for Transation  FB60.
    report ZZFB60
           no standard page heading line-size 255.
    tables t100.
    PARAMETERS : p_file1  like  rlgrap-filename,
                 p_doctyp like  RF05A-BUSCS,
                 p_invdat like  INVFO-BLDAT,
                 p_posdat like  INVFO-BUDAT.
    CONSTANTS  :  C_TRANS_FB60(4) VALUE 'FB60'.
    *Parameter string for runtime of CALL TRANSACTION
    data : l_option type ctu_params,
           l_subrc type sysubrc.
    DATA :  l_mstring(150).
    data      accnt type char17.
    data       : day   type char2,
                 month type char2,
                 year  type char4,
                 date1 type char10,
                 date2 type char10.
    data      :  cnt(2) TYPE n,
                 cnt1 type i,
                 fld(25) TYPE c.
    data : begin of excel occurs 0,
            fieldname(255) type c,
           end of excel.
    DATA:BEGIN OF it_mess OCCURS 0,
             msgtyp(5),
             lms(200),
              msgv1(50),
         END OF it_mess.
    data: begin of t_record occurs 0,
             BUKRS(004),
            ACCNT(017),
            XBLNR(016),
            WRBTR1(016),
            WAERS(005),
            SECCO(004) ,
            SGTXT(050),
            HKONT(010),
            WRBTR2(017),
            MWSKZ(002),
            GSBER(004),
            KOSTL(010),
         end of t_record.
    *Internal Table for Header Data
    DATA :  BEGIN OF t_head OCCURS 0,
            BUKRS(004),      "Company Code
            ACCNT(017),      "Account or Vendor
            XBLNR(016),      "Reference
            WRBTR1(017),     "Amount in document currency
            WAERS(005),      "Currency
            SECCO(004),      "Section Code
            SGTXT(050),      "Text
            END OF t_head.
    *Internal table for Item Data
    DATA :  BEGIN OF t_item OCCURS 0,
            ACCNT(017),      "Account
            HKONT(010),     "GL Account
            WRBTR2(017),    "Line item Amount in document currency
            MWSKZ(002),     "Tax Code
            GSBER(004),     " Business Area
            KOSTL(010),     "Cost centre
            END OF t_item.
    DATA: IT_BDCDATA      LIKE  BDCDATA OCCURS 0 WITH HEADER LINE,
          IT_BDC_MESSAGES LIKE  BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    *include bdcrecx1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      PERFORM  file_selection.
      PERFORM  data_upload.
      PERFORM  table_control.
    start-of-selection.
    l_option-defsize = 'X'.
    l_option-dismode = 'A'.
    l_option-updmode = 'S'.
    day = p_invdat+6(2).
    month = p_invdat+4(2).
    year =  p_invdat+0(4).
    concatenate day month year into date1 SEPARATED BY '.'.
    day = p_posdat+6(2).
    month = p_posdat+4(2).
    year =  p_posdat+0(4).
    concatenate day month year into date2 SEPARATED BY '.'.
    *perform open_group.
    loop at t_head.
    CLEAR    IT_BDCDATA.
    REFRESH  IT_BDCDATA.
    perform bdc_dynpro      using   'SAPLACHD'         '1000'.
    perform bdc_field       using   'BDC_OKCODE'        '=ENTR'.
    perform bdc_field       using   'BKPF-BUKRS'        t_head-bukrs.
    perform bdc_dynpro      using   'SAPMF05A'          '1100'.
    perform bdc_field       using   'BDC_OKCODE'        '/00'.
    perform bdc_field       using   'RF05A-BUSCS'       p_doctyp.
    perform bdc_field       using   'INVFO-ACCNT'       t_head-accnt.
    perform bdc_field       using   'INVFO-BLDAT'       date1.
    perform bdc_field       using   'INVFO-BUDAT'       date2.
    perform bdc_field       using   'INVFO-XBLNR'       t_head-xblnr.
    perform bdc_field       using   'INVFO-WRBTR'       t_head-wrbtr1.
    perform bdc_field       using   'INVFO-WAERS'       t_head-waers.
    perform bdc_field       using   'INVFO-SECCO'       t_head-secco.
    perform bdc_field       using   'INVFO-SGTXT'       t_head-sgtxt.
    cnt = 1.
    cnt1 = 1.
    loop at t_item where accnt = t_head-accnt.
    *if cnt > 4.
    *cnt = 4.
    *endif.
    if cnt1 gt 1.
    CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
    perform bdc_field      using   fld                   'X'.
    perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    perform bdc_field       using 'BDC_OKCODE'        '=0005'.
    endif.
    perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    perform bdc_field       using   'BDC_OKCODE'        '/00'.
    CONCATENATE 'ACGL_ITEM-HKONT(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-hkont.
    CONCATENATE 'ACGL_ITEM-WRBTR(' cnt ')' INTO fld.
    perform bdc_field  using       fld                t_item-wrbtr2.
    CONCATENATE 'ACGL_ITEM-MWSKZ(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-mwskz.
    CONCATENATE 'ACGL_ITEM-GSBER(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-gsber.
    CONCATENATE 'ACGL_ITEM-KOSTL(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-kostl.
    perform bdc_field      using  'BDC_CURSOR'  fld.
    *CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
    *perform bdc_field      using   fld                   'X'.
    cnt1 = cnt1 + 1.
    *cnt = cnt + 1.
    *if cnt > 1.
    *perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    *perform bdc_field       using 'BDC_OKCODE'        '=0005'.
    **perform bdc_field       using 'BDC_OKCODE'        '=0006'.
    *endif.
    endloop.
    perform bdc_dynpro      using 'SAPMF05A' '1100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BS'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    *perform bdc_transaction using 'FB60'.
    CALL TRANSACTION C_TRANS_FB60 USING IT_BDCDATA  options from l_option
                                 MESSAGES INTO IT_BDC_MESSAGES.
    perform error.
    perform errordownload.
    endloop.
    *perform close_group.
    *Form  data_upload
    FORM data_upload .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       FILENAME              =  p_file1
       FILETYPE              = 'DAT'
      TABLES
        DATA_TAB             =  t_record.
    ENDFORM.                    " data_upload
    *Form  file_selection
    FORM file_selection .
    CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  =  syst-cprog
          dynpro_number =  syst-dynnr
          field_name    = 'p_file1'
        IMPORTING
          file_name     =  p_file1.
    ENDFORM.                    " file_selection
    Form  BDC_DYNPRO
    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.
    *Form  BDC_FIELD
    FORM  bdc_field using fnam fval.
      CLEAR  IT_BDCDATA.
      IT_BDCDATA-FNAM = FNAM.
      IT_BDCDATA-FVAL = FVAL.
      APPEND  IT_BDCDATA.
    ENDFORM.
    Table Control
    FORM table_control .
      LOOP AT t_record.
        ON CHANGE OF t_record-accnt.
          MOVE-CORRESPONDING t_record TO t_head.
          APPEND t_head.
        ENDON.
      loop at t_head.
             t_item-accnt   =  t_head-accnt.
             t_item-hkont   =  t_record-hkont.
             t_item-wrbtr2  =  t_record-wrbtr2 .
             t_item-mwskz   =  t_record-mwskz .
             t_item-gsber   =  t_record-gsber .
             t_item-kostl   =  t_record-kostl.
        APPEND t_item.
    endloop.
         If t_record-level = 'H'.
             t_head-bukrs   =  t_record-text1.
             t_head-accnt   =  t_record-text2.
             t_head-xblnr   =  t_record-text3.
             t_head-wrbtr1  =  t_record-text4.
             t_head-waers   =  t_record-text5.
             t_head-secco   =  t_record-text6.
             t_head-sgtxt   =  t_record-text7.
          APPEND t_head.
         else.
            t_item-accnt   =  t_head-accnt.
            t_item-hkont   =  t_record-text1.
            t_item-wrbtr2  =  t_record-text2.
            t_item-mwskz   =  t_record-text3.
            t_item-gsber   =  t_record-text4.
            t_item-kostl   =  t_record-text5.
         APPEND t_item.
         endif.
      ENDLOOP.
    ENDFORM.
    FORM error .
      LOOP AT IT_BDC_MESSAGES.
        IF IT_BDC_MESSAGES-msgtyp = 'E'.
       SELECT single  * FROM t100  WHERE
                                    sprsl = it_BDC_MESSAGES-msgspra
                                    AND   arbgb = IT_BDC_MESSAGES-msgid
                                    AND   msgnr = IT_BDC_MESSAGES-msgnr.
          IF sy-subrc = 0.
            l_mstring = t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
              REPLACE '&2' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
              REPLACE '&3' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
              REPLACE '&4' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
            ENDIF.
            CONDENSE l_mstring.
            it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
            APPEND it_mess.
          ELSE.
            it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
            APPEND it_mess.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    form errordownload.
    *down the internal table to excel file.
    call function 'EXCEL_OLE_STANDARD_DAT'
               EXPORTING
                    file_name                 = 'c:/Error.xls'
               TABLES
                    data_tab                  = it_mess
                    fieldnames                = excel
               EXCEPTIONS
                    file_not_exist            = 1
                    filename_expected         = 2
                    communication_error       = 3
                    ole_object_method_error   = 4
                    ole_object_property_error = 5
                    invalid_filename          = 6
                    invalid_pivot_fields      = 7
                    download_problem          = 8
                    others                    = 9.
    endform.
    Reward if useful
    Regards,
    Narasimha
    Edited by: narasimha marella on May 13, 2008 12:12 PM

  • BDC: Table Control Screen Resolution

    Hi Abapers,
    1.In BDC while handling table control , how to handle screen resolution , that means in some systems i can see 5 item entries , in some systems i can see 10 item entries how to handle this , can u  send the Code relating this.
    With Regards
    Bhaskar Rao.M

    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 two
    BDC - standard screen resolution required?
    https://forums.sdn.sap.com/click.jspa?searchID=739193&messageID=823953
    reward points if found helpful

  • How to get the Number of lines displayed in  table control in bdc

    Hi,
    when we write a  bdc for a standard transaction, if we encounter a table control, we fill the values for each record like field(01), and the second record field(02) .......and so on..
    if only 3 records are displayed in the screen and if we have 5 records to be filled in the table control, how to write the logic for that?
    how to track of how many lines are getting displayed in the table control .. again it depends on the screen resolution i think..
    useful answers will be rewarded
    shekhar

    Hi,
    Here is the solution code for this :-
    data for controlling paging on screen 0102 
    DATA: W_MAXLINES(2) TYPE N, 
    W_NEXT_LINE(3) TYPE N, 
    W_PAGE(1), "y = page forward, n otherwise 
    W_SCRLEN(2) TYPE I, 
    W_SCRLINE(2) TYPE I. 
    DATA: BEGIN OF W_HDR. 
    INCLUDE STRUCTURE D020S. 
    DATA: END OF W_HDR. 
    DATA: BEGIN OF W_FLD OCCURS 100. 
    INCLUDE STRUCTURE D021S. 
    DATA: END OF W_FLD. 
    DATA: BEGIN OF W_LOG OCCURS 20. 
    INCLUDE STRUCTURE D022S. 
    DATA: END OF W_LOG. 
    DATA: BEGIN OF W_MC OCCURS 20. 
    INCLUDE STRUCTURE D023S. 
    DATA: END OF W_MC. 
    DATA: BEGIN OF W_DYNPRONAME, 
    PROGRAM(8) VALUE 'SAPMM60X', 
    DYNPRO(4) VALUE '0102', 
    END OF W_DYNPRONAME. 
    FORM GET_MAX_LINES. 
    set w_maxlines to the number of var-loop occurrences on the screen so 
    that we know when to page forward on screen 0102 
    also initialise w_next_line to zero for GET_NEXT_LINE 
    this subroutine caters for all cases - including screens without loops 
    CLEAR: W_MAXLINES, 
    W_NEXT_LINE. 
    IMPORT DYNPRO W_HDR 
    W_FLD 
    W_LOG 
    W_MC 
    ID W_DYNPRONAME. 
    LOOP AT W_FLD WHERE LTYP EQ 'L'. 
    MOVE W_FLD-LINE TO W_SCRLINE. "first var-loop line 
    MOVE W_FLD-LBLK TO W_SCRLEN. "depth of loop block 
    EXIT. 
    ENDLOOP. 
    IF SY-SUBRC EQ 0 
    AND W_SCRLEN NE 0. 
    sy-srows = total no of lines on screen 
    w_scrline = actual first line of loop so that 
    w_scrline - 1 = number of heading lines (before loop) 
    4 = no of lines at top of screen - command line, pushbuttons, 2 ulines 
    3 = no of lines after loop - uline & Page count 
    w_scrlen = no of lines in loop block 
    w_maxlines = sy-srows - ( wscrline - 1 ) - 4 - 3 
    and then 1 less but not sure why! 
    W_MAXLINES = SY-SROWS - W_SCRLINE - 1 - 4 - 3. 
    W_MAXLINES = W_MAXLINES - 1.
    W_MAXLINES = W_MAXLINES DIV W_SCRLEN. 
    ELSE. 
    MOVE 99 TO W_MAXLINES. "this required if no screen loop 
    ENDIF. 
    ENDFORM. 
    FORM GET_NEXT_LINE. 
    set w_page if page forward is required 
    W_NEXT_LINE = W_NEXT_LINE + 1. 
    IF W_NEXT_LINE GT W_MAXLINES. 
    W_NEXT_LINE = 1. 
    W_PAGE = 'Y'. 
    ELSE. 
    W_PAGE = 'N'. 
    ENDIF. 
    ENDFORM. 
    Hope it helps.
    reward if helpful.
    Regards,
    Sipra

Maybe you are looking for

  • Email each page of a report to different address

    I need to run a hyperion report in PDF and send the output to 100 different emails, now the catch is that each page of the report will have a different store and I need to email a particular page of the report to the appropriate store email. I can ju

  • IPhone 6 Common Defects?

    Hello, last week I bought the iPhone 6 128GB Space Gray. Since then I have been through 3 of them, soon to be 4. Are defects common among these devices? I bought it directly from the Verizon store. Here's the kind of defects I mean. #1- Dark corner,

  • Can i design UI part in flex with an existing JSP page

    hello my name is sandeep, i have one JSP page can i implement it in FLEX 2.0 , as i am very much interested to design the UI part in FLEX 2.0 , can i make it, the JSP page is a login page it contains username and password textfields and onclicking th

  • Games for my ipod nano

    I was wondering if you could put more games on the ipod nano than what came with it originally. I got the game bejewled for my ipod nano but i have no idea how to put it on my ipod ot if it was just a waste of money to get it...

  • Change default address fields

    Hello, Is it possible to change the address default fields (account, contact addresses)? For example, user would like to add "States" when the country "India" is selected. Thanks, Sab