Display report in horizontal after grouping

Dear experts,
I have done a REPORT 1 such as below, but i would like to display as REPORT 2. Is it possible to do it?
If yes, How to do? Using what tools in crystal report?
REPORT 1:
Export (Group)
Date            DocNo.         Amount                 
23.3.10       100001           348.00
23.3.10       100002         3271.00
Local (Group)
23.3.10       100003          356.00
23.3.10       100004         3290.00
REPORT 2:
Export (Group)                                       Local (Group)
Date            DocNo.         Amount           Date             DocNo.         Amount
23.3.10       100001           348.00           23.3.10       100003          356.00
23.3.10       100002         3271.00           23.3.10       100004         3290.00
Your reply is higly appreciated.
Thanks.
Regards,
Danny

Hi Carl,
I also get the result as followed your solution. But i facing a problem, i can't get the both total  local and Export display in nicely, it is due to the unbalance for local sales and export sales. e.g.
Local                                    Export
Date      Inv#      Amount     Date      Inv#      Amount
12.3.10   002     345.00       12.3.10   001     345.00
13.3.10   003    1345.00      12.3.10   001     345.00
14.3.10   004    1345.00      _____________________
15.3.10   007    1345.00                                690.00 <- IS IT POSSIBLE MOVE TO SECOND PAGE EVEN THE DATA IS NO FULL?
16.3.10   008     1345.00                                                To display is nice report.
17.3.10   010     345.00
18.3.10   001     345.00
19.3.10   001     345.00
23.3.10   001     345.00
24.3.10   001     345.00
25.3.10   001     345.00
25.3.10   001     345.00
Total                   8140.00 <- THIS WILL MOVE TO SECOND PAGE IF FIRST PAGE IS FULL, IT IS OK.
The report which i want to display.
Local                                    Export
Date      Inv#      Amount     Date      Inv#      Amount
12.3.10   002     345.00       12.3.10   001     345.00
13.3.10   003    1345.00      12.3.10   001     345.00
14.3.10   004    1345.00   
15.3.10   007    1345.00                         
17.3.10   010     345.00
18.3.10   001     345.00
19.3.10   001     345.00
23.3.10   001     345.00
24.3.10   001     345.00
25.3.10   001     345.00
25.3.10   001     345.00
Total                   8140.00     Total                   690.00
Thanks.
Regards,
Danny

Similar Messages

  • Using aggregation in xslt to display sum of rows after grouping in CQWP

    there is a list in SP which has employee name, project name, and weightage. now there is a requirement to produce a customized view in CQWP where data is grouped by project there must be 2 columns one for projects and other for SUM of percentage of each
    row in each project. In header i have a template as no text which hides the text. and in itemstyle.xsl i have made a template as mystyle which makes columns and displays data. i just need to add SUM of each row of a project and display it together with project
    and the rows must not be shown.
    <xsl:template name="MyStyle" match="Row[@Style='MyStyle']" mode="itemstyle">
    <table border='1'>
    <tr>
    <td><h2>Project</h2></td>
    <td><h2>Percentage</h2></td>
    </tr>
    <tr>
    <td colspan="1"><h3><xsl:value-of select="@Project" /></h3></td>
    <td>
    <xsl:value-of disable-output-escaping="yes" select="@Percentage" />
    </td>
    </tr>
    </table>
    </xsl:template>
    I am not able to figure out how to aggregate this thing. need help!

    thanks again, one more Q.
    in XSLT mapping i have written for loop for complete structure.
    example : <Details>
                         <node1>
                         <node2>
                   </details>
    in XSLT mapping
                         <xsl:for-each select="ZMATMAS_01/IDOC/E1MARAM">
         <Details>
         </Details>
         </xsl:for-each>
    if i add the field at target side....then i will come under details node and it will be repeated.
    how to declare in XSLT mapping.

  • How to display the results of the grouping horizontally

    Hello,
    I still cannot understand what am I doing wrong when trying to display the results of the grouping horizontally. Here is the original thread: How to group report vertically
    In the Section expert, for Detail section, I check the box Format with Multiple columns. Under the Layout tab, I check Format groups with multiple columns and set the width of the column at 3.3 in. This should give me 3 columns for Landscape orientation.
    Now if I select Printing direction Down then Across, I just have the regular vertical grouping.
    If I check Across then Down, then I do get 3 columns, but all the records in the Detail section are also spread across first instead of staying in the column.
    There should be something else that I should do to get the display like this:
    Header1    Header2    Header3
    record11   record21   record31
    record12   record22   record32
    record13   record23   record33
    etc.            etc.            etc.
    Thank you.

    I'm not at all sure columns are gonna help here, as there is no way that I am aware of to tell Crystal to start a new column.
    The only way that I can think of to achieve what you are trying to accomplish is to do something like this:
    In your group header's Suppress formula, keep track of the first (/ next) three groups that you want to print, using something like (basic syntax):
    global grouplist(3) as string
    global groupcount as number
    groupcount = groupcount + 1
    grouplist(groupcount) = {db.GroupingField}
    ' The NextIsNull below implies End-of-Data...
    if groupcount = 3 or NextIsNull({db.GroupField}) then
      formula = false  ' print the group header
    else
      formula = true  ' suppress the group header
    end if
    Then, create three formula fields to get each value in grouplist().  The group header format will then show the three formula fields.  Underneath these three formula fields, add subreports, which will show the details for one specific group.  The subreports should have a parameter for which group's details to show.  Use the three formula fields as the link to the three subreports.
    In the group footer, clear out the grouplist() array, and set groupcount to zero.
    This report will take a while to run, because having three subreports next to each other makes it difficult for Crystal to determine page formatting.
    HTH,
    Carl

  • Button on toolbar after executing the report i.e. after result display

    Hi, after executing the report result is being displayed.Now at this stage I want a button on the application toolbar clicking on which will allow a perform to get triggered.
    I tried in following manner:
    SELECTION-SCREEN: FUNCTION KEY 1.
    *INITIALIZATION.
    TABLES: SSCRFIELDS.
    *MOVE icon_mail TO sscrfields-functxt_01.
    *form SEND_EMAIL .
    IF sy-ucomm = 'FC01'.
         PERFORM SEND_MAIL_ASSET_STATUS.
    ENDIF.
    But it's not ok.The above way is not working.
    Please note: I want button on toolbar only after executing the report i.e. after result display.
    How can I do this?
    Kindly guide.
    Best regards.

    hi
    if you are using alv than just pass 3 values to function call
         I_CALLBACK_PROGRAM                = SY-REPID   " program name
         I_CALLBACK_PF_STATUS_SET          = 'STATUS'  "PF-STATUS
         I_CALLBACK_USER_COMMAND           = 'UCOMMAND'  " subroutine name
    and check the value of UCOMM in subroutine

  • Bridge resizes over multiple displays after "Group as stack" or "Batch rename"

    Hi all,
    pls - any idea how to force Bridge to stay displayed within one monitor after e.g. "Group as stack" or "Batch rename"? When I run these functions, Brigde spreads itself over both monitors, resizes all the thumbnails to the largest size a puts itself on top of all other applications. Very annoying. Any ideas how to make it stop doing this?
    Thanks very much,
    Tom

    Due to the current unavailability of clairvoyants and mind-readers in the forum, we respectfully request you supply sensible, complete details.
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Display the sum of a group

    Hi,
    I what i  want do is simple but can't find it anyway, I am just a beginner with crystal. My report displays a list of product group by product_group. I want to to display in the header of each group the sum of the product price included in that group of course.
    Example:
    Product Group--product price--
    Product group A -
    <Sum price>----
    10.00
    product A--5.00--
    product B--3.00--
    product C--2.00--
    Product group B--<sum price>--
    6.20
    product D--2.20--
    product E--4.00--
    I have tried the formula field and the running total field but I am probably doing it wrong . Either it gives the sum of all the articles or the only the price of the first article included in the group.

    A group-based formula should do the trick, which take the format:
    sum( FieldYouWantToSum, GroupToTakeFieldsFrom )
    so, something like:
    sum( {product_price}, {product_group} )
    (and placing it in the group header) should be what you are after.
    You could, of, course, use the Insert Summary wizard to do this for you.

  • Can not view/export a report which has 2 group by field when no data found

    Recently I developed a report, which contains 2 group by fields. it runs successfully when the report displays some data.
    but when there is no data, i cann't view/export this report.
    It shows nothing by html format and shows "this file cannot be opened because it has no pages" message by pdf format.
    even there is no records for this report, i still want to see the template file and show some basic information.
    please help me.
    Daniel

    I've found that, just like I used to do in Oracle Reports, if you put in a COUNT column to count your returning rows, you can put 'No Data Found' when there's no data. That way, your report will return and not error out.
    For .pdfs, this is the code I use; COUNT with code of <?if:count(field_name)=0?>.
    In the .rtf..
    COUNT
         No Data Found     
    END COUNT
    Put this in the .rtf before your data should appear or else it won't work.
    Hope this helps!
    Kris

  • Error in displaying report

    I am geting the following error while displaying report-
    <b>Internal error (-101) occured [Message 131-183]</b>
    The reports are geting displayed on other pcs but not on my pc.I tried unistalling and re-installing sap but the error was not solved.

    Daan,
           The printer was not installed on my pc.After installing printer, the reports are visible.Thanks for u r help.
                                                                                    Regards,
                                                                                    Dilip Kumbhar

  • Dont want to display "Report Successfully Run" applet

    Dear Users....I Dont want to display "Report Successfully Run" applet after my report runs successfully. I'm calling report from Forms-10g Rel.2 and my browser is Internet Explorer ver.6. I'm sending my report directly to printer using Web.Show_Document.If my report is sent to printer successfully there is no need to display browser window with the above mentioned message. Is there any solution for this???

    Code in when-button-pressed
    DECLARE
    V_Usr_Prm Varchar2 (1000);
    BEGIN
    V_Usr_Prm :=
    'FROM_REF_NO='
    || P_FRM_REF_NO
    || '+TO_REF_NO='
    || P_FRM_REF_NO
    || '+P_PRE_BY='
    || P_PRE_BYE
    || '+P_VR_TYPE='
    || P_VOR_TYP
    || '+YEAR1='
    || P_VOR_YER
    || '+MNU_IDE=0'
    || '+P_PRN_FLG=1';
    web_show_document_proc ('HTMLCSS', 'Y:\02\\02\VOR_PRN.REP', V_USR_PRM);
    END;
    Procedure Web_Show_Document_Proc is
    PROCEDURE WEB_SHOW_DOCUMENT_PROC (runformat varchar2,
    reportname varchar2,
    userparameters vARCHAR2)
    IS
    i NUMBER (10);
    v_a VARCHAR2 (10);
    v_b VARCHAR2 (10);
    vc_url VARCHAR2 (1000);
    vc_url_temp VARCHAR2 (1000);
    vc_user_name VARCHAR2 (30) := GET_APPLICATION_PROPERTY (username);
    vc_user_pw VARCHAR2 (30) := GET_APPLICATION_PROPERTY (password);
    vc_user_connect VARCHAR2 (30)
    := GET_APPLICATION_PROPERTY (connect_string) ;
    BEGIN
    vc_url :=
    'userid='
    || vc_user_name
    || '/'
    || vc_user_pw
    || '@'
    || vc_user_connect;
    FOR i IN 1 .. LENGTH (vc_url)
    LOOP
    v_a := LTRIM (TO_CHAR (TRUNC (ASCII (SUBSTR (vc_url, i, 1)) / 16)));
    IF v_a = '10'
    THEN
    v_a := 'A';
    ELSIF v_a = '11'
    THEN
    v_a := 'B';
    ELSIF v_a = '12'
    THEN
    v_a := 'C';
    ELSIF v_a = '13'
    THEN
    v_a := 'D';
    ELSIF v_a = '14'
    THEN
    v_a := 'E';
    ELSIF v_a = '15'
    THEN
    v_a := 'F';
    END IF;
    v_b := LTRIM (TO_CHAR (MOD (ASCII (SUBSTR (vc_url, i, 1)), 16)));
    IF v_b = '10'
    THEN
    v_b := 'A';
    ELSIF v_b = '11'
    THEN
    v_b := 'B';
    ELSIF v_b = '12'
    THEN
    v_b := 'C';
    ELSIF v_b = '13'
    THEN
    v_b := 'D';
    ELSIF v_b = '14'
    THEN
    v_b := 'E';
    ELSIF v_b = '15'
    THEN
    v_b := 'F';
    END IF;
    vc_url_temp := vc_url_temp || '%' || v_a || v_b;
    END LOOP;
    vc_url :=
    '/reports/rwservlet?server=rep_appsrv_frhome1+'
    || vc_url_temp
    || '+report='
    || reportname
    || '+destype=Printer+desformat='
    || runformat
    || '+paramform=No+'
    || userparameters;
    WEB.SHOW_DOCUMENT (vc_url, '_blank');
    END;

  • Dont want to display "Report Successfully Run"

    Dear Users....I Dont want to display "Report Successfully Run" applet after my report runs successfully. I'm calling report from Forms-10g Rel.2 and my browser is Internet Explorer ver.6. I'm sending my report directly to printer using Web.Show_Document.If my report is sent to printer successfully there is no need to display browser window with the above mentioned message. Is there any solution for this???

    Code in when-button-pressed
    DECLARE
    V_Usr_Prm Varchar2 (1000);
    BEGIN
    V_Usr_Prm :=
    'FROM_REF_NO='
    || P_FRM_REF_NO
    || '+TO_REF_NO='
    || P_FRM_REF_NO
    || '+P_PRE_BY='
    || P_PRE_BYE
    || '+P_VR_TYPE='
    || P_VOR_TYP
    || '+YEAR1='
    || P_VOR_YER
    || '+MNU_IDE=0'
    || '+P_PRN_FLG=1';
    web_show_document_proc ('HTMLCSS', 'Y:\02\\02\VOR_PRN.REP', V_USR_PRM);
    END;
    Procedure Web_Show_Document_Proc is
    PROCEDURE WEB_SHOW_DOCUMENT_PROC (runformat varchar2,
    reportname varchar2,
    userparameters vARCHAR2)
    IS
    i NUMBER (10);
    v_a VARCHAR2 (10);
    v_b VARCHAR2 (10);
    vc_url VARCHAR2 (1000);
    vc_url_temp VARCHAR2 (1000);
    vc_user_name VARCHAR2 (30) := GET_APPLICATION_PROPERTY (username);
    vc_user_pw VARCHAR2 (30) := GET_APPLICATION_PROPERTY (password);
    vc_user_connect VARCHAR2 (30)
    := GET_APPLICATION_PROPERTY (connect_string) ;
    BEGIN
    vc_url :=
    'userid='
    || vc_user_name
    || '/'
    || vc_user_pw
    || '@'
    || vc_user_connect;
    FOR i IN 1 .. LENGTH (vc_url)
    LOOP
    v_a := LTRIM (TO_CHAR (TRUNC (ASCII (SUBSTR (vc_url, i, 1)) / 16)));
    IF v_a = '10'
    THEN
    v_a := 'A';
    ELSIF v_a = '11'
    THEN
    v_a := 'B';
    ELSIF v_a = '12'
    THEN
    v_a := 'C';
    ELSIF v_a = '13'
    THEN
    v_a := 'D';
    ELSIF v_a = '14'
    THEN
    v_a := 'E';
    ELSIF v_a = '15'
    THEN
    v_a := 'F';
    END IF;
    v_b := LTRIM (TO_CHAR (MOD (ASCII (SUBSTR (vc_url, i, 1)), 16)));
    IF v_b = '10'
    THEN
    v_b := 'A';
    ELSIF v_b = '11'
    THEN
    v_b := 'B';
    ELSIF v_b = '12'
    THEN
    v_b := 'C';
    ELSIF v_b = '13'
    THEN
    v_b := 'D';
    ELSIF v_b = '14'
    THEN
    v_b := 'E';
    ELSIF v_b = '15'
    THEN
    v_b := 'F';
    END IF;
    vc_url_temp := vc_url_temp || '%' || v_a || v_b;
    END LOOP;
    vc_url :=
    '/reports/rwservlet?server=rep_appsrv_frhome1+'
    || vc_url_temp
    || '+report='
    || reportname
    || '+destype=Printer+desformat='
    || runformat
    || '+paramform=No+'
    || userparameters;
    WEB.SHOW_DOCUMENT (vc_url, '_blank');
    END;

  • Inventory reports with external material group

    Dear Friends,
    In my office in material master record material group & external material groups are maintained. I am looking for a inventory report which shall displays the stock available in paricular plant & other report of stock lying at vendor both should display the  material group & external material group. Please help.
    Thank you
    Prashant B

    There is no Inventory report with external material group field in SAP so consult Abaper to develop the customized report.

  • Spool Request Display Report

    Hello,
    Pleasure to be part of this community and ask the first question.
    I have created a report and probably, that report is going to be scheduled to run weekly.
    I want to understand how I can create a job and spool request display report for this program. I have found some information from this forum about SM36/SM37 T-Code and spool request display. However, I think I am not able to get the whole scenario of how it is going to work.
    If someone can give me an idea, that would be great. Practical examples will be appreciated.
    Regards,
    Udit

    I am assuming you will be scheduling this job manually and not programmatically.. The process is as follows..
    Goto SM36
    Enter a Job Name
    click on START Condition butto and click Date and Time button
    you will see a button PERIODIC VALUES appeared below.
    Click and select WEEKLY as you have indicated, SAVE it.
    Enter date and time so that it starts on that time and is scheduled everywk at that time
    You can enter NO START AFTER in case you want to restrict this.
    Then Click STEP
    You can enter program name variant and also select Printer specification
    And that should do the trick..
    Hope this helps

  • Crystal Reports version 10  error when displaying report

    Hello: New member here, been lurking around for a while. A lot of good information here.
    I do hope this is the right place to ask this first question.  I have a customer that has a Crystal Reports 10 installation and cannot display reports since he upgraded from Crystal report 8 to Crystal reports 10
    The error he gets is pop message:
    CRAXDT error Occurred on Server Error Number: -2147221005 Error description: 006ASP 0177Server
    CreateObject Failed~800401f3
    Connection to the database is good we checked with query using SQL.
    Let me know what you think I should check next.
    I appreciate it.
    Thanks
    Damon

    1212487 - Error: "CRAXDRT Error Occured on Server. Error Number:-2147221005"
    Symptom
    A report is called through the Active Server Pages (ASP) Report Server to be displayed in the Report Viewer for ActiveX. However, the report is displayed with blank pages and when the viewer is switched to the Report Viewer for HTML the following error is displayed:
    "CRAXDRT Error Occurred on Server. Error Number:-2147221005 Error Description: 006ASP 0177 Server.CreateObject Failed~Invalid Class String"
    The same ASP application returns the report correctly when it is called from a client computer with the full version of Crystal Report 8 Developer Edition installed.
    Resolution
    It was found that the file, Emfgen.dll, was not installed and registered on the web server computer during the installation of the Crystal Reports ASP Reports Server. The report could be displayed correctly on the client computer, without Crystal Reports Developer Edition installed, after this file had been installed on the web server computer.
    For more information on installing the Crystal Reports web components please search for and download Scr8_WebManualInstall.zip from our website at:

  • Tabstrip. display report

    Hi All,
    I like to create 3 tabstrip (report program) . two for selection screen and last to display report.
    How to create tabstrip. after enter data in tab 1 and execute , in tab3 display report.
    How to do it.
    Thanks,
    Balamurugan.R

    Hi Swarna,
    Thanks for your reply.
    I like to display report in TAB 3 based on the condition given in TAB 1.
    How to do it.
    Thanks,
    Balamurugan.R

  • Is it possible to put colors while displaying report using ALVs?

    Gayathri

    hi
    i think the following code is the ur solution
    TABLES VBAK.
    TYPE-POOLS SLIS.
    * Data Declaration
    TYPES: BEGIN OF T_VBAK,
          VBELN TYPE VBAK-VBELN,
          ERDAT TYPE VBAK-ERDAT,
          ERNAM TYPE VBAK-ERNAM,
          AUDAT TYPE VBAK-AUDAT,
          VBTYP TYPE VBAK-VBTYP,
          NETWR TYPE VBAK-NETWR,
          VKORG TYPE VBAK-VKORG,
          VKGRP TYPE VBAK-VKGRP,
         <b> LINE_COLOR(4) TYPE C,</b>
          END OF T_VBAK.
    DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0,
          WA_VBAK TYPE T_VBAK.
    * ALV Data Declaration
    DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GD_REPID TYPE SY-REPID.
    *      I_EVENTS TYPE SLIS_T_EVENT,
    *      W_EVENTS LIKE LINE OF I_EVENTS.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BLD_FLDCAT.
    PERFORM BLD_LAYOUT.
    PERFORM DISPLAY_ALV_REPORT.
    * Build Field Catalog for ALV Report
    FORM BLD_FLDCAT.
    FLDCAT-FIELDNAME = 'VBELN'.
    FLDCAT-SELTEXT_M = 'Sales Document'.
    FLDCAT-COL_POS = 0.
    *FLDCAT-EMPHASIZE = 'C411'.
    FLDCAT-OUTPUTLEN = 20.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'ERDAT'.
    FLDCAT-SELTEXT_L = 'Record Date created'.
    FLDCAT-COL_POS = 1.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'ERNAM'.
    FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'AUDAT'.
    FLDCAT-SELTEXT_M = 'Document Date'.
    FLDCAT-COL_POS = 3.
    FLDCAT-EMPHASIZE = 'C110'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VBTYP'.
    FLDCAT-SELTEXT_L = 'SD Document category'.
    FLDCAT-COL_POS = 4.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'NETWR'.
    FLDCAT-SELTEXT_L = 'Net Value of the SO in Document Currency'.
    FLDCAT-COL_POS = 5.
    FLDCAT-OUTPUTLEN = 60.
    FLDCAT-DO_SUM = 'X'.
    FLDCAT-DATATYPE = 'CURR'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VKORG'.
    FLDCAT-SELTEXT_L = 'Sales Organization'.
    FLDCAT-COL_POS = 6.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VKGRP'.
    FLDCAT-SELTEXT_M = 'Sales Group'.
    FLDCAT-COL_POS = 7.
    FLDCAT-EMPHASIZE = 'C801'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    ENDFORM.
    * Build Layout for ALV Grid Report
    FORM BLD_LAYOUT.
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
    GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    *GD_LAYOUT-TOTALS_TEXT = 'GRAND TOTAL'.
    ENDFORM.
    * Display report using ALV grid
    FORM DISPLAY_ALV_REPORT.
    DATA T_EVENT TYPE SLIS_T_EVENT.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = T_EVENT.
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    GD_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = GD_REPID
       IS_LAYOUT                         = GD_LAYOUT
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       I_GRID_TITLE                      = 'SALES DOCUMENT HEADER'
       IT_FIELDCAT                       = FLDCAT[]
       I_SAVE                            = 'X'
      TABLES
        T_OUTTAB                          = IT_VBAK
    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.
    ENDFORM.
    * Retrieve data from VBAK table and populate itab IT_VBAK
    FORM DATA_RETRIEVAL.
    <b>DATA LD_COLOR(1) TYPE C.</b>
    SELECT VBELN ERDAT ERNAM AUDAT VBTYP NETWR VKORG
    UP TO 20 ROWS
    FROM VBAK
    INTO TABLE IT_VBAK.
    <b>LOOP AT IT_VBAK INTO WA_VBAK.
    LD_COLOR = LD_COLOR + 1.
    IF LD_COLOR = 8.
      LD_COLOR = 1.
    ENDIF.
    CONCATENATE 'C' LD_COLOR '10' INTO WA_VBAK-LINE_COLOR.
    MODIFY IT_VBAK FROM WA_VBAK.
    ENDLOOP.</b>
    ENDFORM.
    FORM TOP_OF_PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
          W_HEADER TYPE SLIS_LISTHEADER.
    W_HEADER-TYP = 'H'.
    W_HEADER-INFO = 'WELCOME HEADER LIST'.
    APPEND W_HEADER TO T_HEADER.
    W_HEADER-TYP = 'S'.
    W_HEADER-KEY = 'REPORT:'.
    W_HEADER-INFO = SY-REPID.
    APPEND W_HEADER TO T_HEADER.
    W_HEADER-TYP = 'S'.
    W_HEADER-KEY = 'DATE:'.
    CONCATENATE SY-DATUM+6(2) ' / ' SY-DATUM+4(2) ' / ' SY-DATUM(4) INTO W_HEADER-INFO.
    APPEND W_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER.
    ENDFORM.
    reward points,if it is useful

Maybe you are looking for