Problem in displaying detail along with Aggregate data.

Hi
I am new to BIP and I am facing problem to display detail as well as aggregate values at a time.
My data is like below
Security Value
S1 10     
S2 20     
S3 30     
S3 40     
S4 50     
S5 60     
S5 70     
I want to display data in report as
Security Value
S1 10     
S2 20     
S3 30     
S3 40     
Total S3 70
S4 50     
S5 10     
S5 70     
Total S5 80
I tried using for <?for-each-group:G_2;./Security?> but I am getting following output:
Security Value
S1 10     
S2 20     
S3 30     
Total S3 70
S4 50     
S5 10     
Total S5 80
Template:
<?for-each-group:G_2;./Security?> <?Security?>:<?Value?>
<?if:count(current-group()/SECNAME)>1?> Total <?Security?>:<?sum(current-group()/Value)?> <?end if?> <?end for-each-group?>
The problem is I need to display detail as well as aggregate data. Please suggest.

Hi Kavipriya
Thanks for your response.
I tried the code you provided but I am getting blank PDF report from RTF template.
Also I didn’t understand <?variable:GRP;G2?>, is this declaration of group variable or something?
Below is my xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Oracle BI Publisher 11.1.1.3.0-->
<DATA_DS>
<G_1>
<SECURITY>S1</SECURITY>
<VALUE1>10</VALUE1>
</G_1>
<G_1>
<SECURITY>S2</SECURITY>
<VALUE1>20</VALUE1>
</G_1>
<G_1>
<SECURITY>S3</SECURITY>
<VALUE1>30</VALUE1>
</G_1>
<G_1>
<SECURITY>S3</SECURITY>
<VALUE1>40</VALUE1>
</G_1>
<G_1>
<SECURITY>S4</SECURITY>
<VALUE1>50</VALUE1>
</G_1>
<G_1>
<SECURITY>S4</SECURITY>
<VALUE1>30</VALUE1>
</G_1>
</DATA_DS>
And following is the code I used in RTF template
<?variable:GRP;G1?>
<?for-each-group:G1;./SECURITY?> <?xdoxslt:set_variable($_XDOCTX,'SEC',./SECURITY)?>
<?for-each:$GRP[./SECURITY= xdoxslt:get_variable($_XDOCTX,'SEC')]?>
<?SECURITY?>:<? VALUE1?> <?end for-each?>
<?if:count(current-group()/SECURITY)>1?> Total <?SECURITY?>:<?sum(current-group()/VALUE1)?> <?end if?>
<?end for-each-group?>

Similar Messages

  • Data Display table along with Graph

    As per my knowledge we are not having any option currently for displaying data table along with graph.
    This plot data table can have plot name along with current data.
    See the sample below. Many times I need to display number of parameters on graph and current value need to see along with graph.
    It will very useful if I get something like this in next version.

    Hi chameli,
    well, you gave the chart as an example to your question - but didn't specify your question any further!
    What's wrong with a little coding to have your data presented as you like to?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Displaying Images along with Drill Drown Results

    I'm using MS access 2003 as my data base and CF as the web
    language. I cannot find a topic in reference to displaying Images
    along with Drill down results. My tables in access have a OLE
    object included however I am clueless as how i can display the
    images with my drill down results. I just cannot find a link that
    talked about this issue already. Does anyone have a link to this
    forum topic?

    College Kid wrote:
    > I'm using MS access 2003 as my data base and CF as the
    web language. I cannot
    > find a topic in reference to displaying Images along
    with Drill down results.
    > My tables in access have a OLE object included however I
    am clueless as how i
    > can display the images with my drill down results. I
    just cannot find a link
    > that talked about this issue already. Does anyone have a
    link to this forum
    > topic?
    >
    Sorry, no link, but I think you want to be looking at the
    <cfimage...>
    and|or the <cfcontent...> tags. One or both of these
    tags should allow
    you to deliver the image from the database to the client.
    You are doing this in a bit of an unusual, but not unheard of
    way. Most
    people just store the image file in a handy directory
    accessible to the
    web server and then store the name|URL to this image as text
    in the
    database.
    But it is definitly possible to server up binary image data
    as well.
    Though I have never heard of this in conjunction with MS
    Access and 'OLE
    objects'. I usually hear this discussed in relation to more
    enterprise
    database management systems and BLOB [Binary Large OBjects]
    data fields.

  • AUDIO PROBLEM WHILE USING OR ALONG WITH WEBCAM

    Hi friends,
    SUBJECT : AUDIO PROBLEM WHILE USING OR ALONG WITH WEBCAM
    I'm not getting any sound while using web-cam.
    I tried recording my voice , and played.. i can see my video but audio
    Do we have any settings where i need to cross-check to make sure that everything being turned-on ?
    My laptop details:-
    HP Pavilion dv6 laptop
    Operating system Installed - Windows 7
    Can someone help me with this?
    Thanks
    kiran

    Hi,
    not sure if coincidence or the same question, but the same question got asked internally. The seeded option is required to get the OJSP filter installed. Here's the internal response
    ADF View integration with MDS not configured
    In web.xml, you need to have mds-ojsp intg enabled to load jspx base + customizations from MDS. In your web project in Jdev, go to ADFv project properties and select “Seeded customization” property. It would enable mds-jsp engine configuration in web.xml. If you want to use user personalization feature at runtime, you would need to select “User customization” property as well which would enable ADFv change persistence config in web.xml.
    Warning: Some of the metadata under ... is packaged as part of both WAR and MAR. This metadata cannot be accessed from WAR using MDS.
    For these two packages, you are including the files in both WAR & MAR. This warning conveys that since these base files are being put in MAR, at runtime they would be read from mds repository & not from WAR.
    Frank

  • Please explain consignment process in details along with SPRO customisation

    hi,
    sap gurus,
    my email id is [email protected]
    Please explain consignment process in details along with SPRO customisation with a proper scenario.
    regards,
    balaji.t
    09990019711.

    Hi Balaji
    Check this link for the building blocks
    [Consignment|http://help.sap.com/bestpractices/BBLibrary/HTML/J58_CustConsProc_EN_KO.htm]
    Also go though the extract below
    The consignment process in SAP standard consist of four small processes: 
    Consignment fillup (send materials to customer consignment). 
    Here you have a consignment fillup order and a consignment fillup delivery. 
    Consignment issue (issue materials from customer consignment to the customer). 
    Here you have a consignment issue order, consignment issue delivery and a consignment issue invoice. (the flow is very similar to a normal OR flow, but the materials are issued from the consignment stock instead of plant stock unrestricted). 
    Consignment return (return materials from customer ownership to customer consignment). 
    Here you have a consignment return order, consignment return delivery and a consignment return invoice. (the flow is very similar to a normal RE flow, but the materials are returned to the consignment stock instead of plant stock returns). 
    Consignment pickup (pickup consignment stock and move it to plant stock). 
    Here you have a consignment pickup order and a consignment pickup delivery. 
    Note that in consignment fillup and consignment pickup there are no invoices since there is no change of ownership for the materials. 
    How to perform a consignment order?
    In consignment orders you are allowing the stock to sit in your customer location. Once he informs that he used the stock you will invoice him. If he returns the stock you will accept the stock to take it back.
    It is defined in 4 steps.
    1. Consignment fill up: 
    Sales document type is KB
    Item category KBN
    shedule line category E1
    In this step, you are not invoicing the customer. document flow is sales order -
    delivery item category. It will not be relevent for billing and pricing because you are not charging money for these goods in this step.
    In schedule line category, you will set movement type 631 & set for availability check and TOR.
    2. Consignment Issue.
    Once the customer informed you that he used all the goods or partial goods then you will create consignment issue for used goods.
    Sales document: KE
    Item category: KEN
    shedule line category: C0 or C1
    Here you are invoicing the customer(because he used the goods). you are assigning the delivery documnt and billing document to the sales document.
    In item category, you are setting relevent for billing, pricing, special stock.
    In schedule line category, your setting is 633 movement type, relevent for availability check & TOR.
    3. Consignment Return:
    Customer found that some goods are damaged or he not able to sold the goods he want to send it back. that you are creating this document.
    Sales document type: KR
    Item category: KRN
    Shedule line category: D0
    You will assign delivery document and billing to sales document. you will create return order, return delivery, return billing.
    Your setting item category relevent for billing, returns, pricing, special stock.
    Your setting schedule line item category: 634 movement type, NO availability NO TOR.
    4. Consignment Pick up:
    Even if you create the consignment return the goods are not come to direct to your plant. For that you need to create consignment pick up. here the owner ship is not changing so you do not need to create billing.
    Assign retrun delivery to sales document type.
    Sales document: KA
    Item category: KAN
    schedule line category: F0 & F1
    Your setting item category relevent for returns. any shedule line category relevent for 632 movement type, MRP, availability check, delivery.
    Now you check your plant stock. Stock will increase.      
    Regards

  • Displaying images along with data on downloading from excel

    Hi All,
    I need to show images along with data in the excel sheet when user clicks downld to excel button.  Is there possible way to show the images in excel sheet if, kindly help.
    Thanks & Regards
    Jaspreet Kaur

    Hi Vinod
    Basically I have a report which needs to be downloaded to excel sheet. For each record there is a particular image in the first column for ex say my colums are img, desc.  Now image column contains an image corresponding to each description.  If its a file, a folder image is there; if its a document, a page image is there etc.  Now i am can display the data of  text fields  in the following manner ie label =new Label(0,RowCount, wdContext.nodeVn_PortalExcel().getVn_PortalExcelElementAt(i).getVa_Role(), PortalRoleDataFormat);
    PortalReportsheet.addCell(label);
    but how do i display the image in the excel sheet?
    Is it possible to do so, if so please provide assistance.
    Thanks & Regards
    Jaspreet Kaur

  • Problems in displaying chinese characters with utf-8 encoding

    Hi,
    I got problem in displaying chinese characters in my web application.
    I am creating a web application supporting both English and Chinese charaters. What I am trying to do is:
    1. storing some chinese characters via a web page (page1) into database.
    2. retrieve the chinese characters via another web page (page2) from the database.
    Once I put the Chinese characters on the webpage (page1 in step #1), it displayes well (the readable chinese characters) before I submit this page (after submit, the data will be stored into the database).
    But when I tried to display the chiese characters via page2 in step#2, I got un-readable characters displayed.
    The running configuration is: Sun Application Server (coming and with the JSC2) and MySQL server 5.0. And I setup the database server with utf8 as character-set.
    It seems like the chinese characters got messed up throught the round-trip (from page1<----via jdbc---->database<----via jdbc------>page2).
    From the database, I found the chinese characters are there. Any helps are appreciated.

    Hi,
    I am trying to insert new record.The record may contain chineese or English data.
    I did same what u specified.
    first I converted to the byte UTF8.again,I converted byte to string using 8859_1.
    the values are not storing chinese characters.
    pls suggest me.
    below is my code.
                                  ascCode = req.getParameter("asccode");
                                  countryCode = req.getParameter("countrycode");
                                  ascName      = req.getParameter("ascname");
                                  address1     = req.getParameter("ascaddress1");
                                  address2 = req.getParameter("ascaddress2");
                                  System.out.println("ASC NAME:"+ascName);
                                  System.out.println("ADDRESS1:"+address1);
                                  System.out.println("ADDRESS2:"+address2);
                                  ascC = ascCode.getBytes("UTF8");
                                  coun = countryCode.getBytes("UTF8");
                                  ascN           = ascName.getBytes("UTF8");
                                  add1 = address1.getBytes("UTF8");
                                  add2          = address2.getBytes("UTF8");
                                  System.out.println("ASC NAME:"+ascN);
                                  System.out.println("ADDRESS1:"+add1);
                                  System.out.println("ADDRESS2:"+add2);
                                  ascCode = new String(ascC,"8859_1");
                                  countryCode= new String(coun,"8859_1");
                                  ascName = new String(ascN,"8859_1");
                                  address1 = new String(add1,"8859_1");
                                  address2 = new String(add2,"8859_1");
                                  System.out.println("ASC NAME:"+ascName);
                                  System.out.println("ADDRESS1:"+address1);
                                  System.out.println("ADDRESS2:"+address2);
    thanks.

  • Problem in filling jasper report with XML Data source

    Hello!
    I am trying to build a report uxing xml data source..Please verify following code:
    String outFileName = "c:/Report1.pdf";
    File xmlFileName = new File("C:/Program Files/JasperSoft/iReport-1.2.5/report.jrxml");
    String recordPath = "/SiteDetails/Site";
    JasperDesign jasperDesign = JRXmlLoader.load(xmlFileName);
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    JRXmlDataSource jrxmlds = new JRXmlDataSource(new File("c:/NewSite.xml"),recordPath);
    HashMap hm = new HashMap();
    try
    JasperPrint print = JasperFillManager.fillReport(jasperReport,hm,jrxmlds);
    JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName);
    exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);
    exporter.exportReport();
    catch (JRException jre)
    jre.printStackTrace();
    catch (Exception e)
    e.printStackTrace();
    My Xml file is:
    <?xml version="1.0" encoding="UTF-8"?>
    <SiteDetails>
    <Site>
    <Name>Site1</Name>
    <Addr>Bangalore</Addr>
    <supersiteid>null</supersiteid>
    </Site>
    <Site>
    <Name> Site2</Name>
    <Addr> Madras</Addr>
    <supersiteid>Site1</supersiteid>
    </Site>
    </SiteDetails>
    I want to display details of Siteand Address..My program works fine but displays only 1 (first) record...What should i do to display the full file..do i need to navigate thru the file and give that as an input to fillReport ()method...

    Hi,
    Have a look at below URL.
    http://ireport.sourceforge.net/cap7.html#7.4
    Regards
    VInK

  • How can I download footer details along with report in excel

    Hi,
    I would like to download dashboard page Footer details (user details, report runtime info and page number are included in footer of dashboard page) as well along with my report, when I download into excel. How would I achieve this?
    Please suggest!
    Thanks,
    SMA

    Hi All…Thanks in Advance
    I don’t understand why it's behaving so typically.
    There are two things here
    1.     When I create a report from Answers and use the hand button (top most left) set all the details. Download then and there itself to excel it’s showing the user info even though there no such info shown with report in Answers, This is working fine.
    2.     However when I place the same report and enable the print, download links for the same report on dashboard page and when I try to download the report to excel it does not show me the user details even though after enabling the footer details using hand symbol of edit dashboard properties.
    Here end user wants this functionality when ever he download’s the report from dashboard page (not the ad hoc report from Answers) user details should appear in his downloaded excel or something.
    Reg
    SMA

  • Display usrname along with usrid when workitem is delegated using Forward

    Hi
    I have a requirement that when ever we want to delegate the work item using Forward action.
    It navigates to user selection, on giving some name search results displays only user ids . This makes confusing in the selection of particular user. Our req is to display name in a separate  column / name also in the same column along with the user id. is this possible through XML configuration
    How we can achieve this req
    Thanks a Lot.
    Regards
    KALYAN

    Hi Kaylan,
    I am not sure how you can achieve this requirement.  I would've said through custom attributes, but this is a dynamic creation based on when the forward button is pressed. (when you press the button, you make the selection).  For this reason, I am pretty sure that this is not achievable presently with a new column real-time and especially not in the older releases of the Universal Worklist.   You use the people picker when you forward the workitem.  In the newer versions of UWL, the real time refresh of custom attributes is also available. Do you know where the userid is stored in the backend?
    Regards,
    Beth Maben
    EP - Senior Support Consultant II
    SAP Active Global Support
    Global Support Centre Ireland
    **SDN Forum Moderator:
    SAP Enterprise Portal: Application Integration
    **SDN Universal Worklist Wiki:
    http://wiki.sdn.sap.com/wiki/x/ehU

  • Display records along with checkbox

    im trying to do the following
    get the records from database and display in jsp along with a checkbox for each record
    ive done the database retrival and displayed in the jsp page as a tables.
    but ive tried to create checkboxes for each record rows and at the end ive to send the hidden variable as the checkbox value . how could i do this.

    Hi,
    While creating the checkbox u have to write variables in the checkbox's value atrribute.
    When ur submiting the form u can also pass these check box variable values.
    <input type=checkbox value = <%= value %> name=chk>Reagrds
    Madhu

  • Display Metadata along with images

    I am not a programmer, do not know script writing. Is there any simple way where I can manage, my metadata to be displayed along with the images ?
    I know how to create metada.

    hi,
    I am implementing the DATA_CELL method of table interface in webtemplate like this,
    case I_X.
    when 9.
      if I_DISPLAY_VALUE = '2'.
        c_cell_content = 'AAA'.
      endif.
    endcase.
    endmethod.
    I am getting the requirement,but can someone help me how I can access the column based on KF technical name, here i placed the KF in column 9,so I took "when 9".But i dont want to use column number , I want to use technical name of KF.
    Thank you
    ven

  • Parsing Parameters Along with XML Data

    Is there a quick and dirty way of getting the "payload" XML data from an HTTP POST coming to an XSQL page as well as some extra parameters that describe the data, for example, a CRC code?
    A colleague has shown me Java code for "catching" the POST that deals with "heterogeneous data" and is quite involved. Is there a way I can accomplish the same "catch" using an XSQL page without calling out to a Java program? I combed the "Oracle XML Applications" book and couldn't find anything dealing with this topic.

    A custom XSQL action handler can do:
    getPageRequest().getPostedDocument()
    to get hold of the posted XML content. There's no other way to reference it as a parameter in a page. You could write a custom action handler that returns the contents of the posted document as a string like this:
    import oracle.xml.xsql.XSQLActionHandlerImpl;
    import oracle.xml.parser.v2.XMLNode;
    import org.w3c.dom.*;
    import java.io.*;
    public class PostedXML extends XSQLActionHandlerImpl {
    private static final String RESULTELT = "PostedXML";
    public void handleAction(Node root) {
    try {
    Document pd = getPageRequest().getPostedDocument();
    if (pd != null) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    ((XMLNode)pd).print(pw);
    addResultElement(root,RESULTELT, sw.toString());
    addResultElement(root,RESULTELT,null);
    catch (Exception e) {
    addResultElement(root,RESULTELT,null);
    }Then when you use the custom action element in an XSQL page like this:
    <xsql:action handler="PostedXML"/>
    Your XSQL data page will end up with:
    <PostedXML>...posted-xml-doc-as-string-here...</PostedXML>

  • BO fails to display cloned reports with DATE_TIME data in View mode

    Problem: We create a table using Rebean API. The table contains cells displaying DATE_TIME data (Detail). The cellu2019s formula is correct and the Applet shows the data alright. But when in view mode, there stand u201CINPUT_DATE_TIMEu201D text. If we open the report in the Applet and just click the cellu2019s formula without changing anything, the report starts to draw itself properly in view mode too.
    We have to manually touch cloned reports with DATE_TIME values.  Didn't find anything same in the search..
    Can anyone help with this problem?
    Great thanks,
    Oleg

    Hi Oleg,
    It may help if you post the code that you are using to create the block (table) with the DATE_TIME data.
    Please include the code from when you open/create the WebI document up to the point when you save the WebI document.
    Regards,
    Dan

  • Display header along with  ALV

    Hi,
    i need to display a report using ALV in the following manner. im using reuse_alv_listdisplay and the display is fine . however, i need to add a header to the list and i need to display total for the currency fields. how can i do that. your help would be appreciated.
    Thanks,
    kranthi.
    ________some company header----
    alv report----
    display total for currency fields------
    i appreciate all of you for your quick response.
    i need to call a function module which uses couple of 'write' statements to create the header. is it possible to use that in this context.
    Thanks,
    Kranthi.
    Message was edited by: kranthi kumar

    *& Report  ZVENU_ALV                                                   *
    Program: ZZ_ALV_REPORT_STUB
    Author :
    Date   :
    Purpose: Report using ALV function
    Notes:
    1) Logos & wallpapers can be found in table BDS_CONN05
       with class = PICTURES
    2) Transaction OAER can be used to create PICTURES.
       Run transaction OAER with class name = PICTURES, Class type = OT,
       and Object key with whatever name you want to create.  In the
       next screen, right clicking on screen and import
                                 Revisions
    Name    :
    Date    :
    Comments:
    report zz_alv_report_stub
           no standard page heading
           line-size 200
           line-count 65
           message-id zz.
    Tables
    tables:
      ekpo,
      trdir.
    Global Types
    type-pools: slis.
    Global Internal Tables
    data:
      i_fieldcat_alv  type slis_t_fieldcat_alv,
      i_events        type slis_t_event,
      i_event_exit    type slis_t_event_exit,
      i_list_comments type slis_t_listheader,
      i_excluding     type slis_t_extab.
    Display data
    data: begin of i_data occurs 0,
            name    like trdir-name,
            clas    like trdir-clas,
            subc    like trdir-subc,
            cnam    like trdir-cnam,
            cdat    like trdir-cdat,
            myfield(1) type c,
          end of i_data.
    Global Variables
    data:
      w_variant          like disvariant,
      wx_variant         like disvariant,
      w_variant_save(1)  type c,
      w_exit(1)          type c,
      w_repid            like sy-repid,
      w_user_specific(1) type c,
      w_callback_ucomm   type slis_formname,
      w_print            type slis_print_alv,
      w_layout           type slis_layout_alv,
      w_html_top_of_page type  slis_formname,
      w_fieldcat_alv     like line of i_fieldcat_alv,
      w_excluding        like line of i_excluding,
      w_events           like line of i_events,
      w_event_exit       like line of i_event_exit,
      w_list_comments    like line of i_list_comments.
    Global Constants
    *constants:
    Selection Screen
    selection-screen begin of block blk_criteria with frame title text-f01.
    select-options:
      s_name for trdir-name.
    selection-screen end of block blk_criteria.
    selection-screen begin of block blk_params with frame title text-f02.
    parameters:
      p_vari like disvariant-variant.
    selection-screen skip 1.
    parameters:
      p_grid radiobutton group rb01 default 'X',
      p_html as checkbox.
    selection-screen skip 1.
    parameters:
      p_list radiobutton group rb01.
    selection-screen end of block blk_params.
    Initialization
    initialization.
      perform init_variant.
      perform variant_default using p_vari.
      clear: s_name[].
      s_name-sign   = 'I'.
      s_name-option = 'CP'.
      s_name-low    = 'Z*'.
      append s_name.
    At Selection Screen PBO
    at selection-screen output.
    At Selection Screen Value Request
    at selection-screen on value-request for p_vari.
      perform variant_f4 using p_vari.
    At Selection Screen
    at selection-screen.
      perform variant_fill.
    Start of Selection
    start-of-selection.
      perform get_data.
    end-of-selection.
      perform fieldcat_build.
      perform event_build.
      perform event_exit_build.
      perform exclude_build.
      perform print_build.
      perform layout_build.
      perform display_data.
    Top of Page
    top-of-page.
    Top of Page During Line Sel
    top-of-page during line-selection.
    At User Command
    at user-command.
    At Line Selection
    at line-selection.
    Macros
      define skip_1.
        write: /001 sy-vline,
                    at sy-linsz sy-vline.
      end-of-definition.
                                    Forms
    *&      Form  variant_f4
    form variant_f4 using p_variant.
      call function 'LVC_VARIANT_F4'
           exporting
                is_variant    = w_variant
                i_save        = w_variant_save
           importing
                e_exit        = w_exit
                es_variant    = wx_variant
           exceptions
                not_found     = 1
                program_error = 2
                others        = 3.
      if sy-subrc <> 0.
        message i000(zz) with text-g01.
      endif.
      if w_exit is initial.
        w_variant-variant = wx_variant-variant.
        p_variant         = wx_variant-variant.
      endif.
    endform.
    *&      Form  init_variant
    form init_variant.
      clear: w_variant.
      w_repid              = sy-repid.
      w_variant-report     = w_repid.
      w_variant-username   = sy-uname.
      w_variant_save       = 'A'. "All types
    endform.
    *&      Form  variant_default
    form variant_default using p_variant.
      wx_variant = w_variant.
      if not p_variant is initial.
        wx_variant-variant = p_variant.
      endif.
      call function 'LVC_VARIANT_DEFAULT_GET'
           exporting
                i_save        = w_variant_save
           changing
                cs_variant    = wx_variant
           exceptions
                wrong_input   = 1
                not_found     = 2
                program_error = 3
                others        = 4.
      case sy-subrc.
        when 0.
          p_variant = wx_variant-variant.
        when 2.
          clear: p_variant.
      endcase.
    endform.
    *&      Form  variant_fill
    form variant_fill.
      clear: w_variant.
      if p_vari is initial.
        w_variant-variant = 'STANDARD'.
        w_variant-report  = w_repid.
      else.
        w_variant-variant = p_vari.
        w_variant-report  = w_repid.
        call function 'LVC_VARIANT_EXISTENCE_CHECK'
             exporting
                  i_save     = w_variant_save
             changing
                  cs_variant = w_variant
             exceptions
                  others     = 01.
        if sy-subrc ne 0.
          message i000(zz) with text-g02.
        endif.
      endif.
    endform.
    *&      Form  fieldcat_build
    form fieldcat_build.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name     = w_repid
              i_structure_name   = 'TRDIR'
                i_internal_tabname = 'I_DATA'
                i_inclname         = w_repid
           changing
                ct_fieldcat        = i_fieldcat_alv.
    Modify displayed fields
      loop at i_fieldcat_alv into w_fieldcat_alv.
        case w_fieldcat_alv-fieldname.
          when 'NAME'.
            w_fieldcat_alv-hotspot   = 'X'.
          when 'MYFIELD'.
            w_fieldcat_alv-checkbox  = 'X'.
            w_fieldcat_alv-seltext_s = 'MyChkBox'.
          when others.
        endcase.
        modify i_fieldcat_alv from w_fieldcat_alv.
      endloop.
    endform.
    *&      Form  display_data
    form display_data.
      w_callback_ucomm   = 'CALLBACK_UCOMM'.
      case 'X'.
        when p_grid.
          if p_html = 'X'.
            w_html_top_of_page = 'HTML_TOP_OF_PAGE'.
          endif.
          call function 'REUSE_ALV_GRID_DISPLAY'
               exporting
                  i_background_id             = 'SIWB_WALLPAPER'
                    i_background_id             = 'SIWB_WALLPAPER'
                    i_callback_program          = w_repid
                    i_callback_html_top_of_page = w_html_top_of_page
                  i_structure_name            = 'TRDIR'
                    i_default                   = 'X'
                    i_save                      = 'A'
                    is_variant                  = w_variant
                    is_layout                   = w_layout
                    i_callback_user_command     = w_callback_ucomm
                    it_fieldcat                 = i_fieldcat_alv
                    it_events                   = i_events
                    it_event_exit               = i_event_exit
                    it_excluding                = i_excluding
                    is_print                    = w_print
                  i_screen_start_column       = 1
                  i_screen_start_line         = 1
                  i_screen_end_column         = 70
                  i_screen_end_line           = 30
               tables
                    t_outtab                    = i_data.
        when p_list.
          call function 'REUSE_ALV_LIST_DISPLAY'
               exporting
                   i_background_id         = 'ALV_BACKGROUND'
                    i_callback_program      = w_repid
                    i_default               = 'X'
                    i_save                  = 'A'
                    is_variant              = w_variant
                    is_layout               = w_layout
                    i_callback_user_command = w_callback_ucomm
                    it_fieldcat             = i_fieldcat_alv
                    it_events               = i_events
                    it_event_exit           = i_event_exit
                    is_print                = w_print
               tables
                    t_outtab                = i_data.
      endcase.
    endform.
          FORM user_command                                             *
    form callback_ucomm  using r_ucomm like sy-ucomm
                               rs_selfield type slis_selfield.
      message i000(zz) with r_ucomm.
      case r_ucomm.
        when '&IC1'.
          set parameter id 'RID' field rs_selfield-value.
          call transaction 'SE38'.
        when others.
      endcase.
    endform.
    *&      Form  get_data
    form get_data.
      select * up to 15 rows from trdir
             into corresponding fields of table i_data
             where name in s_name.
    endform.
          FORM ALV_TOP_OF_PAGE                                          *
    form alv_top_of_page.
      clear: i_list_comments[].
      w_list_comments-typ  = 'H'. "H=Header, S=Selection, A=Action
      w_list_comments-key  = ''.
      w_list_comments-info = 'Info 1'.
      append w_list_comments to i_list_comments.
      w_list_comments-typ  = 'A'. " H = Header, S = Selection, A = Action
      w_list_comments-key  = ''.
      w_list_comments-info = 'Begin of list'.
      append w_list_comments to i_list_comments.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = i_list_comments.
    endform.
    *&      Form  event_build
    form event_build.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = i_events.
      read table i_events
           with key name = slis_ev_top_of_page
           into w_events.
      if sy-subrc = 0.
        move 'ALV_TOP_OF_PAGE' to w_events-form.
        modify i_events from w_events index sy-tabix.
      endif.
      read table i_events
           with key name = slis_ev_end_of_list
           into w_events.
      if sy-subrc = 0.
        move 'ALV_END_OF_LIST' to w_events-form.
        modify i_events from w_events index sy-tabix.
      endif.
      read table i_events
           with key name = slis_ev_end_of_page
           into w_events.
      if sy-subrc = 0.
        move 'ALV_END_OF_PAGE' to w_events-form.
        modify i_events from w_events index sy-tabix.
      endif.
    endform.
          FORM alv_end_of_list                                          *
    form alv_end_of_list.
      clear: i_list_comments[].
      w_list_comments-typ = 'A'. "H = Header, S = Selection, A = Action
      w_list_comments-key = ''.
      w_list_comments-info = 'End of list'.
      append w_list_comments to i_list_comments.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = i_list_comments
                i_logo             = 'ZMYOBJECTKEY'
                i_end_of_list_grid = 'X'.
    endform.
          FORM alv_end_of_page                                          *
    form alv_end_of_page.
    endform.
    *&      Form  print_build
    form print_build.
      w_print-no_print_listinfos = 'X'.
    endform.
    *&      Form  layout_build
    form layout_build.
      w_layout-zebra                = 'X'.
      w_layout-no_vline             = 'X'.
      w_layout-colwidth_optimize    = 'X'.
      w_layout-detail_popup         = 'X'.
      w_layout-detail_initial_lines = 'X'.
      w_layout-detail_titlebar      = 'Detail Title Bar'.
    endform.
    *&      Form  event_exit_build
    form event_exit_build.
      clear: i_event_exit[].
    Pick
      w_event_exit-ucomm  = '&ETA'.
      w_event_exit-before = ' '.
      w_event_exit-after  = 'X'.
      append w_event_exit to i_event_exit.
    endform.
          FORM HTML_TOP_OF_PAGE                                         *
    form html_top_of_page using r_top type ref to cl_dd_document.
      data:
        text     type sdydo_text_element,
        s_table  type ref to cl_dd_table_element,
        col_key  type ref to cl_dd_area,
        col_info type ref to cl_dd_area,
        a_logo   type ref to cl_dd_area.
    Split TOP-Document
      call method r_top->vertical_split
                exporting split_area  = r_top
                          split_width = '30%'
                importing right_area  = a_logo.
    Fill TOP-Document
      call method r_top->add_text
                exporting text  = 'Example of a Heading'
                sap_style       = 'HEADING'.
      call method r_top->new_line.
      call method r_top->new_line.
      call method r_top->add_table
                exporting no_of_columns = 2
                          with_heading  = ' '
                          border        = '1'
                importing table         = s_table.
      call method s_table->add_column importing column = col_key.
      call method s_table->add_column importing column = col_info.
      text = 'A key value marked'.
      call method col_key->add_text
                exporting text         = text
                          sap_emphasis = 'Strong'.
      call method col_info->add_gap exporting width = 6.
      text = '600' .
      call method col_info->add_text
                exporting text      = text
                          sap_style = 'Key'.
      call method col_info->add_gap  exporting width = 3.
      text = 'Block brick units'.
      call method col_info->add_text exporting text  = text.
      call method s_table->new_row.
      text = 'Storage Bin'.
      call method col_key->add_text
                exporting text         = text
                          sap_emphasis = 'Strong'.
      call method col_info->add_gap exporting width = 7.
      text = 'C-A-004'.
      call method col_info->add_text exporting text = text.
      call method s_table->new_row.
      text = 'Warehouse number' .
      call method col_key->add_text
                exporting text         = text
                          sap_emphasis = 'Strong'.
      call method col_info->add_gap  exporting width = 6.
      text = '200' .
      call method col_info->add_text
                exporting text      = text
                          sap_style = 'Success'.
      call method col_info->add_gap  exporting width = 3.
      text = 'marked success'.
      call method col_info->add_text exporting text = text.
      call method s_table->new_row.
      call method r_top->new_line.
      text = 'This last line is a comment in italics.'.
      call method r_top->add_text
                exporting text         = text
                          sap_emphasis = 'EMPHASIS'.
      call method r_top->new_line.
      call method a_logo->add_picture
              exporting picture_id = 'ZZTESTBMP'.
                exporting picture_id = 'ENJOYSAP_LOGO'.
    endform.
    *&      Form  exclude_build
    form exclude_build.
      w_excluding = '&GRAPH'. "Graphic
      append w_excluding to i_excluding.
    endform.                    " exclude_build

Maybe you are looking for