Handling table control in lsmw

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

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

Similar Messages

  • How to handle table control in lsmw recording method

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

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

  • Handling Table controls in LSMW

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

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

  • How to handle table controls using LSMW

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

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

  • How can we handle table control parameter in lsmw

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

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

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

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

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

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

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

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

  • Table control in lsmw tcode me01

    MY requirement is develope an object in lsmw recording method for tcode me01 .
    this tcode has a table control .
    how to handle the table control and what will be the logic for that .
    where to write the logic?
    the source file is one only .
    please help me out.urgently

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

  • How can we handle table control in BDC?

    Hi,
    How can we handle table control in BDC?
    regards
    eswar

    hi,
    check this example:
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    ex:
    *& Report  ZSR_BDC_TBCTRL
    REPORT  ZSR_BDC_TBCTRL
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES : RF02K,LFA1,LFBK.
    DATA : BEGIN OF IT_VEN OCCURS 0,
          LIFNR LIKE RF02K-LIFNR,
          KTOKK LIKE RF02K-KTOKK,
          NAME1 LIKE LFA1-NAME1,
          SORTL LIKE LFA1-SORTL,
          LAND1 LIKE LFA1-LAND1,
          SPRAS LIKE LFA1-SPRAS,
          BANKS(6) TYPE C,
          BANKL(17) TYPE C,
          BANKN(19) TYPE C,
          END OF IT_VEN.
    DATA : BEGIN OF BANKS OCCURS 0,
           BANKS LIKE LFBK-BANKS,
           END OF BANKS,
           BEGIN OF BANKL OCCURS 0,
           BANKL LIKE LFBK-BANKL,
           END OF BANKL,
           BEGIN OF BANKN OCCURS 0,
           BANKN LIKE LFBK-BANKN,
           END OF BANKN.
    DATA : FLD(20) TYPE C,
           CNT(2) TYPE N.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    INCLUDE BDCRECX1.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'Z:\sr.TXT'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = IT_VEN
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM OPEN_GROUP.
    LOOP AT IT_VEN.
        REFRESH BDCDATA.
        REFRESH : BANKS,BANKL,BANKN..
        SPLIT IT_VEN-BANKS AT ',' INTO TABLE BANKS.
        SPLIT IT_VEN-BANKL AT ',' INTO TABLE BANKL.
        SPLIT IT_VEN-BANKN AT ',' INTO TABLE BANKN.
    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'
                                  IT_VEN-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  IT_VEN-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  IT_VEN-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  IT_VEN-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  IT_VEN-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  IT_VEN-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-BANKN(02)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    *perform bdc_field       using 'LFBK-BANKS(01)'
                                 'DE'.
    *perform bdc_field       using 'LFBK-BANKS(02)'
                                 'DE'.
    *perform bdc_field       using 'LFBK-BANKL(01)'
                                 '10020030'.
    *perform bdc_field       using 'LFBK-BANKL(02)'
                                 '67270003'.
    *perform bdc_field       using 'LFBK-BANKN(01)'
                                 '12345'.
    *perform bdc_field       using 'LFBK-BANKN(02)'
                                 '66666'.
    MOVE 1 TO CNT.
        LOOP AT BANKS.
          CONCATENATE 'LFBK-BANKS(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKS-BANKS.
          CNT = CNT + 1.
        ENDLOOP.
        MOVE 1 TO CNT.
        LOOP AT BANKL.
          CONCATENATE 'LFBK-BANKL(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKL-BANKL.
          CNT = CNT + 1.
        ENDLOOP.
        MOVE 1 TO CNT.
        LOOP AT BANKN.
          CONCATENATE 'LFBK-BANKN(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKN-BANKN.
          CNT = CNT + 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 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    PERFORM BDC_TRANSACTION USING 'XK01'.
    ENDLOOP.
    PERFORM CLOSE_GROUP.

  • How to handle Table control in BDC

    How to handle Table control in BDC

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

  • How to use table control in LSMW

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

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

  • Table Control in LSMW

    Hi All,
    I have used XK01 tcode to upload vendor details as well bank details.Bank details are in Table Control. Here in this table control the number of visible rows are 5. And I did LSMW, recording for one vendor with 5 bank details.
    I have taken all the fields in a single row in the file in the sequence of Recording, and the entries in file are uploading into database as well. But while I am giving more than 5 enttries in file, I am unable to update.
    Can any one of you navigate me how to upload the entries in file at table control in LSMW.
    Best Regards,
    Ubedulla.

    Hi !!
    In step 1 of lsmw.
    choose IDOC.
    Message TYPE CREMAS: BASIC TYPE CREMAS04.
    The rest of steps are mostly the same.
    The differency is thaht jou have orginaly prepared structure of data.
    in step 2. do like this
    Source Structures
            SVENDOR                  VENDORS HEADER
                SBANKS                   Banks
    (hierarchical structure - SVENDOR to main data SBANKS for banks deatil)
    in step 3.
    maintain source fields for both structures.
    the assign structure in step 4.
    for examle like this
         E1LFA1M Segment for general vendor data                               <<<< SVENDOR VENDORS HEADER
                 Select Target Structure E1LFA1M .
             E1LFA1A Segment for standard vendor data -  enhancement
             E1LFA1H Vendor Master Basic Data: Texts, Header
                 E1LFA1L Vendor Master Basic Data: Text Lines
             E1LFB1M Segment for company code data for vendors SMD                <<<< SVENDOR VENDORS HEADER
                 E1LFBWM Segment for withholding tax types in vendor master
                 E1LFB5M Reminder data for vendor SMD
                 E1LFB1H Vendor Master Company Code: Texts, Header
                     E1LFB1L Vendor Master Company Code: Text Lines
             E1LFM1M Segment for purchasing organization data vendor SMD          <<<< SVENDOR VENDORS HEADER
                 E1LFM2M Segment purchasing data for vendor MMS SMD
                 E1WYT3M Segment for addresses of vendors MMS SMD
                 E1LFM1H Vendor Master Purchasing Organization: Texts, Header
                     E1LFM1L Vendor Master Purchasing Organization: Text Line
             E1LFBKM Segment for bank details of vendor SMD                       <<<< SBANKS  Banks
             E1LFASM Segment for EU tax numbers vendors
             E1WYT1M Segment for vendor sub-range MMS SMD
                 E1WYTTM Segment for vendor sub-range identification SMD
    (sorry for formating but it was taken from my ready lesm project).
    The rest is mostly the  same like with butch input.
    In assign files it would be better to creat 2 files - one with vendor master data one with banks.
    what you have to do more is to create lsmw ports (LSMW -> settings -> IFOC inbound processing)
    br, JACEK

  • Hi All, Pls send me the recording for va01 by handling table control

    Hi All, Pls send me the recording for va01 by handling table control with 3 or more materials. Pls send me a flat file and code ASAP.
    Thanks&regards.
    Bharat

    Here is a example of similar kind ..plz go through this doc..it will be help hul 4 u
    How to deal with table control / step loop in BDC?
    Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen,
    our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
    Now, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
    Demo ABAP code has two purposes:
    1. how to determine number of visible lines and how to calculte page number; (the 'calpage' routine has been modify to meet general purpose usage)
    2. using field symbol in BDC program, please pay special attention to the difference in Static
    ASSIGN and Dynamic ASSIGN.
    Now I begin to describe the step to implement my method:
    (I use transaction 'ME21', screen 121 for sample, the method using is Call Transation Using..)
    Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop.
    Then have a look at steploop itselp, one entry of it will occupy two lines.
    (Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
    Now we have : FixedLine = 9
    LoopLine = 2(for table control, LoopLine is always equal to 1)
    Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
    Now we have: FirstLine = 0
    or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
    Step3: write a subroutine calcalculating number of pages
    (here, the name of actual parameter is the same as formal parameter)
    global data: FixedLine type i, " number of fixed line on a certain screen
    LoopLine type i, " the number of lines occupied by one steploop item
    FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new
    " scrolling screen is empty, otherwise is 1
    Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
    pageno type i, " you need to scroll screen how many times.
    line type i, " number of lines appears on the screen.
    index(2) type N, " the screen index for certain item
    begin type i, " from parameter of loop
    end type i. " to parameter of loop
    *in code sample, the DataTable-linindex stands for the table index number of this line
    form calpage using FixedLine type i (see step 1)
    LoopLine type i (see step 1)
    FirstLine type i (see step 2)
    DataLine type i ( this is the item number you will enter in transaction)
    changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
    changing line type i.(visible lines one the screen)
    data: midd type i,
    vline type i, "visible lines
    if DataLine eq 0.
    Message eXXX.
    endif.
    vline = ( sy-srows - FixedLine ) div LoopLine.
    *for table control, you should compare vline with maximum line of
    *table control, then take the small one that is min(vline, maximum)
    *here only illustrate step loop
    if FirstLine eq 0.
    pageno = DataLine div vline.
    if pageno eq 0.
    pageno = pageno + 1.
    endif.
    elseif FirstLine eq 1.
    pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
    midd = ( DataLine - 1 ) mod ( vline - 1).
    if midd = 0 and DataLine gt 1.
    pageno = pageno - 1.
    endif.
    endif.
    line = vline.
    endform.
    Step4 write a subroutine to calculate the line index for each item.
    form calindex using Line type i (visible lines on the screen)
    FirstLine type i(see step 2)
    LineIndex type i(item index)
    changing Index type n. (index on the screen)
    if FirstLine = 0.
    index = LineIndex mod Line.
    if index = '00'.
    index = Line.
    endif.
    elseif FirstLine = 1.
    index = LineIndex mod ( Line - 1 ).
    if ( index between 1 and 0 ) and LineIndex gt 1.
    index = index + Line - 1.
    endif.
    if Line = 2.
    index = index + Line - 1.
    endif.
    endif.
    endform.
    Step5 write a subroutine to calculate the loop range.
    form calrange using Line type i ( visible lines on the screen)
    DataLine type i
    FirstLine type i
    loopindex like sy-index
    changing begin type i
    end type i.
    If FirstLine = 0.
    if loopindex = 1.
    begin = 1.
    if DataLine <= Line.
    end = DataLine.
    else.
    end = Line.
    endif.
    elseif loopindex gt 1.
    begin = Line * ( loopindex - 1 ) + 1.
    end = Line * loopindex.
    if end gt DataLine.
    end = DataLine.
    endif.
    endif.
    elseif FirstLine = 1.
    if loopindex = 1.
    begin = 1.
    if DataLine <= Line.
    end = DataLine.
    else.
    end = Line.
    endif.
    elseif loop index gt 1.
    begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
    end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
    if end gt DataLine.
    end = DataLine.
    endif.
    endif.
    endif.
    endform.
    Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index
    form creat_bdc.
    field-symbols: <material>, <quan>, <indicator>.
    data: name1(14) value 'EKPO-EMATN(XX)',
    name2(14) value 'EKPO-MENGE(XX)',
    name3(15) value 'RM06E-SELKZ(XX)'.
    assign: name1 to <material>,
    name2 to <quan>,
    name3 to <indicator>.
    do pageno times.
    if sy-index gt 1
    *insert scroll page ok_code"
    endif.
    perform calrange using Line DataLine FirstLine sy-index
    changing begin end.
    loop at DataTable from begin to end.
    perform calindex using Line FirstLine DataTable-LineIndex changing Index.
    name1+11(2) = Index.
    name2+11(2) = Index.
    name3+12(2) = Index.
    perform bdcfield using <material> DataTable-matnr.
    perform bdcfield using <quan> DataTable-menge.
    perform bdcfield using <indicator> DataTable-indicator.
    endloop.
    enddo.
    Sample code
    Following is a sample code of handling table control in BDC.
    REPORT Y730_BDC5 .
    *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.
    Reward if helpful

  • How to handle Table controls with XD01 in BDC

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

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

  • Handling Table controls in BDC

    Hi Team,
                   While handling Table controls in BDC(Call transaction), how do u ensure your code works Globally.
    As screen Resolution may vary from system to system and
    While building the logic we cannot fix the number of rows
    is 14 or XXX.
    After certain number of rows the logic should be done in such a way it should be  scrolled down.
    Please let me know Regarding this.
    Thanks.
    BestRegards,
    S.Anilkumar

    HI Anil,
    You can use "CTU_PARAMS-DEFSIZE = 'X'" for fixing the screen resolution
    You shuld use OK_CODE for scrolling is "P+".
    if you need scroll after some records just use SY-TABIX .

Maybe you are looking for

  • Select option in smartforms

    Hiiiii, I am new to smartforms and i need to show range of dates in smartforms. I am trying in driver prog. n i got correct data in final internal table but cant fetch correct data using fm in driver prog. Thank You...

  • SPML Webservice OIM 11g - Urgent

    Hi All, I would need to create/update/delete user in OIM using SPML Webservice. Please help in providing the steps to do this. I have gone through the OIM11g documentation, but haven't got any steps to deploy webservice. It would be great if someone

  • Urgent problems, please!!!!!!

    i'm running now my program and i dont know what to do. in the first time i tried to connect to the database an error occured. it's happen just when i'm running the program by tomcat server and in the jbuilder is ok. the error is: type Exception repor

  • Crystal 2011 linking table with a String and a Number

    Hello, I am able to retrieve the data I want with the following  SQL Query in SQL: If I try to create it in Crystal 2011 APPLRUNN is a string and CNTBTCH is a number. Is there a way I can link these two fields if one is a string and the other is a nu

  • Firefox crashed recently, and when i reopened it my norton password manager was gone (the toolbar is still there though). What do i do???

    My computer had not been working very well, and firefox was being a pain and crashed. When i finally got it to open again, my password manager was gone. I still have the norton toolbar with search and the safe site thing. Please help!!! I need my pas