View table vs standard table

Hi,
i am new to abap programming, i want to know which table are always to use in real environment? view or standard table?
Besides, any reference book has specify all sap table, view, function etc.
Thanks.

hii thr,
standard tables are always there but it depends upon your requirement what you want,you can always select data from tables but if the no of tables,fields and data is large it becomes a performance issue,veiws are very helpful in such cases there are 3 types of views have a look,please reward points if of any use to you,
The followings are different types of views:
- Database View   (SE11)
Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set. 
In database views, the join conditions can be formulated using equality relationships between any base fields. In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.
- Help View    ( SE54)
Help views are used to output additional information when the online help system is called. 
When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field. If this is not the case, the help view is displayed in which the check table of the field is the primary table. Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view. 
- Projection View
Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.
A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.
- Maintenance View   ( SE54 )
Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.

Similar Messages

  • Let me know the standary primary key tables in standard table??

    let me know the standary primary key tables in standard table??

    Hi,
    You can go and check the primary keys of a table in SE11 by entering the table name and pressing display.
    You will get to see that there will be some fields with a tick mark in the primary key column.The fields which have such tick marks are the primary keys of that table.
    As far as I know there is nothing called primary key tables.All tables have some fields as primary keys based upon which a record is uniquely defined in that table.
    Hope it was useful.
    Thanks,
    Sandeep.

  • Maintenance view on the standard table

    Hi,
    We need to have a maintenance view on the standard XYZ table .
    Since it is a std table. we would not be able to create a maintenance view since we need an access key.
    So we have to :
    1. Copy the table XYZ into a Z_table. (just the structure alone).
    2. Create a table maintenance generator on this table.
    3. When the data is being saved in the maintenance view, update the record in the XYZ.
    How we can populate the XYZ when the Z_table is populated with data?
    Can anyone help in this regard.
    Thanks and regards,
    Kapil

    Hi Rich,
            Thanks for your reply.
    I am referring to standard table "comc_settyp_attr" in SAP-CRM system . I have copied it and created a z_table. But its not allowing me to create a maintainance view. Its giving an error :
    GUID in table key (Field name CUSTINFO) not supported.
    But when i create the z_table without the GUID(char 32) as key field, it generates table maintenance. But the key field is required.
    Can you help me in this regard.
    Regards,
    Kapil

  • Can we create a view involving a standard table and a ZTable ?

    Hi,
    I created a view based on 2 tables : EKKO and a Ztable having EBELN field in common.
    Now, when i try to create a PO in ME21N , this view should get updated.But,It doesn't happen so.
    So i want to confirm that is it not possible to create a view on a Ztable...
    Also can anyone suggest any other option to do so...

    Hi,
       Yes you can create a view using a standard view using a standard Data base table and a custom data base table. But this getting updated would not be done by the standard program of Tcode ME21N, I reckon you need to write the logic of updation in an enhancement.
    Regards,
    Murthy.

  • View of standard tables in ides

    hi i am beginner of ABAP i am installed sap demo system (ides erp)  but unable to view records of standard table such as mara,vbap etc. the fields and data element are able to view but unable to view the record it displayed as " NO TABLE ENTRIES FOUND FOR SPECIFIED KEY" IF WE CALL THESE TABLE IN SE38 MEANS after executing it by using ALVLIST report_ it display that list contains no data.any body please give me solution.......

    is there any possibility for learning ides for student version ? like trial because it is really make difficult for working no records are unable to retrieve so i can't practice any exercise.
    Edited by: thayuman on May 20, 2011 6:51 AM

  • Unable to see SAP standard table in HANA Studio

    Hello Experts,
    I have  requirement to built calculation view of SAP Standard Table like BSEG, BKPF table
    but i am unable to view this table in Catalog view in HANA Studio.
    Do i require any authorization or configuration to be done to view this table in those catalog view in hana studio.
    Regards,
    Mr. Dehey

    Dehey,
    Assuming that your SAP HANA is the primary database for your backend ERP instance (Suite on HANA), you need to have minimum SELECT privilege on the SAP<SID> schema, <SID> is the system identifier of your ERP instance.
    Ask youur SAP HANA admin to grant the SELECT privilege on SAP<SID> schema to your user ID by executing the below SQL query from SQL console.
    GRANT SELECT ON SCHEMA SAP<SID> TO <YOUR_USER_ID>;
    Hope this helps.
    Regards,
    Srinivas K.

  • Add entries to standard table

    Hey guys,
    how can i add entries to a standard table (generic table)?
    I have a function modul which has an export table of standard table and i'd to add some entries to this table. How can i do that? i don't know the table line type.
        thx,
           Wei-Ming

    Hi Wei-Ming,
    I was not sure what you were asking at the very first question, but it was clear for me at your 2nd post (but it seems it was not obvious for the other persons).
    You must use field symbols or data references to manipulate the generic complex data objects (structure or internal table).
    For example:
    FIELD-SYMBOLS <ls_line> TYPE ANY.
    FIELD-SYMBOLS <l_field> TYPE ANY.
    APPEND INITIAL LINE TO et_test ASSIGNING <ls_line>.
    ASSIGN COMPONENT 1 OF STRUCTURE <ls_line> TO <l_field>.
    or
    DATA dref TYPE REF TO DATA.
    CREATE DATA dref LIKE LINE OF et_test.
    ASSIGN dref->* TO <ls_line>. "dereferencing data reference
    I let you search the forum and the ABAP documentation for more information.
    BR
    Sandra

  • LIKE STANDARD TABLE OF generic

    Hello,
    Is there a way to make the following code work, e.g. using RTTI?
    IMPORTING work_area TYPE data
    DATA table LIKE STANDARD TABLE OF work_area.
    --Florian

    Hello,
    Let me state my aim more precisely. I have a method INNER with the following definition:
    METHODS inner
      EXPORTING
        et_data TYPE index table.
    Now I would like to create a wrapper method WRAPPER with the following definition and content:
    METHODS wrapper
      EXPORTING
        es_first_line TYPE data
        et_table      TYPE index table.
    METHOD wrapper.
      CALL METHOD inner
        IMPORTING
          et_data = et_table.
      READ TABLE et_table INTO es_first_line INDEX 1.
    ENDMETHOD.
    Optimally, method WRAPPER could be called thus:
    DATA work_area TYPE some_structure.
    CALL METHOD wrapper
      IMPORTING
        es_first_line = work_area.
    This fails with an OBJECTS_MOVE_NOT_SUPPORTED error. As the exporting parameter ET_TABLE is not requested, it is interpreted as itable with character-like line type. But as WORK_AREA is a complex structure, it is incompatible to a character-like field and the READ TABLE crashes.
    Optimally, method WRAPPER shall have no exporting parameter ET_TABLE at all, but look something like this:
    METHODS wrapper
      EXPORTING
        es_first_line TYPE data.
    METHOD wrapper.
      DATA lt_table LIKE STANDARD TABLE OF es_first_line.
      CALL METHOD inner
        IMPORTING
          et_data = lt_table.
      READ TABLE lt_table INTO es_first_line INDEX 1.
    ENDMETHOD.
    To do so, it was necessary to create a standard table of generic type, compare my initial post.
    --Florian

  • Standard tables hashed tables

    in SORT we will not use sorted tables like where we will not use STANDARD TABLES and HASDED TABLES ........CAN U EXPLAIN IN DETAIL .......

    <b>Standard Internal Tables</b>
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command).  The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    <b>Sorted Internal Tables</b>
    Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition.  Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    <b>Hashed Internal Tables</b>
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.
    <b>Index Tables</b>
    Index table is only used to specify the type of generic parameters in a FORM or FUNCTION. That means that you can't create a table of type INDEX.
    Internal tables are not DB tables. Standard and Sorted tables in combined are basically called as Index tables and there nothing else. Here is the hierarchy
              ANY TABLE
                                                |
                         |                                                    |
                 Index Tables                                    Hashed Table
                         |          
        |                                                     |
    Standard Table                      Sorted Table
    Reward  points if  it is usefull .....
    Girish

  • Custom Table updation thru table control

    Hi All,
    My requirement is to update the custom table by creating a custom screen with table control,say my z table has 2 fields name1 and bukrs.
    if i enter the value in table control then i click the save icon these fields should get updated in the z table .can any one send me the piece of code for this,since i have not worked on table control i need it in detail.
    Useful answers will be rewarded....
    Thanks in Advance.....

    PROGRAM  ZSD_REBATE_MASTER MESSAGE-ID FV
             NO STANDARD PAGE HEADING.
    TABLES: KONA,
            ZSD_BILLINFO,
            ZSD_RBT_ELG_INV,
            KNVV.
    DATA: OK_CODE LIKE SY-UCOMM,
          L_CODE LIKE SY-UCOMM.
    DATA : BEGIN OF I_KNVV_DATA OCCURS 0,
           GJAHR LIKE ZSD_RBT_MAS_DATA-GJAHR,
           KNUMA LIKE ZSD_RBT_MAS_DATA-KNUMA,
           VKBUR LIKE ZSD_RBT_MAS_DATA-VKBUR,
           VKORG LIKE ZSD_RBT_MAS_DATA-VKORG,
           VTWEG LIKE ZSD_RBT_MAS_DATA-VTWEG,
           SPART LIKE ZSD_RBT_MAS_DATA-SPART,
           OTQTY LIKE ZSD_RBT_MAS_DATA-OTQTY,
           PCPDAYS LIKE ZSD_RBT_MAS_DATA-PCPDAYS,
           OTPC LIKE ZSD_RBT_MAS_DATA-OTPC,
           MATKL LIKE ZSD_RBT_MAS_DATA-MATKL,
          EBDFROM LIKE ZSD_RBT_MAS_DATA-EBDFROM,
          EBDTO LIKE ZSD_RBT_MAS_DATA-EBDTO,
           STATUS LIKE ZSD_RBT_MAS_DATA-STATUS,
         END OF I_KNVV_DATA.
    DATA : G_ANS(1), GR1, FLAG(1),LS(1).
    *&      Module  STATUS_1500  OUTPUT
          text
    MODULE STATUS_1500 OUTPUT.
      SET PF-STATUS '1500'.
      SET TITLEBAR 'HEADING_1500'.
    ENDMODULE.                 " STATUS_1500  OUTPUT
    *&      Module  USER_COMMAND_1500  INPUT
          text
    MODULE USER_COMMAND_1500 INPUT.
      OK_CODE = SY-UCOMM.
      L_CODE = OK_CODE.
      IF L_CODE = 'EXIT'.
        LEAVE PROGRAM.
      ELSEIF L_CODE = 'OK'.
        PERFORM ERROR_MESSGE.
        IF FLAG <> '1'.
          SELECT SINGLE * FROM ZSD_RBT_ELG_INV WHERE KNUMA = KONA-KNUMA.
          IF SY-SUBRC = 0.
            UPDATE ZSD_RBT_MAS_DATA SET STATUS = 'C'
                           WHERE KNUMA = KONA-KNUMA.
            COMMIT WORK.
          ENDIF.
          CALL SCREEN 1600.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " USER_COMMAND_1500  INPUT
    *&      Module  MOD_CHECK_INPUT  INPUT
          text
    MODULE MOD_CHECK_INPUT INPUT.
      SELECT SINGLE * FROM KONA WHERE KNUMA = KONA-KNUMA.
      IF SY-SUBRC <> 0.
        MESSAGE E999 WITH 'Agreement No. ' KONA-KNUMA 'does not exists'.
      ENDIF.
    ENDMODULE.                 " MOD_CHECK_INPUT  INPUT
    *&      Module  EXIT  INPUT
          text
    MODULE EXIT INPUT.
      OK_CODE = SY-UCOMM.
      L_CODE = OK_CODE.
      CLEAR OK_CODE.
      IF L_CODE = 'EXIT'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.                 " EXIT  INPUT
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'GRID_MAST'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   ZSD_RBT_MAS_DATA.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'GRID_MAST'
    TYPES: BEGIN OF T_GRID_MAST,
             GJAHR LIKE ZSD_RBT_MAS_DATA-GJAHR,
             KNUMA LIKE ZSD_RBT_MAS_DATA-KNUMA,
             VKBUR LIKE ZSD_RBT_MAS_DATA-VKBUR,
             VKORG LIKE ZSD_RBT_MAS_DATA-VKORG,
             VTWEG LIKE ZSD_RBT_MAS_DATA-VTWEG,
             SPART LIKE ZSD_RBT_MAS_DATA-SPART,
             OTQTY LIKE ZSD_RBT_MAS_DATA-OTQTY,
             PCPDAYS LIKE ZSD_RBT_MAS_DATA-PCPDAYS,
             OTPC LIKE ZSD_RBT_MAS_DATA-OTPC,
             MATKL LIKE ZSD_RBT_MAS_DATA-MATKL,
            EBDFROM LIKE ZSD_RBT_MAS_DATA-EBDFROM,
            EBDTO LIKE ZSD_RBT_MAS_DATA-EBDTO,
             STATUS LIKE ZSD_RBT_MAS_DATA-STATUS,
           END OF T_GRID_MAST.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'GRID_MAST'
    DATA:     G_GRID_MAST_ITAB   TYPE T_GRID_MAST OCCURS 0 WITH HEADER LINE,
              G_GRID_MAST_WA     TYPE T_GRID_MAST. "work area
    DATA:     G_GRID_MAST_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'GRID_MAST' ITSELF
    CONTROLS: GRID_MAST TYPE TABLEVIEW USING SCREEN 1600.
    *&SPWIZARD: LINES OF TABLECONTROL 'GRID_MAST'
    DATA:     G_GRID_MAST_LINES  LIKE SY-LOOPC.
    DATA: L_LINE LIKE GRID_MAST-CURRENT_LINE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    **&      Module  GRID_INACT  OUTPUT
          text
    MODULE GRID_MAST_INIT OUTPUT.
      DATA: L_FLAG(1).
      IF G_GRID_MAST_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'ZSD_RBT_MAS_DATA'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_GRID_MAST_itab'
        PERFORM GET_DATA.
        LOOP AT I_KNVV_DATA.
          G_GRID_MAST_ITAB-GJAHR = I_KNVV_DATA-GJAHR.
          G_GRID_MAST_ITAB-KNUMA = I_KNVV_DATA-KNUMA.
          G_GRID_MAST_ITAB-VKBUR = I_KNVV_DATA-VKBUR.
          G_GRID_MAST_ITAB-VKORG = I_KNVV_DATA-VKORG.
          G_GRID_MAST_ITAB-VTWEG = I_KNVV_DATA-VTWEG.
          G_GRID_MAST_ITAB-SPART = I_KNVV_DATA-SPART.
          G_GRID_MAST_ITAB-OTQTY = I_KNVV_DATA-OTQTY.
          G_GRID_MAST_ITAB-PCPDAYS = I_KNVV_DATA-PCPDAYS.
          G_GRID_MAST_ITAB-OTPC = I_KNVV_DATA-OTPC.
          G_GRID_MAST_ITAB-MATKL = I_KNVV_DATA-MATKL.
         G_GRID_MAST_ITAB-EBDFROM = I_KNVV_DATA-EBDFROM.
         G_GRID_MAST_ITAB-EBDTO = I_KNVV_DATA-EBDTO.
          G_GRID_MAST_ITAB-STATUS = I_KNVV_DATA-STATUS.
         G_GRID_MAST_ITAB-OTPC = I_KNVV_DATA-OTPC.
          APPEND G_GRID_MAST_ITAB.
        ENDLOOP.
        L_FLAG = 'X'.
        G_GRID_MAST_COPIED = 'X'.
        REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
      ENDIF.
      IF L_FLAG IS INITIAL.
        L_LINE = GRID_MAST-CURRENT_LINE.
        IF NOT G_GRID_MAST_WA IS INITIAL.
         READ TABLE G_GRID_MAST_ITAB INDEX GRID_MAST-CURRENT_LINE.
         IF SY-SUBRC <> 0.
          MOVE-CORRESPONDING G_GRID_MAST_WA TO G_GRID_MAST_ITAB.
          APPEND G_GRID_MAST_ITAB.
          REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
         CLEAR G_GRID_MAST_WA.
         ENDIF.
        ENDIF.
      ELSE.
        CLEAR L_FLAG.
      ENDIF.
    ENDMODULE.                    "GRID_MAST_INIT OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE GRID_MAST_MOVE OUTPUT.
      IF NOT G_GRID_MAST_WA IS INITIAL.
        MOVE-CORRESPONDING G_GRID_MAST_WA TO ZSD_RBT_MAS_DATA.
        CLEAR G_GRID_MAST_WA.
      ENDIF.
      GRID_MAST-LINES = G_GRID_MAST_LINES + 100.
    ENDMODULE.                    "GRID_MAST_MOVE OUTPUT
    **&SPWIZARD: OUTPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    **&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE GRID_MAST_GET_LINES OUTPUT.
      SELECT SINGLE * FROM ZSD_RBT_ELG_INV WHERE KNUMA = KONA-KNUMA.
      IF SY-SUBRC = 0.
        UPDATE ZSD_RBT_MAS_DATA SET STATUS = 'C'
                       WHERE KNUMA = KONA-KNUMA.
        COMMIT WORK.
        IF ZSD_RBT_ELG_INV-ZFLAG = 'C'.
          LOOP AT SCREEN.
            IF SCREEN-GROUP1 = 'GR1'.
              SCREEN-INPUT = '0'.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        ENDIF.
      ENDIF.
      G_GRID_MAST_LINES = SY-LOOPC.
    ENDMODULE.                    "GRID_MAST_GET_LINES OUTPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE GRID_MAST_MODIFY INPUT.
      MOVE-CORRESPONDING ZSD_RBT_MAS_DATA TO G_GRID_MAST_WA.
      IF L_FLAG IS INITIAL.
        L_LINE = GRID_MAST-CURRENT_LINE.
        IF NOT G_GRID_MAST_WA IS INITIAL.
        IF L_LINE = GRID_MAST-CURRENT_LINE.
         READ TABLE G_GRID_MAST_ITAB INDEX GRID_MAST-CURRENT_LINE.
         IF SY-SUBRC = 0.
          MODIFY G_GRID_MAST_ITAB    FROM G_GRID_MAST_WA
        INDEX GRID_MAST-CURRENT_LINE.
        ELSE.
          MOVE-CORRESPONDING G_GRID_MAST_WA TO G_GRID_MAST_ITAB.
          APPEND G_GRID_MAST_ITAB.
          REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
        ENDIF.
        ELSE.
          MOVE-CORRESPONDING G_GRID_MAST_WA TO G_GRID_MAST_ITAB.
          APPEND G_GRID_MAST_ITAB.
          REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
         CLEAR G_GRID_MAST_WA.
         ENDIF.
        ENDIF.
      ELSE.
        CLEAR L_FLAG.
      ENDIF.
    MODIFY G_GRID_MAST_ITAB
       FROM G_GRID_MAST_WA
       INDEX GRID_MAST-CURRENT_LINE.
    ENDMODULE.                    "GRID_MAST_MODIFY INPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE GRID_MAST_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'SY-UCOMM'
                                  'G_GRID_MAST_ITAB'
                                  'FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.                    "GRID_MAST_USER_COMMAND INPUT
    *&      Module  STATUS_1600  OUTPUT
          text
    MODULE STATUS_1600 OUTPUT.
      SET PF-STATUS 'STATUS_1600'.
      SET TITLEBAR 'HEADING_1600'.
    ENDMODULE.                 " STATUS_1600  OUTPUT
    *&      Module  USER_COMMAND_1600  INPUT
          text
    MODULE USER_COMMAND_1600 INPUT.
      CASE SY-UCOMM.
        WHEN 'CAN'.
          CLEAR: G_GRID_MAST_COPIED, G_GRID_MAST_ITAB.
          LEAVE TO SCREEN '1500'.
        WHEN 'BACK'.
          CLEAR: G_GRID_MAST_COPIED, G_GRID_MAST_ITAB.
          LEAVE TO SCREEN '1500'.
        WHEN 'EXIT'.
          LEAVE TO SCREEN '1500'.
        WHEN 'SAVE'.
        DELETE FROM ZSD_RBT_MAS_DATA WHERE KNUMA EQ KONA-KNUMA.
          PERFORM SAVE_DATA.
       WHEN 'DELE'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1600  INPUT
    *&      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
    FORM GET_DATA...
    FORM GET_DATA.
      CLEAR : I_KNVV_DATA, ZSD_BILLINFO, G_GRID_MAST_COPIED,
      G_GRID_MAST_ITAB, ZSD_RBT_MAS_DATA, KNVV, ZSD_RBT_ELG_INV.
      REFRESH: I_KNVV_DATA, G_GRID_MAST_ITAB.
      SELECT SINGLE * FROM KONA WHERE KNUMA = KONA-KNUMA.
      IF SY-SUBRC = 0.
        SELECT * FROM ZSD_RBT_MAS_DATA
               INTO
               CORRESPONDING FIELDS OF
               TABLE I_KNVV_DATA
               WHERE KNUMA = KONA-KNUMA.
        IF SY-SUBRC <> 0.
          SELECT * INTO CORRESPONDING FIELDS OF TABLE I_KNVV_DATA
          FROM KNVV
          WHERE KUNNR = KONA-BONEM.
          SELECT SINGLE * FROM ZSD_BILLINFO WHERE KUNAG = KONA-BONEM.
          LOOP AT I_KNVV_DATA.
            SELECT SINGLE * FROM ZSD_RBT_ELG_INV
                WHERE KNUMA = KONA-KNUMA
                  AND VKORG = I_KNVV_DATA-VKORG
                  AND VTWEG = I_KNVV_DATA-VTWEG
                  AND SPART = I_KNVV_DATA-SPART.
            IF SY-SUBRC = 0.
              I_KNVV_DATA-STATUS = ZSD_RBT_ELG_INV-ZFLAG.
            ENDIF.
            I_KNVV_DATA-GJAHR = ZSD_BILLINFO-GJAHR.
            I_KNVV_DATA-KNUMA = KONA-KNUMA.
            MODIFY I_KNVV_DATA INDEX SY-TABIX.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    "GET_DATA
    FORM SAVE_DATA...
    FORM SAVE_DATA.
      IF NOT G_GRID_MAST_ITAB IS INITIAL.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
           EXPORTING
            TITLEBAR                    = 'Confirmation'
      DIAGNOSE_OBJECT             = ' '
       TEXT_QUESTION               = 'Do you want to save the document?'
            TEXT_BUTTON_1               = 'YES'
      ICON_BUTTON_1               = ' '
            TEXT_BUTTON_2               = 'NO'
      ICON_BUTTON_2               = ' '
             DEFAULT_BUTTON              = '1'
             DISPLAY_CANCEL_BUTTON       = ''
      USERDEFINED_F1_HELP         = ' '
      START_COLUMN                = 25
      START_ROW                   = 6
      POPUP_TYPE                  =
      IV_QUICKINFO_BUTTON_1       = ' '
      IV_QUICKINFO_BUTTON_2       = ' '
          IMPORTING
            ANSWER                      = G_ANS
    TABLES
      PARAMETER                   =
          EXCEPTIONS
            TEXT_NOT_FOUND              = 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.
        IF G_ANS = '1'.
          SELECT SINGLE * FROM ZSD_RBT_MAS_DATA
              WHERE KNUMA = KONA-KNUMA.
          IF SY-SUBRC = 0.
            LOOP AT G_GRID_MAST_ITAB.
             IF G_GRID_MAST_ITAB-OTQTY > 0.
                  I_KNVV_DATA-PCPDAYS
                  I_KNVV_DATA-OTPC
                  I_KNVV_DATA-EBDFROM
                  I_KNVV_DATA-EBDTO
              ZSD_RBT_MAS_DATA-GJAHR = G_GRID_MAST_ITAB-GJAHR.
              ZSD_RBT_MAS_DATA-KNUMA = G_GRID_MAST_ITAB-KNUMA.
              ZSD_RBT_MAS_DATA-VKBUR = G_GRID_MAST_ITAB-VKBUR.
              ZSD_RBT_MAS_DATA-VKORG = G_GRID_MAST_ITAB-VKORG.
              ZSD_RBT_MAS_DATA-VTWEG = G_GRID_MAST_ITAB-VTWEG.
              ZSD_RBT_MAS_DATA-SPART = G_GRID_MAST_ITAB-SPART.
              ZSD_RBT_MAS_DATA-MATKL = G_GRID_MAST_ITAB-MATKL.
              ZSD_RBT_MAS_DATA-OTQTY = G_GRID_MAST_ITAB-OTQTY.
              ZSD_RBT_MAS_DATA-PCPDAYS = G_GRID_MAST_ITAB-PCPDAYS.
              ZSD_RBT_MAS_DATA-OTPC = G_GRID_MAST_ITAB-OTPC.
             ZSD_RBT_MAS_DATA-EBDFROM = G_GRID_MAST_ITAB-EBDFROM.
             ZSD_RBT_MAS_DATA-EBDTO = G_GRID_MAST_ITAB-EBDTO.
              MODIFY ZSD_RBT_MAS_DATA.
              COMMIT WORK.
             ENDIF.
            ENDLOOP.
          ELSE.
            LOOP AT G_GRID_MAST_ITAB.
             IF G_GRID_MAST_ITAB-OTQTY > 0.
                  I_KNVV_DATA-PCPDAYS
                  I_KNVV_DATA-OTPC
                  I_KNVV_DATA-EBDFROM
                  I_KNVV_DATA-EBDTO
              ZSD_RBT_MAS_DATA-GJAHR = G_GRID_MAST_ITAB-GJAHR.
              ZSD_RBT_MAS_DATA-KNUMA = G_GRID_MAST_ITAB-KNUMA.
              ZSD_RBT_MAS_DATA-VKBUR = G_GRID_MAST_ITAB-VKBUR.
              ZSD_RBT_MAS_DATA-VKORG = G_GRID_MAST_ITAB-VKORG.
              ZSD_RBT_MAS_DATA-VTWEG = G_GRID_MAST_ITAB-VTWEG.
              ZSD_RBT_MAS_DATA-SPART = G_GRID_MAST_ITAB-SPART.
              ZSD_RBT_MAS_DATA-OTQTY = G_GRID_MAST_ITAB-OTQTY.
              ZSD_RBT_MAS_DATA-PCPDAYS = G_GRID_MAST_ITAB-PCPDAYS.
              ZSD_RBT_MAS_DATA-OTPC = G_GRID_MAST_ITAB-OTPC.
             ZSD_RBT_MAS_DATA-EBDFROM = G_GRID_MAST_ITAB-EBDFROM.
             ZSD_RBT_MAS_DATA-EBDTO = G_GRID_MAST_ITAB-EBDTO.
              ZSD_RBT_MAS_DATA-STATUS = G_GRID_MAST_ITAB-STATUS.
              ZSD_RBT_MAS_DATA-MATKL = G_GRID_MAST_ITAB-MATKL.
              INSERT ZSD_RBT_MAS_DATA.
              COMMIT WORK.
             ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "SAVE_DATA
    ENDMODULE.                 " GRID_CHECK  OUTPUT

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

  • Standard table for finding query where used list

    Are there any standard tables available to find the list of web templates, bex reports and views using a particular query?
    i.e if i have the query name i should be able to find out where all it is being used.
    Thanks,
    Archna

    Hello,
    You have to join multiple tables to achieve this, here we go
    FOR QUERY Related Information
    RSRREPDIR - Directory of all reports (Query GENUNIID)
    Choose Type of a reporting component -> REP
    Tips :
    Choose Type of a reporting component -> QVW for query view
    SE11 -> RSZ* -> F4 gives you all tables related to queries
    For WORKBOOK Related Information
    Use the FM RRMX_WORKBOOK_QUERIES_GET to get the queries in a workbook by selecting the workbook ID from table RSRWORKBOOK
    Tips :
    SE11 -> RSRWB* -> F4 gives you all tables related to workbooks
    SE37 ->RRMX_WORKBOOKS* -> F4 gives you all the FM related to workbooks
    For Webtemplate Related Information
    Choose the dataprovider for query / view ID.
    SE11 -> RSZWOBJXREF - Structure of the BW Objects in a Template
    Also see,
    SE11 - > RSZWTEMPLATE - Header Table for BW HTML Templates
    Thanks
    Chandran

  • How to create a Attribute "Type standard table OF" to a OSS NOTE

    Dear experts,
    I need to add new attributes in a standard class as per one OSS note. I took access key to add new attributes. I have a question.
    class name: CL_J_1BEFD
    Attribute: MT_GROUP_C350
    Level: Instance
    Visibility: Private
    Type STANDARD TABLE OF mty_result
    How do i add the instance attribute because i do not want to give the typing and associated type, instead i have to declare data: MT_GROUP_C350 type standard table of mty_result in class builder private section code.
    if you look at the pushbutton between Associated type and Description, for all instance attributes there's a green color lining below the arrow. I want my attribute also to be exactly same.
    Though i have access key, in private section the display<->Change button is disabled.
    Please suggest me how do i add code in private section of a standard class. i have required access key to change the class.
    Thanks,
    Alysson

    Hi Friend...
    Thanks, but the question is...
    When I went to transaction se24 or se80, I chose the class CL_J_1BEFD and second I swap to "CHANGE MODE".. after that the pushbutton is blocked... I can create the Attribute  mt_group_c800 in the Class (using TYPE or LIKE option), but i can't change the code in the private session even using the assistant to modify it.
    When I acess the Button "Detail View" the option "Direct Type Entry" is just unavaliable too, no matter what i do!
    I coudn't find a way to create the Attibute like the note Describes (SAPNOTE NUMBER 1575772 - in the attachment of the note)
    The changes are contained in the attachment
    Follows the instructions retrieved from the file:
    Add the following Attributes on the Class CL_J_1BEFD Private section
    data:
    mt_group_c800 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c850 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c860 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c890 TYPE STANDARD TABLE OF mty_result .
    How can i make a way to creat this attributes using  "TYPE STANDARD TABLE OF " Option?

  • How can we add customize seardh help in standard tables?

    Hi,
    Gurus,
    How can we add / assign customize Search Help to standard tables
    as my knowledge this is working fine in SAP 4.60. Where as i was not
    allowing us to add a search help to its data element is there any alternate way to add if give me your support.
    thank you
    shabeer ahmed

    hi shabeer ahmed
    This one is already posted one, chk it
    First in the MARA table the Search Help(MAT1) for matnr is selected and viewed.
    In the included search helps tab of MAT1 there is another search help MAT1_A.
    For that search help in the included u201Csearch helpu201D tab view is selected .
    Inside that there is a search help called MAT1_A_APPEND.
    Then in the included search help tab of MAT1_A_APPEND, the customized search helps can be attached.
    Regards,
    Deva

  • One more Standard table filter weird work

    In the same VO described in previous thread: Standard table filter weird work
    I have another filter trouble.
    The attribute is calculated, not bound to entity.
    SQL:to_char(case when ID_BASE_TYPES_MIME is null then substr(THE_VALUE, 0, 100)
                when ID_BASE_TYPES_MIME = 7 then
           dbms_lob.substr(
              regexp_replace(LargeTextData.DATA_TEXT, '<.*?>|&.*;')
              , 100)
                else LargeBinaryData.Filename
           end) as CONTENT_PREVIEW,VO attribute:<ViewAttribute
        Name="ContentPreview"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="255"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="CONTENT_PREVIEW"
        Expression="CONTENT_PREVIEW"
        SQLType="VARCHAR">
        <Properties>
          <SchemaBasedProperties>
            <LABEL
              ResId="ru.miit.cms.model.view.ContentComplexView.ContentPreview_LABEL"/>
            <DISPLAYWIDTH
              Value="90"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>With logging turned on I apply filter like P or \P\* - anything that contains letter P. ADF table with standard filter shows me no rows.
    I take the executed SQL and parameter value from AdminServer-diagnostic-1.log. It is like:SELECT * FROM ( main query ) QRSLT  WHERE ( ( (CONTENT_PREVIEW LIKE ( :vc_temp_1 || '%') ) ) )
    [SRC_CLASS: oracle.jbo.server.OracleSQLBuilderImpl] [APP: CMS] [SRC_METHOD: bindParamValue]  [850] Binding param "vc_temp_1": %РI execute this query in PL SQL Developer and it shows me 2 records - that is correct.
    While ADF shows me no records, executing the same VO with the same parameters - that is wrong.
    From this SQL query I also created a test VO with vc_temp_1 bind variable = %Р and run it in AppModule Tester. It shows me 2 rows.
    Any ideas?
    JDev 11.1.2.2

    Hello Derio,
    Thanks for your attention. This view object is a part of a composite application with lots of business components, running ~stable on 11.1.2.2. Sherman installed, of cause.
    There are several tables with filters and all of them work fine except this attribute in this VO.
    I believe the filter would work with no problems with such attribute if I create a clean new application, but in my specific case it doesn't.
    The trouble is I don't know where to look for the error source because generated SQL and app module tester seem fine.

Maybe you are looking for

  • With iOS 7 can I still have 2 iCloud accounts on one device?

    I used to have my one iCloud account on every iDevice in my family (i.e. iPhones, iPods...) just for the purpose of using Find My iPhone with 1 account.  Now with iOS 7 it seems like that option is gone.  Example, I upgraded my wife's phone from 6 to

  • Media Encoder CS4 No Error No File (Says It's Created, but It Isn't)

    I have tried repeatedly today to encode an QuickTime container to P2 format, and while Adobe Media Encoder CS4 appears to load correctly, do the conversion, and confirm the file creation, I can not find the file that was supposed to be created. There

  • Can't open Office documents from network share

    Dear, I have a user named X that can't open Office documents from two specific shares. We call this shares T and U. When the user X opens Office documents the error message is "...xlsx can't be opened". The problem is not client specific because when

  • Arrow keys dowsn't work

    hello my name is Giorgi from Georgia. 1. I've got macbook pro 15". Version 10.5.8. after few updates I found that 3 arrow keys stopped to work. I can't find the reason why, so please help me. 2. My mac is already quite old and I'd like to update vide

  • Read Self Register Request using 11g API

    Gurus, I am trying to read Self Register Request using API but I am getting beneficiaries and requester data as null. Can you please provide some code snippet to read beneficiary data from a Self Register Request.