Header Line Per ALV group of items in GRID not LIST.

Hello Experts,
My question may seem very basic but i am stuck with it.
I am using ALV Grid function (REUSE_ALV_GRID_DISPLAY) to display my ALV.
Example Case :
I have 10 line items .
1)     2 line items are sports.
2)     2 line items are books.
3)     2 line items are Mobiles.
My ALV displays like this :
No.    Object     Object Type
1)       Ball          sports
2)       Bat          sports
3)     Maths        Books
4)     History      Books
5)     Nokia         Mobiles
6)     Samsung   Mobiles
And i want it like this :
No.     Object
Sports <---- I want this to act as header per line item .
1)        Ball
2)        Bat
Books
3)       Maths
4)       History
Mobiles
5)       Nokia
6)       Samsung.
I.e i need a row stating Object Type IN ALV Grid similar to how we make use of AT NEW EVENT in LIST REPORT.
Thanks in Advance,
Sudeep.
Edited by: Sudeep Yerunkar on Jul 21, 2010 11:40 AM

Hi,
If GRID is a 'MUST' requirement, then you can try preparing your internal table in the manner you want the output.
Something like this:
- Sort the output internal table.
- Loop on the output int table.
- Use AT NEW object type
- Append Object Type into another internal table
- Then read rest of the records with same object type into another internal table and appending the same.
Not sure about the efficieny but you can try.
BR,
Vishal.

Similar Messages

  • Two header line in ALV display

    Hi ,
    I want two header lines in ALV report using reuse_alv_grid_display .
    Like
    Factory-Sales
    Qty   Value
    10     1000
    How to do that please help

    Hi,
       I am giving the example code for 3 header line display. This may help you.
    First declare Form, 
    FORM TOP-OF-PAGE .
    FREE TTOP .
    FREE HTOP .
    CLEAR TTOP .
    HTOP-TYP = 'H' .
    HTOP-INFO = 'LLYODS STEEL INDUSTRIES LIMITED, WARDHA' .
    APPEND HTOP TO TTOP .
    CLEAR HTOP .
    HTOP-TYP = 'S' .
    HTOP-INFO = MAT .
    APPEND HTOP TO TTOP .
    CLEAR HTOP .
    HTOP-TYP = 'S' .
    HTOP-INFO = PONO .
    APPEND HTOP TO TTOP .
    CLEAR HTOP .
    HTOP-TYP = 'S' .
    HTOP-INFO = item .
    APPEND HTOP TO TTOP .
    CLEAR HTOP .
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = TTOP
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    After that declare this form in your Grid or List like below.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = SY-REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
       I_CALLBACK_TOP_OF_PAGE            = 'TOP-OF-PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = BTAB
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
       I_SAVE                            = 'X'
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = ITAB
    EXCEPTIONS
      PROGRAM_ERROR                     = 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.
    Regards,
    Himanshu

  • 2 header lines in ALV report

    Hello All,
                Does any one have any idea how to create 2 Header lines in an ALv report
    as in 1 cummulative header and under that 2nd detailed header.
    Please help me out.
    Cheers,
    Deepthee Kasal

    Hi,
    It is not possible to have 2 detailed headers in ALV reports.
    Regards,
    Satish

  • Group Added With dscl Command Not Listed In Account Prefs

    I added groups for each user per article 307128 using the dscl command:
    sudo dscl . create /Groups/username GroupMembership username
    sudo dscl . change /Groups/username RecordName username _username
    But these new groups are not listed by the Account preferences on my new MacBook. They are listed on my iMac G4. Both machines are running 10.5.2. The accounts on the new MacBook were migrated from the iMac.
    A dscl list shows that the groups are defined:
    sudo dscl . list /Groups
    And when I try to add a new group called _username with Account preferences I get an error saying the name is in use.
    Any idea how to get Account preferences to show these groups?
    Thanks.

    ovithucu, in your contacts app, swipe down from the top bezel to Settings.
    In the list of "Show Account in Contacts List", turn OFF each account shown, leaving none ON.
    Tap the lower left BACK button.
    Now, back in the main Contacts view, drag down on the screen to see the total number of contacts, what number is there?
    Those are you "Local" contacts, stored locally in the device memory. Those can be cleared if you want, and start all over again.
    Also, check your gmail account on a PC, login and see how many contacts you have in gmail which should be sycning to the device.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Printing more than 1 header line in ALV

    How to print more than one line from header table before printing detail lines in REUSE_ALV_HIERSEQ_LIST_DISPLAY?

    Hi
    Hierarchical sequential list output.
    The function module is
    A.  REUSE_ALV_HIERSEQ_LIST_DISPLAY
    1. Export:
        a. I_CALLBACK_PROGRAM
        b. I_CALLBACK_PF_STATUS_SET
        c. I_CALLBACK_USER_COMMAND
        d. IS_LAYOUT
    e. IT_FIELDCAT
    f.  IT_EVENTS
    g. I_TABNAME_HEADER : Name of the internal table in the program containing the output data of the highest hierarchy level.
    h. I_TABNAME_ITEM : Name of the internal table in the program containing the output data of the lowest hierarchy level.
    i. IS_KEYINFO : This structure contains the header and item table field names which link the two tables (shared key).
    2. Tables
      a. T_OUTTAB_HEADER  : Header table with data to be output
      b. T_OUTTAB_ITEM       :  Name of the internal table in the program containing the  output data of the lowest hierarchy level.
    if it is helpful reward points,
    thanks,
    sap-abap

  • Ssrs to display Page header as per the group

    Hi All;
    I have a DataSet.
    I had group the table
    Used Page breaks so that the data gets dispalyed as per the parent group
    I need to display the Page header as well as per teh parent group
    Is this possible?
    Any help much appreciated
    Thanks
    Pradnya07

    Hi Simran08,
    According to your description, you added group to the table and added page break to the group. You want to show page header according to group.
    In Reporting Services, we can use ReportItems to refer to the value of the report design surface in corresponding textbox. For example, if you want to show the group name in each page header dynamically, we can refer to the following steps:
    Right-click anywhere of page header, click Insert, then click Text Box.
    Right-click the text box, and click Expression.
    In the expression text box, type the code like below:
    =ReportItems!name.Value
    The following screenshots are for your reference:
    Reference:
    ReportItems Collection References (Report Builder and SSRS)
    If you have any more questions, please feel free to ask.
    Best Regards,
    Wendy Fu

  • AD security groups listed in user groups in Config Manager however not listed when selecting values for the "System Resource - System Group Name" query

    Morning All,
    We are in the process of setting up our SCCM 2012 infrastructure and are experiencing issues with our device collection querys based on AD security groups.
    I can see the security groups are being updated per adsgdis.log - i can see the computers that are members of the groups in AD are being recorded in the same log. Issue is when we build the device collection query - click the value button for the string,
    only 2 of the 18 AD security groups are displayed.  These are 2 AD groups we setup initially to test.
    We have since added several additional yet they only appear to populate as user groups in config manager.
    The same goes for additional OUs that we have created with AD.
    When i click the value button only the initial 10 OUs that were created are populating in the list of applicable OUs.
    We have the discovery methods Group Discovery & System Discovery enabled and set to search the parent OU recursively
    I'm wondering if there might be an SQL issue with this as it initially worked but stopped...
    Additionally we added an OU recently that now appears in in the Values options in the query but the ones added previously and additionally after are not showing up....
    Any help is appreciated.
    Thanks,
    Jeff

    Given the adsgdis.log lists the new pc and the group it's assigned to it appears the AD group discovery is working.
    Have the following excert from the adsgdis.log
    INFO: Processing discovered group object with ADsPath = 'LDAP://************.****.COM/CN=Software - Microsoft Project Professional 2010 x64,OU=Software,OU=US-West,DC=*****,DC=com' SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT 10/4/2012 7:08:13 AM 8180
    (0x1FF4)
    INFO: DDR was written for group '*****\Software - Microsoft Project Professional 2010 x64' - E:\Program Files\Microsoft Configuration Manager\inboxes\auth\ddm.box\userddrsonly\asg8ud94.DDR at 10/4/2012 7:8:12. SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT 10/4/2012
    7:08:13 AM 8180 (0x1FF4)
    INFO: DDR was written for system 'THURMANWIN7VM' - E:\Program Files\Microsoft Configuration Manager\inboxes\auth\ddm.box\adhh8419.DDR at 10/4/2012 7:8:12. SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT 10/4/2012 7:08:13 AM 8180 (0x1FF4)
    Here you can see it processes the new members in the Software - Microsoft Project Professional 2010 x64 group and captures Thurmanwin7vm as a member.
    I did find some log entries that reference permission issues with objects in the SQL database and have opened a case with MS to get that looked into.  Hopefully that will be where the issue lies.

  • Group Space and Personal Space not listed

    Version used : 11.1.1.4
    When I login to WebCenter Spaces as an administrator, I do not get the option to create a Group Space. I get links for Favourites, Logout, Help, Spaces, Administation but not for Group Space. Why is it so. I all the tutorials for WC these options are available but when I want to explore group Space I cannot do so in WebCenter Spaces.
    Also, Is it possible to create Group Spaces for a custom Space created (other than the default webcenter space) ?
    Any help/pointers much appreciated.

    I think in WC 11.1.1.4, only space concept is used. I also dont see any group or personal spaces in my Webcenter ps3 app. All we can do is create a space or subspaces or business role pages and assign the role or users to it. In that way we can decide it will be a personal or belong to a group.
    Regards
    Prasath.C

  • Create Protection Group Hyper-V Virtual Machines Not Listed

    Hello,
    We are in the process of testing DPM 2012 R2 and we are trying to backup our Hyper-V virtual machines on both cluster hosts and stand-alone Hyper-V hosts.  We have deployed the DPM agent to all cluster hosts and the stand-alone hosts, but when we go
    to create a protection group, we do not see Hyper-V Virtual Machines listed under "HyperV".  We are expecting Virtual Machines to show up as shown in Step 7 of this guide: http://blogs.technet.com/b/kevinholman/archive/2013/11/07/dpm-2012-r2-quickstart-deployment-guide.aspx.
     We have DPM 2012 R2 UR4 installed and Hyper-V role is enabled on the DPM server.
    Is there something extra we need to do or something we are doing wrong?
    Thank you.

    Gleb,
    Thank you for your help.  For our cluster, we realized we weren't seeing any VM's under the Cluster Node because an agent was not installed on our of the Hyper-V hosts in the cluster.  As for the stand-alone Hyper-V host and the cluster node listing
    within the "Create New Protection Group" wizard, it looks like MOST of the VM's have the "Backup Using Child Partition Snapshot" option, but no longer show as "Online" or "Offline".  I believe this is due to the
    way the Hyper-V backups are done w/ DPM which was changed either in R2 or one of the Update Rollups.  

  • Duplicate Items in Sidebar-Not Listed In Volumes

    I hook up a number of external (USB & Firewire) external drives to my MacBook Pro when at my home office. All of a sudden these drives continue to show in the Sidebar after being ejected and unplugged. Once this starts, they continue to remain in the Sidebar multiple times until I reboot the machine. Unlike the other posts that I have seen (Doppelganger effect, etc...) these drives DO NOT show up in /Volumes. Ideas on how to fix ? ?

    For duplicates on side bar and save as menu.
    1. Drag all icons off bottom of your Finder sidebar.
    2. In Finder >> Preferences >> Sidebar UNcheck all options.
    3. navigate to ~(yourHome)/Library/Preferences and trash these two files:
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then log out and back in again. Or restart.
    (You will have to reset a few finder prefs the way you like them.)
    -mj

  • Item values not listing in the correct order.

    Hi,
    When I click on header record synckey link, the corresponding item records are not listing in the correct order, in the MI Client. Can anybody suggest a solution for this.
    Regards,
    Shemim

    Hi Divya,
    I am attaching sample data obtained at Back End & MI Client.
    Value in Back End
    PHYSINVENT FISC ITE MATERIAL           PLAN STGE
    1000015    1998 001 T-RF100            1100 0001
    1000015    1998 002 T-RF200            1100 0001
    1000015    1998 003 T-RF200            1100 0001
    1000015    1998 004 T-RF200            1100 0001
    1000015    1998 005 T-RF300            1100 0001
    Value in MI CLient
    SYNC_KEY PHYSINVENTORY FISCALYEAR ITEM MATERIAL PLANT STGLOC
    0001001234  0001000015  1998  005  T-RF300  1100  0001   
    0001001233  0001000015  1998  004  T-RF200  1100  0001   
    0001001232  0001000015  1998  003  T-RF200  1100  0001   
    0001001231  0001000015  1998  002  T-RF200  1100  0001   
    0001001230  0001000015  1998  001  T-RF100  1100  0001   
    Regards
    Shemim

  • How to print header lines at the top of every page with Alv list display?

    Dear all,
    I need a requirement with printing issue. A program list should be printed with the function reuse_alv_list_display.
    The list has several pages and then can be printed but the header lines appear only first page when they printed. The other pages don't have header lines, they continue with the next record of the list remaining from previous page. I use the alv parameters as below:
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_pf_status_set = 'ALV_PF_STATUS'
          is_layout                = ls_layo
          it_fieldcat              = lt_fcat
          i_default                = 'X'
          i_save                   = 'A'
          is_variant               = ls_variant
          it_events                = lt_events
        TABLES
          t_outtab                 = lt_data
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    and lt_events as below:
      ls_event-name = 'END_OF_LIST'.
      ls_event-form = 'ALV_END_OF_LIST'.
      APPEND ls_event TO lt_events.
      ls_event-name = 'END_OF_PAGE'.
      ls_event-form = 'ALV_END_OF_PAGE'.
      APPEND ls_event TO lt_events.
      ls_event-name = 'TOP_OF_LIST'.
      ls_event-form = 'ALV_TOP_OF_LIST'.
      APPEND ls_event TO lt_events.
      ls_event-name = 'TOP_OF_PAGE'.
      ls_event-form = 'ALV_TOP_OF_PAGE'.
      APPEND ls_event TO lt_events.
    So, how can I print header lines for every page?
    Best Regards,

    Hello Saba,
    Your point might be very close to solution.
    Because in the selection screen of the program there are two radio buttons, one of them visits 'REUSE_ALV_COMMENTARY_WRITE' function and the other doesn't. The one which visits has a problem with header liens in every page when printing. But I couldn't find out the solution yet.
    reuse_alv_list_display uses 4 event and of course I call subroutine. There are end_of_list, end_of_page, top_of_list and top_of_page. I use in the subroutine for top_of_page:
      CALL FUNCTION 'LVC_TRANSFER_TO_SLIS'
        EXPORTING
          it_fieldcat_lvc         = gt_fcat
        IMPORTING
          et_fieldcat_alv         = lt_fcat
        EXCEPTIONS
          it_data_missing         = 1
          it_fieldcat_lvc_missing = 2
          OTHERS                  = 3.
      CALL FUNCTION 'REUSE_ALV_LIST_WIDTH_GET'
        EXPORTING
          it_fieldcat = lt_fcat
        IMPORTING
          e_width     = l_width.
    WRITE l_reptx TO l_reptx CENTERED.
      NEW-LINE.
      WRITE: AT (l_width) l_reptx CENTERED.
      SUBTRACT 10 FROM l_width.
      WRITE: AT l_width sy-pagno RIGHT-JUSTIFIED.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            it_list_commentary       = lt_header
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    Do you have other suggestions ?

  • ALV Header Line

    can i add 2 header lines in ALV Reporting, if so then how give example.
    abhishek suppal

    Hi,
    Copy the following code and execute, it will work fine.
    TYPE-POOLS: slis.
    DATA: BEGIN OF i_data OCCURS 0,
            qmnum      LIKE qmel-qmnum,
            qmart      LIKE qmel-qmart,
            qmtxt      LIKE qmel-qmtxt,
            ws_row     TYPE i,
            ws_char(5) TYPE c,
            chk,
          END OF i_data.
    DATA: report_id  LIKE sy-repid.
    DATA: ws_title   TYPE lvc_title VALUE 'An ALV Report'.
    DATA: i_layout   TYPE slis_layout_alv.
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: i_events   TYPE slis_t_event.
    DATA: i_header   TYPE slis_t_listheader.
    SELECT qmnum
           qmart
           qmtxt
           INTO TABLE i_data
           FROM qmel
           WHERE qmnum <= '00030000010'.
    LOOP AT i_data.
      i_data-ws_row = sy-tabix.
      i_data-ws_char = 'AAAAA'.
      MODIFY i_data.
    ENDLOOP.
    report_id = sy-repid.
    PERFORM f1000_layout_init CHANGING i_layout.
    PERFORM f2000_fieldcat_init CHANGING i_fieldcat.
    PERFORM f3000_build_header CHANGING i_header.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                = report_id
       i_grid_title                      = ws_title
       is_layout                         = i_layout
       it_fieldcat                       = i_fieldcat
       i_save                            = 'A'
      TABLES
        t_outtab                          = i_data
    EXCEPTIONS
       program_error                     = 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.
    *&      Form  F1000_Layout_Init
    FORM f1000_layout_init USING i_layout TYPE slis_layout_alv.
      CLEAR i_layout.
      i_layout-colwidth_optimize = 'X'.
      i_layout-edit = 'X'.
    ENDFORM.                    " F1000_Layout_Init
    *&      Form  f2000_fieldcat_init
    FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: line_fieldcat TYPE slis_fieldcat_alv.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMNUM'.     " The field name and the table
      line_fieldcat-tabname   = 'I_DATA'.    " name are the two minimum req.
      line_fieldcat-key       = 'X'.  " Specifies the column as a key (Blue)
      line_fieldcat-seltext_m = 'Notification No.'. " Column Header
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMART'.
      line_fieldcat-ref_tabname = 'I_DATA'.
      line_fieldcat-hotspot = 'X'.           " Shows the field as a hotspot.
      line_fieldcat-seltext_m = 'Notif Type'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMTXT'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_m = 'Description'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'WS_ROW'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_m = 'Row Number'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'WS_CHAR'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_l = 'Test Character Field'.
      line_fieldcat-datatype  = 'CHAR'.
      line_fieldcat-outputlen = '15'.     " You can specify the width of a
      APPEND line_fieldcat TO i_fieldcat. " column.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'CHK'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_l = 'Checkbox'.
      line_fieldcat-checkbox  = 'X'.      " Display this field as a checkbox
      line_fieldcat-edit      = 'X'.      " This option ensures that you can
      " edit the checkbox. Else it will
      " be protected.
      APPEND line_fieldcat TO i_fieldcat.
    ENDFORM.                    " f2000_fieldcat_init
    *&      Form  f3000_build_header
    FORM f3000_build_header USING i_header TYPE slis_t_listheader.
      DATA: gs_line TYPE slis_listheader.
      CLEAR gs_line.
      gs_line-typ  = 'H'.
      gs_line-info = 'This is line of type HEADER'.
      APPEND gs_line TO i_header.
      CLEAR gs_line.
      gs_line-typ  = 'S'.
      gs_line-key  = 'STATUS 1'.
      gs_line-info = 'This is line of type STATUS'.
      APPEND gs_line TO i_header.
      gs_line-key  = 'STATUS 2'.
      gs_line-info = 'This is also line of type STATUS'.
      APPEND gs_line TO i_header.
      CLEAR gs_line.
      gs_line-typ  = 'A'.
      gs_line-info = 'This is line of type ACTION'.
      APPEND gs_line TO i_header.
    ENDFORM.                    " f3000_build_header
    Cheers,
    Venkat

  • With header line & with out header line ?

    what is difference between with header line & without header line ?

    When you create an internal table object you can also declare a header line with the same name. You can use the header line as a work area when you process the internal table. The ABAP statements that you use with internal tables have short forms that you can use if your internal table has a header line. These statements automatically assume the header line as an implicit work area. The following table shows the statements that you must use for internal tables without a header line, and the equivalent statements that you can use for internal tables with a header line:
    Operations without header line
    Operations with header line
    Operations for all Table Types
    INSERT <wa> INTO TABLE <itab>.
    INSERT TABLE ITAB.
    COLLECT <wa> INTO <itab>.
    COLLECT <itab>.
    READ TABLE <itab> ... INTO <wa>.
    READ TABLE <itab> ...
    MODIFY TABLE <itab> FROM <wa> ...
    MODIFY TABLE <itab> ...
    MODIFY <itab> FROM <wa> ...WHERE ...
    MODIFY <itab> ... WHERE ...
    DELETE TABLE <itab> FROM <wa>.
    DELETE TABLE <itab>.
    LOOP AT ITAB INTO <wa> ...
    LOOP AT ITAB ...
    Operations for Index Tables
    APPEND <wa> TO <itab>.
    APPEND <itab>.
    INSERT <wa> INTO <itab> ...
    INSERT <itab> ...
    MODIFY <itab> FROM <wa> ...
    MODIFY <itab> ...
    Using the header line as a work area means that you can use shorter statements; however, they are not necessarily easier to understand, since you cannot immediately recognize the origin and target of the assignment. Furthermore, the fact that the table and its header line have the same name can cause confusion in operations with entire internal tables. To avoid confusion, you should use internal tables with differently-named work areas.
    The following example shows two programs with the same function. One uses a header line, the other does not.
    With header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1
    WITH HEADER LINE.
    DO 4 TIMES.
    ITAB-COL1 = SY-INDEX.
    ITAB-COL2 = SY-INDEX ** 2.
    INSERT TABLE ITAB.
    ENDDO.
    ITAB-COL1 = 2.
    READ TABLE ITAB FROM ITAB.
    ITAB-COL2 = 100.
    MODIFY TABLE ITAB.
    ITAB-COL1 = 4.
    DELETE TABLE ITAB.
    LOOP AT ITAB.
    WRITE: / ITAB-COL1, ITAB-COL2.
    ENDLOOP.
    Without header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1,
    WA LIKE LINE OF ITAB.
    DO 4 TIMES.
    WA-COL1 = SY-INDEX.
    WA-COL2 = SY-INDEX ** 2.
    INSERT WA INTO TABLE ITAB.
    ENDDO.
    WA-COL1 = 2.
    READ TABLE ITAB FROM WA INTO WA.
    WA-COL2 = 100.
    MODIFY TABLE ITAB FROM WA.
    WA-COL1 = 4.
    DELETE TABLE ITAB FROM WA.
    LOOP AT ITAB INTO WA.
    WRITE: / WA-COL1, WA-COL2.
    ENDLOOP.
    The list, in both cases, appears as follows:
    1 1
    2 100
    3 9
    The statements in the program that does not use a header line are easier to understand. As a further measure, you could have a further work area just to specify the key of the internal table, but to which no other values from the table are assigned.
    Internal table with header line
    you can use anywhere except obkect oriented concept.
    Internal table without header line :
    You should use in Object oriented concept..
    Always try to use without header line,performance point of view it is best..
    Example :
    Without header line.
    Structure
    types : begin of ty_itab ,
    matnr type mara-matnr,
    end of ty_itab.
    Internal table
    data i_itab type standard table of ty_itab .
    Work area
    data wa_itab like line of i_itab
    With header line
    data : begin of i_itab occurs 0,
    matnr like mara-matnr,
    end of i_itab
    itab with header lines are obsolete, anyway it will work but not recommended. instead use work area or more effiecient is field symbols. so donot use itab with header line.
    i will explain use of itab w/o header line.
    Data: itab1 type standard table of mara with header line occurs 0,
            itab2 type standard table of mara,
            wa_itab2 type mara.
    loop at itab1.
    "This will work fine.
    endloop.
    loop at itab2.
    "This will give erro that itabd does not hav workarea
    endloop.
    "so write
    loop at itab2 into wa_itab2.
    "This will work
    endloop.
    <b>The difference between
    whih header line and with out heater line of internal table.
    ex:-
    a) Data : itab like mara occurs 0 with header line.
    b) Data: itab like mara occurs 0.
    -While adding or retrieving records to / from internal table we have to keep the record temporarily.
    -The area where this record is kept is called as work area for the internal table.
    -The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    -Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    a) Data : itab like mara occurs 0 with header line.
    table is with header line
    b) Data: itab like mara occurs 0.
    table is without header line</b>
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • How to declare a header line table in class

    Hi Experts ;
    I m writing a class.I must display a picture in class. So Im find a below code
      TYPES: BEGIN OF ZW3QUERY,
              NAME(30) TYPE C,
              VALUE(255) TYPE C,
             END OF ZW3QUERY.
      data DOCKING type ref to CL_GUI_DOCKING_CONTAINER .
      data PICTURE_CONTROL_1 type ref to CL_GUI_PICTURE .
      data:
        URL(256) TYPE C .
      data QUERY_TABLE TYPE STANDARD TABLE OF ZW3QUERY 
            INITIAL SIZE 0.
      data HTML_TABLE type W3HTML .
      data RETURN_CODE type W3PARAM-RET_CODE .
      data CONTENT_TYPE type W3PARAM-CONT_TYPE .
      data CONTENT_LENGTH type W3PARAM-CONT_LEN .
      data PIC_DATA type W3MIME .
      data PIC_SIZE type I .
      data:
        SUM(4) .
      data:
        NUM1(4) .
      data:
        NUM2(4) .
    DATA: REPID LIKE SY-REPID.
      REPID = SY-REPID.
      CREATE OBJECT PICTURE_CONTROL_1
        EXPORTING
          PARENT = DOCKING.
      CHECK SY-SUBRC = 0.
      CALL METHOD PICTURE_CONTROL_1->SET_3D_BORDER
        EXPORTING
          BORDER = 5.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
        EXPORTING
          DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
      CALL METHOD PICTURE_CONTROL_1->SET_POSITION
        EXPORTING
          HEIGHT = 40
          LEFT   = 5
          TOP    = 170
          WIDTH  = 90.
      IF URL IS INITIAL.
        REFRESH QUERY_TABLE.
        QUERY_TABLE-NAME  = '_OBJECT_ID'.
        QUERY_TABLE-VALUE = 'ZBOYDAKLOGO'.
        APPEND QUERY_TABLE.
    but I must do header line decleration in code. an Error. Class not support this decleration.  . I m try create types but its not works.
    How do I traverse not can this error
    Thanks everything Regards.

    Hi Irfan,
    in ABAP-Objects you don't work with headerlines - instead you work with work-areas.
    You must define a workarea for your table like that:
    DATA:
      gw_query TYPE ZW3QUERY.
      gw_query-name ='_OBJECT_ID'.
      gw_query-value = 'ZBOYDAKLOGO'.
      APPEND gw_query TO query_table.
    Regards.

Maybe you are looking for