ABAP-ALV Reports

what are the sub gropus in ALV reports and how to display them?

The commonly used ALV functions used for this purpose are;
1. REUSE_ALV_VARIANT_DEFAULT_GET
2. REUSE_ALV_VARIANT_F4
3. REUSE_ALV_VARIANT_EXISTENCE
4. REUSE_ALV_EVENTS_GET
5. REUSE_ALV_COMMENTARY_WRITE
6. REUSE_ALV_FIELDCATALOG_MERGE
7. REUSE_ALV_LIST_DISPLAY
8. REUSE_ALV_GRID_DISPLAY
9. REUSE_ALV_POPUP_TO_SELECT
Also refer this for some explanations
A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
The important parameters are :
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
iii. I_callback_user_command : routine where the function codes are handled
iv. I_structure name : name of the dictionary table
v. Is_layout : structure to set the layout of the report
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
II. Tables :
i. t_outtab : internal table with the data to be output
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
Parameters :
I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
This internal table has three fields :
Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
Key : only when typ is ‘S’.
Info : the text to be printed
E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
Parameters : same as reuse_alv_list_display
This is an example for simple list.
2. BLOCK REPORT
This is used to have multiple lists continuously.
The important functions used in this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_BLOCK_LIST_DISPLAY
A. REUSE_ALV_BLOCK_LIST_INIT
Parameters:
I. I_CALLBACK_PROGRAM
II. I_CALLBACK_PF_STATUS_SET
III. I_CALLBACK_USER_COMMAND
This function module is used to set the default gui status etc.
B. REUSE_ALV_BLOCK_LIST_APPEND
Parameters :
Export :
I. is_layout : layout settings for block
II. it_fieldcat : field catalog
III. i_tabname : internal table name with output data
IV. it_events : internal table with all possible events
Tables :
i. t_outtab : internal table with output data.
This function module adds the data to the block.
Repeat this function for all the different blocks to be displayed one after the other.
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
This function module is used for hierarchical sequential blocks.
D. REUSE_ALV_BLOCK_LIST_DISPLAY
Parameters : All the parameters are optional.
This function module display the list with data appended by the above function.
Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
3. Hierarchical reports :
Hierarchical sequential list output.
The function module is
A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
i. t_outtab_header : Header table with data to be output
ii. t_outtab_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
Important Attributes :
A. col_pos : position of the column
B. fieldname : internal fieldname
C. tabname : internal table name
D. ref_fieldname : fieldname (dictionary)
E. ref_tabname : table (dictionary)
F. key(1) : column with key-color
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
J. just(1) : (R)ight (L)eft (C)ent.
K. do_sum(1) : sum up
L. no_out(1) : (O)blig.(X)no out
M. outputlen : output length
N. seltext_l : long key word
O. seltext_m : middle key word
P. seltext_s : short key word
Q. reptext_ddic : heading (ddic)
R. ddictxt(1) : (S)hort (M)iddle (L)ong
S. datatype : datatype
T. hotspot(1) : hotspot
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
regards,
srinivas
<b>*reward for useful answers*</b>

Similar Messages

  • Setting the column labels in webdynpro abap alv report

    Hello,
    Right now I have programmed an ALV report. The selection criterion and the display of the report all work.
    However, there is an issue with the labels of columns in the ALV report. The report takes the field names of the structure I am using in the ALV report as the labels of the report. I have been trying to play around with the ALV class model to see if something will change the labels of the fields but to no avail. Would you guys know of some code or way to change the labels of the columns in the ALV report.
    Thank you for your help in advance.
    Sumit.
    Here is some of the code I tried but does no work in the wdInit() method. It does not change the label. Any suggestions???
    METHOD wddoinit .
    * instantiate used component from wizard
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    * call a method in the used component from wizard
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
    DATA: lr_field TYPE REF TO cl_salv_wd_field.
    lr_field = lo_value->if_salv_wd_field_settings~get_field( 'CUSTOMER_NUMBER' ).
    * change the label of the report.
    DATA: lr_CUSTOMER_NUMBER TYPE REF TO cl_salv_wd_column.
                CALL METHOD lo_value->if_salv_wd_column_settings~get_column
                  EXPORTING
                    id     = 'CUSTOMER_NUMBER'   receiving value  = LR_CUSTOMER_NUMBER.
    * SET THE LABEL OF THE COLUMN
    DATA: HR_CUSTOMER_NUMBER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.
    CALL METHOD lr_customer_number->get_header
      receiving
        value  = HR_CUSTOMER_NUMBER.
    ***** set the text of the column
    CALL METHOD hr_customer_number->set_text
      EXPORTING
        value  = 'Customer1 Number1'.
    ENDMETHOD.

    You have to disable the DDic binding on the column before your override text will show up:
    data: l_ref_cmp_usage type ref to if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      data l_salv_wd_table type ref to iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      data l_column type ref to cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
      data l_header type ref to cl_salv_wd_column_header.
      l_header = l_column->get_header( ).
      l_header->set_prop_ddic_binding_field(
        property =  if_salv_wd_c_ddic_binding=>bind_prop_text
        value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
      l_header->set_text( `Posting Date` ).

  • Problem in performing subtotaling in ABAP ALV Report for GL Account ID

    Hi,
    I had developed a report in which i am displayng data on the basis of GL Account in a ALV Report. I want to display the sub-totaling on the different series of GL Account (i..e. 100000,400000 etc..) but at present this fucntionality is not possible right now. Is there method of doing it?

    Hi,
    Thanks ,i had solved the problem by taking a variable type string and the assigning the GL A/C ID in it and it is showing the data accuarately as per requierment..
    Thanks everybody for valueable response.
    Problem Solved.

  • How we can sort subtotal results value in abap alv report

    Hi, How we can sort subtotal results value in abap alv report

    Thanks a lot for your code
    but i am still getting double and weird results.
    Subtotal     IN     PARTY              KGS        TOTAL VALUE
         1     40008     3,141.20     192,799.00
         1     40008     16,681.06     1,908,659.00
    Subtotal     1          19,822.25     2,101,458.00
         10     40022     4,590.60     531,228.00
         10     40022     3,448.27     377,173.00
    Subtotal     10          8,038.87     908,401.00
         100     40010     270.172     19,852.00
    Subtotal     100          270.172     19,852.00
         101     40036     752.898     61,051.00
         101     40036     207.586     19,431.00
    Subtotal     101          960.484     80,482.00
         102     40048     325.936     32,154.00
         102     40048     264.32     19,364.00
    Subtotal     102          590.256     51,518.00
         103     40066     216.134     18,088.00
    Subtotal     103          216.134     18,088.00
         104     40001     231.96     16,986.00
    Subtotal     104          231.96     16,986.00
         105     40021     585.918     65,461.00
         105     40021     108.683     15,825.00
    Subtotal     105          694.601     81,286.00
         106     40046     209.777     15,341.00
    Subtotal     106          209.777     15,341.00
         107     40043     167.353     14,755.00
    Subtotal     107          167.353     14,755.00
         108     40046     153.023     14,343.00
         108     40046     342.348     32,223.00
    Subtotal     108          495.371     46,566.00
         109     40008     184.085     13,483.00
    Subtotal     109          184.085     13,483.00
         11     40011     5,275.63     524,232.69
         11     40011     6,723.28     643,911.82
    Subtotal     11          11,998.90     1,168,144.51
         110     40067     142.113     13,333.00
         110     40067     492.883     44,428.00
    Subtotal     110          634.996     57,761.00
         111     40040     118.961     13,190.00
         111     40040     492.433     60,029.00
    Subtotal     111          611.394     73,219.00
    Edited by: Timaji Sawant on Feb 16, 2012 12:16 PM
    Edited by: Timaji Sawant on Feb 17, 2012 9:27 AM

  • How to show ABAP ALV report in Portal iview?

    I have a ABAP report developed in ALV grid. Now I want to show it in EP iview. How can I do that? What type iview I shall use? And any step by step procedure/doc will be really appreciated.
    Alternatively is it possible to create a HTML tabular report similar to that of ALV grid and show it in EP.
    How complex will it be?

    To add to padmakar's remark. You can use a transaction iview but it has limitations.
    First of all: You can use a transaction iview with or without Gui. If the user has a sap gui then 1) you make a transaction for your ALV 2) create a transaction iview defining the alv transaction + with gui output
    If the user has no gui. Then it will only work if your ALV is made web enabled ( so not on 4.6c ).
    Other alternatives are to create a BSP + bsp iview instead of a list. Or use Webdynpro.
    Hopes this helpes somewhat,
    Frederik

  • Need to display grand total text in OOPS ABAP ALV report

    Hi
    I am using OOPS for alv display and need to display grand "total text" in any column in th eoutput display.
    I know the procedure to display in ALV display. but dont have idea in OOPS. Please help.
    Thanks
    Amminesh.

    hi,
    follow this link for alv's with oop's oncept.
    http://abapreports.blogspot.com/2008/06/alv-grid-display-with-oops.html
    for calculating total  to the specific field.....
    while creating the fieldcatalog pass the value 'X' to field do_sum of lvc_t_fcat( field catalog).
    data: fcat type lvc_t_fcat.
    fcat-fieldname = <field-name>.
    fcat-ref_table = <ref-tablename>.
    fcat-ref_field = <ref-fieldname>.
    fcat-do_sum = 'X'.
    regards,
    Ashok

  • ALV Report printing to A3 format

    Hi
    We have written an ABAP ALV report to extract information from any number of Sales Orders from a given set of criteria. A number of layouts have been created. The layouts have been defined by the business (as they wanted the same format as they were previously used to). The default layout is about 337 columns wide, thus sending it over the 255 A4 limit. I can print the layout on an A4 landscape on 2 sheets of paper, but this is not practical when you have up to 30 pages of content (thus 60 sheets of A4 paper).
    As such, I am experimenting with printing to A3. This is what I have tried so far (from information gleaned from Forum posts and elsewhere):
    Created a new Page Type (used template DINA3 to create ZDINA3.
    Created a new Format Type (e.g. Z_65_400_A3) and use ZDINA3 with 65 rows and 400 columns.
    Assigned this new Format Type to a Device Type, in this case, SWIN.
    In the Device Type, I have had to change the List Handler printer driver to "Print driver for SWIN using SAPLPD/Windows", otherwise I end up with 3 lines.
    I have also set the paper size on the printer to A3, but nothing else. Leaving this as A4 results in an A4 print!
    I have set up a number of Escape characters in the Device Type configuration:
    Printer Initialzation
    SAPWIN data stream
    \e%SAPWIN%
    \i<::XPAGES>
    \i<::XPGINIT>
    \i<::XPARAM>
    \i<::XLINEMOD>
    \i<::XFONT>
    End Of Page
    \f
    End of Line
    \n
    XLINEMOD: Line handling
    ##usage: Line handling
    ##DO NOT CHANGE the first two lines!
    output complete line with one call (do not use for proportional fonts)
    \eOa1
    XPARAM: Local settings
    ##usage: Local settings
    ##DO NOT CHANGE the first two lines!
    Schrift 5 Punkt einstellen.
    \eS92X
    #8,5 lpi
    \el8.5;
    XPGINIT: Orientation
    ##usage: Orientation
    ##DO NOT CHANGE the first two lines!
    Landscape-Mode
    \ePL
    I have tried to use the same example as <a href="http://www.sap-img.com/basis/how-can-i-print-a3-format-in-sap.htm">http://www.sap-img.com/basis/how-can-i-print-a3-format-in-sap.htm</a> but although I am getting an A3 sheet of paper, there are still issues with it:
    Portrait instead of Landscape
    Text appears to be double line spaced
    Font is very small (believe this can be resolved by specifying the size of a font)
    Firstly, any tips or tricks on printing to A3?
    Secondly, what is the List Driver checkbox used for on the Format Type (other than to show the portrait and landscape page types)?
    I do tend to scan these forums before posting, but in this case I have not managed to resolve this by looking in the Forum or elsewhere.
    Many thanks
    Nick

    Hi
    Due to getting no joy with this, I ended up creating an A3 Smartform and using a Windows printer capable of printing it. I also have the option of an A4 or A3 sheet in the Selection Screen, so this gives me the output in the format that was needed.
    Defining a Printer Output definition proved too tricky and I had to find a way to do it.
    Whether you can use a Smartform to print your ALV grid across several pages I do not know, but might be worth considering. I used a custom print button to trigger the correct page size (as selected on the Selection Screen).
    Regards
    Nick

  • Merging of 2 Cells in WD ABAP ALV Header & Dynamically change the header

    Hello Experts,
    I have two main requirements with respect to WD ABAP - ALV report creation
    1) Two feilds in the  header of ALV GRID created in the WD ABAP screen must be merged as shown below(Month Column) ,
    |     January         |     February         |  
    |   Col 1 | Col2      |   Col 1 | Col2        |     
    2) The header value(Month) should dynamically change based on the current date.
    For Eg: If June 2011 is the current month , the ALV table should start from June 2011 and displayed till May 2012.
    Looking forward for your valuable inputs @ the earliest
    Regards,
    Sriram

    Hi Sriram,
    For merging..
    Pleaese go through this
    Merge of Cells in ALV table in ABAP webdynpro.
    ABAP WD: ALV merge cells
    For Header Change..
    How to set title/text for ALV table column header in WD ABAP
    Change column header in ALV to another DDIC Element type
    Change label of a column in ALV
    Cheers,
    Kris.

  • ABAP Custom Report (ALV Format) in Background Processing

    Hi
    I am not the hardcore ABAP Person. But want to know about the detail fact of the ABAP Custome Reports. The question is can we do the background processing for the ABAP Custome Report in ALV Format.
    If Yes ..do we require to have any additional Function/code to get the spool in ALV Format. I saw the comments that the output will look like the mess.
    Please share your comment or any useful documenation on this. We are in ECC 6.0
    Thanks in advance..and yes it will be rewared by points.
    Navin

    You can use alv's in background using docking containers, but the display wont be interactive. If you search the forum you will see tons of threads which talk about running ALV's in background.
    For the output to be interactive, you can run the report in foreground and do the data processing in background.
    Refer this link:
    Displaying ALV Grid in Background Job

  • ALV Report In Background.. Generating same out put using ABAP Extracts

    Hi
        We are running ALV reports and generating out put in background using Extracts. We are having a discussion that SAP doesn’t recommend to execute ALV reports using batch and generate report output , as it heavily load for spool ... we are coming across some problem when I analyze Sm37 ... I found an error " ABAP framework unable to initialize " .
    I want an input/suggestion what you guys think about it?
    Thanks in Advanced...
    Bye

    Nope... We’re using some batch id which use to run background job, as I am also in SAP Security, I just verify it has all the security to run the report . As this report is running fine if we ran it other then batch id ... as before it was running fine .
    Thanks
    Message was edited by: Saquib Khan

  • Alv report using oops ABAP

    hi friendz,
    can any one of u give an example, how to build alv report using oops abap ?
    thanks in advance.
    points for sure
    regards,
    Vijaya

    Hi Vijaya,
    I hope the following code upto your requirement.
    *& Report  ZMAT_ALV_GRID                                               *
    REPORT  ZCL_CLASS1.
    TYPES: BEGIN OF T_MARA,
             MATNR TYPE MARA-MATNR,
             MAKTX TYPE MAKT-MAKTX,
             WERKS TYPE MARD-WERKS,
             LGORT TYPE MARD-LGORT,
             LABST TYPE MARD-LABST,
           END OF T_MARA.
    *DATA: IT_MARA TYPE STANDARD TABLE OF T_MARA.
    DATA: IT_MARA TYPE T_MARA OCCURS 0.
    DATA: O_CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          O_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: X_FLDCAT TYPE LVC_S_FCAT.
    DATA: IT_FLDCAT TYPE LVC_T_FCAT.
    DATA: I_LAYOUT TYPE LVC_S_LAYO.
    DATA: X_SORT TYPE LVC_S_SORT.
    DATA: I_SORT TYPE LVC_T_SORT.
    TABLES: MARA.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    PARAMETERS: P_CHK AS CHECKBOX.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM GENERATE_FLDCAT.
      PERFORM GENERATE_LAYOUT.
      PERFORM DO_SORT.
      SET SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
       SET PF-STATUS 'MAIN'.
    SET TITLEBAR 'xxx'.
       PERFORM BUILD_ALV.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_ALV
          text
    FORM BUILD_ALV .
    CREATE OBJECT O_CONT
       EXPORTING
          CONTAINER_NAME              = 'MAT_CONTAINER'
       EXCEPTIONS
         CNTL_ERROR                  = 1
         CNTL_SYSTEM_ERROR           = 2
         CREATE_ERROR                = 3
         LIFETIME_ERROR              = 4
         LIFETIME_DYNPRO_DYNPRO_LINK = 5
         others                      = 6.
         CREATE OBJECT O_GRID
           EXPORTING
              I_PARENT          = O_CONT
           EXCEPTIONS
             ERROR_CNTL_CREATE = 1
             ERROR_CNTL_INIT   = 2
             ERROR_CNTL_LINK   = 3
             ERROR_DP_CREATE   = 4
             others            = 5.
    CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
       EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
       I_STRUCTURE_NAME              =
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = ' '
         IS_LAYOUT                     = I_LAYOUT
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
       CHANGING
         IT_OUTTAB                     = IT_MARA
         IT_FIELDCATALOG               = IT_FLDCAT[]
         IT_SORT                       = I_SORT
       IT_FILTER                     =
      EXCEPTIONS
        INVALID_PARAMETER_COMBINATION = 1
        PROGRAM_ERROR                 = 2
        TOO_MANY_LINES                = 3
        others                        = 4.
    ENDFORM.                    " BUILD_ALV
    *&      Form  GET_DATA
          text
    FORM GET_DATA .
    SELECT A~MATNR
          B~MAKTX
          C~WERKS
          C~LGORT
          C~LABST
    INTO TABLE IT_MARA
    FROM MARA AS A
    INNER JOIN MAKT AS B
    ON BMATNR = AMATNR
    INNER JOIN MARD AS C
    ON CMATNR = AMATNR
    WHERE A~MATNR IN S_MATNR
    AND   B~SPRAS = SY-LANGU.
    ENDFORM.                    " GET_DATA
    *&      Form  GENERATE_FLDCAT
          text
    FORM GENERATE_FLDCAT .
    *CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
      I_BUFFER_ACTIVE              =
       I_STRUCTURE_NAME             = 'ZSMARA'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_INTERNAL_TABNAME           = ' '
    CHANGING
       CT_FIELDCAT                  = IT_FLDCAT
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3.
    X_FLDCAT-COL_POS = 1.
    X_FLDCAT-FIELDNAME = 'MATNR'.
    X_FLDCAT-OUTPUTLEN = '18'.
    X_FLDCAT-REPTEXT = 'Material No'.
    APPEND X_FLDCAT TO IT_FLDCAT.
    X_FLDCAT-COL_POS = 2.
    X_FLDCAT-FIELDNAME = 'MAKTX'.
    X_FLDCAT-OUTPUTLEN = '48'.
    X_FLDCAT-REPTEXT = 'Material Desc'.
    X_FLDCAT-TOOLTIP = 'Material Desc'.
    APPEND X_FLDCAT TO IT_FLDCAT.
    X_FLDCAT-COL_POS = 3.
    X_FLDCAT-FIELDNAME = 'WERKS'.
    X_FLDCAT-OUTPUTLEN = '5'.
    X_FLDCAT-REPTEXT = 'Plant'.
    X_FLDCAT-TOOLTIP = 'Plant'.
    APPEND X_FLDCAT TO IT_FLDCAT.
    X_FLDCAT-COL_POS = 4.
    X_FLDCAT-FIELDNAME = 'LGORT'.
    X_FLDCAT-OUTPUTLEN = '5'.
    X_FLDCAT-REPTEXT = 'S.Loc'.
    X_FLDCAT-TOOLTIP = 'S.Loc'.
    APPEND X_FLDCAT TO IT_FLDCAT.
    X_FLDCAT-COL_POS = 5.
    X_FLDCAT-FIELDNAME = 'LABST'.
    X_FLDCAT-OUTPUTLEN = '20'.
    X_FLDCAT-REPTEXT = 'Quantity'.
    X_FLDCAT-TOOLTIP = 'Quantity'.
    X_FLDCAT-DO_SUM = 'X'.
    APPEND X_FLDCAT TO IT_FLDCAT.
    ENDFORM.                    " GENERATE_FLDCAT
    *&      Form  GENERATE_LAYOUT
          text
    FORM GENERATE_LAYOUT .
      I_LAYOUT-ZEBRA = 'X'.
      I_LAYOUT-FRONTEND = 'X'.
      I_LAYOUT-GRID_TITLE = 'ALV GRID USING OOPS'.
      I_LAYOUT-NUMC_TOTAL = 'X'.
    ENDFORM.                    " GENERATE_LAYOUT
    *&      Form  DO_SORT
          text
    FORM DO_SORT .
    X_SORT-FIELDNAME = 'MATNR'.
    X_SORT-UP = 'X'.
    X_SORT-SUBTOT = 'X'.
    IF P_CHK = 'X'.
       X_SORT-EXPA = SPACE.
    ELSE.
       X_SORT-EXPA = 'X'.
    ENDIF.
    APPEND X_SORT TO I_SORT.
    ENDFORM.                    " DO_SORT
    inorder to execute this code perfectly, do the following things.
    1. Create a Graphical Screen 100.
    2. Place a Custom Control on that screen and give name as MAT_CONTAINER.
    3. activate the screen.
    and execute the program.
      if this suits requirement award points.
    satish

  • Hierarchical ALV Report in webdynpro abap

    Hi Experts,
    I'm facing the trouble with requirement as below. Please help me to resolve this issue.
    Output as:
    Material Number                         Description               Created Date
    - 10001(Header data)                      abc                         09-09-2013  
              1001 (item level data)            abc                         10-09-2013
              1002                                   xyz                          11-09-2013
              1003                                   xyz                          11-09-2013    
    - 10002(Header data)                      abc                         09-09-2013  
              2001 (item level data)            abc                         10-09-2013
              2002                                   xyz                          11-09-2013
              2003                                   xyz                          11-09-2013    
    - 10003(Header data)                      abc                         09-09-2013  
              3001 (item level data)            abc                         10-09-2013
              3002                                   xyz                          11-09-2013
              3003                                   xyz                          11-09-2013    
    .... and so on...
    - when I expand on header Materail number, it has to be display with item level data with   in alv report in webdynpro abap.
    Looking forward your valuable comments.
    Regards,
    Venkat

    Hi Venkat,
    We can achieve the  HIERARCHY through the following code.In this case I have used  CARRID as the drill down column.
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_flight_tree( ).
    if lo_cmp_usage->has_active_component( ) is initial.
       lo_cmp_usage->create_component( ).
    endif.
    DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
    lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_flight_tree( ).
       DATA lv_value TYPE ref to cl_salv_wd_config_table.
       lv_value = lo_interfacecontroller->get_model(
    lv_value->IF_SALV_WD_TABLE_SETTINGS~SET_DISPLAY_TYPE(  IF_SALV_WD_C_TABLE_SETTINGS=>DISPLAY_TYPE_HIERARCHY ).
    "Enable HIERARCHY structure
    data lr_col type ref to CL_SALV_WD_COLUMN.
    lr_col = lv_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'CARRID' )." Enable HIERARCHY for the col. specified
    lr_col->IF_SALV_WD_COLUMN_HIERARCHY~SET_HIERARCHY_COLUMN( ABAP_TRUE ).
    Regards,
    Harsha

  • OO Design--do ABAP Persistent Classes make sense for ALV reports in NW2004?

    Hello experts,
    At our company, we started using ABAP OO in the last year.
    I am on NW-2004 .  We just acquired a business that is on 4.6C.
    We have a lot of customization to bring into our system. There are a lot of reports with common queries that span multiple tables.
    I would like to follow the best practice for OO design and create global classes for the data access layer  the business logic layer and the UI layer.  For the UI layer, I will be utilizing the SALV class, since NW2004 doesn't have ABAP WebDynpro (we don't have a java stack available for development and software change management).
    For the data access layer,  I would like to use the persistent classes,  but without the query manager, it just doesn't make sense.
    Thomas Jung said in a blog that he sometimes used SQL to get the keys and then used persistent classes to retrieve the remaining data.  But for straight ALV reporting, that just seems inefficient.  But it could be that I am just not familiar enough with the technology.
    I am looking for suggestions on how to design the data access layer for these intense  and commonly used queries.
    (Ironically, we will upgrade to NW2004s after this migration -- ouch!)
    All ideas are appreciated.
    Thanks.

    Hi Kimberly,
    the main advantage of persistent objects is that their state can be saved in the database. If a persistent object changes in your program, these changes can be reflected in the corresponding database field(s). Thus, persistent objects are very useful when doing CRUD (create, read, update and delete) operations with business objects.
    However, if you just want to read data (for simple reporting) but do not plan to implement any of the other CRUD operations, I doubt if a persistency layer is necessary since this causes extra effort during design time and runtime. In that case, simple SELECT statements seem to be more appropriate.
    Regards,
    David

  • Regarding ALV Reporting in ABAP

    Hi All,
    I have some clarifications related to <b>ALV Reporting</b> in ABAP.
    <b>Actually i have to create ALV report with Structure Length/Each record length is around 300 characters.</b>
    Is it possible to create a ALV Report with <b>300</b> length for each record!
    If possible which is the best<b>[ALV]</b> method for the same!
    Can anybody give me the solution!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hai Prasad
    Check with the code
    *& Report  ZALV_PRAKASH_SAMP                                           *
    REPORT  ZALV_PRAKASH_SAMP .
    TABLES: MARA.
    TYPE-POOLS : SLIS.
    Data declaration
    DATA: BEGIN OF I_MARA OCCURS 0.
            INCLUDE STRUCTURE MARA.
    DATA: END OF I_MARA.
    DATA: V_REPID LIKE SY-REPID.
    selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
      PARAMETERS: P_MTART LIKE MARA-MTART DEFAULT 'ROH'.
    SELECTION-SCREEN END OF BLOCK B1.
    initialisation
    INITIALIZATION.
    S_MATNR-LOW = '1400'.
    S_MATNR-HIGH = '1500'.
    APPEND S_MATNR.
    V_REPID = SY-REPID.
    start-of-selection
    START-OF-SELECTION.
    SELECT * FROM MARA
        INTO TABLE I_MARA
        WHERE MATNR IN S_MATNR AND
              MTART = P_MTART.
      CHECK SY-SUBRC = 0.
    end of selection
    END-OF-SELECTION.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = ' '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
       I_STRUCTURE_NAME               = 'MARA'
      IS_LAYOUT                      =
      IT_FIELDCAT                    =
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      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
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = I_MARA
    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.
    loop at i_mara.
    write:/ i_mara.
    endloop.
    Thanks & Regards
    Sreenivasulu P

  • ALV Reports versus ABAP drilldown or high volume data

    Which is better with regards to performance? An ALV grid or an ABAP drilldown ?
    I am very concerned about performance given the high volume of data and therefore not sure if I should use ALV?
    input is appreciated
    J

    hi JJ,
    ALV reporting is always having lot of advantages over abap reproting in many ways,
    performace increases due to the use of
    object oriented cocepts like classes, objects and methods
    by using the line type and row type internable declarations..
    and user friendly out put
    Regards,
    GUDURI

Maybe you are looking for

  • Campaign data in BP Fact Sheet

    Hello, What are the prerequisites so as to display the campaign data in the BP Fact Sheet? Isn't it enough for the BP to be a member of the Target Group which is assigned in the Campaign? I have noticed that Campaign Data is displayed in the BP Fact

  • Problem in creating A certificate for Depo excise for price escalation

    Hi all, There is a scenario where we transfer stocks OF 100 KG from manufacturing plant to depo..DID the  ME21N, VL10B, VF01, J1IIN, MIGO, J1IG. fROM DEPO DID va01 , VL01N, VF01, J1IJ FOR 50 qty. The later on while selling 10 KG from the depo the pri

  • Why isn't my ipod shuffle not showing up in my devices, or my desktop?

    I received my ipod shuffle (2nd gen) app. 2 years ago, however, this is the first time that I have ever tried to sync my current itunes library onto it. I connected the shuffle with a USB chord, but, the shuffle does not show up in "devices", nor on

  • What is the content slider on whitehouse.gov?

    Dear Adobe Community! Please follow this link:" The White House ". Notice the title "Top news" to the right underneath the main image area of the front page and also recognize the three buttons that are interactive. Can anyone of you tell me which ty

  • Why do templates use .classes so much instead of DIVS?

    I really thought DIV's were the way we named once-off major columns and sections across our site, yet when I look into the DW templates they are all classes with unusual names. Yet I thought CSS were moving to standard naming conventions like.... div