Selection screen fields in SAP Query

HI friends,
I have to make the seletion screen field as mandatory in SAP-Query.
Please let me know the procedure to make field as mandatory or Let me know how to validate the selection-screen field in Query.
Thanks in Advance,
Ravi

Go to SQ02
Select your Infoset-->Change
On next Screen.
Select GoTo->Code->Initialization.
Write there code
LOOP AT SCREEN.
  IF screen-name EQ 'SP$00004'.
       screen-required = 1.
       MODIFY SCREEN.
  ENDIF.
ENDLOOP.

Similar Messages

  • Default values on selection screen of a SAP Query

    Hello,
    I have a selection screen which is designed in SAP Query.
    How to get default values for the fields on selection screen.
    Regards,
    Satya

    hi....
    you can go with following type of code..
    ITS A TESTED CODE AND WILL SERVE YOUR PURPOSE
    tables: sflight.
    data: t_table like standard table of sflight.
    select-options:
       s_carrid for sflight-carrid.
    parameters:
      p_fldate type d.
    initialization.
    p_fldate = sy-datum - 7.
    s_carrid-sign = 'I'.
    s_carrid-option = 'BT'.
    s_carrid-low = 'AA'.
    s_carrid-high = 'LH'.
    append s_carrid.
    start-of-selection.
    select carrid
              connid
              fldate
    from   sflight
    into corresponding fields of  table t_table
    where carrid in s_carrid
    and fldate < p_fldate.

  • Mandatory selection input field in SAP query

    Can anyone please let me know how we can make a selection field input mandatory in SAP query,If we can?

    we can make a selection field input mandatory in SAP query by giving the option *OBLIGATORY * with the SELECT-OPTIONS for the required field.
    This addition defines the input field of the parameter on the selection screen as a required field. If no entry is made in this field, the user cannot use the Execute function (F8) to exit the selection screen, they can only use the functions Back, Exit, or Cancel.
    Reward Points if useful.

  • Get selection screen parameters from sap query

    Hello. I use SAP Query Reporting, so I added a report assignment for detailing (sq01 ->  Change button -> Goto -> Report Assignment -> Insert row -> Other type row -> Abap Report Program)
    and put there ABAP program.
    When I run query and press CtrlShiftF1  (or double click) It calls my abap program.
    So the question is: how to get selection screen parameters in my program ?
    to be more precise I want to get date parameter (begda, endda)
    Thanks a lot.

    There is a Z query which I can see in sq01. I set reporting period and run the query; when I run it, it gives me the employee list.
    So I wrote the abap report to get an employee details, customized query as I mentioned above.
    The query calls my report and I need to get parameters.
    SELECTION-SCREEN BEGIN OF BLOCK frm1 WITH FRAME TITLE text-001.
    PARAMETER :  p_pernr LIKE p0001-pernr OBLIGATORY MATCHCODE OBJECT prem.
    PARAMETER : p_date LIKE sy-datum.
    SELECTION-SCREEN END OF BLOCK frm1.
    Parameter
    p_pernr
    passes normal. ALV Query contains it, but I'd like to get one more parameter from selection screen of the query and don't know how to get it.

  • F4 search-help in infoset query selection-screen fields

    Hi all,
    I created an infoset, and it's corresponding query, and now I need to associate F4 search-help in two of the selection-screen fields. Since they don't have any reference field associated (they are SAP standard table fields), there are no possible values available to select.
    How can I do this?
    I have already tried to use the "AT SELECTION-SCREEN OUTPUT" in the infoset, but I'm not able to do that. When I try to use the select-options generated by the query (SP$00013 and SP$00014) I have a syntax error with "Field not known".
    Can you help me? I never done this before, so I really don't have a guess.
    Thanks in advance.
    Beste regards,
    Sónia Gonçalves

    Hi all,
    I have found thread  that helped me a lot in this issue.
    I just have one more doubt: I created the selection criterion and I can already see it in the query selection-screen, but it's appearing in the top of the selection-screen, in a different area called "General data selections".
    Isn't it possible to include it in the "Report-specific selctions"?
    Thanks in advance.
    Best regards,
    Sónia Gonçalves

  • Selection screen fields in query

    experts
    i have created a query with 5 selection screen fields, now i want to change the order of the fields in the selection screen.
    Earlier:
    Material
    order
    delivery
    qty
    amount
    Now i want
    order
    material
    delivery
    amount qty
    In sq01 i tried but there are possibility to change the output fields but not selection screen field sequence.

    Hi,
    In SQ01, enter the query name and click on the change button.
    Next click on the next screen (top left) arrow button until you reach Change query xxxxx: Selections.
    Here under the column No  enter the number like 1,2,3, 4 ... against the checked fields that want to see in order. Then save the query.
    Regards,

  • Order of the selection fields in SAP QUERY

    Hello All,
    How can we set the order of the selection fields in SAP QUERY!
    Regards!
    Ashish

    Hi,
    You can go into infoset and change the order.
    Or you can select 1 by 1 in the same order, you want to display.
    Below is the link which might help you:
    help.sap.com/printdocu/core/Print46c/EN/data/.../BCSRVQUE.pdf
    Please revert, if needed more clarifications
    Regards,
    Yashwin

  • Regarding Selection-Screen Field Display

    Hi All,
    I have issues with Selection-Screen field display.
    The Actual issue is i had declared a selection screen field as: <b>s_exgen FOR embk-exgen</b>.
    <b>EMBK-EXGEN</b> is actually <b>20</b> Char length field.
    But in output display it is being shown as <b>18</b> Char field though i can type in all <b>20</b> characters.
    But <b>display</b> restricted to <b>18</b> Characters only.
    Can anybody give me the solution for the same!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hi,
    You can decrease the visible length of the field but you can not increase more than database field length. check SAP help on this :
    select-options: s_exgen FOR embk-exgen VISIBLE LENGTH 5.
    ... VISIBLE LENGTH vlen
    Effect
    This addition allows you to shorten the visible length of the corresponding screen field on the selection screen to vlen.
    Variant 2
    SELECT-OPTIONS sel FOR (f).
    Additions as in variant 1.
    Effect
    In this variant, (f) must be a field containing the name of the actual reference field at runtime. The system creates the LOW and HIGH fields as character fields with length 45. However, their appearance on the selection <b>screen is inherited from the reference field whose name is contained in field f at runtime.</b>
    Regards
    Appana

  • How to schedule the background job using current selection screen field val

    Hello Friends,
    How to schedule the background job using current selection screen field values.
    after completion of the job the spool should be sent as a mail to SAP Inbox.
    Is there any way to create the variant dynamically by reading the current selection screen values.
    Thanks,
    Ravi

    Hi,
    To get the variant details you can use teh following FM.
    'RS_VARIANT_CONTENTS'.
    Regards,
    Ankur Parab

  • Selection screen fields are not getting detected in an infoset in code

    Hi All,
    I am developing an infoset query using logical database 'PNPCE'. I am facing problem while writing a validation on selection screen fields on an infoset query at infoset code level.
    The fields that are under program specific selection are determined at runtime with variables viz. SP$00001, SP$00002 etc. There are actually select options on selection screen of an infoset query.
    So I cannot write a direct  code on these fields as they do not exist at infoset level and hence cannot be detected.
    I want to put down a validation that if user does not select anything on selection-screen and executes the query, then he should get a pop-up message 'Narrow down your search...' and he should go back to selection screen again.
    Is there any alternative way to achieve this?

    hi,
    Your Screen resolution is more in the system that's why while creating it was fine and while executing it was gone after the next field.
    so you better create a frame and place that inside it or you can change cols size  in the properties about the columns you want

  • Selection screen fields order in report painter report..

    hi experts,
    i have a  problem with selection screen fields order in report painter report.
    Actually in report painter report selection screen order is different compare to report writer report selection screen.
    how should i get the same selection screen fields order For  Report painter  report compare to Report Writer report ?
    For example, Report Writer selection screen order is:
      ledger:
      company code:
      period:
      current fiscal year:
      previous fiscal yer:
      previous quarter end period:
    where as Report Painter selection screen order is:
      ledger:
      previous fis year:
      current fis year:
      company code:
      period:
      previous quarter end period:
    please help me regarding with this.
    Thanks and Regards,
      NAGARJUNA.

    hi nagarjun,
    Go to Sq01, select the query and goto to change mode.go to the next screens till u reach Selection fields. Here u enter the NO field in the sequence which u want ot appear in the selection screen and it is done. Save and execute.
    Ex:
    Selection fields No
    Exclude Cancelled Lots 5
    Material number 1
    Plant 2
    Material type 3
    Inspection Lot Origin 4
    Regards,
    Lokesh

  • Multiple Value in additional fields using SAP Query

    HI All,
    I have a question related additional field in SAP Query. I tried to create report about PR and PO using SAP Query. Since one PR can be converted to multiple PO, I decided to create additional field
    po_1
    to display the value of PO that related to the PR. But I meet problem when I want to show several PO number in additional field
    po_1
    , I couldn't look the way to solve this problem. Can anybody help me? Just for info, I assign value to additional field
    po_1
    in record processing part.
    Thanks....

    HI,
    IN SQ02, IF table is already in JOIN, just click on the PLUS sign to expand the strcture.
    All the field showing Plus sign in the strcture are selected in your query and with MINUS sing are no selected.
    So you have to just click on the MINUS sign for the field you want to use through table field.
    Generate the query and execute thriugh SQ01.
    If you want to add some other field which is not a part of JOIN,
    then click on EXTRAS Button shown in the MENU option.
    Click on Create button and system will ask abt the additional field.
    Regds,
    Anil

  • Hiding selection screen fields upon clicking a button

    Hi .
    I have a requirement like we need to hide and bring back the selection screen fields upon clicking a button( Expand and collapse in the same button) .
    in ABAP Query,we can maintain this,  for the variant we created.
    We need this functionality on the selection-screen presently.
    How to achieve this in the selection -screen?
    Valuale pointers are desparately needful.
    Regards,
    SSR.

    Hi,
    SELECTION SECREEN (P_) Parameter
    (S_) Select Options
    SELECTION-SCREEN : BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001,
    BEGIN OF LINE,
    COMMENT (26) C1 MODIF ID XYZ.
    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MODIF ID XYZ NO-EXTENSION .
    SELECTION-SCREEN : END OF LINE,
    BEGIN OF LINE,
    COMMENT (26) C2 MODIF ID XYZ.
    SELECT-OPTIONS : S_MATKL FOR MARA-MATKL MODIF ID XYZ NO-EXTENSION .
    SELECTION-SCREEN : END OF LINE.
    PARAMETERS : R_MATNR RADIOBUTTON GROUP RAD1 DEFAULT 'X'
    MODIF ID ABC USER-COMMAND MAT,
    R_MATKL RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN END OF BLOCK blk1.
    INITIALIZATION.
    C1 = 'Product Code'.
    c2 = 'Product Group'.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF SCREEN-NAME0(7) = 'S_MATNR' OR SCREEN-NAME0(7) = 'S_MATKL'.
    SCREEN-INPUT = '0'.
    SCREEN-INVISIBLE = '1'.
    ENDIF.
    CASE SCREEN-NAME+0(7).
    WHEN 'S_MATNR'.
    IF R_MATNR = 'X'.
    SCREEN-INPUT = '1'.
    SCREEN-INVISIBLE = '0'.
    ENDIF.
    WHEN 'S_MATKL'.
    IF R_MATKL = 'X'..
    SCREEN-INPUT = '1'.
    SCREEN-INVISIBLE = '0'.
    ENDIF.
    ENDCASE.
    IF R_MATNR = 'X'.
    IF SCREEN-NAME = 'C1'.
    C1 = 'Product code'.
    C2 = SPACE.
    ENDIF.
    ENDIF.
    IF R_MATKL = 'X'.
    IF SCREEN-NAME = 'C2'.
    C2 = 'Product Group'.
    C1 = SPACE.
    ENDIF.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    Hope it helps.
    best regards,
    Nagaraj Kalbavi

  • Difference between At selection-screen  and At selection-screen field

    I need to know the difference between
    Difference between At selection-screen  and At selection-screen field
    Regards
    Shashi

    Hi,
    AT SELECTION-SCREEN is the event triggered in the PAI of the selection screen.
    AT SELECTION-SCREEN on field field_name is the event specific to the field and is triggered when u press enter in that field.
    AT SELECTION-SCREEN selscreen_event.
    Effect
    This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
    Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
    AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
    SELECTION-SCREEN FIELD SELECTION
    FOR {NODE|TABLE} node [ID id].
    Effect
    This statement defines a node node in the structure of the logical database for field selection. If a node belongs to type T, you can use the TABLE addition instead of NODE. The statement cannot be used for type C nodes. .
    If a node is defined for field selection, you can use an executable program linked to the logical database in the GET statement to control which fields in the node are to be read by the logical database. If you use the function module LDB_PROCESS, the FIELD_SELECTION parameter must be specified accordingly.
    for more details check this link...
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
    Regards,
    Priyanka.

  • How to fill internal table with selection screen field.

    Hi all,
    i am new to sap . pls tell me how to fill internal table with selection screen field.

    Hi,
    Please see the example below:-
    I have used both select-options and parameter on the selection-screen.
    Understand the same.
    * type declaration
    TYPES: BEGIN OF t_matnr,
            matnr TYPE matnr,
           END OF t_matnr,
           BEGIN OF t_vbeln,
             vbeln TYPE vbeln,
           END OF t_vbeln.
    * internal table declaration
    DATA : it_mara  TYPE STANDARD TABLE OF t_matnr,
           it_vbeln TYPE STANDARD TABLE OF t_vbeln.
    * workarea declaration
    DATA : wa_mara  TYPE t_matnr,
           wa_vbeln TYPE t_vbeln.
    * selection-screen field
    SELECTION-SCREEN: BEGIN OF BLOCK b1.
    PARAMETERS : p_matnr TYPE matnr.
    SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
    * I am adding parameter value to my internal table
      wa_mara-matnr = p_matnr.
      APPEND wa_mara TO it_mara.
    * I am adding select-options value to an internal table
      LOOP AT s_vbeln.
        wa_vbeln-vbeln =  s_vbeln-low.
        APPEND  wa_vbeln TO  it_vbeln.
      ENDLOOP.
    Regards,
    Ankur Parab

Maybe you are looking for