Drilling Down to "friendly" descriptions instead of codes

Hi,
In my dimension I managed to create the drill down functionality user-friendly in most of the cases (replace the code by the description field) but in one specific case the drill down only works correctly when the code is used.
This specific case is a drill down from department - employee - project.
I use the employee's firstname and lastname (a combination of 2 fields) as the logical level key for employee used for drill down, instead of employee_code, the PK logical level key.
In that case I cannot drill further to project. I don't get an error I just get the message my query is too restrictive and returns no rows.
When I only use first name in the logical level key it works.
I tried to create a new logical column being the combination of first & lastname and use this in the logical level key but this didn't work either, the same behaviour occured.
Thanks for any advice how to solve this issue!
Kris
Edited by: Kris Caluwaerts on Apr 3, 2009 3:08 PM

Thanks for your answer.
What I did is the following :
On the level of "Employee" I defined two logical keys.
One begin the PK which contains the code. This one is not checked as "Use for drill down"
A second key is defined on the same level. This one contains first & lastname and for this key the "use for drill down" is checked.

Similar Messages

  • How to show description instead of code on a view page?

    I'm new so this is probably basic, but I didn't find an answer when I tried searching.
    I'm using JDeveloper 10.1.3.3, ADF Business Components, ADF Faces.
    In my application, I have both view pages and edit pages (some users will only have read access). Many of the fields will be populated from LOV and the code will be stored in the database.
    The edit page is no problem - I have read-only VO for the LOV and I use af:selectOneChoice and display the description. But how do I display the same description on the view page? By defaiult the code is displayed when the entity based VO is dropped as a ADF Read Only Form.
    I assume I need to do something in the BC, but I'm not sure how to get values from read-only VO into my entity based VO. Or do I have to make all my VO for LOVs entity based even though they will never be edited? Or is there something I can do in the view to get the description instead of the code?
    Thank you for your help.
    Karen Helt
    Sr IT Programmer/Analysit
    Hach Company

    So if I understand you properly, I need to create EOs for all my list of values (which are based on views of Oracle apps tables) and base my VO on those EOs. And then I setup associations between these EOs and the Item EO. Then I include the these EOs in my Items VO and add the description attributes to my list of attributes. I had done this for the list of users, but for the views of Oracle I had just created read only VO. Sounds like that won't work if I want to display the description. I know what to do - I guess I was hoping there was a way to use the read only VO.
    Thanks
    Karen

  • Object status - Get description instead of code (J_STATUS) for OBJNR

    Hi,
    I am modifying a report, in which one of the fields on output is "Object status," which is pulled from table "Jest". The field is called "Stat" and pertains to the specific OBJNR (object number.)
    However, the status is a code (5 Char) but the user wants to see a description instead. Where can I get the description data for the status from?
    Thanks,
    John

    Hello,
    I think you may be talking about the statuses held in tables TJ02T and TJ30T (4.64).  If yes, here's how we get to them:
         f_system_status     type j_stsma.
         f_user_status         type j_stsma.
        select single c~txt04
          into (f_system_status)
          from equi as a
          join jest as b
            on bobjnr eq aobjnr
          join tj02t as c
            on cistat eq bstat
         where a~sernr = i_old-sernr and
               a~eqtyp = 'I' and
               not b~inact = 'X' and
               c~istat like 'I%' and
               c~spras = 'EN'.
        select single c~txt04
          into (f_user_status)
          from equi as a
          join jest as b
            on bobjnr eq aobjnr
          join tj30t as c
            on cestat eq bstat
         where a~sernr = i_old-sernr and
               a~eqtyp = 'I' and
               not b~inact = 'X' and
               c~stsma eq 'CPS-DEV1' and
               b~stat like 'E%'.
    Hope this helps!
    K---

  • "How can I call Drill down report in 10g Without hard code user/password"

    Dear All;
    Can I get the "Pasword" of the login user in oracle, because I want to use in report, i have get the
    User Name and Connecting string already but I can not get the Password. can I anybody tell me
    "How I get the Password in Oracle 10g"
    Give User Name: = SELECT SYS_CONTEXT('USERENV','CURRENT_SCHEMA') FROM DUAL;
    Give DB Name: = SELECT SYS_CONTEXT('USERENV','DB_NAME') FROM DUAL;
    BUT how I get the password............???
    regards;
    Zahid Hussain
    Edited by: zahid9999 on Jun 10, 2010 3:04 AM

    hi
    you can use openDocument for this.
    [http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf]
    I would suggest to use variables that build the HTML code for the hyperlinks dynamically, and display them in your crosstab. Set the display option for the related cells (ie. the cells where your variables are displayed in) so that the cell's contents as interpreted as HTML code.
    Regards,
    Stratos

  • Is it possible to use a Java command to RRI and then Drill Down?

    I am trying to build a Java command to jump from Report "A" to Report "B" through an RRI and then apply the same drill downs to report B as the user had entered in Report A. I want to use an RRI as this saves the user re-entering the selection criteria.
    I can get the characteristics that have been drilled down through the command SAPBWGetDataProviderDimensions so all I need to do is complete the RRI and then reapply the same drill downs.
    I've set the code to do an RRI and a simple drill down (see below) but it isn't working,it simply rebuilds the screen (IE no RRI nor expand).If I remove the EXPAND command the RRI works.
    function sheptest() {
    /* Get the optionnode */
    myhtml = '<form name="MyShep" method="post" action="<SAP_BW_URL>">';
    myhtml = myhtml + '<input type="hidden" name="DATA_PROVIDER" value="DATAPROVIDER_1">';
    myhtml = myhtml + '<input type="hidden" name="CMD" value="RRI">';
    myhtml = myhtml + '<input type="hidden" name="RRI_RECEIVER" value="QURY0001">';
    myhtml = myhtml + '<input type="hidden" name="CMD_2" value="CMD=EXPAND&IOBJNM=0MAT_PLANT__0MATL_GROUP">';
    myhtml = myhtml + '</form>';
    alert(myhtml);
    document.getElementById('MyForm').innerHTML = myhtml;
    I also tried changing the dataprovider through the command RESET_DATA_PROVIDER, instead of using the RRI, but when I did this I am forced into the selection criteria screen, which the users want to avoid (as the variables are all the same).
    Is what I'm trying to do possible?
    Any advise will be greatly appreciated.
    Cheers Shep.

    Hi,
    this is only possible with BW 3.5. There you have the possibility to add the parameter &rri=X to the RESET_DATA_PROVIDER command. This will result in transfering filters and variables to the new Query / View.
    With RESET_DATA_PROVIDER you can create a command sequence.
    It is not possible to have a command sequence influencing the result of the command RRI.
    Heike

  • HTML Drill Down Report

    Hi,
    I am using CR4E Ver 2.0.11.r1346.
    I am producing HTML drill down report. My code for the same looks like..
    CrystalReportViewer crystalReportViewer = new CrystalReportViewer();
                        crystalReportViewer.setOwnPage(false);
                        crystalReportViewer.setPrintMode(CrPrintMode.ACTIVEX);
                        crystalReportViewer.setReportSource(reportClientDocument.getReportSource());
                        HttpServletRequest request = (HttpServletRequest) parameters.get("httpServletRequest");
                        HttpServletResponse response = (HttpServletResponse) parameters.get("httpServletResponse");
                        String htmlContent = crystalReportViewer.getHtmlContent(request, response, request.getSession().getServletContext());
                        output.setContent(htmlContent.getBytes());
    For some reasons, I can not use
    crystalReportViewer.processHttpRequest
    My code generates the HTML report as expected but the drill down reports do NOT work. I tried to inspect and got that the HTML generated by
    getHtmlContent
    does not have the script tag
    event.js
    . I added this script manually in generated content and tried to debug through, but it does not work.
    Any clues?

    Thanks.
    I tried using
    processHttpRequest
    This generates the same report but Drill down does NOT work.
    The code in my action class is...
    CrystalReportViewer viewer = new CrystalReportViewer();
    viewer.setOwnPage(true);
    viewer.setPrintMode(CrPrintMode.ACTIVEX);
    //Get the report source object that this viewer will be displaying.
    IReportSource reportSource = (IReportSource)(httpServletRequest.getAttribute("ReportSource"));
    if (null != reportSource && servletContext != null) {
         viewer.setReportSource(reportSource);
         //Render the report.
         viewer.processHttpRequest(httpServletRequest, httpServletResponse,
                   servletContext,
                   null);
    Any clue?

  • Drill down problem

    Hi ALL
    I hv a question that in repository i hv month name & month code in periods table.
    and i set drill down on month name and month code as a level key.
    but when i take month code in report then drill down is possible on month code.
    i want to know, why is it happening?
    Regards,
    SAP

    Hi SAP,
    When you set the level key, you have to uncheck the use for drill down check box to disable the drill down .
    Now go to the logical level key properties and uncheck it.
    Thanks,
    Vino

  • Unable to populate the G/L account text ( description ) in drill down repor

    Hi
    We have developed the trial balance drill down report from FAGLFLEXT table under 0FL library for company code wise.
    The charecters are period,fiscal year  & Version and the key figures are HSL ( GLT0 table ).
    We are getting only the GL account number in the row ( actual requirement is we need to get the g/l account number and text beside of number ) . Please suggest.
    Regards
    Venkat

    Hi
    Thanks for the reply, this we have already tried. We are preparing the report for the trial balance which consists of the Balance sheet accounts & Profit and loss accounts. The total number of G/L accounts is more than 500. Here under the Charecteristic values we are giving the account number range . We dont want to manually enter the description for all the G/L accounts. The report should automatically populate the G/L account description ( text ) from the range of the G/L accounts such as 10000000-30000000 etc.
    Regards
    Venkat

  • SharePoint PPS Analytic Chart Drill Down Dimension showing all values instead of corresponding value.

    Hi,
    I have Performance Point Analytic Chart.
    I am doing drill down the bar with one of dimension. System showing all the dimension values instead of correspond values.
    Unwanted dimensions are showing like blank in the chart.
    How to over come this.
    Thanks & Regards
    Poomani Sankaran

    Hi Poomani,
    According to your description, my understanding is that you want the drill down to show only the required dimensions.
    Here is an article about this issue, please check if it is useful:
    http://denglishbi.wordpress.com/2012/03/28/using-perspectives-with-performancepoint-services/
    In addition, as this issue is related to SSAS, I suggest you create a new thread on SQL forum, more experts will assist you with this issue.
    SQL forum:
    http://social.technet.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Group Description in Drill down and grouping on field

    I want to put a formula field for grouping, but I want to display some text(description) in group drill down.
    My group field is numeric and I want to display text on right side of drill down report.

    Hi Seema,
    In order to display a different group name you may try the below steps:
    -  Right click on the group and click on change Group option and then click on Options taband then check the box which says 'Customize Group Name Field'.
    - Now either 'choose from existing field' or 'use a formula as group name' to display the group description.
    This would help you to display the appropriate description for that field.
    Regards,
    Komal Prasad

  • Drill down is giving an error in Bex analyser.

    hi friends, when iam using the bex analyser, the repoort will open in a short time. And all the free characteristics are works fine.
    But one of the free char(company code) is not able to giving the drill down, insted it is getting the following error.
    *An error occured in the communication with the bw server, due to this, the connection had to be closed.*
    *Detailed des:- No more storage space available for extending an internal table.*
    could u help me what iam missing and how to solve this problem.
    and how it is related when we r drill down with one particular char how does this is related to table space, other free char are working fine with drill down.
    pls guide me...
    thanks in advance.
    sruthi.

    hi , i check the error dump in st22 and the error analysis is as below..
    any help based on below information....
    Short text
        No more storage space available for extending an internal table.
    What happened?
        You attempted to extend an internal table, but the required space was not available.
    How to correct the error
        The amount of storage space (in bytes) filled at termination time was
        Roll area...................... 2718352
        Extended memory (EM)........... 2003038144
        Assigned memory (HEAP)......... 2000756480
        Short area..................... " "
        Paging area.................... 16384
        Maximum address space.......... 4294967295
        If the error occures in a non-modified SAP program, you may be able t
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the followin
        keywords:
        "TSV_TNEW_PAGE_ALLOC_FAILED" " "
        "CL_RSR_NET_GRID===============CP" or "CL_RSR_NET_GRID===============
        "APPEND_DATA_CELL"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".

  • Alv : drill down not working.

    Hi All,
    Could you please tell me whats wrong with this code ? its not drilling down to show 'ebeln' with me22n.  Am I missing something ?
    Please help.
    Hrishi
    code is :-
    REPORT  Z_VENDOR_BACKORDER_REPORT_ALV .
    TABLES:  EKKO, LFA1, MAKT, EKET, EKPO, AFPO, MARC.
    *Data Declaration
    DATA:  BEGIN OF ITAB OCCURS 0 ,
            ebeln       LIKE ekko-ebeln  ,  " PO number
            aedat       LIKE ekko-aedat  ,  " creation date
            ebelp       LIKE ekpo-ebelp  ,  " item no
            lifnr       LIKE ekko-lifnr  ,  " vendor number
            name1       LIKE lfa1-name1  ,  " vendor name
            RESWK       LIKE EKKO-RESWK  ,  " PLANT NO
            MEMORY      LIKE EKKO-MEMORY , " ORDER INCOMPLETE
            matnr       LIKE ekpo-matnr  ,  " material number
            werks       like ekpo-werks  ,  " plant
            txz01       LIKE ekpo-txz01  ,  " material description
            eindt       LIKE eket-eindt  ,  " Promised date
            menge       LIKE eket-menge  ,  " quantity
            wemng       LIKE eket-wemng  ,  " delivered quantity
            netpr       like ekpo-netpr  ,  " value in AUD
            peinh       like ekpo-peinh  ,  " price unit
            banfn       like ekpo-banfn  ,  " PR no
            aufnr       like ebkn-aufnr  ,  " Production order no
            MAABC       LIKE MARC-MAABC  ,  " MATERIAL ABC Indicator
            maktx       like makt-maktx  ,  " material long description
            open_quant  type p decimals 2,  " quantity - delivered
            VALUE       TYPE p decimals 2,  " $ VALUE * OPEN QUANTITY
            end of ITAB.
    data: wa like itab.
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    DATA: TEMP TYPE EKKO-LIFNR.
    data: opt like CTU_PARAMS.
    *DATA:  WA TYPE FINAL.
    all ALV declarations
    type-pools: slis.                                 "ALV Declarations
    DATA:   fieldcatalog        TYPE slis_t_fieldcat_alv with header line,
            G_REPID             TYPE SY-REPID,
            GS_PRINT            TYPE SLIS_PRINT_ALV,
            GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
            GT_EVENTS           TYPE SLIS_T_EVENT,
            GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
            GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
            COL_POS TYPE I.
    -----------------SELECTION SCREEN----------------------
      selection-screen begin of block b1 with frame title text-001.
      select-options VENDORNO for ekko-lifnr.
      select-options MATERIAL for ekpo-matnr.
      SELECT-OPTIONS PLANT FOR EKKO-RESWK.
      select-options REQDAT for eket-eindt.
      selection-screen end of block b1.
    *................... GET DATA..................
    START-OF-SELECTION.
    PERFORM GATHER_DATA.
    END-OF-SELECTION.
    FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    CASE  rs_selfield-sel_tab_field.
    WHEN 'ITAB-EBELN'.
    CHECK NOT rs_selfield-value IS INITIAL.
    SET PARAMETER ID 'BUS' FIELD rs_selfield-value.
    CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
    Do something at 'Sales document type' field selection
    when 'ITAB-MATNR'.
    SET PARAMETER ID 'BUS' FIELD rs_selfield-value.
    CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
    ENDCASE.
    ENDCASE.
    ENDFORM.
    form gather_data.
    SELECT EKKO~EBELN
           EKKO~AEDAT
           EKKO~LIFNR
          EKKO~MEMORY
          EKKO~RESWK
           EKPO~EBELP
           EKPO~MATNR
           ekpo~werks
           ekpo~netpr
           ekpo~peinh
           ekpo~banfn
           ekpo~txz01
          makt~maktx
           EKET~EINDT
           EKET~MENGE
           EKET~WEMNG
           LFA1~NAME1
    INTO corresponding fields of ITAB
    FROM (
    EKKO inner JOIN EKPO
    ON EKKOEBELN = EKPOEBELN
    inner JOIN EKET
    ON EKPOEBELN = EKETEBELN
    AND EKPOEBELP = EKETEBELP
    inner JOIN LFA1
    ON EKKOLIFNR = LFA1LIFNR
    *left outer join makt
    *on ekpomatnr = maktmatnr
    WHERE EKKO~LIFNR IN VENDORNO
    AND EKKO~RESWK IN PLANT
    and EKPO~MATNR IN MATERIAL
    and ekpo~elikz eq ' '
    and ekpo~loekz ne 'L'
    and eket~eindt in REQDAT.
    append itab.
    CLEAR ITAB.
    endselect.
    clear temp.
    sort itab by lifnr.
    loop at itab .
    ITAB-OPEN_QUANT = ITAB-MENGE - ITAB-WEMNG.
    if itab-matnr eq ''.
    select single aufnr from ebkn into itab-aufnr where banfn = itab-banfn.
      select single matnr from afpo into itab-matnr where aufnr = itab-aufnr.
    endif.
    select single maktx from makt into itab-maktx where matnr = itab-matnr.
    select single maabc from MARC INTO ITAB-MAABC WHERE MATNR = ITAB-MATNR.
    ITAB-VALUE = ITAB-NETPR * ITAB-OPEN_QUANT / itab-peinh.
    modify itab.
    endloop.
    SKIP.
      fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'LIFNR'.
      fieldcatalog-seltext_m   = 'vendor no'.
      fieldcatalog-col_pos     = 1.
      fieldcatalog-outputlen   = 15.
       fieldcatalog-inttype = 'C'.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
      fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
        clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'po Number'.
      fieldcatalog-col_pos     = 2.
       fieldcatalog-inttype = 'C'.
       fieldcatalog-emphasize = 'C401'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'po date'.
      fieldcatalog-col_pos     = 3.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
    fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'item number'.
      fieldcatalog-col_pos     = 4.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'MATNR'.
       fieldcatalog-no_zero     = 'X'.
      fieldcatalog-seltext_m   = 'material number'.
      fieldcatalog-col_pos     = 5.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'MAABC'.
      fieldcatalog-seltext_m   = 'material type'.
      fieldcatalog-col_pos     = 6.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'TXZ01'.
      fieldcatalog-seltext_m   = 'short text'.
      fieldcatalog-col_pos     = 7.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'MAKTX'.
      fieldcatalog-seltext_m   = 'long text'.
      fieldcatalog-col_pos     = 8.
       fieldcatalog-inttype = 'C'.
       fieldcatalog-outputlen   = 15.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
    fieldcatalog-fieldname   = 'EINDT'.
      fieldcatalog-seltext_m   = 'date promised'.
      fieldcatalog-col_pos     = 9.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'Quantity'.
      fieldcatalog-col_pos     = 10.
       fieldcatalog-inttype = 'C'.
      fieldcatalog-outputlen   = 15.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'WEMNG'.
      fieldcatalog-seltext_m   = 'Delivered'.
      fieldcatalog-col_pos     = 11.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
      fieldcatalog-fieldname   = 'OPEN_QUANT'.
      fieldcatalog-seltext_m   = 'Open quantity'.
      fieldcatalog-col_pos     = 12.
       fieldcatalog-inttype = 'C'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-tabname = 'ITAB'.
    fieldcatalog-fieldname   = 'VALUE'.
      fieldcatalog-seltext_m   = '$ value'.
      fieldcatalog-col_pos     = 13.
       fieldcatalog-inttype = 'C'.
       fieldcatalog-do_sum      = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = g_repid
                 I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                it_fieldcat             = fieldcatalog[]
                is_layout               = GS_layout
                  IT_SORT                = gt_sort
                  I_DEFAULT = 'X'
                    I_SAVE = 'X'
               is_variant              = z_template
           tables
                t_outtab                = ITAB
                exceptions
                program_error           = 1
                others                  = 2.
    endform.

    hi,
    please run the code below.
    REPORT yfi7g_ing_mic_001 .
    *PROGRAM YFI7G_ING_MIC_001.
    TABLES: vbak .
    TABLES: mara .
    TYPES: BEGIN OF tp_vbak ,
          vbeln TYPE vbak-vbeln,
          erdat TYPE vbak-erdat,
          erzet TYPE vbak-erzet,
          ernam TYPE vbak-ernam,
          vbtyp TYPE vbak-vbtyp,
          trvog TYPE vbak-trvog,
          auart TYPE vbak-auart,
          lifsk TYPE vbak-lifsk,
          faksk TYPE vbak-faksk,
          waerk TYPE vbak-waerk,
          vkorg TYPE vbak-vkorg,
          kunnr TYPE vbak-kunnr,
          vgbel TYPE vbak-vgbel,
          vgtyp TYPE vbak-vgtyp,
    END OF tp_vbak .
    TYPES: BEGIN OF tp_mara ,
            matnr TYPE mara-matnr,
    END OF tp_mara .
    TYPES: BEGIN OF tp_alv1_data.
    INCLUDE TYPE tp_vbak .
    TYPES: END OF tp_alv1_data.
    TYPES: BEGIN OF tp_alv2_data.
    INCLUDE TYPE tp_mara .
    TYPES: END OF tp_alv2_data.
    TYPE-POOLS: slis.
    DATA: gt_vbak TYPE STANDARD TABLE OF tp_vbak WITH HEADER LINE.
    DATA: gt_mara TYPE STANDARD TABLE OF tp_mara WITH HEADER LINE.
    DATA: gs_variant LIKE disvariant.
    DATA: gt_alv1_data TYPE STANDARD TABLE OF tp_alv1_data WITH HEADER LINE.
    DATA: gt_alv2_data TYPE STANDARD TABLE OF tp_alv2_data WITH HEADER LINE.
    SELECTION-SCREEN                                                     *
    BLOCK b0                                                             *
    SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.        "<field not defined?>
    PARAMETERS: p_matnr LIKE mara-matnr.           "<field not defined?>
    SELECTION-SCREEN END OF BLOCK b0.
    BLOCK bvar                                                           *
    SELECTION-SCREEN BEGIN OF BLOCK bvar WITH FRAME.
    PARAMETERS: p_vari  LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK bvar.
    BLOCK bbox                                                           *
    SELECTION-SCREEN BEGIN OF BLOCK bbox WITH FRAME.
    PARAMETERS: p_box_up  RADIOBUTTON GROUP b1,
                p_box_do  RADIOBUTTON GROUP b1 DEFAULT 'X',
                p_box_no  RADIOBUTTON GROUP b1.
    SELECTION-SCREEN END OF BLOCK bbox.
          AT SELECTION-SCREEN ON P_VARI                                 *
    AT SELECTION-SCREEN ON p_vari.
      PERFORM alv_variant_existence USING    p_vari
                                    CHANGING gs_variant.
          AT SELECTION-SCREEN ON VALUE REQUEST FOR P_VARI               *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM alv_variant_f4 CHANGING p_vari
                                      gs_variant.
    INITIALIZATION                                                       *
    INITIALIZATION.
    START-OF-SELECTION                                                   *
    START-OF-SELECTION.
      PERFORM authority_check.
      PERFORM get_control_data.
      PERFORM get_transaction_data.
      PERFORM process_transaction_data.
    END-OF-SELECTION                                                     *
    END-OF-SELECTION.
      PERFORM output_data.
    F   O   R   M   S                                                   *
          FORM AUTHORITY_CHECK                                          *
          Perform authority checks for the report                       *
    FORM authority_check.
    !!! Note: authorisation checks are application-dependent.
    !!! Some common cases are listed below - please select one of them
    !!! or add new authorisation checks.
    !!! If the report is creating batch input session or using LDB
    !!! it may be sufficient to use automatic SAP auth.checks.
    Authorisation for displaying documents in a single company code
    authority-check object 'F_BKPF_BUK'
           id 'BUKRS' field p_bukrs
           id 'ACTVT' field '03'.
    if sy-subrc <> 0.
      message e001(z9) with 'No authorisation to display documents'
                            'in company code' p_bukrs.
    endif.
    Displaying documents from a list of company codes (select-options)
    call function 'Y_BUKRS_AUTHORITY_CHECK'
       EXPORTING
            ACTVT     = '03'
            NOMESSAGE = ' '
       tables
            s_bukrs   = s_bukrs.
    ENDFORM.                              " AUTHORITY_CHECK
          FORM GET_CONTROL_DATA                                         *
          Read configuration etc.                                       *
    FORM get_control_data.
    ENDFORM.                               " GET_CONTROL_DATA
          FORM GET_TRANSACTION_DATA                                     *
          Read documents etc.                                           *
    FORM get_transaction_data.
    !!! Data selection statement below has been generated automatically.
    !!! Please check if it is correct and complete.
    !!! Use table joins or 'SELECT FOR ALL ENTRIES' when selecting data
    !!! from related tables.
      SELECT
                vbeln
                erdat
                erzet
                ernam
       FROM vbak
          INTO CORRESPONDING FIELDS OF TABLE gt_vbak
      CHECK NOT gt_vbak[] IS INITIAL.
      SELECT
                matnr
       FROM mara
          INTO CORRESPONDING FIELDS OF TABLE gt_mara
          FOR ALL ENTRIES IN gt_vbak
          WHERE ernam = gt_vbak-ernam
    ENDFORM.                               " GET_TRANSACTION_DATA
          FORM PROCESS_TRANSACTION_DATA                                 *
    FORM process_transaction_data.
      LOOP AT gt_vbak .
        MOVE-CORRESPONDING gt_vbak TO gt_alv1_data .
        APPEND gt_alv1_data .
      ENDLOOP.
      FREE gt_vbak .
      LOOP AT gt_mara .
        MOVE-CORRESPONDING gt_mara TO gt_alv2_data .
        APPEND gt_alv2_data .
      ENDLOOP.
      FREE gt_mara .
    ENDFORM.                               " PROCESS_TRANSACTION_DATA
          FORM OUTPUT_DATA                                              *
    FORM output_data.
      PERFORM alv_list_display.
    ENDFORM.                               " OUTPUT_DATA
          FORM DISPLAY_RECORD                                           *
          Display object associated with the current ALV line           *
    FORM display_record USING is_selfield TYPE slis_selfield.
      READ TABLE gt_alv1_data INDEX is_selfield-tabindex.
      CHECK sy-subrc = 0.
    !!! SAMPLE IMPLEMENTATION FOR DISPLAYING FI DOCUMENTS:
      SET PARAMETER ID 'BUK' FIELD gt_alv1_data-vbeln.
    set parameter id 'BLN' field gt_alv1_data-belnr.
    set parameter id 'GJR' field gt_alv1_data-gjahr.
      CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
    ENDFORM.                               " DISPLAY_RECORD
          FORM ALV_LIST_DISPLAY                                         *
          Invoke main ALV function to format and show the report        *
    FORM alv_list_display.
      DATA: ls_layout      TYPE slis_layout_alv,
            ls_print       TYPE slis_print_alv,
            ls_keyinfo     TYPE slis_keyinfo_alv,
            lt_fieldcat    TYPE slis_t_fieldcat_alv,
            lt_exctab      TYPE slis_t_extab,
            lt_sorttab     TYPE slis_t_sortinfo_alv,
            lt_events      TYPE slis_t_event.
      PERFORM alv_init_report_events TABLES   lt_events.
      PERFORM alv_init_report_layout TABLES   lt_fieldcat
                                              lt_exctab
                                              lt_sorttab
                                     CHANGING ls_layout
                                              ls_print
                                              ls_keyinfo.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_interface_check        = ' '
          i_callback_program       = sy-cprog
          is_layout                = ls_layout
          it_fieldcat              = lt_fieldcat
          it_excluding             = lt_exctab
        IT_SPECIAL_GROUPS        =
          it_sort                  = lt_sorttab
        IT_FILTER                =
        IS_SEL_HIDE              =
        I_SCREEN_START_COLUMN    = 0
        I_SCREEN_START_LINE      = 0
        I_SCREEN_END_COLUMN      = 0
        I_SCREEN_END_LINE        = 0
        I_DEFAULT                = 'X'
          i_save                   = 'A'
          is_variant               = gs_variant
          it_events                = lt_events
        IT_EVENT_EXIT            =
          i_tabname_header         = 'GT_ALV1_DATA'
          i_tabname_item           = 'GT_ALV2_DATA'
        I_STRUCTURE_NAME_HEADER  =
        I_STRUCTURE_NAME_ITEM    =
          is_keyinfo               =  ls_keyinfo
          is_print                 =  ls_print
        IS_REPREP_ID             =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER  =
        ES_EXIT_CAUSED_BY_USER   =
        TABLES
          t_outtab_header          = gt_alv1_data
          t_outtab_item            = gt_alv2_data.
      EXCEPTIONS
        PROGRAM_ERROR            = 1
        OTHERS                   = 2
    ENDFORM.                           " ALV_LIST_DISPLAY
          FORM ALV_INIT_REPORT_LAYOUT                                   *
          Set up report layout definition for ALV_LIST_DISPLAY          *
    <-- OT_FIELDCAT list of fields                                     *
    <-- OT_EXCTAB   excluded menu options                              *
    <-- OT_SORTTAB  sorting/grouping definition                        *
    <-- OS_LAYOUT   global report layout settings                      *
    <-- OS_PRINT    global report printout settings                    *
    <-- OS_KEYINFO  itab key fields (required only for hier.lists)     *
    FORM alv_init_report_layout TABLES ot_fieldcat TYPE slis_t_fieldcat_alv
                                       ot_exctab   TYPE slis_t_extab
                                       ot_sorttab  TYPE slis_t_sortinfo_alv
                              CHANGING cs_layout   TYPE slis_layout_alv
                                       cs_print    TYPE slis_print_alv
                                       cs_keyinfo  TYPE slis_keyinfo_alv.
    add menu items to be excluded to ot_exctab.
      REFRESH ot_exctab.
      REFRESH ot_fieldcat.
      REFRESH ot_sorttab.
    !!! List all ALV data fields for display here:
    DD-struct  = data dictionary structure name
    DD-field   = field of data dictionary structure
    itab       = internal table for output data
    itab-field = internal table field name
    key        = set to 'X' if key field
    sum        = set to 'X' for totals
    hid        = set to 'X' if field is initially hidden
    row        = list row number (multi-line list if >1)
    DD-struct    DD-field     itab         itab-field  key sum hid row
      PERFORM alv_build_fieldcat TABLES ot_fieldcat USING:
    'VBAK'       'VBELN'      'GT_ALV1_DATA' 'VBELN'     ' ' ' ' ' ' 1 ,
    'VBAK'       'ERDAT'      'GT_ALV1_DATA' 'ERDAT'     ' ' ' ' ' ' 1 ,
    'VBAK'       'ERZET'      'GT_ALV1_DATA' 'ERZET'     ' ' ' ' ' ' 1 ,
    'VBAK'       'ERNAM'      'GT_ALV1_DATA' 'ERNAM'     ' ' ' ' ' ' 1.
      PERFORM alv_build_fieldcat TABLES ot_fieldcat USING:
    'MARA'       'MATNR'      'GT_ALV2_DATA' 'MATNR'     ' ' ' ' ' ' 1 .
    !!! List all ALV data fields for sorting/grouping here
    itab       = internal table for output data
    itab-field = internal table field name
    up         = sort ascending
    down       = sort descending
    grp        = group by
    comp       = group initially compressed
    pos        = field position in sort sequence
    itab                   field              up down grp comp        pos
      PERFORM alv_build_sorttab TABLES ot_sorttab USING:
    'GT_ALV1_DATA'         'VBELN'             'X' ' ' ' ' ' '           1.
      PERFORM alv_build_sorttab TABLES ot_sorttab USING:
    'GT_ALV2_DATA'         'MATNR'             'X' ' ' ' ' ' '           1.
    !!! key definition - required only for hierarchical display (2 itabs)
      cs_keyinfo-header01 = 'VBELN' .
      cs_keyinfo-item01   = 'MATNR' .
    !!! See the declaration of type SLIS_LAYOUT_ALV and set the fields
    !!! of OS_LAYOUT record to change list-level attributes
    os_layout-no_colhead     = 'X'.         " no headings
      cs_layout-zebra          = 'X'.         " stripped pattern
    os_layout-no_vline       = 'X'.         " columns separated by space
    os_layout-totals_only    = 'X'.         " show only totals
    os_layout-totals_text    = 'Total'.     " totals line label
    os_layout-subtotals_text = 'Subtotal'.  " subtotals line label
    os_layout-subtotals_text = 'Subtotal'.  " subtotals line label
    os_layout-key_hotspot    = 'X'.         " keys as hotspot
    os_layout-expand_all     = 'X'.         " Expand all positions
    os_layout...
      cs_print-no_print_selinfos = 'X'.       " Skip selection statistics
      cs_print-no_print_listinfos = 'X'.      " Skip list statistics
    os_print-...
    ENDFORM.                               " INIT_REPORT_LAYOUT
          FORM ALV_BUILD_FIELDCAT                                       *
          Format a single line for ALV_INIT_REPORT_LAYOUT               *
    FORM alv_build_fieldcat TABLES ot_fieldcat
                            USING  iv_ref_tabname   "ref to a table/field
                                   iv_ref_fieldname
                                   iv_tabname     "actual table/field name
                                   iv_fieldname
                                   iv_key
                                   iv_do_sum
                                   iv_no_out
                                   iv_row_pos.
    status variables for auto-numbering of field column position
    (column number reset when a new table or row begins)
      STATICS: sv_last_tabname TYPE slis_tabname,
               sv_last_row_pos TYPE i,
               sv_current_col  TYPE i.
      IF sv_last_tabname <> iv_tabname OR sv_last_row_pos <> iv_row_pos.
        sv_current_col = 1.
      ELSE.
        ADD 1 TO sv_current_col.
      ENDIF.
      sv_last_tabname = iv_tabname.
      sv_last_row_pos = iv_row_pos.
      DATA: ls_fieldcat    TYPE slis_fieldcat_alv.
      DATA: lv_fieldname   TYPE slis_fieldname.
      lv_fieldname = iv_fieldname.
    !!! List all the special formatting requirements in cases below
    case lv_fieldname.
      when 'WRBTR'.                      "<-- link with currency required
        ls_fieldcat-cfieldname = 'WAERS'.
        ls_fieldcat-ctabname   = iv_tabname.
      when 'HKONT'.                     "<-- change default column header
        ls_fieldcat-seltext_s  = 'GL Acc.'.
        ls_fieldcat-ddictxt    = 'S'.          " (S)hort (M)iddle (L)ong
      when 'SOME_NUMBER'                 "<-- change number formatting
        ls_fieldcat-nosign     = 'X'.
        ls_fieldcat-nozero     = 'X'.
        ls_fieldcat-just       = 'L'.         " (L)eft (R)ight (C)enter
    endcase.
      ls_fieldcat-ref_tabname   = iv_ref_tabname.
      ls_fieldcat-ref_fieldname = iv_ref_fieldname.
      ls_fieldcat-tabname       = iv_tabname.
      ls_fieldcat-fieldname     = iv_fieldname.
      ls_fieldcat-key           = iv_key.
      ls_fieldcat-do_sum        = iv_do_sum.
      ls_fieldcat-no_out        = iv_no_out.
      ls_fieldcat-row_pos       = iv_row_pos.
      ls_fieldcat-col_pos       = sv_current_col.
      APPEND ls_fieldcat TO ot_fieldcat.
    ENDFORM.                          " ALV_BUILD_FIELDCAT
          FORM ALV_BUILD_SORTTAB                                        *
          Set up sorting information for ALV_INIT_REPORT_LAYOUT         *
    FORM alv_build_sorttab TABLES ot_sorttab TYPE slis_t_sortinfo_alv
                           USING  iv_tabname   TYPE slis_fieldname
                                  iv_fieldname TYPE slis_fieldname
                                  iv_up        TYPE c
                                  iv_down      TYPE c
                                  iv_subtot    TYPE c
                                  iv_comp      TYPE c
                                  iv_spos      TYPE n.
      ot_sorttab-spos      = iv_spos.
      ot_sorttab-fieldname = iv_fieldname.
      ot_sorttab-tabname   = iv_tabname.
      ot_sorttab-up        = iv_up.
      ot_sorttab-down      = iv_down.
      ot_sorttab-subtot    = iv_subtot.
      ot_sorttab-comp      = iv_comp.
      APPEND ot_sorttab.
    ENDFORM.                            " ALV_BUILD_SORTTAB
          FORM ALV_INIT_REPORT_EVENTS                                   *
          Set up program events for ALV_LIST_DISPLAY                    *
    <-- OT_EVENTS   list of events and associated report subroutines   *
    FORM alv_init_report_events TABLES ot_events TYPE slis_t_event.
      CLEAR   ot_events.
      REFRESH ot_events.
      ot_events-name = slis_ev_user_command.
      ot_events-form = 'USER_COMMAND'.
      APPEND ot_events.
      ot_events-name = slis_ev_pf_status_set.
      ot_events-form = ''.                         "'PF_STATUS_SET'.
      APPEND ot_events.
      ot_events-name = slis_ev_top_of_list.
      ot_events-form = 'TOP_OF_LIST'.
      APPEND ot_events.
      ot_events-name = slis_ev_end_of_list.
      ot_events-form = 'END_OF_LIST'.
      APPEND ot_events.
      ot_events-name = slis_ev_top_of_page.
      ot_events-form = 'TOP_OF_PAGE'.
      APPEND ot_events.
      ot_events-name = slis_ev_end_of_page.
      ot_events-form = 'END_OF_PAGE'.
      APPEND ot_events.
      ot_events-name = slis_ev_foreign_top_of_page.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_foreign_end_of_page.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_top_of_coverpage.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_end_of_coverpage.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_before_line_output.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_after_line_output.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_caller_exit_at_start.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_list_modify.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_subtotal_text.
      ot_events-form = ''.
      APPEND ot_events.
    ENDFORM.                            " ALV_INIT_REPORT_EVENTS
          FORM USER_COMMAND                                             *
          Subroutine attached as callback form to ABAP List Viewer      *
      --> UCOMM    - user command code passed from ALV                  *
      --> SELFIELD - information record describing current line/field   *
    FORM user_command USING value(iv_ucomm) LIKE sy-ucomm
                            is_selfield     TYPE slis_selfield.
      CASE iv_ucomm.
        WHEN '&IC1'.                                  "ALV record selection
          PERFORM display_record USING is_selfield.
      when ...
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
          FORM PF_STATUS_SET                                            *
          Subroutine attached as callback form to ABAP List Viewer,     *
          allows setting alternative menu.  If necessary:               *
          1. Copy 'STANDARD' menu from SAPLKKBL and modify as required, *
          2. Activate callback                                          *
    FORM pf_status_set USING it_exctab TYPE slis_t_extab.
    set pf-status 'STANDARD' excluding it_exctab.
    ENDFORM.                               " PF_STATUS_SET
          FORM TOP_OF_LIST                                              *
          Subroutine attached as callback form to ABAP List Viewer,     *
          executed once at the start of list output.                    *
    FORM top_of_list.
      DATA: lt_seltab TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
      DATA: lv_report LIKE sy-repid.
      lv_report = sy-repid.             "do not pass sy-repid to function!
      IF p_box_up = 'X'. "display select options at report start
        CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
          EXPORTING
            curr_report     = lv_report
          TABLES
            selection_table = lt_seltab.
    remove 'technical' parameters with 'DELETE LT_SELTAB WHERE...'
    before display, if necessary
        CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
           EXPORTING
                report        = lv_report
                seltext       = 'X'
            dyn_range     =
                newpage       = ' '
            screennr      = 1000
           TABLES
                sel_tab       = lt_seltab
           EXCEPTIONS
                sel_tab_empty = 1.
      ENDIF. "p_box_up = 'X'
    ENDFORM.                               " TOP_OF_LIST
          FORM END_OF_LIST                                              *
          Subroutine attached as callback form to ABAP List Viewer      *
          executed once at the end of list output.                      *
    FORM end_of_list.
      DATA: lt_seltab TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
      DATA: lv_report LIKE sy-repid.
      lv_report = sy-repid.             "do not pass sy-repid to function!
      IF p_box_do = 'X'. "display select options at report end
        CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
          EXPORTING
            curr_report     = lv_report
          TABLES
            selection_table = lt_seltab.
    remove 'technical' parameters with 'DELETE LT_SELTAB WHERE...'
    before display, if necessary
        CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
           EXPORTING
                report        = lv_report
                seltext       = 'X'
            dyn_range     =
                newpage       = ' '
            screennr      = 1000
           TABLES
                sel_tab       = lt_seltab
           EXCEPTIONS
                sel_tab_empty = 1.
      ENDIF. "p_box_do = 'X'
    ENDFORM.                               " END_OF_LIST
          FORM TOP_OF_PAGE                                              *
          Subroutine attached as callback form to ABAP List Viewer      *
    FORM top_of_page.
    standard Ingram Micro report page heading
      DATA: lv_coco_pos TYPE i,          "CurPos of 'Company confidential'
            lv_title_pos TYPE i,           "CurPos of report title
            lv_title(70) TYPE c,           "Truncated report title
            lv_page_pos TYPE i,            "CurPos of page number
            lv_date_pos TYPE i,            "CurPos of date and time
            lv_page_no(10) TYPE c,
            lv_date(25) TYPE c,
            lv_time(20) TYPE c,
            lv_page(10) TYPE c.
    We may need to truncate title if the line size is < 81.
      IF sy-linsz < 81.
        lv_title = sy-title+0(50).
      ELSE.
        lv_title = sy-title.
      ENDIF.
    Decide on positioning of text depending on width of page
      lv_title_pos = ( sy-linsz / 2 ) - ( STRLEN( lv_title ) / 2 ).
      lv_coco_pos = sy-linsz - 20.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      WRITE: / 'Ingram Micro',
               AT lv_title_pos lv_title,
               AT lv_coco_pos 'Company Confidential'.
    Setup data correctly in the correct format for the display fields.
      lv_page = sy-pagno.
      SHIFT lv_page LEFT DELETING LEADING ' '.
      CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4)
                   INTO lv_date SEPARATED BY '.'.
      CONCATENATE sy-uzeit0(2) ':' sy-uzeit2(2) INTO lv_time.
      CONCATENATE lv_date lv_time INTO lv_date SEPARATED BY ' '.
      CONCATENATE 'Page' lv_page INTO lv_page_no SEPARATED BY ' '.
    Decide on positioning of text depending on width of page.
      lv_page_pos = sy-linsz - ( STRLEN( lv_page_no ) ).
      WRITE: / lv_date,
               AT lv_page_pos lv_page_no.
      ULINE.
    ENDFORM.                               " TOP_OF_PAGE
          FORM END_OF_PAGE                                              *
          Subroutine attached as callback form to ABAP List Viewer      *
    FORM end_of_page.
    ENDFORM.                               " END_OF_PAGE
          Form  ALV_VARIANT_EXISTENCE
          Reads ALV variant definition
    FORM alv_variant_existence  USING    iv_variant LIKE disvariant-variant
                                CHANGING os_variant LIKE disvariant.
      CHECK NOT iv_variant IS INITIAL.
      os_variant-report  = sy-repid.
      os_variant-variant = iv_variant.
      IF iv_variant CP '/*'.    "user-specific variants begin with slash
        os_variant-username = sy-uname.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
        EXPORTING
          i_save        = 'A'
        CHANGING
          cs_variant    = os_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc <> 0.
        MESSAGE e001(z9) WITH 'Please select a valid display variant.'.
      ENDIF.
    ENDFORM.                               " ALV_VARIANT_EXISTENCE
          FORM ALV_VARIANT_F4                                           *
          Display list of layout variants on report selection screen    *
    FORM alv_variant_f4  CHANGING cv_varname  LIKE disvariant-variant
                                  cs_variant  LIKE disvariant.
      DATA: lv_exit(1) TYPE c.
      cs_variant-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant          = cs_variant
                i_save              = 'A'
              it_default_fieldcat =
           IMPORTING
                e_exit              = lv_exit
                es_variant          = cs_variant
           EXCEPTIONS
                not_found = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF lv_exit = space.
          cv_varname = cs_variant-variant.
        ENDIF.
      ENDIF.
    hope this will help.
    see form  user_command.
    regards,
    Ruchika

  • Drill down ( Collapsible Row ) Report in BEx query designer ?

    Dear Friends!
       I am supoosed to create a report drill down report for Purchasing History to be precise,  I know that we can have drill down feature using heirarchy but is it possible for Us to have PO & PO item heirarachy ? or any other way to do drill down reporting in SAP BEx Query designer ?
    like my current report is : -
    | Vendor | Purchasing Organisation | Purchasing Group | Plant | PO Number | Item | Material / Service | Description | .... ( keyfigures) |
    Now I am supposed to create a report  in which
    normal view
    | Vendor | Purchasing Organisation | Purchasing Group | Plant | |> PO Number| .... ( keyfigures) | Payment |
    drill down or collapsible view ( please consider the heading as data I am not talking about dynamically change of  headings ).
    | Vendor | Purchasing Organisation | Purchasing Group | Plant | V PO Number | Item | Material / Service | Description | .... ( keyfigures) |
    is there anyway to design the report in above mention manner ? you any input will be appreciated greatly.
    Thank you so much!
    Regards
    Naim

    Hi Naim,
    usually we don't do the transactional data as hierarchy.  not sure the reason behind your requirement.
    we can do one of the below :-
    1. To have the default view as
    | Vendor | Purchasing Organisation | Purchasing Group | Plant | | PO Number| .( keyfigures) | Payment |
    and then user can drill down on rest of the characteristics for detailed view later on.
    2. or if they don't want to drill down on characteristics;-
    we can build 2 reports , one for header level information and then jump to second query for detailed information(item level) using RRI.
    first query:
    | Vendor | Purchasing Organisation | Purchasing Group | Plant | | PO Number| .( keyfigures) | Payment |
    second query:
    | Vendor | Purchasing Organisation | Purchasing Group | Plant |  PO Number | Item | Material / Service | Description | .... ( keyfigures) |
    Let us know if this works out?
    Regards,
    Sakthi.

  • Problem displaying drill down STANDARD ALV for a particular record after pressing back button

    I have a simple interactive ALV grid report. NOT 'OO'. It display correctly on initial execution. AT the moment, 6 records. I want it to work such that if i click record '1', a drill-down version of that ALV with only that one record clicked is displayed. This currently occurs correctly. The problem arises when i click the back button and want to click on a new record, say in the 2nd row..this new 2nd row record is not displayed. The first one is displayed again. I tried clearing and fiddling around but then the last record is displayed. I have used the 'ID' field as a 'hotspot' getting picked up by sy-tabindex. Maybe it could be that i shouldn't loop and use  a work area e.g in my select statement. i'm not so sure i've looked around, and tried a few things. I can't get it right yet. My code is below:
    *& Report  ZALV
    REPORT  ZALV.
    TABLES: ZCONTACT.
    TYPE-POOLS: slis. "slis contains all of the ALV data types.
    TYPES: BEGIN OF ty_zcontact.
             INCLUDE STRUCTURE zcontact.
    TYPES: icon TYPE char4, "field holding traffic light value- adding a column to internal table to hold the traffic light
             END OF ty_zcontact.
    DATA: "fieldcatALOG TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           it_zcontact TYPE TABLE OF ty_zcontact,"declares an internal table of type ZCONTACT
           wa_zcontact TYPE ty_zcontact,
           gd_layout TYPE slis_layout_alv,
           gd_repid LIKE sy-repid,
           g_variant TYPE disvariant,
           gx_variant TYPE disvariant,
           g_save TYPE c VALUE 'X',
           it_fieldcat TYPE slis_t_fieldcat_alv,"declares field catalog table of line type alv
           wa_fieldcat TYPE slis_fieldcat_alv, "declares the work area of the field catalog
           it_list_top_of_page TYPE slis_t_listheader.
    DATA: it_fieldcat1 TYPE slis_t_fieldcat_alv,
           wa_fieldcat1 TYPE slis_fieldcat_alv.
    DATA: V_FIELD(30) TYPE C,
    V_VALUE(10) TYPE C.
           "izontact TYPE TABLE OF zcontact.
            "i_logo TYPE OT.
           "ls_layout TYPE slis_layout_alv.
    **Selection Screen details
    *SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    *PARAMETERS: variant like disvariant-variant.
    *SELECTION-SCREEN END OF BLOCK B1.
    SELECT-OPTIONS:
    age FOR wa_zcontact-age,
    lastnme FOR wa_zcontact-lastname.
    **Getting default variant
    *  AT SELECTION-SCREEN ON age.
    *    SELECT SINGLE age FROM zcontact INTO wa_zcontact-age WHERE age = age.
    *  IF sy-subrc NE 0.
    *    MESSAGE:'That age does not exist mate, Please enter another age' TYPE 'E'.
    *    ENDIF.
    INITIALIZATION.
    *gx_variant-report = sy-repid.
    *CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    *EXPORTING
    *  I_SAVE = G_SAVE
    *  CHANGING
    *    CS_VARIANT = GX_VARIANT
    *  EXCEPTIONS
    *    NOT_FOUND = 2.
    *IF SY-SUBRC = 0.
    *  VARIANT = GX_VARIANT-VARIANT.
    *  ENDIF.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM DISPLAY_ALV_REPORT.
      PERFORM top_of_page.
    "g_repid = sy-repid.
    *Fetch data from the database
    FORM DATA_RETRIEVAL.
    SELECT * FROM zcontact INTO TABLE it_zcontact WHERE age IN age AND lastname IN lastnme.
    "assigning traffic light colour to each row based on a condition
    *  IF wa_zcontact-age GE 65.
    *   wa_zcontact-icon = 1. "Red Traffic Light
    *   ELSEIF wa_zcontact-age BETWEEN 40 AND 64.
    *     wa_zcontact-icon = 2. "Yellow traffic light
    *     ELSE.
    *       wa_zcontact-icon = 3." Green traffic light
    *       ENDIF.
    *       MODIFY it_zcontact FROM wa_zcontact TRANSPORTING icon.
    *       CLEAR wa_zcontact.
    ENDFORM.
    FORM BUILD_FIELDCATALOG.
    *Build field catalog
    wa_fieldcat-fieldname = 'ID'.
    "wa_fieldcat-seltext_m = 'The Contact ID'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'LASTNAME'.
    "wa_fieldcat-seltext_m = 'Contact Lastname'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FIRSTNAME'.
    "wa_fieldcat-seltext_m = 'Contact Firstname'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'DOB'.
    "wa_fieldcat-seltext_m = 'Date Of Birth'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'TEL'.
    "wa_fieldcat-seltext_m = 'Telephone Number'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'ADDRESS'.
    "wa_fieldcat-seltext_m = 'The Address'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'OCCUPATION'.
    "wa_fieldcat-seltext_m = 'The Occupation'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'WEIGHT'.
    "wa_fieldcat-seltext_m = 'WEIGHT'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'AGE'.
    "wa_fieldcat-seltext_m = 'AGE OF THE CONTACT'.
    wa_fieldcat-do_sum   = 'X'.        "Display column total
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'SALARY'.
    "wa_fieldcat-seltext_m = 'SALARY'.
    wa_fieldcat-do_sum   = 'X'.
    APPEND wa_fieldcat TO it_fieldcat.
    gd_layout-lights_fieldname = 'ICON'.
    ENDFORM.
    FORM DISPLAY_ALV_REPORT.
    gd_repid = sy-repid.
    *Pass data and field catalog to ALV function module to display ALV list
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           it_fieldcat            = it_fieldcat
           i_callback_program     = gd_repid
           i_callback_top_of_page =  'TOP_OF_PAGE'
           i_callback_user_command =  'USER_COMMAND'
           i_structure_name       =  'ZCONTACT'
           i_save                 = 'X'
           is_variant             = g_variant
           is_layout     = gd_layout
    TABLES
           t_outtab      = it_zcontact
    EXCEPTIONS
           program_error = 1
           OTHERS        = 2.
    ENDFORM.
    FORM top_of_page.
    *ALV Header declarations
       DATA: it_listheader TYPE slis_t_listheader,
             wa_listheader TYPE slis_listheader,
             t_line like wa_listheader-info,
             ld_lines TYPE I,
             ld_linesc(10) TYPE C.
    wa_listheader-typ = 'H'.
    wa_listheader-info = 'Contact Details'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-info = sy-repid.
    wa_listheader-key = 'Program Name:'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-info = sy-uname.
    wa_listheader-key = 'User Name:'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Run Date :'.
    CONCATENATE sy-datum+6(2)
                 sy-datum+4(2)
                 sy-datum(4)
                 INTO wa_listheader-info
                 SEPARATED BY '/'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Time :'.
    CONCATENATE sy-uzeit(2)
                 sy-uzeit+2(2)
                 sy-uzeit+4(2)
                 INTO wa_listheader-info
                 SEPARATED BY ':'.
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
       CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
           it_list_commentary = it_listheader
           i_logo = 'KLOGO'.
    ENDFORM. "top_of_page
    *& Form sub_user_command
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
    P_SELTAB TYPE SLIS_SELFIELD.
    CASE P_UCOMM.
       WHEN '&IC1'.
    CASE p_seltab-fieldname.
       WHEN 'ID'.
       READ TABLE it_zcontact INTO wa_zcontact INDEX p_seltab-tabindex.
       PERFORM DATA_RETRIEVAL1.
       PERFORM BUILD_FIELDCATALOG1.
       PERFORM SECOND_GRID.
       ENDCASE.
       ENDCASE.
    ENDFORM. "
    FORM DATA_RETRIEVAL1.
    SELECT * FROM zcontact INTO TABLE it_zcontact WHERE id EQ wa_zcontact-id.
    ENDFORM.
    FORM BUILD_FIELDCATALOG1.
    *Build field catalog
    CLEAR: wa_fieldcat, it_fieldcat.
    wa_fieldcat-fieldname = 'ID'.
    "wa_fieldcat-seltext_m = 'The Contact ID'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'LASTNAME'.
    "wa_fieldcat-seltext_m = 'Contact Lastname'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FIRSTNAME'.
    "wa_fieldcat-seltext_m = 'Contact Firstname'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    ENDFORM.
    FORM SECOND_GRID.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM = SY-REPID
         IT_FIELDCAT = IT_FIELDCAT
         i_structure_name       =  'ZCONTACT'
         i_callback_user_command =  'USER_COMMAND'
         TABLES
           T_OUTTAB = IT_ZCONTACT.
       ENDFORM.

    Hi Ten Mariga,
                     I wonder why the second select Query is needed at all instead you can use
    ---> Not Needed
    FORM DATA_RETRIEVAL1.
    SELECT * FROM zcontact INTO TABLE it_zcontact WHERE id EQ wa_zcontact-id.
    ENDFORM.
    ----> Instead you can do
       READ TABLE it_zcontact INTO wa_zcontact INDEX p_seltab-tabindex.
      Append wa_zcontact to Second_table.
    And you can use the Second_table to display the second ALV. The second Select Query will affect the performance too.
    Cheers,
    Krishnakumar B.

  • Drill Down and Drill UP on Web Analysis Report

    Hi all,
    I have a question regarding Drill down and Drill up on Web Analysis Report.
    The situation is the following:
    I've created a report with some account parent elements in row. The dimension account has a multiple hierarchy.
    I need to drill down on the child of these elements keeping the parente on top and so i've selected the option "Selected Member First".
    The drill down it's ok for the first drill to go on the next level but when i drill down once more to go on the next level of the selected member hierarchy the drill move this level out hierarchy.
    Can someone help me on this point?
    After that i've drilled just to the last level when i drill up on these elements to return on the previous level i note that in the report happens a strange thing:
    The Drill Up works fine but on the report appears another elements which is the same parent with anothe code/alias of another hierarchy instead of the Selected member.
    On this i've noted tha this 2 different parente have the same elements...I think that the children of the selected memeber can be shared members....Can be this the problem?
    Thanks for the help.
    Best Regards
    Eugenio Gualtieri

    Hi John,
    thanks for your answer.
    I've trayed to set the report on Smart View to virify tou test your advise.
    The situatio is the following:
    IS05101010-PUBBLICITA'
    702000 - VEND. DI SPAZIO PUBBLICITARIO
    702010 - RETTIFICHE VENDITE SPAZIO PUBBLICITARIO     
    W10004 - RICAVI PUBBL ICITA' ATTIVA (Q.EDIT) INTE     
    W10007 - RICAVI DA SPAZIO PUBBL. INTERASA     
    W10029 - RETTIFICA RICAVI PUBBL. INTERASA     
    ED05101010-PUBBLICITA'
    702000 - VEND. DI SPAZIO PUBBLICITARIO
    702010 - RETTIFICHE VENDITE SPAZIO PUBBLICITARIO     
    W10004 - RICAVI PUBBL ICITA' ATTIVA (Q.EDIT) INTE     
    W10007 - RICAVI DA SPAZIO PUBBL. INTERASA     
    W10029 - RETTIFICA RICAVI PUBBL. INTERASA     
    If I take only one parent member the drill up works fine but if i take all 2 memeber as above and i decide to drill up on one of the two element occur that the drill work for the two elements at the same time.
    Afetr the drill in this case the situation is:
    IS05101010-PUBBLICITA'
    ED05101010-PUBBLICITA'
    Can be a problem due to shared memebers?
    Thanks for your help.
    Regards
    Eugenio Gualtieri

Maybe you are looking for

  • How To Move or Copy Files From Multiple Sources To MBP

    I will shortly be taking delivery of a new MBP. Currently I have my files spread across an eMac Panther partition, a OS 9 partition, and several partitions on 2 different external hard drives (iPhoto library is on one and iTunes Library on another. N

  • From DRFOUT not able to replicate the material, I-doc is not triggering

    Hello Experts, I am implementing SAP MDG for Material. I have done all the required confiration for Data replication as per the standard configuration document. I want to replicate to another SAP system from SAP MDG hub.I have created the Data replic

  • Where do I put my KeyListener ?

    I've got a JInternalFrame with a JPanel and JToolBar added to it. I want to add a key listener so when the user pushes + or -, a method is called on the JPanel. A screenshot is available below -- the colored boxes are JLabels. http://www.enginuity.or

  • Nokia Lumia 710 photo sync issues

    I'm trying to sync the photos on my Lumia 710 to my computer. I've done it before using Zune but it doesn't seem to be working this time. Any ideas? Thanks

  • Moving the row in the Iterator

    Hi I am using ADF Business component and UIX. I have a uix page that displays a Table and two buttons The buttons job is move a particilar row up or down . Here is the code for the move up button. int index = transaction.getCurrentRowIndexInRange()-1