WHAT IS TABLE CONTROL?

HI EXPERTS
WHAT IS TABLE CONTROL?

For Transactions like VA01 , VK11 etc Header data , Item data is available .
For each Header entry there is  1 or more item entries exisisted . These item
data is saved in table  format.
eg : va01  etc.,.
Check eg prg for Table control transaction : FV11
Program Name        : ZFV11_NEW
Program Description : To Upload Condition Records-FV11
Author              : Jagadish
Start Date          : 11/06/2007
REPORT zfv11
       NO STANDARD PAGE HEADING LINE-SIZE 255.
   DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
  If it is nessesary to change the data section use the rules:
  1.) Each definition of a field exists of two lines
  2.) The first line shows exactly the comment
      '* data element: ' followed with the data element
      which describes the field.
      If you don't have a data element use the
      comment without a data element name
  3.) The second line shows the fieldname of the
      structure, the fieldname must consist of
      a fieldname and optional the character '_' and
      three numbers and the field length in brackets
  4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE  ***
TABLES : t100.
DATA: BEGIN OF record OCCURS 0,
data element: KSCHA
        kschl(004),               "Condition Type
data element: SELKZ_LIST
      selkz(001),
data element: WERKS_D
        werks(004),               "Plant
data element: ELIFN
        lifnr(010),               "Vendor
data element: MATNR
        matnr(018),               "Material No.
data element: KBETR_KOND
        kbetr(016),               "Amount
data element: KODATAB
        datab(010),               "Condition Validity Date from
data element: KODATBI
        datbi(010),               "Condition Validity To
data element: MWSKZ
        mwsk1(002),
      END OF record.
DATA : BEGIN OF it_new OCCURS 0,                    " Internal Table for Header Data
       kschl(004),
       werks(004),
       lifnr(010),
       END OF it_new.
DATA : BEGIN OF it_item OCCURS 0,                  " Internal table for Item Data
      werks(004),
      lifnr(010),
      matnr(018),
      kbetr(016),
      datab(010),
      datbi(010),
      mwsk1(002),
      END OF it_item.
DATA : cnt(2) TYPE n,
       fld(25) TYPE c.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
DATA : n TYPE n.
DATA:
     BEGIN OF t_data OCCURS 0,
           data TYPE string,
     END   OF t_data.
DATA:BEGIN OF it_mess OCCURS 0,
  msgtyp(5),
   lms(200),
   msgv1(50),
    END OF it_mess.
DATA : p_mode    TYPE c.
DATA:it_msgtab TYPE STANDARD TABLE OF  bdcmsgcoll WITH HEADER LINE,
   it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
DATA :  l_mstring(150).
DATA : BEGIN OF bdcdata OCCURS 0.
        INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
PARAMETERS : p_file1 LIKE rlgrap-filename.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
  PERFORM file_selection.
  PERFORM data_upload.
  PERFORM table_control.
  LOOP AT it_new.
    REFRESH bdcdata.
    PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'RV13A-KSCHL'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM bdc_field       USING 'RV13A-KSCHL'
                                  it_new-kschl.
    PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'RV130-SELKZ(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=WEIT'.
    PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'KONP-KBETR(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM bdc_field       USING 'KOMG-WERKS'
                                  it_new-werks.
    PERFORM bdc_field       USING 'KOMG-LIFNR'
                                  it_new-lifnr.
DATA: "X(5) TYPE N,
         N(5) TYPE N.
   N = 0.
   LOOP AT it_item.
     N = N + 1.
   ENDLOOP.
   "X = 1.
   CNT = 1.
   DO N TIMES.
     IF CNT > 19.
       perform bdc_field       using 'BDC_OKCODE' 'KOMG-MATNR(01)'.
       perform bdc_field       using 'BDC_OKCODE' '=P+'.
       PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
       CNT = 1.
     ENDIF.
    cnt = 1.
    LOOP AT it_item WHERE werks EQ it_new-werks AND lifnr EQ it_new-lifnr . "FROM x TO x.
      CONCATENATE 'KOMG-MATNR(' cnt ')' INTO fld.
      PERFORM bdc_field USING fld it_item-matnr.
      CONCATENATE 'KONP-KBETR(' cnt')' INTO fld.
      PERFORM bdc_field USING fld it_item-kbetr.
      CONCATENATE 'RV13A-DATAB(' cnt ')' INTO fld.
      PERFORM bdc_field USING fld it_item-datab.
      CONCATENATE 'RV13A-DATBI(' cnt ')' INTO fld.
      PERFORM bdc_field USING fld it_item-datbi.
      CONCATENATE 'KONP-MWSK1(' cnt ')' INTO fld.
      PERFORM bdc_field USING fld it_item-mwsk1.
      cnt = cnt + 1.
      if cnt = 20.
        perform bdc_field       using 'BDC_OKCODE' 'KOMG-MATNR(19)'.
        perform bdc_field       using 'BDC_OKCODE' '=P+'.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
        CNT = 1.
       endif.
CLEAR it_item.
    ENDLOOP.
   ENDDO.
    PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'KONP-MWSK1(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=SICH'.
    CALL TRANSACTION 'FV11' USING bdcdata MODE 'A'
                                        UPDATE 'S'
                                       MESSAGES  INTO it_msgtab.
    CLEAR bdcdata[].
    PERFORM error.
  ENDLOOP.
       Start new screen   -Subroutine     for screen s                                      *
FORM bdc_dynpro USING program dynpro.
  CLEAR bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  APPEND bdcdata.
ENDFORM.                    "BDC_DYNPRO
       Insert field        -Subroutine   for field s                                         *
FORM bdc_field USING fnam fval.
  CLEAR bdcdata.
  bdcdata-fnam = fnam.
  bdcdata-fval = fval.
  APPEND bdcdata.
ENDFORM.                    "BDC_FIELD
*&      Form  file_selection
FORM file_selection .
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = 'P_FILE1'
    IMPORTING
      file_name     = p_file1.
ENDFORM.                    " file_selection
*&      Form  data_upload
FORM data_upload .
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
   EXPORTING
    I_FIELD_SEPERATOR        =
       i_line_header            =  'X'
       i_tab_raw_data           =  it_raw
       i_filename               =  p_file1
     TABLES
       i_tab_converted_data     = record
    EXCEPTIONS
       conversion_failed        = 1
       OTHERS                   = 2.
  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.                    " data_upload
*&      Form  error
FORM error .
  LOOP AT it_msgtab.
    IF it_msgtab-msgtyp = 'E'.
      SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
                                AND   arbgb = it_msgtab-msgid
                                AND   msgnr = it_msgtab-msgnr.
      IF sy-subrc = 0.
        l_mstring = t100-text.
        IF l_mstring CS '&1'.
          REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
          REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
          REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
          REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
        ELSE.
          REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
          REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
          REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
          REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
        ENDIF.
        CONDENSE l_mstring.
        it_mess-msgtyp = it_msgtab-msgtyp.
        it_mess-lms = l_mstring.
        it_mess-msgv1 = it_msgtab-msgv1.
        APPEND it_mess.
       WRITE: / it_msgtab-msgtyp, l_mstring(150).
      ELSE.
       WRITE: / it_msgtab.
        it_mess-msgtyp = it_msgtab-msgtyp.
        it_mess-lms = l_mstring.
        it_mess-msgv1 = it_msgtab-msgv1.
        APPEND it_mess.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " error
*&      Form  table_Control
FORM table_control .
SORT record BY lifnr matnr.
  LOOP AT record.
    ON CHANGE OF record-lifnr.
      MOVE-CORRESPONDING record TO it_new.
      APPEND it_new.
    ENDON.
    MOVE-CORRESPONDING record TO it_item.
    APPEND it_item.
  ENDLOOP.
ENDFORM.                    " table_Control
Reward if useful
Regards
Jagadeesh.G

Similar Messages

  • Hi gurus what is table control can explin with example

    hi gurus what is table control can explin with example

    TABLE CONTROL
    These are the screen elements used to display tabular data they can be called
    as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
    using OK_CODE field.
    Having a parallel loop(at screen table rows & int table rows) by using parameter
    AT int_table makes the ABAP code simple.
    A special structure of type CXTAB_CONTROL is used to set/get various
    attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
    ABAP declaration
    CONTROLS: tab_con TYPE TABLEVIEW USING SCREEN nnnn
    Here tab_con is the same name we used in screen for the table control.
    This ABAP statement will declare a control variable that will be used to access
    the table control , and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
    REFRESH CONTROL tab_con FROM SCREEN nnnn
    This ABAP statement will initialize the table control on the screen nnnn to its initial values.
    PBO processingI
    n PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
    intenal table.
    LOOP WITH CONTROL tab_con.
    MODULE fill_tab_con.
    ENDLOOP.
    Here a module should be called between the loop endloop statement to transfer
    data from th ABAP program to the screen table through a structure.This module
    should use the CURRENT_LINE attribute of the table control variable to get the
    current screen table record index to read the data from the internal table into a work area.
    e.g.
    READ TABLE int_table INDEX tab_con-CURRENT_LINE
    The record read will be placed in the header line of the internal table and will be available to the similarly named screen fields or if these are different it can be written explicitly. e.g.
    screen_field_name = int_table-field_name
    LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
    n1 TO n2.
    ENDLOOP.
    Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
    should be the first to display on the table control .FROM n1 TO n2 can be used
    to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
    In both cases before the LOOP statement a module should be called which
    is generally for setting of status ,in which we should fill the LINES attribute
    (tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
    The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
    to get the total lines in an int table.
    PAI Processing
    We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
    call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
    e.g.
    PROCESS AFTER INPUT
    MODULE mod AT EXIT-COMMAND.
    LOOP AT itab_table or LOOP "depending on whether we are using AT int_table
    MODULE modify_int_table.
    ENDLOOP.
    MODULE user_command.
    In the MODULE call modify_int_table we can use
    MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
    or we can use
    int_table-field_name = screen_field_name.

  • BDC Table Controler

    hi friends,
    Could u please tell me what BDC TABLE CONTROLER
    in which cases we can use the bdc Table Contorler
    Regards
    srinu y

    Hi srinu,
    <b>Check this link</b>
    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
    How to deal with table control / step loop in BDC
    <b>Steploop</b> and <b>table contol</b> 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 <b>ABAP code</b> has two purposes:
    <b>1.</b> how to determine number of visible lines and how to calculte page number;
    (the 'calpage' routine has been modify to meet general purpose usage)
    <b>2.</b> 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..)
    <b>Step1:</b> 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)
    <b>Step2:</b> 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)
    <b>Step3:</b> write a subroutine calcalculating number of pages
    (here, the name of actual parameter is the same as formal parameter)
    <b>global data:</b> 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.
    <b>Step4</b> 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.
    <b>Step5</b> 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.
    <b>Step6</b> 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.
    Reward with points if it is helpful
    Cheers
    Alfred

  • What is needed for sorting on two fields in a table control

    Hi Everybody
    I am going to certification in a couple of days. I need some help and was hopeing that you  guys could help.
    What is needed for sorting on two fields in a table control?
         One sorted table and two processing blocks
         Two standard tables and one processing blocks
         Two standard tables and two processing
    Which one is corret??
    //Script

    Hi Kimallan
    I am not sure what is meant by a "processing block". However, it seems the question wants the original table order to be preserved. If so; as far as I understood the problem we need:
    itab_proxy[] = itab_main[] .
    "two standard tables"
    SORT itab_proxy BY field1 field2 .
    If we have a sorted table, then it is always sorted by its keys. So, the question seems to become obsolete for that option.
    Hope I've understood correct...
    Regards
    *--Serdar
    [email protected]

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

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

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

  • What is wrong with PBO (table control)

    Hi,
    Another beginner's question. Unable to fill table control.
    Following in my Program
    report  test_tab_con.
    controls flights type tableview using screen 100.
    data:  ok_code type sy-ucomm,
           save_ok type sy-ucomm.
    data: fill type i,
          begin of itab_con occurs 0,
          id type i,
          name(10) type c,
          address(20) type c,
          end of itab_con.
    data: wa_itab like line of itab_con.
    perform populate.
    form populate.
      itab_con-id = 1.
      itab_con-name = 'ABCD'.
      itab_con-address = 'Test Area'.
      append itab_con.
      itab_con-id = 2.
      itab_con-name = 'XYZ'.
      itab_con-address = 'Come again'.
      append itab_con.
      call screen 100.
    endform.
    module fill_table_control output.
      move-corresponding wa_itab to flights.
    endmodule.                   
    module status_0100 output.
      set pf-status 'SCREEN_100'.
      describe table itab_con lines fill.
      flights-lines = fill.
    endmodule.
    and my screen PBO is:
    process before output.
      loop at itab_con into wa_itab with control flights.
        module fill_table_control.
      endloop.
      module status_0100.
    But finally I see empty table control. There is some option of w/ selColumn (i m not using this - is it mandatory for display?).
    Regards,
    Arpit

    Still no luck. I am sure it is not being refresh onto the final screen. Just don't know how to get it done
    Steps taken to create the UI using screen painter:
    - Create screen
    - Drag & drop the Table control element
    - Press F6 to open dictionary/program fields view, selected itab_con and its fields. Dragged them on to the table control to create it.
    - For all the three fields ID, Name, Address - double clicked on the table control and in screen painter attribute marked them as Input Field (possible). Tried it also by marking as Output field.
    Do I need to do anything part of the screen painting?
    I get three rows in the UI but the text is not visible. What else can be a miss here?
    Regards,
    Arpit

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

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

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

  • What is the maximum number of row for a table control in LabWindows/CVI ?

    I use LabWindows CVI 8.5.1 (MMI first developped in version 6.0).
    In one of our many MMI, a table control contains a list of aircraft parameters.
    We can add as many parameters (row) as we want but over 40 000 we observe a crash of the LabWindows CVI runtime.
    Our client want to inscrease the number of parameters (row) up to 200 000 !!!
    So my questions are:
    What is the real maximum number of row for the table control ?
    Is this maximum number of row different on LabWindows 2010 version ?
    Or is there an other solution ?
    Thanks

    Greetings,
    Can you clarify what you mean by "crash"? Is there an error message thrown? Is it possible that you've consumed all of the available memory?
    Please let me know.
    Thanks, James Duvall
    Product Support Engineer
    National Instruments

  • What is the Length of a Field in a Table Control?

    Hi,
        I have a small question. I want to know, What could be the Maximum length that can be assigned to a field while creating a Table Control? Any help would be highly appreciated.
    Thanks in advance,
    Exertive.

    Hi Exertive,
    I've found that a simple field can have a maximum length of 128 characters.
    To enter more text, use a custom textview control - use the text view class to build yourself a field that can hold a string variable - then you can have as long a value as you want. refer to class CL_GUI_TEXTEDIT.
    Not sure about putting custom controls in a table control though!
    Hope this helps slightly or gives you something to work with.
    Cheers,
    Chris

  • What are the prerequisites before creating a Table Control?.

    What are the prerequisites before creating a Table Control?.

    It depends on the kind of application you want to develop....You can use Editable ALV or Table Control......
    If you need a table control...The best is create an Structure in SE11 to assing the fields to the table....It's easy -;)
    Greetings,
    Blag.

  • What are the uses of table control and tabstrip control

    can anyone tell me the uses of table control and tabstrip control

    Hi,
    table control is more comfortable for customizing.scroll bars all possible in this.where as it is not possible in step loops.
    check this example.
    PROGRAM ZBHTCTRL.
    TABLES: LFA1, EKKO.
    DATA: OKCODE1 LIKE SY-UCOMM,
    OKCODE2 LIKE SY-UCOMM.
    CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.
    DATA: BEGIN OF ITAB OCCURS 0,
    MANDT LIKE EKKO-MANDT,
    EBELN LIKE EKKO-EBELN,
    BSTYP LIKE EKKO-BSTYP,
    BSART LIKE EKKO-BSART,
    END OF ITAB.
    MODULE USER_COMMAND_1000 INPUT.
    CASE OKCODE1.
    WHEN 'BACK'.
    SET SCREEN 0.
    WHEN 'NEXT'.
    SET SCREEN 1001.
    SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE
    LIFNR = LFA1-LIFNR.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_1001 INPUT
    MODULE MOVE_DATA OUTPUT.
    EKKO-MANDT = ITAB-MANDT.
    EKKO-EBELN = ITAB-EBELN.
    EKKO-BSTYP = ITAB-BSTYP.
    EKKO-BSART = ITAB-BSART.
    ENDMODULE. " MOVE_DATA OUTPUT
    MODULE USER_COMMAND_1001 INPUT.
    CASE OKCODE2.
    WHEN 'BACK'.
    SET SCREEN 1000.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_1001 OUTPUT
    MODULE STATUS_1001 OUTPUT.
    SET PF-STATUS 'MENU'.
    SET TITLEBAR 'TIT'.
    ENDMODULE. " STATUS_1001 OUTPUT
    MODULE STATUS_1000 OUTPUT.
    SET PF-STATUS 'DMENU'.
    SET TITLEBAR 'xxx'.
    ENDMODULE. " STATUS_1000 OUTPUT
    FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.
    CALL METHOD CMENU->LOAD_GUI_STATUS
    EXPORTING
    PROGRAM = ' ZBHTCTRL'
    STATUS = 'CMENU'
    MENU = CMENU.
    CALL METHOD CMENU->ADD_FUNCTION
    EXPORTING
    FCODE = 'RX'
    TEXT = 'RECIEVE'.
    ENDFORM.
    FLOW LOGIC:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1000.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_1000.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1001.
    LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.
    MODULE MOVE_DATA.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_1001.
    LOOP AT ITAB.
    ENDLOOP.
    for more info check this link.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
    thanks
    Ashu.

  • Table control - what is the limit to how much I can sent to it.

    Greetings,
    I am using a table control for a test program.  Each time a feature of the unit is tested it is logged to the table control.
    I know that the answer will depend on how many columns i am filling (9) and the length of the strings in each column,
    but i need to get a ball park figure on how many rows i can write to the table control before I have problems?
    Secondly is there something I can do to the control to lets say purge the first x number of entries to regain memory used or am I
    just going to create a memory leak by doing this?
    thanks in advance
    Pete Hedlund

    Hi phedlund,
    According to the CVI Help Topic on "Programming with Table Controls" a table in CVI can hold an arbitrary number of rows and columns. You can use the DeleteTableRows and DeleteTableColumns functions to adjust the size of the table and the length of the strings does not effect the data structure of the table as the table should only hold pointers to strings. One thing to keep in mind is if the GetTableCellRangeVals function is used to probe the values in the table then make sure to clear the return values from memory using FreeTableValStrings, etc to prevent memory leaks.
    Milan

  • Module pool - table control - update ztable

    hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
    pd: sorry for my bad english
    this is my code:
    TOP:
    PROGRAM  z_pp_lote_etiquetas MESSAGE-ID zz.
    TABLES:zc2p_lote_etique,
           zc2p_lider_modul.
    DATA: ok_code LIKE sy-ucomm.
    DATA save_ok LIKE sy-ucomm.
    * internal table
    DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
    DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    **************Workarea
    DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
    DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
    DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
    DATA: sel.
    DATA: MARK.
    DATA: init.
    DATA:  col TYPE scxtab_column.
    DATA: lines TYPE i.
    * Variable Declaration
    DATA : flg, "Flag to set the change mode
    ln TYPE i. "No. of records
    * Table Control Declartion.
    CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
    **PROCESS BEFORE OUTPUT INCLUDE **
    *&  Include           Z_PP_LOTE_ETIQUETAS_O01
    *& Module set_status OUTPUT
    * Setting the GUI status
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    ENDMODULE. " set_status OUTPUT screen 100
    *  MODULE status_0101 OUTPUT
    * Setting the GUI status
    MODULE status_0101 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    * Data retreving
      if init is INITIAL.
      select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
        zc2p_lider_crtl-lines = ln + 10.
        init = 'X'.
    endif.
    ENDMODULE.                    "status_0101 OUTPUT
    module change_sdyn_conn output.
    * you can change the content of current table control line via
    * sdyn_conn
      READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
    endmodule.                             " FILL_TABLE_CONTROL  OUTPUT
    MODULE set_screen_fields OUTPUT.
    LOOP AT SCREEN.
    IF flg IS INITIAL.
    screen-input = 0.
    ELSE.
    screen-input = 1.
    ENDIF.
    *ENDIF.
    * Modifying the screen after making changes
    MODIFY SCREEN.
    ENDLOOP.
    ENDMODULE. " set_screen_fields OUTPUT
    PROCESS AFTER INPUT INCLUDE.
    *  MODULE USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'LIDM'.
          CALL SCREEN 101.
        WHEN 'CANC'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0100 INPUT
    *  MODULE USER_COMMAND_0101 INPUT
    MODULE user_command_0101 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'SORT'.
          DATA: fldname(100),help(100).
          READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
          SPLIT col-screen-name AT '-' INTO help fldname.
          SORT it_zc2p_lider_modul BY (fldname).
        WHEN 'CHANGE'.
    * Setting the flag to make the table control in editable mode[excluding
    * primary key].
          flg = 'Y'.
        WHEN 'BACK'.
          CALL SCREEN 100.
          LEAVE SCREEN.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'SAVE'.
          MODIFY  zc2p_lider_modul FROM it_zc2p_lider_modul.
          COMMIT WORK.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0101 INPUT
    *  MODULE read_table_control INPUT
    MODULE read_table_control INPUT.
    * Check input values
      IF mark = 'X' AND save_ok = 'DELETE'.
        DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    Screen Flow Logic 100
    PROCESS BEFORE OUTPUT.
    MODULE status_0100.
    PROCESS AFTER INPUT.
    MODULE user_command_0100.
    Screen Flow Logic 101.
    PROCESS BEFORE OUTPUT.
      MODULE status_0101.
      LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    zc2p_lider_crtl.
    * Dynamic screen modifications
        MODULE set_screen_fields.
        MODULE change_sdyn_conn.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0101.
      LOOP AT it_zc2p_lider_modul.
        MODULE read_table_control.
      ENDLOOP.
    i hope somebody can help for what i missing here  thanks

    >
    Sanjeev Kumar wrote:
    > Hello Edgar,
    >
    > Problem seems to be there in the flow logic of 101
    >
    >
    > PROCESS BEFORE OUTPUT.
    >   MODULE status_0101.
    >   LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    > zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
    > * Dynamic screen modifications
    >     MODULE set_screen_fields.
    >     MODULE change_sdyn_conn.
    >   ENDLOOP.
    > *
    > PROCESS AFTER INPUT.
    >   MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.

    >   LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
    >     MODULE read_table_control.
    >   ENDLOOP.
    >
    >
    >
    > With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
    >
    > Try these changes and I hope it will work.
    >
    > Thanks
    > Sanjeev
    i do the firts advice but the second one i get syntax error :
    my code :
    PROCESS AFTER INPUT.
      LOOP  at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
        MODULE read_table_control.
      ENDLOOP.
       MODULE user_command_0101.
    error :
    In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP     
    AT".

  • How to modify changes of table control data in PAI

    I have a table control where the columns are brought by dict fields.I am able to bring data into table control through an itab.
    Now what i want is whenever user edits data in table control and clicks on save button the corresponding changes should be made in database.
    For this according to my understanding we need to (in PAI) modify the changes in itab from the table control and then in SY-UCOMM of SAVE button we need to update in database table using itab.
    For this , I am not able to write code for modifying the changes in itab from table control. Here is my code below.Please tell me how to do this.
    PROCESS BEFORE OUTPUT.
    MODULE FILL_DATA.
    LOOP AT ITAB INTO ZEMPLOYEE_MASTER WITH CONTROL EMPTABLE CURSOR
    EMPTABLE-CURRENT_LINE.
    ENDLOOP.
    MODULE STATUS_0001.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
       MODULE MODIFY_ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.
    REPORT  ZDATA_FORM1.
    TABLES: ZEMPLOYEE_MASTER.
    CONTROLS EMPTABLE TYPE TABLEVIEW USING SCREEN 0001.
    data: begin of itab occurs 0,
           emp_no like zemployee_master-emp_no,
           name like zemployee_master-name,
           city like zemployee_master-city,
          end of itab,
          rowno TYPE I VALUE 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
      MESSAGE 'Inside INPUT' TYPE 'I'.
    CASE SY-UCOMM.
       WHEN 'SAVE'.
         UPDATE zemployee_master.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    *&      Module  fill_data  OUTPUT
    *       text
    MODULE fill_data OUTPUT.
      select emp_no name city from zemployee_master into TABLE itab ORDER BY emp_no.
      Describe table itab lines EMPTABLE-LINES.
    ENDMODULE.                 " fill_data  OUTPUT
    *&      Module  modify_itab  INPUT
    *       text
    MODULE modify_itab INPUT.
    * MODIFY itab from zemployee_master index
    * MESSAGE 'Inside modify_itab' TYPE 'I'.
    ENDMODULE.                 " modify_itab  INPUT

    Hi
    In the following module of your code
    MODULE modify_itab INPUT.
    MODIFY itab from zemployee_master index tc-current_line " Where TC is the name of the Table control on the Screen
    ENDMODULE.
    Table control data gets refreshed on *enter*
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2165e990-0201-0010-5cbb-b5c2ad436140
    Cheerz
    Ramchander Rao.K

  • Internal table not getting modified from Table Control

    Hi Guys,
    I am developing a <b>Module Pool </b>Program where I am inserting data directly in table control of the main screen.
    In the flow logic of the Table control I have written :
    PROCESS BEFORE OUTPUT.
      LOOP AT itab WITH CONTROL tc1 CURSOR tc1-current_line.
        MODULE read_data.
      ENDLOOP.
    MODULE status_0100.
    PROCESS AFTER INPUT.
      LOOP AT itab.
        MODULE mod_data.
      ENDLOOP.
    MODULE user_command_0100.
    Module mod_data input.
    MODIFY itab INDEX tc1-current_line.
    Endmodule.   
    At modify, when I am debugging it's showing sy-subrc = 4 (Entry not appending in Int Table though it is there in the header line). But, if I use append itab, it's working (Problem is that while inserting 2nd record a copy of first record is also appending which I don't want).
    Please let me know what's wrong in Modify statement or what is solution for inserting records of tablecontrol in internal table.
    TIA,
    Nitin

    Hi Nitin,
    use the following code wor module.
    Module mod_data input.
    READ ITAB INDEX TC1-CURRENT_LINE.
    IF SY-SUBRC = 0.
           MODIFY itab INDEX tc1-current_line.
    ELSE.
           APPEND ITAB.
    ENDIF.
    Endmodule.

Maybe you are looking for

  • How do I format an external HD with Recovery Disk Assistant on?

    Hi, I have seen a couple of threads on this, but I'm still not "Compos Mentis" with how to format an external drive with the Recovery Disk Assistant on. I have a 320GB which has my recovery disk assistant on - "Don't ask!" - Anyway it goes without sa

  • AppliedCellStyle not giving the whole answer

    I am trying to return the cell style for a cell in a table. Normally appliedCellStyle would do this for me. But, I have applied a table style to the table which has the 'left column' attribute setting the first column cell style to 'left' When I use

  • Gapless playback information

    sometimes it does it, but only when i dont want it to and then it slows down itunes completely but when im going to be away for awhile, i dont know how to make it run the scan to do the gapless playback info scan, does anyone know how?

  • SQL developer broken DL

    Can't download SQL Developer from the dl site (oracle). Only gets 404's If someone got a external link to someone that actually host the new version it would be much appriciated.

  • THE 'FIRST TIME' MESS

    HI ALL, I HAVE BEEN WRITING CODE FOR A TEST RMI 'GRAPHICSERVER'. THIS IS A KIND OF A SERVER THAT PROVIDES CLIENTS WITH A FRAME. ON WHICH IT DRAWS DIFFERENT SORT OF SHAPES ON CLIENT REQUEST e.g. CLIENT CAN REQUEST FOR A LINE OR AN OVAL etc. INITIALLY