<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Table control programming in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187033#M1000906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.niraj.tripod.com/id29.html" target="test_blank"&gt;http://sap.niraj.tripod.com/id29.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://hometown.aol.com/skarkada/sap/table_control/table_control.htm" target="test_blank"&gt;http://hometown.aol.com/skarkada/sap/table_control/table_control.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm" target="test_blank"&gt;http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Jul 2008 05:33:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-12T05:33:55Z</dc:date>
    <item>
      <title>Table control programming</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187032#M1000905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me information about table control programming.&lt;/P&gt;&lt;P&gt;explain it with example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Rajesh Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2008 05:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187032#M1000905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-12T05:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Table control programming</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187033#M1000906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.niraj.tripod.com/id29.html" target="test_blank"&gt;http://sap.niraj.tripod.com/id29.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://hometown.aol.com/skarkada/sap/table_control/table_control.htm" target="test_blank"&gt;http://hometown.aol.com/skarkada/sap/table_control/table_control.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm" target="test_blank"&gt;http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2008 05:33:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187033#M1000906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-12T05:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Table control programming</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187034#M1000907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refer to this link&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2008 06:40:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187034#M1000907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-12T06:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Table control programming</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187035#M1000908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*How to create a Table control	*&lt;/P&gt;&lt;P&gt;To use table controls in ABAP program, declare a control statement in the declaration part of the type TABLEVIEW for every table control used in the program using the following syntax.&lt;/P&gt;&lt;P&gt;CONTROLS &lt;/P&gt;&lt;P&gt;Inside the module name, call the functional module F4IF_INT_TABLE_VALUE_REQUEST as similar as we used in F4 help for particular field. Import and export the required information to the functional module. In the screen painter for that field attributes set the Dropdown input field as u2018List boxu2019. See the snap shot for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to make lines and fields editable in table control?&lt;/P&gt;&lt;P&gt;In the screen painter you can set whether it is editable/non-editable by checking/uncheck the Input field check box. You can also change the settings dynamically in the PBO module. Inside the loop you have to loop at screen and change particular field screen-input = 0(non-editable) or 1(editable) and modify the screen depend on the conditions.&lt;/P&gt;&lt;P&gt;For example, in the table control you want to show some lines as editable &amp;amp; some of them as non editable. Those lines which need to be shown as non-editable are existing in database while those which are shown as editable are new entry from the users. &lt;/P&gt;&lt;P&gt;In order to achieve this you have to check Input field check box for all the fields in table control in the screen painter. Inside the loop in PBO check whether the table control line exist in the database table. If yes, then loop at screen and set the screen input = 0 and modify the screen. This will display the existing database records as non-editable even though we have checked the field as u2018Inputu2019 in the screen painter.&lt;/P&gt;&lt;P&gt;You can also group all the required fields to single group for example u2018GP1u2019 in the screen fields attribute and use in your program as below. It will change the field as non-editable only for those fields that are grouped as u2018GP1u2019.&lt;/P&gt;&lt;P&gt;  LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;      IF screen-group1 = 'GP1'.  u201Cfor specific condition&lt;/P&gt;&lt;P&gt;        screen-input = 0.&lt;/P&gt;&lt;P&gt;        MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;You can also use screen name directly if you are going to modify the screen attributes for one or two fields. See the code below&lt;/P&gt;&lt;P&gt;  LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;      IF screen-name = 'WA_ALOC-EMPID' OR screen-name = 'WA_ALOC-NAME1'. u201CFor specific condition&lt;/P&gt;&lt;P&gt;        screen-input = 0.&lt;/P&gt;&lt;P&gt;        MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;How to use Radio button and check boxes in table control.&lt;/P&gt;&lt;P&gt;In the screen painter à control elements there is an option create elements. On clicking this it will gives you screen like below screen. From this option select Radio button or check box and assigned the declared name to the field.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While handling Radio buttons in TableControl, there might be a possibility of selecting two radio buttons in a group that leads to dump error. We have already seen that TableControl will only loop for the visible rows.  For example if you have some 25 records in the internal table and your table control size is able to show only 8 records then in the PAI it will loop only for 8 records that are visible. If you are selecting 2nd line in the table control as radio button enabled then rest of the visible radio buttons in the TableControl would get grey out. Scroll down the table control to get out of the 2nd line (radio button selected line) from the visible lines in the table control. Once the 2nd line gone out of the table control visible rows then again the Radio button column will be enabled and it will be ready to accept Input though we already selected a Input for that. Here the Functionality of radio buttons fails.&lt;/P&gt;&lt;P&gt;In order to overcome this, If radio button field is selected, before modifying the internal table, read the internal table with radio button column = u2018Xu2019. If successful then clear the radio button selected field else donu2019t do anything.&lt;/P&gt;&lt;P&gt;  IF wa_aloc-manager = 'X'.  u201Cradio button field&lt;/P&gt;&lt;P&gt;    READ TABLE it_aloc INTO lwa_aloc WITH KEY manager = 'X'.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CLEAR lwa_aloc-manager.&lt;/P&gt;&lt;P&gt;      MODIFY it_aloc FROM lwa_aloc TRANSPORTING manager&lt;/P&gt;&lt;P&gt;                                                    WHERE manager = 'X'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How to use Table Controls in Tabstrips and Subscreens&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Generally in SAP transactions, screens are structured using Tabstrip controls. Tabstrips are used to categorize the data. If the data is to be organized as a table, then table control is used. We have seen how to use Tablecontrols in a screen, under this heading I would like to give the overview of Tabstrips and Subcreens.&lt;/P&gt;&lt;P&gt;In Screen Layout create a Tabstrip Control and declare the TabStrip control in the program using following syntax. &lt;/P&gt;&lt;P&gt;   Controls: tab1 TYPE TABSTRIP.  &lt;/P&gt;&lt;P&gt;Name of the control should match the name given in the screen attribute.&lt;/P&gt;&lt;P&gt;Any number of tabs can be added to the Tabstrip control using Control elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FCODE is used to capture the Function code of the Tab clicked.  This FCODE will be transferred to SY-UCOMM during execution. &lt;/P&gt;&lt;P&gt;Subscreen area has to be assigned to each tab in the Tabstrip control (Reference subscrn column) to hold the Subscreens. The concept of Subscreen here, is same as normal subscreens.&lt;/P&gt;&lt;P&gt;Tabstrip area can be controlled using control  attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Subscreen displayed on the mainscreen depends on the tab selected. This is controlled in the flow logic of the Mainscreen using the FCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE FCODE.&lt;/P&gt;&lt;P&gt;    WHEN 'EMP'.&lt;/P&gt;&lt;P&gt;      v_dynnr = 1000.&lt;/P&gt;&lt;P&gt;      tab1-activetab = 'EMP'.&lt;/P&gt;&lt;P&gt;      v_tabflag = 'X'.&lt;/P&gt;&lt;P&gt;    WHEN 'PROJ'.&lt;/P&gt;&lt;P&gt;      v_dynnr = 2000.&lt;/P&gt;&lt;P&gt;      tab1-activetab = 'PROJ'.&lt;/P&gt;&lt;P&gt;      v_tabflag = 'X'. ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the given example if tab1 is selected subscreen 1000 will be assigned to variable v_dynnr . This v_dynnr has the subscreen which has to be called in the PBO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flow logic of the mainscreen will be like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;  MODULE status_3000.&lt;/P&gt;&lt;P&gt;  MODULE set_tab_strip. "Set default tabstrip for the first time&lt;/P&gt;&lt;P&gt;  CALL SUBSCREEN subarea INCLUDING sy-repid v_dynnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;(Subscreen V_DYNNR is displayed in the subscreen area (subarea) of the tabstrip control)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;  CALL SUBSCREEN subarea.&lt;/P&gt;&lt;P&gt;  MODULE user_command_3000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subscreen can be designed as per the requirement like a normal screen, the only difference is the type of the screen should be 'Subscreen'. Keep in mind that subscreen do not have a 'okcode'. The function code of any action taken in subscreen is transferred to the 'okcode' of mainscreen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2008 06:56:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187035#M1000908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-12T06:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Table control programming</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187036#M1000909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refer to the link below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.niraj.tripod.com/id29.html" target="test_blank"&gt;http://sap.niraj.tripod.com/id29.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2008 10:39:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187036#M1000909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-12T10:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Table control programming</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187037#M1000910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say the table has more than 20 fields and at first shot there are say 15 screen fields and to enter the 16th field you have to press page down so in this case you have to have a control on table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below example would help you to analyse..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*"Selection screen elements............................................

parameters:
  p_file like rlgrap-filename.

*" Data declarations...................................................
*"--------------------------------------------------------------------*
* Work variables                                                      *
*"--------------------------------------------------------------------*
data w_file type string.
data wa(80) type c.
data : w_fname(20),
    w_tabix(2) type n,
    w_table(20),
    w_index,
    w_fkey(20),
    w_ftype(20),
    w_flen(20),
    w_fdesc(20).

*" Internal table declarations.........................................

*"--------------------------------------------------------------------*
* Internal table to hold 		                                    *
*"--------------------------------------------------------------------*
data:
  begin of itab_fields occurs 0,
    count,
    fname(20),
    fkey,
    ftype(10),
    flen(10),
    fdesc(30),
  end of itab_fields.

data:
  begin of itab_header occurs 0,
    dbcheck,
    tname(20),
    tdesc(40),
    devclass,
    maintain,
  end of itab_header.

data t_data like standard table of wa .
data:
  t_bdcdata like
   standard table of bdcdata with header line.
data w_count type i.
*"--------------------------------------------------------------------*
*       AT SELECTION-SCREEN ON VALUE-REQUEST EVENT                    *
*"--------------------------------------------------------------------*
at selection-screen on value-request for p_file.

  call function 'F4_FILENAME'
* EXPORTING
*   PROGRAM_NAME        = SYST-CPROG
*   DYNPRO_NUMBER       = SYST-DYNNR
*   FIELD_NAME          = ' '
   importing
     file_name           = p_file
            .

  w_file = p_file.

*"--------------------------------------------------------------------*
*                       START-OF-SELECTION EVENT                      *
*"--------------------------------------------------------------------*

start-of-selection.

  call function 'GUI_UPLOAD'
    exporting
      filename                      = w_file
     filetype                      = 'ASC'
*   HAS_FIELD_SEPARATOR           = 'X'
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
    tables
      data_tab                      = t_data
   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 &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

  loop at t_data into wa.
    if wa+0(1) eq 'H'.
      shift wa by 2 places left.
      split wa at ',' into itab_header-dbcheck
      itab_header-tname
      itab_header-tdesc
      itab_header-devclass
      itab_header-maintain.
      append itab_header.
      clear itab_header.
      add 1 to w_count.
    else.
      shift wa by 2 places left.
      split wa at ',' into itab_fields-fname
      itab_fields-fkey
      itab_fields-ftype
      itab_fields-flen
      itab_fields-fdesc.
      write w_count to itab_fields-count.
      append itab_fields.
      clear itab_fields.
    endif.
  endloop.
  call function 'BDC_OPEN_GROUP'
   exporting
     client                    = sy-mandt
*   DEST                      = FILLER8
     group                     = 'PADMA'
*   HOLDDATE                  = FILLER8
*   KEEP                      = FILLER1
     user                      = sy-uname
*   RECORD                    = FILLER1
*   PROG                      = SY-CPROG
* IMPORTING
*   QID                       =
   exceptions
     client_invalid            = 1
     destination_invalid       = 2
     group_invalid             = 3
     group_is_locked           = 4
     holddate_invalid          = 5
     internal_error            = 6
     queue_error               = 7
     running                   = 8
     system_lock_error         = 9
     user_invalid              = 10
     others                    = 11
            .
  if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.
  loop at itab_header.
    w_table = itab_header-tname.
    w_index = sy-tabix.
    refresh t_bdcdata.
    perform populate_se11.

    call function 'BDC_INSERT'
     exporting
       tcode                  = 'SE11'
*    POST_LOCAL             = NOVBLOCAL
*    PRINTING               = NOPRINT
*    SIMUBATCH              = ' '
*    CTUPARAMS              = ' '
      tables
        dynprotab              = t_bdcdata
     exceptions
       internal_error         = 1
       not_open               = 2
       queue_error            = 3
       tcode_invalid          = 4
       printing_invalid       = 5
       posting_invalid        = 6
       others                 = 7
              .
    if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

    refresh t_bdcdata.

    perform populate_se13.
    call function 'BDC_INSERT'
     exporting
       tcode                  = 'SE13'
*    POST_LOCAL             = NOVBLOCAL
*    PRINTING               = NOPRINT
*    SIMUBATCH              = ' '
*    CTUPARAMS              = ' '
      tables
        dynprotab              = t_bdcdata
     exceptions
       internal_error         = 1
       not_open               = 2
       queue_error            = 3
       tcode_invalid          = 4
       printing_invalid       = 5
       posting_invalid        = 6
       others                 = 7
              .
    if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

    refresh t_bdcdata.

    perform activate.

    call function 'BDC_INSERT'
     exporting
       tcode                  = 'SE11'
*    POST_LOCAL             = NOVBLOCAL
*    PRINTING               = NOPRINT
*    SIMUBATCH              = ' '
*    CTUPARAMS              = ' '
      tables
        dynprotab              = t_bdcdata
     exceptions
       internal_error         = 1
       not_open               = 2
       queue_error            = 3
       tcode_invalid          = 4
       printing_invalid       = 5
       posting_invalid        = 6
       others                 = 7
              .
    if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

  endloop.

  call function 'BDC_CLOSE_GROUP'
    exceptions
      not_open    = 1
      queue_error = 2
      others      = 3.
  if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  POPULATE_SE11
*&amp;amp;---------------------------------------------------------------------*
*    This subroutine is used to populate SE11 transaction data         *
*----------------------------------------------------------------------*
*     No interface parameters                                          *
*----------------------------------------------------------------------*
form populate_se11 .

  perform bdc_dynpro      using 'SAPMSRD0' '0102'.
  perform bdc_field       using 'BDC_CURSOR'
                                'RSRD1-TBMA_VAL'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=ADD'.
  perform bdc_field       using 'RSRD1-TBMA'
                                itab_header-dbcheck.
  perform bdc_field       using 'RSRD1-TBMA_VAL'
                                itab_header-tname.
  perform bdc_dynpro      using 'SAPLSD41' '2200'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=CHANGE_MAINTFLAG'.
  perform bdc_field       using 'DD02D-DDTEXT'
                                itab_header-tdesc.
  perform bdc_field       using 'BDC_CURSOR'
                                'DD02D-MAINFLAG'.
  perform bdc_field       using 'DD02D-CONTFLAG'
                                itab_header-devclass.
  perform bdc_field       using 'DD02D-MAINFLAG'
                                itab_header-maintain.
  perform bdc_dynpro      using 'SAPLSD41' '2200'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=DEF'.
  perform bdc_field       using 'DD02D-CONTFLAG'
                                'A'.
  perform bdc_field       using 'DD02D-MAINFLAG'
                                'X'.
  perform bdc_dynpro      using 'SAPLSD41' '2200'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=FTYP'.
  w_tabix = 0.
  loop at itab_fields where count eq w_index.
    add 1 to w_tabix.

    if w_tabix gt 13.

      perform bdc_dynpro      using 'SAPLSD41' '2200'.
      perform bdc_field       using 'BDC_CURSOR'
                                   w_fname.

      perform bdc_field       using 'BDC_OKCODE'
                                    '=P+'.
      w_tabix = 2.
    endif.
    concatenate 'DD03P-FIELDNAME(' w_tabix ')' into w_fname.
    concatenate 'DD03P-KEYFLAG(' w_tabix ')' into w_fkey.
    concatenate 'DD03D-DATATYPE(' w_tabix ')' into w_ftype.
    concatenate 'DD03P-LENG(' w_tabix ')' into w_flen.
    concatenate 'DD03P-DDTEXT(' w_tabix ')' into w_fdesc.

    perform bdc_dynpro      using 'SAPLSD41' '2200'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using w_fname
                                  itab_fields-fname.
    perform bdc_field       using w_fkey
                                  itab_fields-fkey.
    perform bdc_field       using w_ftype
                                  itab_fields-ftype.
    perform bdc_field       using w_flen
                                    itab_fields-flen.
    perform bdc_field       using w_fdesc
                                  itab_fields-fdesc.


  endloop.

  perform bdc_dynpro      using 'SAPLSD41' '2200'.

  perform bdc_field       using 'BDC_OKCODE'
                                '=WB_SAVE'.

  perform bdc_dynpro      using 'SAPLSTRD' '0100'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=ADD'.
  perform bdc_field       using 'KO007-L_DEVCLASS'
                                'Z1139'.
  perform bdc_field       using 'KO007-L_AUTHOR'
                                'SAPDEV02'.
  perform bdc_dynpro      using 'SAPLSTRD' '0300'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=LOCK'.
  perform bdc_field       using 'KO008-TRKORR'
                                'TR1K900085'.

  perform bdc_dynpro      using 'SAPLSD41' '2200'.
  perform bdc_field       using 'BDC_CURSOR'
                                'DD03P-DDTEXT(03)'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=BACK'.
  perform bdc_dynpro      using 'SAPMSRD0' '0102'.
  perform bdc_field       using 'BDC_CURSOR'
                                'RSRD1-TBMA_VAL'.

  perform bdc_field       using 'BDC_OKCODE'
                                '=BACK'.


  .
endform.                    " POPULATE_SE11
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  POPULATE_SE13
*&amp;amp;---------------------------------------------------------------------*
*    This subroutine is used to populate SE13 data                     *
*----------------------------------------------------------------------*
*     No interface parameters                                          *
*----------------------------------------------------------------------*
form populate_se13 .

  perform bdc_dynpro      using 'SAPMSEDS' '0010'.
  perform bdc_field       using 'DD09V-TABNAME'
                                w_table.
  perform bdc_field       using 'BDC_OKCODE'
                                'PFLG'.
  perform bdc_dynpro      using 'SAPMSEDS' '0050'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=SICH'.
  perform bdc_field       using 'DD09V-TABART'
                                'APPL0'.
  perform bdc_field       using 'DD09V-TABKAT'
                                '0'.
  perform bdc_field       using 'ALLOWSTATE-NOT_ALLOWED'
                                'X'.
  perform bdc_dynpro      using 'SAPMSEDS' '0050'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=BACK'.
  perform bdc_field       using 'DD09V-TABART'
                                'APPL0'.
  perform bdc_field       using 'DD09V-TABKAT'
                                '0'.
  perform bdc_field       using 'ALLOWSTATE-NOT_ALLOWED'
                                'X'.
  perform bdc_field       using 'BDC_OKCODE'
                               '=WB_BACK'.
  perform bdc_dynpro      using 'SAPMSEDS' '0050'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=BACK'.

  perform bdc_dynpro      using 'SAPMSEDS' '0010'.

  perform bdc_field       using 'BDC_OKCODE'
                                '=BACK'.

endform.                    " POPULATE_SE13
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ACTIVATE
*&amp;amp;---------------------------------------------------------------------*
*     This subroutine is used to activate the table from SE11          *
*----------------------------------------------------------------------*
*     No interface parameters.                                         *
*----------------------------------------------------------------------*
form activate .

  perform bdc_dynpro      using 'SAPMSRD0' '0102'.
  perform bdc_field       using 'RSRD1-TBMA'
                                'X'.
  perform bdc_field       using 'RSRD1-TBMA_VAL'
                                w_table.

  perform bdc_field       using 'BDC_OKCODE'
                                'ACT'.
  perform bdc_dynpro      using 'SAPLSEWORKINGAREA' '0205'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=WEIT'.

  perform bdc_dynpro      using 'SAPMSRD0' '0102'.

  perform bdc_field       using 'BDC_OKCODE'
                                '=BACK'.


endform.                    " ACTIVATE
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  bdc_dynpro
*&amp;amp;---------------------------------------------------------------------*
*    This subroutine is used to populate the screen information        *
*----------------------------------------------------------------------*
*      --&amp;gt;prgname   Program name
*      --&amp;gt;screenno  Screen number
*----------------------------------------------------------------------*
form bdc_dynpro  using    value(prgname)
                          value(screenno).

  clear t_bdcdata.
  t_bdcdata-program = prgname.
  t_bdcdata-dynpro = screenno.
  t_bdcdata-dynbegin = 'X'.
  append t_bdcdata.

endform.                    " bdc_dynpro
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  bdc_field
*&amp;amp;---------------------------------------------------------------------*
*     This subroutine is used to populate the field values             *
*----------------------------------------------------------------------*
*      --&amp;gt;fnam   Field name                                            *
*      --&amp;gt;fval   Field value                                           *
*----------------------------------------------------------------------*
form bdc_field  using    value(fnam)
                         value(fval).
  clear t_bdcdata.

  t_bdcdata-fnam = fnam.
  t_bdcdata-fval = fval.
  append t_bdcdata.

endform.                    " bdc_field

******flat file ******
**H,X,Z1139_REC_30,Recorded Table,A,X*
**I,mandt,X,clnt,3,Client*
**I,ENO,X,char,6,Employee Number*
**I,ENAME, ,Char,20,Employee Name*
**I,deptno, ,char,10,Department Number*
**I,salary, ,int4, ,Salary*
**I,deptno,X,char,10,Department Number*
**I,dname, ,char,20,Department Name*
**I,Locate, ,char,20,Location*
**I,deptno,X,char,10,Department Number*
**I,dname, ,char,20,Department Name*
**I,Locate, ,char,20,Location*
**I,deptno,X,char,10,Department Number*
**I,dname, ,char,20,Department Name*
**I,Locate, ,char,20,Location*
**I,deptno,X,char,10,Department Number*
**I,dname, ,char,20,Department Name*
**I,Locate, ,char,20,Location*
**I,deptno,X,char,10,Department Number*
**I,dname, ,char,20,Department Name*
**I,Locate, ,char,20,Location*
**H,X,Z1139_REC_31,Recorded Table,A,X*
**I,mandt,X,clnt,3,Client*
**I,deptno,X,char,10,Department Number*
**I,dname, ,char,20,Department Name*
**I,Locate, ,char,20,Location*

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope the above example would help you and solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narin Nandivada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2008 11:34:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-programming/m-p/4187037#M1000910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-12T11:34:24Z</dc:date>
    </item>
  </channel>
</rss>

