Display/Print the Selection criteria entered by USER on the ALV Report o/p?

Hi Experts,
I hv a requirement of to print/display the Selection criteria entered by user in the selection screen.........on the top portion of the ALV report output lay out.
There is a FM for this purpose, but, I forgot its name!!
So, let me know the FM or FMs, so that, will choose, which is best one,
or the piece of code, which covers all select-option entries..........appreciated.
thanq
Edited by: SAP ABAPer on Sep 3, 2008 6:35 PM

Use the Function RS_REFRESH_FROM_SELECTOPTIONS get the selection details, now format the data accordingly in the TOP_OF_PAGE using the calss CL_DD_DOCUMENT.
Check the below mention code.
REPORT  ztest_page.
TABLES: sflight.
DATA : it_flight TYPE TABLE OF sflight WITH HEADER LINE.
DATA BEGIN OF it_sel_opt OCCURS 0.
        INCLUDE STRUCTURE rsparams.
DATA END   OF it_sel_opt.
SELECT-OPTIONS: s_carrid FOR sflight-carrid.
START-OF-SELECTION.
  SELECT * FROM sflight INTO TABLE it_flight
   WHERE carrid IN s_carrid.
END-OF-SELECTION.
  CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
      curr_report     = sy-repid
    TABLES
      selection_table = it_sel_opt
    EXCEPTIONS
      not_found       = 01
      no_report       = 02.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = sy-repid
      i_callback_html_top_of_page = 'TOP_OF_PAGE'
      i_structure_name            = 'SFLIGHT'
    TABLES
      t_outtab                    = it_flight
    EXCEPTIONS
      program_error               = 1
      OTHERS                      = 2.
*&      Form  top_of_page
*       text
*      -->DOCUMENT   text
FORM top_of_page USING document TYPE REF TO cl_dd_document.
  DATA : dl_text(255) TYPE c.  "Text
* Add new-line
  CALL METHOD document->new_line.
  CALL METHOD document->new_line.
  CLEAR : dl_text.
* program ID
  dl_text = 'Program Name :'.
  CALL METHOD document->add_gap.
  CALL METHOD document->add_text
    EXPORTING
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_heading_int.
  CLEAR dl_text.
  dl_text = sy-repid.
  CALL METHOD document->add_text
    EXPORTING
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_negative_inv.
* Add new-line
  CALL METHOD document->new_line.
  CLEAR : dl_text.
  dl_text = 'Selection Criteria'.
  CALL METHOD document->add_gap
    EXPORTING
      width = 34.
  CALL METHOD document->add_text
    EXPORTING
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_negative_inv.
* Add new-line
  CALL METHOD document->new_line.
  CLEAR : dl_text.
  CONCATENATE 'SELECT Option' 'SIGN' 'OPTION' 'LOW' 'HIGH'
  INTO dl_text SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
  CALL METHOD document->add_gap
    EXPORTING
      width = 34.
  CALL METHOD document->add_text
    EXPORTING
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_negative_inv.
* Add new-line
  CALL METHOD document->new_line.
  LOOP AT it_sel_opt.
    CLEAR : dl_text.
    CONCATENATE it_sel_opt-selname  it_sel_opt-sign
     it_sel_opt-option it_sel_opt-low it_sel_opt-high
    INTO dl_text SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
    CALL METHOD document->add_gap
      EXPORTING
        width = 34.
    CALL METHOD document->add_text
      EXPORTING
        text         = dl_text
        sap_emphasis = cl_dd_area=>heading
        sap_color    = cl_dd_area=>list_negative_inv.
* Add new-line
    CALL METHOD document->new_line.
  ENDLOOP.
ENDFORM.                    "top_of_page

Similar Messages

  • WAD - How to create the variables to have the selection criteria

    Hi all,
      I am trying to display a BW Statistics query in 'Chart' with Web Application Designer (WAD). I want to have the selection criteria with variable USER ID ('ABC123'), Info Cube ('Z_FIGL_C01') and Time Period '01/01/2005' to '12/31/2005'. How can I have this selection criteria in Web Application Designer, PLEASE ?.
    Thanks.

    Venkat,
      Yes, It's possible.
       I think in the menu options.. there tools--> create Table(it's not Table Web Item web item). May be similar option. we need to create the Table. Right now i don't have the system. you need to keep the 2 Drop Down Boxes in the Table(in the 2 coloumns).
    All the best.
    Regards,
    Nagesh Ganisetti.

  • Can we make the SELECTION CRITERIA BOX act as a Menu / Submenu system?

    Dear All,
    I have written several queries.
    For user convenience, I wish to combine all related queries in a single Query and use the Selection Criteria box as a Menu System to select which Query script to run.
    I can already do this by the use of variables.
    But all  variables are shown in the Selection Criteria Box, and  users must fill in only the relevant boxes.
    It's not a problem, but as the number of Queries grows, the Selection box becomes quite long and distracting.
    I wonder if it is possible to create a sub-menu?
    Example
    Let's say: When you run the Query, it gives this Selection Box:
    Query - Selection Criteria
    Choose a Report                                  [                     ]
                                                    There are 2 choices:
                                                           (a) AP Aging by Document Date
                                                           (b) AP Aging by Posting Date
    [OK]                [Cancel]
    When you choose AP Aging by Doc Date, this Selection Box should pop up:
    Query - Selection Criteria
    Document Date                                  [                     ]
    [OK]                [Cancel]
    And when you choose AP Aging by Posting Date, this Selection Box should pop up:
    Query - Selection Criteria
    Posting Date                                  [                     ]
    [OK]                [Cancel]
    Please let me know if this kind of menu / sub-menu system is possible using SQL only?
    I tried (see code below), but all variables appear on the initial screen (not what I expect) - like this:
    Query - Selection Criteria
    Choose a Report                             [                     ]
    Document Date                               [                     ]
    Posting Date                                [                     ]
    [OK]                [Cancel]
    Thanks
    Leon Lai
    Here's a test code: (not exactly for the illustration above)
    declare @apaging1 varchar(max)
    set @apaging1 =
    /*select T6.U_apaging1 from [dbo].[@APAGING] T6 where T6.U_apaging1*/ '[%0]'
    /* @apaging1 : [0 = Summary]  [Detailed]  */
    If @apaging1 = ' ' set @apaging1 = 'Sum'
    If @apaging1 = 'Sum'
    GOTO Screen1
    If @apaging1 = 'Det'
    GOTO Screen2
    Screen1:
    begin
    declare @aptxn nvarchar (30)
    set @aptxn =
    /*select T9.U_aptxn from [dbo].[@APTRXNS] T9 where T9.U_aptxn*/ '[%9]'
    /*@aptxn: [0 = PU] [PC] [Both]*/
    If @aptxn = ' ' set @aptxn = 'PU'
    end
    Screen2:
    begin
    declare @taxdt1 date
    set @taxdt1=
    /*select T1.[TaxDate] from [dbo].[OPCH] T1 where T1.[TaxDate]*/              '[%5]'
    end

    Dear István Korös 
    Thanks a lot.
    Sad  
    At least, your answer will save me a lot of time searching for the unattainable.
    Best Regards
    Leon Lai

  • WIP Assy Completion -The onhand qty is zero for the selection criteria ente

    Hi,
    I am trying to do a Work Order-Less completions with Transaction Type as 'WIP Assy Completion', the assembly items are not serial and lot controlled.
    When i am trying to save it, it throws an error as 'The onhand qty is zero for the selection criteria entered'.
    Please suggest.
    Thanks

    Do you have onhand quantity for the components under that assembly?
    Thanks
    Nagamohan

  • How to ignore the selection criteria temporary page in print

    Hi Experts,
    I use 2007A and when i would like to print example a Trial Balance then the system prints the selection criteria on the first printed page .
    How can I delete or ignore this option? There's no need for this print.
    I was searching in help files but with no success.
    Thanks,
    Eszter

    In Administration > System Initialization > Print Preferences > General Tab
    There is a checkbox for "Print SAP Business One Generation Message"
    Uncheck it to not print the first page with selection criteria.
    Hope this was what you were looking for.

  • Payment run error "No check exists which meets the selection criteria"

    I have done a payment run successfully, maintained a variant for the check print program but when I want to display the cheques i get this error: " No check exists which meets the selection criteria"  
    I have mantained the check lot for the house bank and the ID as well.
    What could be the problem? Please help.
    Regards
    Debra

    Hi
    I have checked FBZP t. code and the check lots , all seem to be in order. I still have not found out where the problem is.
    Thanks Shammi
    Regards
    Debra

  • Issue-Displaying year in selection criteria check

    I am using V3 as fiscvariant. It corresponds to financial year from APR to MAR. It gives proper result in report. But issue is for last three posting periods (JAN,FEB and MAR which corresponds to 010,011 and 012 respectively) when I press check in selection criteria it displays previous year. E..g 011.2008 should display FEB-2009 after pressing check, but it displays as FEB-2008. I have checked table T009B and I can see Year Shift column values as -1 for periods 10, 11 and 12. For all other periods the year shift is 0. Is it the problem? SM30 doesn't allow me to change entries, I am importing them from R/3 as it is.
    Note that as far as query results are concerned it gives proper results, only issue is display during check in selection criteria.

    Any comments/answers? I would like to know atleast which table is read when we press check in the selection criteria after entering the values...

  • How make default values in the selection criteria of BEx query????

    Hi all
    I have to create a brand new query, in the selection criteria(Prompts) I have two prompts. one prompt should show current budget year and second prompt should show next budget year, both prompts are mandatory and default.
    Can any one please let me know how to obtain current and next budget year??? do I need to write any customer exit or do i need to create a offset???
    Two prompts are using same infoobject 0fiscper which is mapped to ECC Table MBEW and field is LFGJA.
    Thanks

    HI sathiyaa,
    so you want to show user with two prompts one will show current year and the other next year value by default.
    //tell me that if you user change the current year value for ex: it will show 2011 by default.. and user changed it to 2009.
    you want to show 2009 year results or 2011 even though he changed the prompt.
    Here i'm considering that even though user changed current year to some other year still you want to show the current year results.
    Create a customer exit variable for calyear with ready for input (checked).
    customer exit code in CMOD :
    when ' customer exit var for cal year'
    IF I_step = 1.
    clear l_S_range.
    l_S_range-low = sy-datum+0(4).
    l_s_range-sign = 'I'.
    L_s_RANGE-opt = 'EQ'.
    ENDIF.
    if i_step = 2.
    data: zyear(4) type c.
    zyear = sy-datum+0(4).
    ex: l_s_range-sign = 'I',
    l_s_range-opt = 'EQ'.
    L_s_range-low = zyear.
    appen l_s_range to e_t_range.
    after this create a variable offset
    create a new selection in the structure, drag the KF and calyear restricted by current year variable . Copy the same selection and insert it as a new selection, go back to the calyear restriction, right clik on the variable. specify variable offset and enter + 1.
    or search in sdn how to create variable offset it will help you
    Regards,
    Ranganath.

  • Enhance the selection criteria of COOIS

    Hi Experts,
    My role is Basis, I have a problem with tcode COOIS. Users normally execute the COOIS and not enter the sensible selection criteria. It make very high system performance during run and use more than 70% of SAP paging after finished. Normally SAP performance is good enough, I cant imagine if user execute COOIS more than 1 session. They're also not accept to execute in background due to their existing operation design but only thing I can thinking now is make more restriction for the selection criteria.
    Pls suggest me ur best practise that, How can I hide or lock the unneccessary selection criteria in COOIS? And set the default variant for everytime user run tcode COOIS or else that can enhance the COOIS. 
    Regards,
    Piyapong C.

    Hi
    Piyapong using variants we can solve this problem.In the initial screen enter the selection parameters as per your requirements after that save that variant.After that when you run the COOIS again,run with this variant.
    In this you can protect the field,hide the field and you can make the field as required field(mandatory entry).
    Regards,
    Raj.

  • Webtemplates - Disply Group Of Key Figures based on the selection criteria

    Hello,
    I have a requirement of displaying Kefigures based on the selection criteria in the browser.
    Assume that I have Query with the following set of key figures.
    Plan_KF in units CSE
    Actual_KF in units  CSE
    Difference in units CSE
    Plan_KF in units T3
    Actual_KF in units T3
    Difference in units T3
    Plan_KF in units PAK
    Actual_KF in units PAK
    Difference in units PAK
    1) I should have drop down box with values
    CSE
    T3
    PAK
    2) If user selects PAK then query should display only the key figures with units in PAK
    i.e.
    Plan_KF in units PAK
    Actual_KF in units PAK
    Difference in units PAK
    If user selects CSE the query should display only key figures
    Plan_KF in units CSE
    Actual_KF in units  CSE
    Difference in units CSE
    I tried using the DropDown Box - (not much usefull to select more than one Key Figure)
    and CheckBox web items - I have to do multiple selections (Not very much suitable if the Key figures are too many).
    I appreciate your timely help.
    system specifications:
    SAP_BW - 310
    Front-End - 6.20
    Advanced Thanks,
    Ramana

    Hi,
    One alternative would be to save two additional copies of the query (each with different units) and code your dropdown box with the RESET_DATA_PROVIDER command.
    So if your queries were:
    Z_QUERY_CSE
    Z_QUERY_T3
    Z_QUERY_PAK
    You would define the default unit (I'll assume CSE) in yoru web template, and code your dropdown box entries to switch the Data Provider (I'll asume DP1) to the appropriate query.
    The code behind "T3" in your dropdown box would be:
    <SAP_BW_URL DATA_PROVIDER='DP1' CMD='RESET_DATA_PROVIDER' INFOCUBE='Z_CUBE1' QUERY='Z_QUERY_T3'>
    http://help.sap.com/saphelp_nw04/helpdata/en/bd/43143c1ab8ff1ae10000000a11405a/frameset.htm
    Two things to look out for in this work-around:
    1) Number of queries increases by a factor of 3
    2) Performance implication in replacing the data provider with a new query.

  • InfoSet - Z tables need to be appeared on the selection criteria

    Hi ,
    My requirement is to have Z table fields in the selection criteria in an info set.
    Currently i have an info set which has only standard SAP fields for selection. I have couple of Z tables whose fields need to be included in the selection criteria. Based on the values selected, report has to be displayed. So i believe some code has to be added for it.
    Can you please tell me how to add Z Fields in the query.
    Thanks,
    Sarika.

    Hi Sarika,
    Again refer to the above link http://shafiq.us/sap/index.php?option=com_content&view=article&id=54:adhoc-query&catid=41:adhocquery&Itemid=61
    Then go to heading "Ad-hoc Queries (Tcode: SQ01)"
    Then see Step 6-b, this is where you specify which field will be displayed on selection screen. Follow the steps and I am sure you will be able to complete your requirement.

  • Key and Text in selection criteria depending on user

    Hello,
    I have strange situation and I have no idea how to fix this issue. I built the report in BEx and present it to the users. When they expand the selection criteria options (from first pop-up window of variables), they want to see both texts and keys. All of them set up the option "Key and Text" from settings, but some of them see descriptions, some of them see only keys given twice (what happens when there are no descriptions for masterdata). It is a big surprise for me and I am not able to fix it. Do you have any idea?
    Best Regards,
    Arelis

    Hello,
    I use BEx Analyzer. The patch level is the same.
    Masterdata texts are maintained of course. It it wouldn't - noone would see the texts.
    Arelis

  • Cannot acces to the selection criteria of a local query in web browser

    We cannot access to the selection criteria of a local query in using the web browser
    It seems this issue is already known, a local query created with BW release 7 cannot be used with the web browser.
    But this is a blocking issue in our case because we cannot create another local query in using BW 3.X and if we are using the analyser with RRMX and Excel we cannot displayed more of 65000 rows due to Analyser R3.X or R7.
    That's why we want to use the web browser because we can export the extraction from the intranet in MS Excel 2007 without limitation of rows.
    Thanks in advance to find a solution asap

    Hi Mustafa,
    I checked your requirement but it is not possible to display first value as default value for a drop down list because the list will be generate when you click the drop down list. You can use a 'list box' instead of drop down list.
    Regards
    Basheer

  • Invalid batch according to the selection criteria in batch determination

    Good day to all!
    I am trying to Post Goods Issue in my Delivery but I cannot proceed because of the Batch. When I am trying to use a Batch in the Picking tab of Delivery Create Overview, this message appears: Invalid batch <BATCH NAME>according to the selection criteria in batch determination. Do you have any idea how to resolve this? Thanks!

    you work with batches,
    and your system is customized to check if a manually entered batch fulfills the  criteria of your batch determination.
    This is not the case, hence you get the error message.
    So you have to decide whether your batch determinatiion selection criteria wrong, or if the customizing to check this criteria is unwanted, or if you better do not send this chosen batch to your customer as it may result in a return.

  • Suppress Printing of Selection Criteria page

    Hi Experts,
    Long shot - is there any way to suppress the printing of the first page summarising the Selection Criteria on printing Management Reports etc?
    Thanks

    You can set the preliminary page to a print layout, that is set (in Document Properties/Page Form / Printer ) to a non-printing printer.
    (There are five preliminary page in the layout designer document type list.)

Maybe you are looking for

  • Crystal Report error trying to retrieve data from a user table

    Hi, I'm making crystal report application with VS 2005 and I need to retrieve data form a user table. I'm using Pull method, I configure the connection and parameters by code. I think that the problem could be the @ that is used to identify these tab

  • Creation of Purchase Req with components in the case of subcontracting

    Hi Frndz, We would appreciate if anybody can help up us in this.We are trying to build a Z-functionality to create a purchase requisition for subcontracting material (with special procurement key=30).We are able to create PR with item category "L".Bu

  • Install Leopard on eMac (USB 2.0)

    Hi I would like to install Leopard on my eMac (USB 2.0) but it doesn't read dual layer DVDs so my Leopard disc gets spat back out by the eMac. Is there another method that will allow me to install Leopard on it?

  • How do I sort by date added while maintaining track order?

    Hello, I'm trying to do what I think is a simple function in ITunes. I'd like to sort by "date added" and have the tracks line up sequentially by track number. In other words, when in Itunes, I'd like to have (from top of the library to bottom) my mo

  • Oracle Text Query of abbreviated word / name

    I'm new to Oracle Text so please excuse the (probably) simple question. I want to be able to create a search that excludes (includes?) special characters and/or spaces between an abbreviated name. I'm not sure if it's possible but I would like to be