Unable to add ztables in table control

Dear experts,
i have got ztables, using table controls in module pool. i need to display multiple tables in TC for accepting the values and also displaying the data from the database. I am also not getting the column headings for the fields from ztables on the TC.
Thanks,
Regards,CHK

Hello
Check this
http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/frameset.htm
Thanks

Similar Messages

  • How to add radiobutton in table control

    dear all
    i want to add radiobutton in table control and want to select the corresponding data
    & display that selected data in another screen
    please guide.
    Moderator Message: Please search for available information before posting.
    Edited by: kishan P on Jun 3, 2011 4:08 PM

    Hi,
    Go through the below link.
    <<link removed by moderator>>
    Hope it will be useful to you.
    Edited by: kishan P on Jun 3, 2011 4:07 PM

  • How to add column in table control for transaction APPCREATE

    Hi All,
    How can i add the additional column in table control for transaction APPCREATE.
    There is structure PT1045_EXT present behind table control. But not found any customer exit or badi to display on screen.
    Please help...

    You can add new columns
    If you add new columns in tr. PHAP_CATALOG

  • How to Insert Data in Ztable Using table Control

    Hi All,
      Please give some ideas of how to store the data from table control into the ztable database.
    There is a table control in which the end user enters the data manually and clicks the save button. Then, the data from the table control will go and store in the ztable.
    regards
    Vicky Kumar

    Hi Vicky,
    are you talking about ABAP transaction SE11 or about creating tables in the SAP HANA directly, i.e. in the HANA Modeler perspective?
    Cheers,
      Jasmin

  • How to add rows in table control for data recording BDC?

    hello,
    pl tell me the way to upload data through BDC in table control of screen .
    how to add fields inrecording of table control?
    Please give some code in this regard.
    I am generous in giving points..pl help!

    Hi,
    While doing code under recording first you need to do the recording with sample data under a particular transaction like T-code XK01 (Vendor creation).
    Take an example of create vendor using T-code XK01:
    Go to t-code 'SHDB' under make recording for XK01 with sample data and once if you complete the recording means after vendor creation check the source code bye by pressing the button  'Program', it shows the total coding for recording of what you entered the test data.
    Then you will create one program and copy that source code of recording into your program, and now you have to remove the values at perform statement and give the internal table field name.
    Like that you can develop your own code along with your validations.
    my best suggestion is don’t see the example code of recording method because any one for standard t-code should get the code from recording with sample data, so first tryout with your own recording method and you can understand the code step by step.
    With these I hope you will get some idea of recoding method.
    Let me know for further doubts.
    Regards,
    Vijay.

  • Add Line in Table control

    Hi,
       I have a proble in table control where my table control have 3 lines and when i enter three records i can see the records in table control scrren and when i want to add a 4 th line  i need to press a BUTTON.when i press the button a new line inserted but i need to scroll to see the fourth record,but my req ments is to see the 4th record in the 3 rd line of the table control and 3 rd will be seen in the 2 nd line of the table control. Is there any good soultions to achieve this.
    Thanks,
    Deesanth

    Hi Deesanth,
    In the PBO of the screen just add code:-
    tab_ctrl-lines = tab_ctrl-lines + 10. "tab_ctrl is name of table control
    This will insert 10 extra line in the table control.
    You can see these empty line when you scroll the vertical scroll bar of the table control.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • SHDO - add column in table control in CRMD_ORDER

    Hi,
    is it possible to add a EEWB generated column to table control (on the first screen)
    in TCODE CRMD_ORDER ?
    did anyone ever do that ?
    thank you,
    Regards,
    michal

    hehe
    it would be great to get feedback on everything here but I'd better obey the forum rules
    too many opened forums and I sometimes get a little lost
    Regards,
    michal

  • Insert into ztable through table control

    hai
    i have taken the table control in the screen painter .
    n i have enter the data in table control
    now i like to append the dat into table
    plz helpme need the code

    Refer the link -
    Update internal table data from table control
    Transfer data from table control to internal  table
    Regards,
    Amit
    Reward all helpful replies.

  • Unable to scroll down in table control screen .

    Hi techies ,
    am attaching the table control screen .
    am not able to scroll down in that .
    and also may i know the reason why am not able to tick the checkbox ?
    it seems in disable mode .

    Hi Ajay,
    It was the only reason, ever i have faced...
    And other possibility is regarding tbc-lines, but i saw that you were doing this using describe table.
    Sometimes the table control will not show all the records in internal table(case while changing number of records in internal table each time )..
    At this case you have to set the lines in TBC.. using
    describe table itab lines tbc-lines.
    tbc-lines is very useful, if you want to enable a new blank line in table control, just do this
    tbc-lines = tbc-lines + 1.
    Explore all properties of table control it is very useful.
    I think, i could solved your issue.. thanks for your appreciation.
    Regards
    Sreekanth

  • Add lines to table control TCTRL_U_ERF_AUFTRAG

    As I have not found any topic concerning this issue yet, I have created this thread:
    Let us imagine, we enter data in VA01. The table control TCTRL_U_ERF_AUFTRAG (rather: a tableview) is situated in dynpro 4900 of SAPMV45A.
    At first we type in five items and press enter. The PAI starts and we begin to loop at the lines of this table control. The data is transfered to workareas such as VBAP and RV45A and finally stored in itabs such as XVBAP and XVBEP. Works fine.
    Now we're approaching my question:
    The PAI is processing item 2, e.g., and within a userexit - let's say move_field_to_vbap - I happen to notice due to some checks that a new line in between the second and third item must be filled with an additional item.
    Unfortunatly, we simply loop at the table control, not at a corresponding itab. The item - let's name it 2.5 - need the same standard processing, checks and userexits we all are used to in SAPMV45A.
    Does anybody have a clue how this issue colud be solved? Any help would be highly appreciated.
    Kind regards,
    Dennis

    HI,
    According to my understanding : an extra line item(may be a free item based on the given criteira) may be inserted in the internal table.
    Now we have conditions before hand where the extra line items are created.
    So let us loop the table control and read the internal table with the condition(where an extra line item is inserted).
    This would solve your proplem.
    Regards,
    Bhaskar.

  • Unable to add Action for table - throwing Fatal error while rendering the table after adding

    Hi,
    I am not able to add action to the table i created.
    when i click on events and then Create Action for "onFilter" event, it is giving me Internal Error. The message details is:
    eclipse.buildId=@qualifier@
    java.version=1.6.0_45
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en
    Command-line arguments:  -os win32 -ws win32 -arch x86 -data C:\NWDS\Workspace
    Error
    Thu Jul 17 11:17:27 IST 2014
    Internal Error
       Plug-In Name: Web Dynpro HTML Rendering
       Internal Error  : com.sap.ide.webdynpro.rendering.html
       Class      : com.sap.ide.webdynpro.viewdesigner.ur.RenderingService
       Method     : renderDelta
       Message    : java.lang.RuntimeException: nullFatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSSapTableRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter@1376233Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSFlowLayoutRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter@1102ae6Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.GroupAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSGroupRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.GroupAdapter@70815bFatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSFlowLayoutRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter@3cb708Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSScrollContainerRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter@14a4b5Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSFlowLayoutRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter@14983d6Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSScrollContainerRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter@16e8151
       Exception  : java.lang.RuntimeException: java.lang.RuntimeException: nullFatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSSapTableRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter@1376233Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSFlowLayoutRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter@1102ae6Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.GroupAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSGroupRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.GroupAdapter@70815bFatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSFlowLayoutRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter@3cb708Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSScrollContainerRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter@14a4b5Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSFlowLayoutRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter@14983d6Fatal rendering error at control com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter [] and renderer com.sap.tc.ls.renderer.ie6.LSScrollContainerRenderer. Please contact the developer of the renderer. com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ScrollContainerAdapter@16e8151
          [Error: com.sap.ide.tools.services.ui.dialog.DialogService  Thread[main,6,main]]
    The complete error details is also attached with the message.
    After creating the action, the table looks like below:
    Can someone help me on fixing this issue.
    Thanks,
    Abhishek.

    Its a rendering issue with the NWDS/IDE.
    Try, close and re-open for fix it. If it still persists, uninstall NWDS and re-install the right version of NWDS w.r.t the Portal server.
    Regards,
    Sharath

  • Unable to Update data in Ztable (dbase) through Table Control.

    Hi Experts.
    I am able to pull dta from Ztable into table control and also able to insert a new line and delete a row from table control. But after trying a lot I am unbale to pass the same from Table control to Ztable.
    Any ideas. Seems like here Update of Ztable needs some different treatment.
    PLZ LOOK into the code in red only. rest are for reference.
    The code on the Flow Logic Screen:
    PROCESS BEFORE OUTPUT.
      module init_100.
      LOOP At it_auftrag1 with CONTROL tctrl1 cursor tctrl1-current_line.
      ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT it_auftrag1.
       Module modify_it_auftrag1.
    ENDLOOP.
    MODULE fcode_100.
    MODULE USER_COMMAND_9000.
    The code on main Screen (Mod. Pool Screen ) follows:
    PROGRAM  SAPMZDEMO_MPOOL_06.
    TABLES: ZLT_Auftrag1, ZLT_Kunde.
    DATA: fcode2(4), fcode(4).    "OK_Code.
    CONTROLS : tctrl1 type TABLEVIEW USING SCREEN '9000'.
    DATA: col TYPE cxtab_column.
    DATA: demo_cprop, demo_tprop.
    DATA:  Begin Of it_Auftrag1 occurs 20,
            marked.
            include structure ZLT_auftrag1.
    DATA:  END OF it_Auftrag1.
    DATA: linno TYPE i.
    DATA: fld(20).
    DATA: off TYPE i.
    module fcode_100 input.
    endmodule.                 " fcode_100  INPUT
    module modify_it_auftrag1 input.
      modify it_Auftrag1 index tctrl1-current_line.
    endmodule.                 " modify_it_auftrag1  INPUT
    module init_100 output.
      set pf-status 'ZSTATUS01'.
      Describe Table it_auftrag1  lines  tctrl1-lines.   "TO add Scroll Bar to Table Control1
      UPDATE ZLT_Auftrag1 From it_auftrag1.
    endmodule.                 " init_100  OUTPUT
    module USER_COMMAND_9000 input.
       CASE sy-ucomm.
    *To Populate Data into Kunde through Pushbuttons
        When 'OK_GETK'.
            IF ZLT_Kunde-K1 is NOT INITIAL.
                SELECT SINGLE *
                FROM  ZLT_Kunde
                Where K1 = ZLT_KUNDE-K1.
               IF ZLT_Kunde-K1 is NOT initial.
                  Select *
                  From ZLT_Auftrag1
                  INTO Corresponding fields of TABLE it_auftrag1
                  Where A3 = ZLT_Kunde-K2.
               ENDIF.
            ELSE.
                MESSAGE S000(8i) With 'Enter Kunde Name'.
            ENDIF.
      when 'DELL'.
    * remove marked lines
           delete it_auftrag1.
          loop at it_auftrag1 where marked = 'X'.
          UPDATE ZLT_Auftrag1 From it_auftrag1.
          endloop.
          if sy-subrc <> 0.
            get cursor field fld line linno offset off.
            set cursor field fld line linno offset off.
            if fld cp 'IT_auftrag1*' and sy-subrc = 0.
              linno = linno + tctrl1-top_line - 1.
              delete it_auftrag1 index linno.
              tctrl1-lines = tctrl1-lines - 1.
            endif.
          endif.
       When 'INSL'.
    * insert line above cursor position
          get cursor field fld line linno offset off.
          set cursor field fld line linno offset off.
          if fld cp 'IT_auftrag1*' and sy-subrc = 0.
            if linno >= 1.
              linno = linno + tctrl1-top_line - 1.
              clear it_auftrag1.
              insert it_auftrag1 index linno.
              tctrl1-lines = tctrl1-lines + 1.
            else.
              clear it_auftrag1.
              append it_auftrag1.
              tctrl1-lines = tctrl1-lines + 1.
            endif.
          endif.
         When 'SAVE'.
         loop at it_auftrag1 where marked = 'X'.
    *        Modify it_Auftrag1.
            Modify ZLT_Auftrag1 From it_Auftrag1.
          Endloop.
            IF sy-subrc = 0.
             MESSAGE s000(8i) With 'Data Saved'.
           ENDIF.
       When 'BACK'.
           Leave Program.
        When 'OK_CLEAR'.
          Clear : ZLT_KUNDE, ZLT_AUFTRAG1, it_auftrag1.
    ENDCASE.
    endmodule.                 " USER_COMMAND_9000  INPUT
    Looking forward for your advice,
    Regards
    Chandan

    Hi Venkat,
    Thanks again. I will try ur suggestion too. In the meanwhile I did the following changes in the code:
    Purpose: After data is getting pulled from dbase table (ZLT_Auftrag1) into internal table it_auftrag1 then and just after I press the button delete ( i.e. When the user command starts: When 'DELL' )
    then I delete all the contents reflecting in it_auftrag1 from ZLT_Auftrag1, Now the Ztable is empty but it_auftrag1 holds all values. futher when loop starts then the Marked line gets deleted. Now at this stage the it_Auftrag1 contains all data of ZLT_auftrag1 except the line that I want to delete. If I am able to MODIFY  the ZLT_auftrag1 from it_Auftrag1 at this stage then ZLT_Auftrag1 will again be populated with all those data except the line that I want to delete.
    Here goes the code that I modified ( ref the code in my 1st post in red to compare)
       WHEN 'DELL'.
    * remove marked lines
    *      If it_Auftrag1-Marked = 'X'.
            DELETE from ZLT_Auftrag1 where A3 = ZLT_kunde-K2.
    *      ENDIF.
          IF sy-subrc = 0.
                loop at it_auftrag1 where marked = 'X'.
                 DELETE it_auftrag1.
    *             INSERT ZLT_Auftrag1 From TABLE it_auftrag1 accepting duplicate keys.
    *             UPDATE ZLt_auftrag1 from TABLE it_auftrag1.
    *             MODIFY ZLT_Auftrag1 From TABLE it_auftrag1.
                endloop.
    *            INSERT ZLT_Auftrag1 From TABLE it_auftrag1.
    *             UPDATE ZLt_auftrag1 from TABLE it_auftrag1.
    *             MODIFY ZLT_Auftrag1 From TABLE it_auftrag1.
    *        If sy-subrc = 0.
    *          MESSAGE S000(8i) With 'Data Deleted from Database'.
    *        ENDIF.
          ENDIF.
            MODIFY  ZLT_Auftrag1 from it_Auftrag1.  ==> This modification doesn't works.
             If sy-subrc = 0.
              MESSAGE S000(8i) With 'Data Deleted from Database'.
            ENDIF.
          if sy-subrc <> 0.
            get cursor field fld line linno offset off.
            set cursor field fld line linno offset off.
            if fld cp 'IT_auftrag1*' and sy-subrc = 0.
              linno = linno + tctrl1-top_line - 1.
              delete it_auftrag1 index linno.
              tctrl1-lines = tctrl1-lines - 1.
            endif.
          endif.
    Looking forward for your suggestions.
    Regards
    Chandan

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

  • Error while trying to change the Column description in Table Control

    Hi,
    I have created a table control using the wizard in Module Pool.
    When i try to change the column description of the table control or adjust any other element which is already available on the screen and not in table control. It gives me an error
    Unable to transfer data. End Program?
    Any help would be appreciated.
    Thanks
    Sarves S V K

    Hi.,
    Check these  [Table Control Change Column Description|Add new columns in table control in custom screen program;
    and  [Add Columns in Table Control|Re: Table control columns]
    else  delete and create Table control Again..!!
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Baffling Table Control

    Hi,
    Currently using SAP 4.7 SAPKB62011
    The need was to develop a program, which based on a selection-criteria displays a table(editable) and some changes will be done in the table and data should get saved.
    The best approach I assumed was to
    a) Create a report, define the selection screen parameters
    b) Do validation in at selection-screen
    c) If all validations are proper, select values to be shown in table control
    d) call screen 9000
    Everything is working perfectly, except for adding new lines in table control.
    When I execute select query in AT SELECTION-SCREEN event before calling the screen 9000, then I am not able to add values to table control.
    But if I put the select query in the PBO of screen 9000, I am able to add new values. Only those values which are already present in table control can be changed. I am not able to add any new entries.
    In my opinion, there should not be a select query in PBO, because that query would hit the database in all possible events.
    Any particular reason, why.
    <b>AT SELECTION-SCREEN code</b>
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'ONLI'.
          lv_pernr = p_pernr.
          lv_lifnr = p_lifnr.
    *      SELECT *
    *        FROM zpersoninfo
    *        INTO TABLE lt_zpersoninfo
    *       WHERE personno = lv_pernr.
    *      IF sy-subrc <> 0.
    *      ENDIF.
    *      APPEND INITIAL LINE TO LT_ZPERSONINFO.
          CALL SCREEN 9000.
      ENDCASE.
    <b>Dynpro code</b>
    PROCESS BEFORE OUTPUT.
      MODULE pbo_9000.
    LOOP AT lt_zpersoninfo INTO zpersoninfo WITH CONTROL tablecontrol CURSOR
    tablecontrol-current_line.
        MODULE pbo_tc_9000.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP.
        MODULE pai_tc_9000.
      ENDLOOP.
      MODULE pai_9000.
    <b>PBO_9000</b>
    MODULE pbo_9000 OUTPUT.
      SET PF-STATUS lv_pfstatus.
      pa0315-pernr = lv_pernr.
      SELECT *
        FROM zpersoninfo
        INTO TABLE lt_zpersoninfo
       WHERE personno = lv_pernr.
      IF sy-subrc <> 0.
      ENDIF.
      APPEND INITIAL LINE TO LT_ZPERSONINFO.
    ENDMODULE.                 " PBO_9000  OUTPUT
    <b>PBO 9000 - Table Control Code</b>
    MODULE pbo_tc_9000 OUTPUT.
      LOOP AT SCREEN.
        IF lv_pfstatus = 'DISPLAY'.
          CASE screen-name.
            WHEN 'ZPERSONINFO-SERVICENO'.
              screen-input = '1'.
              screen-active = '1'.
            WHEN 'ZPERSONINFO-MANDATORY'.
              screen-input = '1'.
              screen-active = '1'.
          ENDCASE.
        ELSEIF lv_pfstatus = 'CHANGE'.
          CASE screen-name.
            WHEN 'ZPERSONINFO-SERVICENO'.
              screen-input = '0'.
            WHEN 'ZPERSONINFO-MANDATORY'.
              screen-input = '0'.
          ENDCASE.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    ENDMODULE.
    Let me know if I have skipped some information, which you may find it useful to find the solution.
    Regards,
    Subramanian V.

    That is because I didn't upate the 'LINES' field in tablecontrol. How silly !!
    Regards,
    Subramanian V.

Maybe you are looking for