Query on selection screen

Hi all,
Please give me the solutions to the following in selection screen:
1. In selection-screen there is one select-options and one parameter.
Now,if the select-opotions range is given 30 to 40 then, the parameter should be populated with 'A'.
If the select -options is given the value 50, then the value should be 'P'.
If the select-optons is given the value 65,then the value should be 'X'.
if the select-options is given the value 87, then the value should be 'N'.
2) In the selection - screeen there is one check box and select-options.
By default the check-box will be deselected and select-options will be defaulted with system date.
Now, when the checkbox is selected the select-options should be empty.
And again, when the checkbox is deselected then again the select-optons should be populated with system date.
Please let me know solutions to the above asap.
All points will be awarded.
Thanking you in advance.
Regards,
A.Srinivas

Hi Srinu,
Try below code. I have used matnr in select-options. Change it according to your data element.
TABLES: mara.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
PARAMETERS: p_c TYPE c.
PARAMETERS: p_chk AS CHECKBOX USER-COMMAND chk.
SELECT-OPTIONS: s_date FOR sy-datum DEFAULT sy-datum.
AT SELECTION-SCREEN.
  IF p_chk = 'X'.
    CLEAR s_date[].
  ELSE.
    s_date-low = sy-datum.
    APPEND s_date.
  ENDIF.
AT SELECTION-SCREEN OUTPUT.
  IF s_date[] IS NOT INITIAL.
    p_chk = ''.
  ENDIF.
  LOOP AT s_matnr.
    IF s_matnr-low = '000000000000000030' AND s_matnr-high = '000000000000000040'.
      p_c = 'A'.
      exit.
    ENDIF.
    CASE s_matnr-low.
      WHEN '000000000000000050'.
        p_c = 'P'.
      WHEN '000000000000000065'.
        p_c = 'X'.
      WHEN '000000000000000087'.
        p_c = 'N'.
    ENDCASE.
  ENDLOOP.

Similar Messages

  • Sap query report-selection screen modification

    Hi
    I  have created a SAP query report using the logical database KDF ,the selection screen was created automatically.For vendor report open item and Cleared item Push button would be there in FBL1N but here it only displays Open key date,clearing dates.The open key date is mandatory to give though i give clearing dates as i need vendor cleared items.
    Is ther way to change the selection screen to get the option open item and cleared item push button as in FBL1N.
    This is because i was filtering a vendor only for particular doc type only for clearing items but report takes open item too though i meantioned clearing date rate.How to modify the selection screen in sap query report when Logicaldatabase is selcted.

    I need to get only the cleared items.I donot need open items.Then if go for BSIK is it wrong.Should go only for BSAK.
    I couldnt find the table BSAK in logical database KDF.
    Edited by: mysap query on Mar 18, 2009 3:15 PM
    Edited by: mysap query on Mar 18, 2009 3:15 PM

  • Infoset query ('At Selection-Screen') - Urgent

    Hi All,
    The below code for selection criteria 'At Selection-Screen' for an infoset-query works ok, but i find 2 problems, can someone help.
    1. When user presses F4, i wanted the output to display
       SG Singapore
       IN   India
       But at the moment it just displays
       SG
       IN
    2. If the user enters any other value apart from the above 2 i do not want the query to execute, instead show something like enter a valid value. But at the moment if i enter another country code manually just to test eg: US, the query runs with this selection which i do not want.
    Hope my problem is clear, await inputs.
    Code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR VEN_CTY-LOW.
            IT_LAND-VEN_CTY = 'SG'.
            IT_LAND-LTEXT   = 'Singapore'.
              APPEND IT_LAND.
            IT_LAND-VEN_CTY = 'IN'.
            IT_LAND-LTEXT   = 'India'.
              APPEND IT_LAND.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'VEN_CTY'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_LAND
          RETURN_TAB = IT_RETURN
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2.
    IF SY-SUBRC = 0.
        READ TABLE IT_LAND INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO VEN_CTY-LOW.
    ENDIF.

    Hi vivek,
    for the 2nd problem,
    create a range for ingapor and india say r_range.
    and
    r_range will have two values say india, singapore.
    loop at VEN_CTY.
    if ven_cty not in r_range.
    display error message.
    exit.
    endloop.
    try this and let me know.
    reward if helpful.
    thanks .
    ranya

  • Query views - selection screen fields double

    Hi expects,
    BW 3.5 SP13.
    Do you know why I have double fields in WEB report selection screen ? example Month/year ?
    In WEB properties I flag 'Display same variables only once'.
    I have a WEB report with one table based on a query and with two charts based on query views from the query. Some fields are mandatory in selection screen Month/year.
    Br,
    Ole Paludan

    Hi,
    It's query views based on same query also use in WEB report, so variables are the same.
    Query view Purpose: to get fewer key figures to charts - but still by query show all key figures in table.
    BR,
    Ole

  • Query regarding selection screen

    Hi experts,
    I have a requirement that once I get my output on a selection screen, suppose it has just 1 row and 4 columns. If I click on each of these 4 columns, a new transaction/report etc. needs to be called. How can I achieve this functionality?
    Thanks,
    Ajay.

    Hi,
    Say you have an internal table with fields as:
    VBELN (sales order)
    POSNR (sales order line item)
    WERKS (plant)
    MATNR (matnr)
    And you write all these fields on output screen using reporting and when you click on any column field then a particular transaction/report should be called, then follow the below mentioned logic:-
    DATA : BEGIN OF it_final OCCURS 0,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             werks TYPE vbap-werks,
             matnr TYPE vbap-matnr,
           END OF it_final.
    DATA : fldname(25) TYPE c,
           fldvalue(25) TYPE c.
    START-OF-SELECTION.
      "select query into it_final internal table
    AT LINE-SELECTION.
      GET CURSOR FIELD fldname VALUE fldvalue.
      CASE fldname.
        WHEN 'IT_FINAL-VBELN'.
          WRITE : / fldvalue.
          "code to call transaction/report
        WHEN 'IT_FINAL-POSNR'.
          WRITE : / fldvalue.
          "code to call transaction/report
        WHEN 'IT_FINAL-WERKS'.
          WRITE : / fldvalue.
          "code to call transaction/report
        WHEN 'IT_FINAL-MATNR'.
          WRITE : / fldvalue.
          "code to call transaction/report
      ENDCASE.
    END-OF-SELECTION.
      ULINE.
      FORMAT HOTSPOT.
      LOOP AT it_final.
        WRITE : /1 it_final-vbeln, 10 it_final-posnr, 20 it_final-werks, 30 it_final-matnr.
        HIDE : it_final-vbeln, it_final-posnr, it_final-werks, it_final-matnr.
      ENDLOOP.
      ULINE.
    Now to call a transaction user:-
    SET PARAMETER ID '<param_id>' FIELD '<field_value>'.
    CALL TRANSACTION '<t_code>' AND SKIP FIRST SCREEN.
    To call a report use:-
    SUBMIT <report_name> WITH <parameter_name1> = <field_value1>
                         WITH <parameter_name2> = <field_value2>
                         "and so on use parameters
                         AND RETURN.
    <paramater_name> refer to the parameter of the called report <report_name>
    and <field_value> refer to value for the parameter to be passed.
    Hope this helps you.
    Regards,
    Tarun

  • SAP Query and selection screen fields

    Hi,
    I am currently modifying a Query. I have added a new selection field. The fieldname for this selection field has been autogenerated within the query and I have pasted a bit in here:
    SELECT-OPTIONS SP$00015 FOR ZERROR_FLG LOWER CASE.
    SELECT-OPTIONS SP$00022 FOR KNA1-ERDAT.
    SELECT-OPTIONS SP$00023 FOR KNA1-ERNAM.
    SELECT-OPTIONS SP$00027 FOR ZLOEVM LOWER CASE.
    SELECT-OPTIONS SP$00030 FOR ZPARTNERNO
    NO INTERVALS NO-EXTENSION.
    I relation to this select -option, I want to execute a few lines of code that only is executed if the user has filled in a value in teh ZPARTNERNO field. However, no matter if I use the field name ZPARTNERNO or SP$00030 it has no effect.
    Any good ideas ?

    HI,
    In the AT SELECTIOn-SCREEN event, you can write the code
    IF not <b>SP$00030[]</b> is initial.
    write the code which you want to execute before the output
    ENDIF.
    if you want in START-OF-SELECTION>
    IF not <b>SP$00030[]</b> is initial.
    write the code which you want to execute before the output
    ENDIF
    Regards
    Sudheer

  • SAP Query DB - Selection screen

    Hi!
    I am workin with a DB for SAP Query.  I tried it and there is just one problem: In the report selection screen there is a field (from the DB) that is mandatory. I wanted to exclude that field or at least to make it not mandatory. Is it possible? How?
    Thank you

    Hi,
    Go to SQ01. Input your Query. Press change button. Press Basic list. In the left side you will see check box for list fields and selection fields. Remove the check box for whatever field you dont wan in the selection screen.
    Thanks,
    Senthil

  • How to position a check box in an ABAP query's selection screen?

    Hi Experts,
    I am working on SAP queries and for that I have created an infoset. There was a requirement to have a checkbox at selection screen, which we can obtain by Infoset-> Extras->"Selections" tab -> create a parameter as a checkbox.
    However, it is appearing at the first place among all the selection screen elements which are defined in the infoset.
    Is there any way to have it positioned as per the requirement? (We have checked the option of "sequence on selection screen" provided while creating the checkbox, however, it does not work for us).
    Kindly have a look at the attached screen shots.
    Here , in the file, “Test Par” is the selection text for the parameter declared.
    Thanks
    Mohit

    I think I have it 90%there. I have no error now, it edits a
    record fine, if you add the checkbox to the record it adds it, and
    if you take it away, it does that. BUT now it will not add a new
    record.
    This is my code now for the update / insert
    <cfif not IsDefined("FORM.admin")>
    <cfset IsAdmin= 0>
    <cfelse>
    <cfset IsAdmin= 1>
    </cfif>
    <cfif isDefined("Form.RecordID")>
    <cfquery datasource="#APPLICATION.dataSource#">
    UPDATE user
    SET user.Fname=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.Fname#">,
    user.Lname=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.Lname#">,
    user.userName=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.userName#">,
    user.password=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.password#">,
    user.email=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.email#">,
    user.admin =<cfqueryparam value="#IsAdmin#"
    CFSQLType="CF_SQL_INTEGER">
    WHERE ID =<cfqueryparam value="#form.RecordID#"
    cfsqlType="CF_SQL_INTEGER">
    </cfquery>
    <cflocation url="indexUser.cfm?RecordID=#Form.RecordID#"
    addtoken="no">
    <cfelse>
    <cfquery result="GetNewRecord"
    datasource="#APPLICATION.dataSource#" dbtype="ODBC">
    INSERT INTO user
    (Fname, Lname, userName, password, email, admin)
    VALUES (<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.Fname#">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.Lname#">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.userName#">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.password#">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.email#">,
    <cfqueryparam value="#IsAdmin#"
    CFSQLType="CF_SQL_INTEGER">)
    </cfquery>
    <cflocation url="indexUser.cfm">
    </cfif>
    Is there a better way to write this so it will work? I have
    everything else working including the checkbox showing checked if
    it is checked in the db, I believe this is my last hang up on a
    checkbox.
    Any ideas?

  • Query in Selection screen!!!!

    Hi all,
            I have a requirement which requires me to validate the data entered in the selection screen when the data entered in the selection screen is saved as a variant.
    That is, when the save button in the selection screen is clicked, then the data entered in the selection screen should be validated.
    Can anyone please tell me how to achive the above.
    Regards,
    Vijay

    Hi Bala,
      As also said by others do it like this way as the example below:
    Parameters:
      p_kunnr type kna1-kunnr.
    Data:
      lw_kunnr type kna1-kunnr.
    At Selection-screen.
      Case sy-ucomm.
        When 'SPOS'.
          Select Single kunnr
            from kna1
            into lw_kunnr
           where kunnr eq p_kunnr.
          If sy-subrc ne 0.
            Message 'enter correct customer number' type 'E'.
          Endif.
      Endcase.
    With luck,
    Pritam.

  • Small Query in Selection Screen and Screen.

    Hello Guys...
    I have Created a program using Selection-Screen 1000. and Screen 2000.
    At Selection-Screen I have written code
    Start-of-selection.
      ok_code = sy-ucomm.
      CASE ok_code.
        WHEN 'BACK'.
            LEAVE PROGRAM.
    end case.
    and At the user-command of Screen 2000.
    I have written Follow code.
    ok_code = sy-ucomm.
      CASE ok_code.
        WHEN 'BACK'.
            LEAVE PROGRAM.
        when 'CANCEL'.
           LEAVE PROGRAM.
        when 'ADD'.
           Perform Add_New_Row.
        when 'REMOVE'.
           Perform DELETE_Row.
        when 'SAVE'.
           Perform SAVE_DATA.
        when 'EXIT'.
           LEAVE PROGRAM.
        endcase.
    My Problem is that I am not able to come out from program through back button..
    Follow is like that..
    at Selection Screen user provide some input on that basis screen 2000 Call.
    but when i press back button on screen 2000 Selection screen 1000 appear.
    and my Problem is that when i press back button on selection-screen on 1000.
    it's goes to screen 2000.
    I know, it's little thing I am missing, Let me know ..what was that..
    Cheers......
    Swati...

    Hello Guys...
    Previous code I have given is modify by this but same problem..
    I have dubug the program and trace it. it's will not goes on Selection Screen
    on Each back button the event occurs which is user-command 2000.
    I have Created a program using Selection-Screen 1000. and Screen 2000.
    At Selection-Screen I have written code
    Start-of-selection.
    ok_code = sy-ucomm.
    CASE ok_code.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    end case.
    and At the user-command of Screen 2000.
    I have written Follow code.
    ok_code = sy-ucomm.
    CASE ok_code.
    WHEN 'BACK'.
          CALL SELECTION-SCREEN '1000'.
            EXIT.
    when 'CANCEL'.
    LEAVE PROGRAM.
    when 'ADD'.
    Perform Add_New_Row.
    when 'REMOVE'.
    Perform DELETE_Row.
    when 'SAVE'.
    Perform SAVE_DATA.
    when 'EXIT'.
    LEAVE PROGRAM.
    endcase.
    My Problem is that I am not able to come out from program through back button..
    Follow is like that..
    at Selection Screen user provide some input on that basis screen 2000 Call.
    but when i press back button on screen 2000 Selection screen 1000 appear.
    and my Problem is that when i press back button on selection-screen on 1000.
    it's goes to screen 2000.
    I know, it's little thing I am missing, Let me know ..what was that..
    Cheers......
    Swati...

  • Query regarding selection screen layout

    i want to knw how to put a blank line / how to skip a line in selection screen...
    like
    in Block 1
    Presentn filepath
    Application filepath
    (1 line skipped)
    Log filepath
    end of block 1

    Hi ,
    use <b>SELECTION-SCREEN SKIP 2</b>. statement.If u want to skip two lines .
    check this code.
    selection-screen begin of block B1 with frame title text-d01.
    selection-screen SKIP 3.
    parameters : p_lifnr type lifnr.
    parameters : p_kunnr type kunnr.
    parameters : p_count(2) type n.
    selection-screen SKIP 3.
    selection-screen end of block B1.
    regards
    reena

  • Not getting BI query variable selection screen  for few test users

    Hi,
    i am having problem when i am executing the reports. i am not getting variable screen for the test users ID's. but i am getting the screen when when 0BI_ALL authorization selected.
    i want role based authorization, and not complete authorization.
    the parameters in su01 are scl(X) and wlc(X   X  XX   X)
    Thanks,

    Can you please check into Infoobject Maintenance screen in Bex Tab i.e. Query Execution Filter Value Selection. assign "Values from Masterdata Table".
    Try again and let me know.
    Nagesh Ganisetti.

  • Analysis Authorization : Selection screen not appearing for query

    Hi,
    I am facing an issue with analysis authorization. I have created the new roles and assigned to the users. For one user when I am executing the query, the selection screen is not coming up and it shows error message to specify the variables. Whereas its running for all other users.
    In S_RS_COMP I have selected Type of a reporting component as Query View, Query & Template structure. I also tried adding Variable in this field but that also did not help.
    Please let me know if you have faced similar issue.
    Regards,
    Manish

    Hi,
    Go to your query desinger opend your query and select your variable in that you have see first "Ready Input Query" Check box is selected or not. It's not selected you can select that check box.
    Your problem will be sloved.
    Thanks & Regards,
    venkat.

  • Multiprovider query selection screen

    HI,
    I have a query built on multiprovider. Multiprovider has two underlying infocubes.
    At selection screen user wants to input only one field , say field 'A'. Field 'A' exists in one infocube only
    . when I restrict query on selection screen with  field A , only the records of one infocube is displayed.
    What should I do to get records of other infocube also?
    Regards,
    Rahul Sindhwani

    Hi,
    When there is no field at 2nd cube then how you get from.
    You need to check exactly what you need.
    If you enter selection on a field which is form two cubes then only you will get data from two cubes other wise you get data from one cube only.
    to test it use t code - LISTCUBE and check the results with same selections(A).
    you may get data from 1 cube only.
    Thanks

  • Selection Screen pop up issue - with jump query RRI

    Hi Experts,
    I am facing one issue regarding Jump Query(RRI) functionality.
    I have one query and also one drill down query.
    I need to jump from the first query to the drill down query.
    To achieve this , I have added the first query as sender in RSBBS T-Code and added the drill down query as Receiver.
    I have also done the variable assignment from the Assignment Details tab.
    Now the Jump functionality is working.
    But , whenever I am jumping to the receiver query , The selection screen pop up is appearing.
    I don't want this selection screen to appear during jump.
    Please help me in this regard.
    Thanks,
    Biswarup

    Hi ,
    For testing purpose , I have used a single query as sender as well as receiver query.
    So , the characteristics set is same.
    The query is a simple query, with only one input variable.
    and I have assigned it, from variable assignment.
    But still the selection screen pop up is coming , when trying to jump.
    Please suggest.
    Regards,
    Biswarup

Maybe you are looking for

  • Write arrays into a text file in different columns at different times

    Hi,           I have a problem write data into a text file. I want to write 4 1D arrays into a text file. The problem is that I need to write it at different time and in different column (in other word, not only append the arrays). Do you have an ide

  • Edited clips will not open with other apps

    After editing video clips using Adobe Premiere Elements, clips will not open with other apps (like VLC, Media Player, etc...)

  • Turning Wireless apple keyboard off.

    This might be a very simple thing to achieve, turning the wireless keyboard off, but I don't seem to find information on how to do it. I have looked on instructions book, which recommends to turn it off when not using it and in old post with no succe

  • How to maintain a customer for one sales office

    Dear All, One customer was assigned to more than 1 sales office. Due to this collection report which customized based on sales office was showing wrong data. We need to maintain only one sales office for one customer. If we change in master data all

  • Page thumbnails are not number correclty

    I have 123 pages pdf files. The original pages on the paper are mark page 2, 4 , 6 (evenly). But my Page thumbnails are not number correclty they go from 30 -31, 1-5, whole mess. But I can view my pages in order (by 2, 4, and so on). is there a way I