Bdc for table control in abap -hr

Dear all,
how can we read if infotype is having table control 0008
how to record 0008 infotype please suggest me
Regards.
bose,

HI,
Have two internal table, one containing the primary data and other with multiple data regarding to particular primary data with one column as key field. In the BDC code, write LOOP Statement with the second internal table. No other modification is required for it.
Hope you understand it.

Similar Messages

  • How to give line items in flatfile while doing BDC for Table control

    Hi all,
    I am writing BDC for Multiple line items and Transaction  is : FSE5N.
    How do i give the data in the flat file. I mean how do we give the multiple line items in flat file , i.e for second line item again we have to header data or not ?
    ex:
    1015;ALL;demo;kr;INR;01;0001;3000172;100
    1015;ALL;demo;kr;INR;01;0001;3000172;200
    for first lineitem  : 3000172;100
    for 2nd line item : 3000172; 200.
    header data : 1015;ALL;demo;kr;INR;01;0001.
    Thanks in advance
    krupali

    Hii ,
    u can give in the same format as u have done in the example.
    A       B    C     D  E    F   G        H          I
    1015;ALL;demo;kr;INR;01;0001;3000172;100
    1015;ALL;demo;kr;INR;01;0001;3000172;200
    and while writing the loop u can give
    loop at it_head.
    loop at it_head where a = it_head-A and b = it_head-B ..........upto G = it_head-G.
      endloop.
    endloop.
    check this
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Neeraj

  • Problem in bdc for table control for line items

    Hi experts,
    I am runnig a bdc for ME52.
    i am just entering PR number, in the second screen i have got all the line items. I need to select these line item 10 and double click or hit enter, it takes me to screen 3, there im just checking a checkbox and saving.
    Again i need to select the line item 20 and double click or hit enter. again the same process.
    Again repeat for all the line items.
    But my problem is it is updating everytime for only line item  10. for line item 20 and others it say "no chnge in the data".
    I am pasting my code here. please check and revert me back .plz.
    DATA: w_output LIKE LINE OF i_output.
      REFRESH I_ITAB[].
      SELECT * FROM EBAN
               INTO TABLE i_itab
               WHERE banfn in s_banfn AND
                     bsart in s_bsart AND
                     bstyp in s_bstyp AND
                     matnr in s_matnr AND
                     werks in s_werks AND
                     lfdat in s_lfdat AND
                     pstyp in s_pstyp AND
                     knttp in s_knttp AND
                     estkz in s_estkz AND
                     loekz eq ' '.
      IF sy-subrc = 0.
        CLEAR: w_itab,
                 i_poitab[].
        SORT i_itab by banfn.
        LOOP AT i_itab INTO w_itab where menge GT eban-bsmng.
          IF p_close = 'X' AND p_rep = 'X'.
            IF w_itab-ebakz = 'X'.
              w_itab-ebakz = ' '.
              APPEND w_itab to i_poitab.
            ENDIF.
          ELSEIF p_open = 'X' AND p_rep = 'X'.
            IF w_itab-ebakz = ' '.
              w_itab-ebakz = 'X'.
              APPEND w_itab to i_poitab.
            ENDIF.
          ELSEIF p_close = 'X' AND p_repw = 'X'.
            IF w_itab-ebakz = ' '.
              APPEND w_itab to i_poitab.
            ENDIF.
          ELSEIF p_open = 'X' AND p_repw = 'X'.
            IF w_itab-ebakz = 'X'.
              APPEND w_itab to i_poitab.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
      LOOP AT i_poitab into w_output.
        APPEND w_output to i_output.
       PERFORM CALL_BDC.
      endloop.
    IF p_rep = 'X'.
    PERFORM CALL_BDC.
    ENDIF.
    ENDFORM.                    " GET_DATA
    *&      Form  CALL_BDC
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_BDC.
    DATA: seltab(5) TYPE N,
          seltab1(2) TYPE N,
          tempvar(30) TYPE N,
          cnt TYPE N.
    LOOP AT i_output.
    clear: seltab,
           seltab1.
    seltab = i_output-bnfpo.
    seltab1 = seltab+2(2).
    perform bdc_dynpro      using 'SAPMM06B' '0105'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EBAN-BANFN'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'EBAN-BANFN'
                                  i_output-banfn.
    perform bdc_dynpro      using 'SAPMM06B' '0106'.
    clear tempvar.
    *cnt = 1.
    concatenate 'EBAN-BNFPO(' seltab1 ')' into tempvar.
    perform bdc_field       using 'BDC_CURSOR'
                                 'EBAN-BNFPO(seltab1)'.
                                    tempvar.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=DETA'.
    perform bdc_field       using 'RM06B-BNFPO'
                                  i_output-bnfpo.
    perform bdc_field       using 'RM06B-TCSELFLAG(seltab1)'
                                 'X'.
    perform bdc_dynpro      using 'SAPMM06B' '0102'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EBAN-EBAKZ'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'EBAN-EBAKZ'
                                  i_output-ebakz.
    CALL TRANSACTION 'ME52' USING bdc_data MODE 'A'
                                   MESSAGES INTO i_bdcmsg.
        COMMIT WORK AND WAIT.
    ENDLOOP.
    ENDFORM.                    " CALL_BDC
    *&      Form  bdc_dynpro
          text
         -->P_0686   text
         -->P_0687   text
    FORM bdc_dynpro USING    program dynpro.
    CLEAR bdc_data.
      bdc_data-program  = program.
      bdc_data-dynpro   = dynpro.
      bdc_data-dynbegin = 'X'.
      APPEND bdc_data.
      CLEAR bdc_data.
    ENDFORM.   
    thanks,
    N

    Looks like table control logic is wrong -- do compare with below program...
    only table contril area
    REPORT ZPadmam
    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.
    Thanks
    Seshu

  • BDC coding for TABLE controls

    how to write BDC coding based on Table Controls...

    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
    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 with the help of Poonam on sapfans.com developement forum, 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 in steploop/Table Control
    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.
    Cheers
    VJ

  • BDC Recording for Table Control

    dears,
    I am using BDC for posting payments by TCode FP05.
    after processing two payment items i am getting the following error.
    "Runtime error SAPSQL_ARRAY_INSERT_DUPREC has occurred"
    but when i repeat the same recording in foreground it processes the payment sucessfully.
    wht could be wrong with the recording?
    how to record for table control?
    Bye

    Hi Syed,
    I could find few notes for the array insert duplicate runtime error.
    136433
    191544
    You can find may in OSS.
    Cheers
    Vinod

  • How to create bdc with table control

    hi all.
    please some body tell me how to create bdc with table control
    or suggest any www with screen shots
    thanks in advance ,
    aparna

    Hi AParna,
    Its very Simple.
    ALl you have to do is set up a counter based on the number of lines in the tabke. when the counter reaches the number of lines in the table hit the next page button which is at the top of every screen in SAP.
    Please refer to the following BDC program I had developed using Table control,
    this is for ME01 transaction.
      LOOP AT T_EORD_HED.
        SELECT SINGLE * FROM MARA WHERE MATNR = T_EORD_HED-MATNR.
        IF SY-SUBRC = 0.
          PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0200'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EORD-MATNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'EORD-MATNR'
                                        T_EORD_HED-MATNR.       "'58335'.
          PERFORM BDC_FIELD       USING 'EORD-WERKS'
                                        T_EORD_HED-WERKS.       "'0253'.
          L_COUNT = 1.
          LOOP AT T_EORD WHERE MATNR = T_EORD_HED-MATNR
                           AND WERKS = T_EORD_HED-WERKS.
            SELECT SINGLE * FROM LFA1 WHERE LIFNR = T_EORD-LIFNR.
            IF SY-SUBRC = 0.
    * Look into the if condition below
              IF L_COUNT = 010.
                L_COUNT = 1.
                PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0205'.
                PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'EORD-MATNR'.
                PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=NS'.
                L_COUNT = L_COUNT + 1.
              ENDIF.
              PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0205'.
              PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                            'EORD-AUTET(01)'.
              PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                            '/00'.
              CONCATENATE 'EORD-VDATU' '(' L_COUNT ')' INTO OPR_FIELD.
              WRITE SY-DATUM TO T_EORD-VDATU.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-VDATU.
              CONCATENATE 'EORD-BDATU' '(' L_COUNT ')' INTO OPR_FIELD.
              WRITE T_EORD-BDATU TO V_BDATU.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            V_BDATU.
              CONCATENATE 'EORD-LIFNR' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-LIFNR.
              CONCATENATE 'EORD-EKORG' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            '0001'.
              CONCATENATE 'EORD-RESWK' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-RESWK.
              WRITE T_EORD-MEINS TO V_MEINS.
              CONCATENATE 'EORD-MEINS' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            V_MEINS.
    *          CONCATENATE 'EORD-EBELN' '(' L_COUNT ')' INTO OPR_FIELD.
    *          PERFORM BDC_FIELD       USING 'OPR_FIELD'
    *                                        T_EORD-EBELN.
              CONCATENATE 'EORD-EBELP' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-EBELP.
              IF T_EORD-FLIFN NE SPACE OR T_EORD-FRESW NE SPACE OR
                 T_EORD-FEBEL NE SPACE.
                CONCATENATE 'RM06W-FESKZ' '(' L_COUNT ')' INTO OPR1_FIELD.
                PERFORM BDC_FIELD       USING OPR1_FIELD
                                              'X'.
              ENDIF.
              IF T_EORD-NOTKZ <> ''.
                CONCATENATE 'EORD-NOTKZ' '(' L_COUNT ')' INTO OPR_FIELD.
                PERFORM BDC_FIELD       USING OPR_FIELD
                                              'X'.
              ENDIF.
              CONCATENATE 'EORD-AUTET' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-AUTET.
              L_COUNT = L_COUNT + 1.
            ENDIF.
          ENDLOOP.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EORD-MATNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=BU'.
          CALL TRANSACTION 'ME01' USING I_BDCDATA
                        MODE UP_MODE
    *                     optIONS  FROM l_opt
                        MESSAGES INTO I_BDCMSGCOLL.
          PERFORM FORMAT_OUTPUT.
        ENDIF.
      ENDLOOP.

  • Function module for table control

    Hi experts,
    I am creating the BDC program, In that I need to select the particular item from the table control say for example item 0010 or 0020 based on the input file and need to process from there.
    Is there any function module to select the particular item by passing item no say 0010 or 0020.
    Thanks in advance
    sai

    Hi
    I suppose there is no function module for table control.
    below solution might be useful to you.
    1) Do BDC recording for the table control with each condition you would like to incorporate in your program.
    2) copy the code of Table Control recording in your program and place the code in Loop of internal table.
    3) based on the condition  call the respective BDC recording of the table control
    4) By the above steps  you can manage the table control based on the condition.
    Regards
    Santosh Kumaar.M

  • WIZARD FOR TABLE CONTROL DOCUMENTS REQUIRED

    hI ALL,
    cAN ANYBODY SEND ME DOCUMENTS RELATED TO TABLE CONTROL USING WIZARD.i NEED TO CREATE A TABLE IN WHICH I WOULD FILL THE TABLE WITH AND WHEN I SAVE IT I NEED THE ZTABLE TO BE UPDATED .
    cAN ANYBODY SEND ME SOME DOCUMENTS REGARDING HOW TO USE WIZARD.
    mY EMAIL ID :
    [email protected]
    tHANKS IN ADVANCE

    Hi Kajol,
    I was searching online and came with this short steps from this link:
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/dialogprogramcall-dump-725857#
    (1) drag the table control (with wizard) on the full screen. (2) press continue. (3) enter the name of your table control (any name you want) (4) press continue (5) select 'internal table' (6) enter name of your internal table (the one that contains data to be displayed for table control) (7) press continue (8) fields of your itab will be displayed then, select the fields you want to be seen on your table control (9) continue pressing 'continue' until complete button is shown (10) press 'complete'.
    I tried giving database table name instead of internal table at point number (6).
    Also, did you go thru this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/150d67da1011d3963800a0c94260a5/content.htm
    Hope this will be of some help to you.
    Regards,
    Vivek

  • Screen Variant for table control in FB60

    Hi ,
    I need to create variant to show Quantity and Base Unit of Measure columns in the table control which is available at the first screen of FB60 . I tried using the option screen variant - > create variant. i couldnt see the options of colmuns properties for table control on click that small icon available at the right conner. Pls guide.
    Thanks

    In transaction SHD0 you need to create a new variant.
    After that you will be taken into FB60.
    Press Enter as if you are trying to process vendor invoice. It will take you to a screen "Screen values    1100 Program  SAPMF05A"
    There you will have 3 columns Output only, Invisible and Mandatory.
    Select as you want.
    Just try out carefully, you will be able to get the desired result.
    It is very difficult to guide you in details.
    Please let me know if you face any problems.
    Rgds,
    Harmees

  • IB51, IB52 : Page up & Page Down option for table control disabled

    Hi experts,
    IB51, IB52 Page up & Page Down option for table control is disabled.
    We want to use these options in the table control while recording .
    Can any one tell us?
    Regards,
    Lakshmi

    Hi,
    You can refer to Note 379208 .
    The same is applicable in CRM too.
    Thanks ,
    Jomy

  • Unable get the table scroll for table control

    hai
    i unable get horizontal scrolling for table control when the output is dislayed
    help me
    very urgent

    Hi,
    check out the sample program it might help you
    See the following simple ex
    *& Module pool ZTEST_TBLCTRL
    PROGRAM ZTEST_TBLCTRL.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TC1'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES: ZFG_SRNO, ZFIH0004.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TC1'
    *TYPES: BEGIN OF T_TC1,
    ZSRNO LIKE ZFG_SRNO-ZSRNO,
    SCRNAME LIKE ZFIH0004-SCRNAME,
    END OF T_TC1.
    *TYPES: BEGIN OF T_TC1.
    STRUCTURE ZFG_SRNO.
    END OF T_TC1.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TC1'
    *DATA: G_TC1_ITAB TYPE T_TC1 OCCURS 0 WITH HEADER LINE,
    G_TC1_WA TYPE T_TC1. "work area
    DATA: G_TC1_ITAB LIKE ZFG_SRNO OCCURS 0 WITH HEADER LINE,
    G_TC1_WA LIKE G_TC1_ITAB. "work area
    DATA: G_TC1_COPIED. "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TC1' ITSELF
    CONTROLS: TC1 TYPE TABLEVIEW USING SCREEN 0100.
    *&SPWIZARD: LINES OF TABLECONTROL 'TC1'
    DATA: G_TC1_LINES LIKE SY-LOOPC.
    DATA: OK_CODE LIKE SY-UCOMM,
    S_CODE LIKE SY-UCOMM,
    MARK.
    DATA: T1(10).
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE TC1_INIT OUTPUT.
    IF G_TC1_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'ZFG_SRNO'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_TC1_itab'
    SELECT * FROM ZFG_SRNO
    INTO CORRESPONDING FIELDS
    OF TABLE G_TC1_ITAB.
    G_TC1_COPIED = 'X'.
    REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    IF T1 <> SPACE.
    G_TC1_ITAB-ZSRNO = T1.
    CLEAR T1.
    APPEND G_TC1_ITAB.
    REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    ENDIF.
    *TC1-TOP_LINE = 1.
    ENDIF.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE TC1_MOVE OUTPUT.
    MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
    if sy-subrc ne 0.
    *append G_TC1_WA to G_TC1_ITAB.
    *endif.
    READ TABLE G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    IF SY-SUBRC = 0.
    G_TC1_WA-ZSRNO = G_TC1_ITAB-ZSRNO.
    ENDIF.
    MOVE-CORRESPONDING G_TC1_ITAB TO ZFG_SRNO.
    REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
    *******Below line is the logic for scrolling.
    tc1-lines = G_TC1_LINES + 100.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE TC1_GET_LINES OUTPUT.
    G_TC1_LINES = SY-LOOPC.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE TC1_MODIFY INPUT.
    *break-point.
    MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_ITAB.
    MODIFY G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    G_TC1_COPIED = 'X'.
    REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
    MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.
    MODIFY G_TC1_ITAB
    FROM G_TC1_WA
    INDEX TC1-CURRENT_LINE.
    G_TC1_COPIED = 'X'.
    if sy-subrc ne 0.
    append G_TC1_WA to G_TC1_ITAB.
    endif.
    *modify G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE TC1_USER_COMMAND INPUT.
    OK_CODE = SY-UCOMM.
    PERFORM USER_OK_TC USING 'TC1'
    'G_TC1_ITAB'
    'FLAG'
    CHANGING OK_CODE.
    SY-UCOMM = OK_CODE.
    ENDMODULE.
    INCLUDE TABLECONTROL_FORMS *
    *& Form USER_OK_TC *
    FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
    P_TABLE_NAME
    P_MARK_NAME
    CHANGING P_OK LIKE SY-UCOMM.
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA: L_OK TYPE SY-UCOMM,
    L_OFFSET TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    *&SPWIZARD: Table control specific operations *
    *&SPWIZARD: evaluate TC name and operations *
    SEARCH P_OK FOR P_TC_NAME.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    L_OFFSET = STRLEN( P_TC_NAME ) + 1.
    L_OK = P_OK+L_OFFSET.
    *&SPWIZARD: execute general and TC specific operations *
    CASE L_OK.
    WHEN 'INSR'. "insert row
    PERFORM FCODE_INSERT_ROW USING P_TC_NAME
    P_TABLE_NAME.
    CLEAR P_OK.
    WHEN 'DELE'. "delete row
    PERFORM FCODE_DELETE_ROW USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME.
    CLEAR P_OK.
    WHEN 'P--' OR "top of list
    'P-' OR "previous page
    'P+' OR "next page
    'P++'. "bottom of list
    PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
    L_OK.
    CLEAR P_OK.
    WHEN 'L--'. "total left
    PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
    WHEN 'L-'. "column left
    PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
    WHEN 'R+'. "column right
    PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
    WHEN 'R++'. "total right
    PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
    WHEN 'MARK'. "mark all filled lines
    PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME .
    CLEAR P_OK.
    WHEN 'DMRK'. "demark all filled lines
    PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME .
    CLEAR P_OK.
    WHEN 'SASCEND' OR
    'SDESCEND'. "sort column
    PERFORM FCODE_SORT_TC USING P_TC_NAME
    l_ok.
    ENDCASE.
    ENDFORM. " USER_OK_TC
    *& Form FCODE_INSERT_ROW *
    FORM fcode_insert_row
    USING P_TC_NAME TYPE DYNFNAM
    P_TABLE_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_LINES_NAME LIKE FELD-NAME.
    DATA L_SELLINE LIKE SY-STEPL.
    DATA L_LASTLINE TYPE I.
    DATA L_LINE TYPE I.
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <LINES> TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: get looplines of TableControl *
    CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
    ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line *
    GET CURSOR LINE L_SELLINE.
    IF SY-SUBRC <> 0. " append line to table
    L_SELLINE = <TC>-LINES + 1.
    *&SPWIZARD: set top line *
    IF L_SELLINE > <LINES>.
    <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
    ELSE.
    <TC>-TOP_LINE = 1.
    ENDIF.
    ELSE. " insert line into table
    L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
    L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
    ENDIF.
    *&SPWIZARD: set new cursor line *
    L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
    *&SPWIZARD: insert initial line *
    INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
    <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor *
    SET CURSOR LINE L_LINE.
    ENDFORM. " FCODE_INSERT_ROW
    *& Form FCODE_DELETE_ROW *
    FORM fcode_delete_row
    USING P_TC_NAME TYPE DYNFNAM
    P_TABLE_NAME
    P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <WA>.
    FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: delete marked lines *
    DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
    LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    IF <MARK_FIELD> = 'X'.
    DELETE <TABLE> INDEX SYST-TABIX.
    IF SY-SUBRC = 0.
    <TC>-LINES = <TC>-LINES - 1.
    ENDIF.
    ENDIF.
    ENDLOOP.
    ENDFORM. " FCODE_DELETE_ROW
    *& Form COMPUTE_SCROLLING_IN_TC
    text
    -->P_TC_NAME name of tablecontrol
    -->P_OK ok code
    FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
    P_OK.
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_TC_NEW_TOP_LINE TYPE I.
    DATA L_TC_NAME LIKE FELD-NAME.
    DATA L_TC_LINES_NAME LIKE FELD-NAME.
    DATA L_TC_FIELD_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <LINES> TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl *
    CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
    ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled? *
    IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ... *
    L_TC_NEW_TOP_LINE = 1.
    ELSE.
    *&SPWIZARD: no, ... *
    CALL FUNCTION 'SCROLLING_IN_TABLE'
    EXPORTING
    ENTRY_ACT = <TC>-TOP_LINE
    ENTRY_FROM = 1
    ENTRY_TO = <TC>-LINES
    LAST_PAGE_FULL = 'X'
    LOOPS = <LINES>
    OK_CODE = P_OK
    OVERLAPPING = 'X'
    IMPORTING
    ENTRY_NEW = L_TC_NEW_TOP_LINE
    EXCEPTIONS
    NO_ENTRY_OR_PAGE_ACT = 01
    NO_ENTRY_TO = 02
    NO_OK_CODE_OR_PAGE_GO = 03
    OTHERS = 0.
    ENDIF.
    *&SPWIZARD: get actual tc and column *
    GET CURSOR FIELD L_TC_FIELD_NAME
    AREA L_TC_NAME.
    IF SYST-SUBRC = 0.
    IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column *
    SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
    ENDIF.
    ENDIF.
    *&SPWIZARD: set the new top line *
    <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM. " COMPUTE_SCROLLING_IN_TC
    *& Form FCODE_TC_MARK_LINES
    marks all TableControl lines
    -->P_TC_NAME name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME.
    &SPWIZARD: EGIN OF LOCAL DATA----
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <WA>.
    FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: mark all filled lines *
    LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    <MARK_FIELD> = 'X'.
    ENDLOOP.
    ENDFORM. "fcode_tc_mark_lines
    *& Form FCODE_TC_DEMARK_LINES
    demarks all TableControl lines
    -->P_TC_NAME name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <WA>.
    FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: demark all filled lines *
    LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    <MARK_FIELD> = SPACE.
    ENDLOOP.
    ENDFORM. "fcode_tc_mark_lines
    *& Module D20XX_INIT OUTPUT
    text
    MODULE D20XX_INIT OUTPUT.
    *if screen-name = 'ZSRNO'.
    SCREEN-INPUT = 0.
    SCREEN-COLOR = 0.
    MODIFY SCREEN.
    endif.
    ENDMODULE. " D20XX_INIT OUTPUT
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    *CLEAR R1_REF.
    DO 30 TIMES.
    APPEND G_TC1_ITAB.
    ENDDO.
    DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module TAB1_INIT OUTPUT
    text
    MODULE TAB1_INIT OUTPUT.
    ENDMODULE. " TAB1_INIT OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module MESSAGE INPUT
    text
    MODULE MESSAGE INPUT.
    OK_CODE = SY-UCOMM.
    S_CODE = OK_CODE.
    CLEAR OK_CODE.
    if S_CODE = 'DELE'.
    loop at G_TC1_ITAB.
    if G_TC1_ITAB-scrname = 'X'.
    delete g_tc1_itab.
    endif.
    endloop.
    ELSEIF S_CODE = 'SAVE'.
    G_TC1_WA-ZSRNO = T1.
    MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
    REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    ENDIF.
    ENDMODULE. " MESSAGE INPUT
    *& Module DELETE_RECORD INPUT
    text
    MODULE DELETE_RECORD INPUT.
    IF MARK = 'X' AND S_CODE = 'DELE'.
    DELETE TABLE G_TC1_ITAB FROM ZFG_SRNO.
    DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
    ENDIF.
    ENDMODULE. " DELETE_RECORD INPUT
    *********************Screen modules*********************
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC1'
    MODULE TC1_INIT.
    *&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
    LOOP AT G_TC1_ITAB
    INTO G_TC1_WA
    WITH CONTROL TC1
    CURSOR TC1-CURRENT_LINE.
    *&SPWIZARD: MODULE TC1_CHANGE_FIELD_ATTR
    MODULE TC1_MOVE.
    MODULE TAB1_INIT.
    MODULE TC1_GET_LINES.
    ENDLOOP.
    MODULE D20XX_INIT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC1'
    *BREAK POINT.
    LOOP AT G_TC1_ITAB.
    CHAIN.
    FIELD ZFG_SRNO-ZSRNO.
    MODULE TC1_MODIFY ON CHAIN-REQUEST.
    MODULE TC1_MODIFY.
    ENDCHAIN.
    MODULE MESSAGE .
    MODULE DELETE_RECORD.
    ENDLOOP.
    MODULE TC1_USER_COMMAND.
    *&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
    MODULE USER_COMMAND_0100.
    please check out the link below for more information it might help you
    http://help.sap.com/saphelp_sm32/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/801c7b454211d189710000e8322d00/content.htm
    http://www.sapbrainsonline.com/REFERENCES/ABAP_SYNTAX/SAP_ABAP_SYNTAX.html
    *********please reward points if the information is helpful to you*************

  • An itab has been used as source for table control

    Hi,
    An itab has been used as source for table control without delete option of table control.
    Now I need to delete the row which the mouse arrow is on.
    Can I do this?
    Thanks.

    Hi Deniz,
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'DEL'.
        remove marked lines
          LOOP AT it_tabctrl
                  INTO wa_tabctrl
                  WHERE marked EQ kc_sel.
            IF sy-subrc EQ 0.
              DELETE it_tabctrl INDEX sy-tabix.
            ENDIF.
          ENDLOOP.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

  • Table type not defined for table control "T_CONTROL" (Custom table)

    Hi All,
    I m facing a problem in ITS mobile service.
    The Table control designed by me in R/3 (Module pool program) is
    not getting displayed in ITS mobile page.
    It is giving me an error "Table type not defined for table control "T_CONTROL" (Custom table) ".
    Can you please let me how this issue can be resolved.
    With Regards,
    Mahesh

    CONTROLS: table_ctr TYPE TABLEVIEW USING SCREEN '0010'.
    try using this....
    Regards
    Vasu

  • Wanted a code for table controls in bdc

    hi,
    i have written code for uploading data into FB60 transaction but i have a serious problem with that code.
    after entering 10 line items and when i am entering 11th item it is saying that the screen doesnot contain 11th line.
    so please modify my program or if you can please send me a program for handling table controls more line details.
    thanks and i will surely provide ten points to it.
    my code is
    LOOP AT I_PREPARE INTO WA_PREPARE.
    V_VALUE = WA_PREPARE-LINE+0(2).
    CASE V_VALUE.
    WHEN 'A'.
      CLEAR:V_DCNT.
    *UPLOAD THE COMPANY CODE TO FB60.
    *PERFORM.......USING WA_PREPARE-LINE+2(4).
    *? filling header data
    *********to initialize the company code and to get the popup**********
    PERFORM SET_BUKRS.
      PERFORM BDC_DYNPRO      USING 'SAPLACHD' '1000'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'BKPF-BUKRS'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=ENTR'.
      BUKRS = WA_PREPARE-LINE+2(4).
      PERFORM BDC_FIELD       USING 'BKPF-BUKRS'
                                          BUKRS.
      PERFORM BDC_DYNPRO      USING 'SAPMF05A' '1100'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'RF05A-BUSCS'
                                    'R'.
    *UPLOAD THE VENDOR NUMBER TO FB60
    *PERFORM.......USING WA_PREPARE-LINE+45(10).
      ACCNT = WA_PREPARE-LINE+45(10).
      PERFORM BDC_FIELD       USING 'INVFO-ACCNT'
                                           ACCNT.
    *UPLOAD THE DATE TO FB60
    WRITE WA_PREPARE-LINE+34(8) TO V_DATE USING EDIT MASK '  .  .    .'
    *PERFORM.......USING V_DATE.
      PERFORM BDC_FIELD       USING 'INVFO-BLDAT'
                                    '15.09.2004'.
      PERFORM BDC_FIELD       USING 'INVFO-BUDAT'
                                    '15.09.2004'.
    *UPLOAD THE AMOUNT TO FB60
    *PERFORM.......USING WA_PREPARE-LINE+85(15).
      WRBTR = WA_PREPARE-LINE+85(15).
      PERFORM BDC_FIELD       USING 'INVFO-WRBTR'
                                           WRBTR.
    *UPLOAD THE CURRENCY CODE TO FB60
    *PERFORM.......USING WA_PREPARE-LINE+100(3).
      WAERS = WA_PREPARE-LINE+100(3).
      PERFORM BDC_FIELD       USING 'INVFO-WAERS'
                                    WAERS.
    WHEN 'D'.
      V_DCNT = V_DCNT + 1.
    IF V_DCNT GT 04.
       V_DCNT = 04.
    ENDIF.
    *UPLOAD THE G/L ACC. TO FB60.
    *PERFORM.......USING WA_PREPARE-LINE+51(20).
    *? filling item data
      CONCATENATE 'ACGL_ITEM-WRBTR(' V_DCNT ')' INTO FNAM.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    FNAM.
      CONCATENATE 'ACGL_ITEM-HKONT(' V_DCNT ')' INTO FNAM.
      HKONT = WA_PREPARE-LINE+51(20).
      PERFORM BDC_FIELD       USING FNAM
                                    HKONT.
    *UPLOAD THE AMOUNT TO FB60(ACGL_ITEM-WRBTR)
    *PERFORM........USING WA_PREPARE-LINE+121(15).
      CONCATENATE 'ACGL_ITEM-WRBTR(' V_DCNT ')' INTO FNAM.
      WRBTR = WA_PREPARE-LINE+75(15).
      PERFORM BDC_FIELD       USING FNAM
                                    WRBTR.
      PERFORM BDC_DYNPRO      USING 'SAPMF05A' '1100'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=0006'.
      PERFORM BDC_FIELD       USING 'RF05A-BUSCS'
                                    'R'.
    ENDCASE.

    hi,
    check this example:
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    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.

  • More than 1 line items in bdc using table controls for BOM

    Hi....
    how do u update more than one line item for BOM using BDC table control.......
    is there any specific command for doing that.......
    hav tried d following code bt it takes the flatfile i/p FOR 2 LINE ITEMS as 2 different BOM'S.....
    would appreciate ur help....plz provide code.............
    REPORT zbdc4_cs01
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    INCLUDE bdcrecx1.
    DATA : a TYPE i,
           b type i,
           c type i.
    DATA : BEGIN OF it_rec OCCURS 0,
           rec(200) TYPE c,
           END OF it_rec.
    DATA : BEGIN OF ctab OCCURS 0,
           matnr(18),
           werks(4),
           stlan(1),
           END OF ctab.
    DATA : BEGIN OF xtab OCCURS 0,
           idnrk(18),
           menge(13),
           postp(1),
           END OF xtab.
    DATA : BEGIN OF itab OCCURS 0,
           matnr(18),
           werks(4),
           stlan(1),
           idnrk(18),
           menge(13),
           postp(1),
           END OF itab.
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = 'C:/TEST4.TXT'
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = it_rec.
      LOOP AT  it_rec.
        a = strlen( it_rec-rec ).
        if a = 55.
        itab-matnr = it_rec-rec+0(18).
        itab-werks = it_rec-rec+18(4).
        itab-stlan = it_rec-rec+22(1).
        itab-idnrk = it_rec-rec+23(18).
        itab-menge = it_rec-rec+41(13).
        itab-postp = it_rec-rec+54(1).
        APPEND itab.
        elseif a > 55.
        itab-matnr = it_rec-rec+0(18).
        itab-werks = it_rec-rec+18(4).
        itab-stlan = it_rec-rec+22(1).
        itab-idnrk = it_rec-rec+23(18).
        itab-menge = it_rec-rec+41(13).
        itab-postp = it_rec-rec+54(1).
        APPEND itab.
        itab-idnrk = it_rec-rec+55(18).
        itab-menge = it_rec-rec+73(13).
        itab-postp = it_rec-rec+86(1).
        APPEND itab.
        endif.
      ENDLOOP.
      PERFORM open_group.
      LOOP AT itab.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29N-STLAN'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RC29N-MATNR'
                                       itab-matnr.           "'3000000107'.
        PERFORM bdc_field       USING 'RC29N-WERKS'
                                       itab-werks.              "'UN02'.
        PERFORM bdc_field       USING 'RC29N-STLAN'
                                       itab-stlan.              "'1'.
        PERFORM bdc_field       USING 'RC29N-STLAL'
        PERFORM bdc_field       USING 'RC29N-DATUV'
                                      '11.08.2008'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0110'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RC29K-BMENG'
                                      '1'.
        PERFORM bdc_field       USING 'RC29K-STLST'
                                      '1'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29K-EXSTL'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0111'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29K-LABOR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSTP(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RC29P-IDNRK(01)'
                                       itab-idnrk.             "'1000000232'.
        PERFORM bdc_field       USING 'RC29P-MENGE(01)'
                                       itab-menge.              "'100'.
        PERFORM bdc_field       USING 'RC29P-POSTP(01)'
                                       itab-postp.             "'L'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0130'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSNR'.
        PERFORM bdc_field       USING 'RC29P-POSNR'
                                      '0010'.
        PERFORM bdc_field       USING 'RC29P-IDNRK'
                                      '1000000232'.
        PERFORM bdc_field       USING 'RC29P-MENGE'
                                      '100'.
        PERFORM bdc_field       USING 'RC29P-MEINS'
                                      'KG'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0131'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POTX1'.
        PERFORM bdc_field       USING 'RC29P-SANKA'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSNR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSNR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=FCBU'.
        PERFORM bdc_transaction USING 'CS01'.
      ENDLOOP.
      PERFORM close_group.

    Hi
    Check this sample code for the Table Control in BDC:
    data: fnam(20) type c.
    move 1 to id.
        loop at TI_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE.
          concatenate 'RM06E-EPSTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-itmcategory.
          concatenate 'EKPO-KNTTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-accassignment.
          concatenate 'EKPO-EMATN(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-material.
          concatenate 'EKPO-TXZ01(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-shortxt.
          quan = ti_staging-poqty.
          concatenate 'EKPO-MENGE(0' id ')' into fnam.
          perform bdc_field       using fnam quan.
          concatenate 'RM06E-EEIND(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-deliverydate.
          netpr = ti_staging-netpr.
          concatenate 'EKPO-NETPR(0' id ')' into fnam.
          perform bdc_field       using fnam netpr.
          concatenate 'EKPO-MATKL(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-mategroup.
          concatenate 'EKPO-WERKS(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-plant.
          ID = ID + 1.
        ENDLOOP.
    Regards,
    Vishwa.

Maybe you are looking for

  • Looking for an email/ calendar app

    I just recently moved from PC to Mac and I am really missing Outlook, it just does so much more than Ical/ mail.  I have not been able to find a similar program- does anyone know of one?  I want email and calendar combined.  I use gmail so I do not t

  • Significance of Secondary field in doc_link of parameter ct_doc_flow

    Hi , Does any one know what is the significance of ' Secondary' field (Document Flow: Secondary Object)in internal table  doc_link of parameter ct_doc_flow in FM CRM_ORDER_MAINTAIN . Regards, Nithish Edited by: nithish P on Dec 20, 2011 2:49 PM

  • C++ Problem Casting RawDateTime::View to struct tm

    Hi, I am writing a C++ client (using release 3.5.1 on Windows) and having problems casting a RawDateTime::View to a struct tm. The code snippet that gives me the problem is: <pre> RawDateTime::View dateTime = hIn->readRawDateTime(Stock::TIMESTAMP); s

  • "error opening file" on html files

    I have an existing site with several html files that edge code displays an "error opening file... the file could not be read" alert on. These html files display fine, and open in my other text/html editors.

  • PIX/ASA Failover conditions

    I have a asa cluster in active/standby mode with lan cable connected for stateful failover. I want to know about the condtions when the box fails over to the other. One parameter should be the hello timers going between the failover interfaces. Does