How to validate selection-screen field

Hi all,
  How to validate a selection-screen field defined as a select-options.for Ex i declared a selection-screen field select-options:s_matnr for mara-matnr.
   Then how to validate this field.

Hi,
write the below code in AT SELECTION-SCREN.
EX :
AT SELECTION-SCREEN.
*-- Validate the Selection screen data
  PERFORM VALIDATE_SELSCR_DATA.
WRITE THE below code in Form "VALIDATE_SELSCR_DATA".
IF  S_MATNR[] IS INITIAL.
*--MATNR is initial.
   message e000(MsgCLass) with 'matnr is empty'.
ELSE.
    SELECT MATNR
           INTO MARA-MATNR
           FROM MCHA
           UP TO 1 ROWS
           WHERE MATNR IN S_MATNR.
    ENDSELECT.
    IF SY-SUBRC <> 0.
      MESSAGE E000 WITH 'Invalid MATNR entered'.
    ENDIF.
  ENDIF.

Similar Messages

  • How to set selection screen field obligatory dymically

    hi expert,
    i have to make selection screen field obligatory while selecting a check box,i am using the following code can any one help me regards, thanks in advance.....
    PARAMETER:p_user TYPE adr6-smtp_addr ,
              p_check AS CHECKBOX user-command ucomm.
    at SELECTION-SCREEN.
    case sy-ucomm.
    when 'UCOMM'.
      PERFORM set_obligatory.
    ENDCASE.
    FORM set_obligatory .
      LOOP AT SCREEN.
      IF SCREEN-name = 'P_USER'.
      SCREEN-REQUIRED = 1.
       MODIFY SCREEN.
      ENDIF.
      ENDLOOP.
    ENDFORM.                    " set_obligatory

    Hi,
       The following is the sample code.
    PARAMETERS : p_barea TYPE ps0171-barea DEFAULT 'Z1' MODIF ID pb,
                                                " Benefit Area
                 p_imfil TYPE rlgrap-filename,  " Import file name
                 p_lock  TYPE ztx_int-int_name
                   DEFAULT 'ZHBNT06A_METLIFE_INBOUND' MODIF ID pb, " Lock
                p_test  TYPE c AS CHECKBOX,    " Test run
                 p_update type c as checkbox. " default 'X'
    SELECTION-SCREEN END OF BLOCK selb01.
                          AT SELECTION-SCREEN OUTPUT                     *
    AT SELECTION-SCREEN OUTPUT.
    Benefit Area field made display only field
      LOOP AT SCREEN.
        IF screen-group1 EQ 'PB'.
          CLEAR screen-input.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Regards
    Vick

  • 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

  • How to populate f4 values to standard pnp selection screen fields

    Hi Experts,
    my question is how to populate f4 values to standard pnp selection screen field. i am using LDB PNP for a report , it displays several fields with f4 values, i need to remove all the stadard f4 values and want to place my  f4 values in the selection screen

    Hi Venkat,
    To put ur own values in the F4 help of any field...all u have to do is.
    1st fetch all the records that u need to display in F4 help list...in one internal table.
    and then use the function module  'F4IF_INT_TABLE_VALUE_REQUEST'
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield =
    value_org =
    tables
    value_tab =
    return_tab =
    exceptions
    parameter_error = 1
    no_values_found = 2
    others = 3.
    where retfield is the field for which u need to give the F4 help.
    and valu_tab is the internal table in which u have the list of records to be displayed.
    this would do the work...
    I dont have the system in front of me...as soon as i have...will try to send a piece of code, to make ur work easy.
    Till then hope this helps u...all the best
    Regards,
    Radhika

  • How to assign maintenance view to a selection screen field in a program.

    Hi Experts,
    I have created a custom table. Now, I have a program where there is a selection screen field for example "Load". After entering a value in the selection screen, and press enter, the user must be redirected to the maintenance view of the custom table to modify the specifed record.
    Can anyone help me on how to do that?
    Thanks a lot for ur precious help.
    Regards,
    Aksh

    Hi,
    What is the need to search for a program.
    Use transaction SM30 or SE16 to create or maintain entries in the table.
    e.g. if the Maintenance view is created on table A, then Goto transaction SM30 or SE16 and give the table name as A and proceed. This will automatically take u to the maintenance view on tha table A.
    Regards,
    Himanshu

  • How to link a search help to a selection screen field

    Hi All,
    I am using field PKWRG from PA0017 table in selection screen. I need F4 help there as in Tcode PA30 . But this field does not have value table or check table. However, it has a search help attached 'TRV_PKWRG' .
    But, I donot know how to assign a search help to a selection screen field. Please help.
    Regards,
    Nibha

    Hello,
    Fetch all the data which from the table which you want to show in the search help and pass the value to the FM
    F4IF_INT_TABLE_VALUE_REQUEST and the selection-screen event must be
    at selection-screen on value request parameter or selection option variable.
    BCALV_TEST_FULLSCREEN
    BCALV_TEST_FULLSCREEN_CALLS
    BCALV_TEST_FULLSCREEN_PRINT
    BCALV_TEST_FULLSCREEN_STATUS
    BCALV_TEST_GRID
    BCALV_TEST_GRID_DRAG_DROP
    BCALV_TEST_GRID_EDITABLE
    BCALV_TEST_GRID_EVENTS
    BCALV_TEST_GRID_INDEX
    BCALV_TEST_GRID_TOOLBAR
    BCALV_TEST_HIERSEQ_LIST
    BCALV_TEST_LIST
    BCALV_TEST_LIST_PRINT
    BCALV_TEST_LIST_STATUS
    BCALV_VERIFY_DTYPES_D0100_F01
    BCSMENUF01
    BDLCOF10
    BDLDVI10
    BDLTREDF

  • How to put Mandatory option for selection screen fields in ABAP Queries

    Hi Experts
    Can anyone tell me how to put mandatory option for the selection screen fields in ABAP Queries.
    Manually I had written code in the At Selection Screen  option in infoset to display error message if that field is blank.
    But I need to display the selection fields with the tick mark (obligatory mark).
    How to do this?
    Appropriate answers will be awarded

    Hi
    For parameter option
    parameters : p_kunnr type kna1-kunnr  obligatory.
    For select option
    select-options: s_date for vbak-erdat obligatory.
    Plz rewards points ,
    Regards ,
    Ganesh.

  • How to change standard selection-screen fields

    hi i am kishore.
    i have requirement.
    i have to change selection-screen label purchase order to purchase docuement in request for quatation.
    pls suggest that how to change the standard selection screen field labels.

    Hi.
    This is possible.
    Just try out this way.Heres is an example. 
    TABLES: pernr.
    data: i_tab type standard table of RSSELTEXTS with header line.
    initialization.
    i_tab-name = 'PNPPERNR'.
    i_tab-kind = 'S'.
    i_tab-text = 'Employee ID'.
    append i_tab.
    CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
      EXPORTING
        program                           = 'ZESO_TEST'
      tables
        seltexts                          = i_tab
    EXCEPTIONS
      PROGRAM_NOT_FOUND                 = 1
      PROGRAM_CANNOT_BE_GENERATED       = 2
      OTHERS                            = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks and regards,
    Maheshwari.V

  • How to display the selection screen fields for selected checkboxes

    Hi all,
             I have 7 checkboxes, for each check box we have some seletion screen fields.if i select first check box,i want to display first slection screen fields only.
    and if we select more than one check box how to display the selection screen fields for selected check boxes,please help me this
    Thanks
    sriman.

    hi,
    Try this code
    report z_13317_sdn2.
    tables : mara, marc, dd03l.
    parameters : p_chk1 as checkbox user-command ABC,
                 p_chk2 as checkbox user-command PQR,
                 p_chk3 as checkbox user-command XYZ.
    select-options : s_matnr for mara-matnr modif id A,
                     s_ersda for mara-ersda modif id A,
                     s_werks for marc-werks modif id B,
                     s_lvorm for marc-lvorm modif id B,
                     s_tab for dd03l-tabname modif id C.
    data: v_chk1,
          v_chk2,
          v_chk3.
    at selection-screen output.
      loop at screen.
        if screen-group1 = 'A' or
           screen-group1 = 'B' or
           screen-group1 = 'C'.
            screen-input = 0.
           modify screen.
        endif.
      endloop.
      loop at screen.
        if v_chk1 = 'X'.
          if screen-group1 = 'A'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
        if v_chk2 = 'X'.
          if screen-group1 = 'B'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
        if v_chk3 = 'X'.
          if screen-group1 = 'C'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
      endloop.
    at selection-screen.
      if sy-ucomm = 'ABC'.
        if v_chk1 = ' '.
          v_chk1 = 'X'.
        else.
          v_chk1 = ' '.
        endif.
      endif.
      if sy-ucomm = 'PQR'.
        if v_chk2 = ' '.
          v_chk2 = 'X'.
        else.
          v_chk2 = ' '.
        endif.
      endif.
      if sy-ucomm = 'XYZ'.
        if v_chk3 = ' '.
          v_chk3 = 'X'.
        else.
          v_chk3 = ' '.
        endif.
      endif.
    Regards,
    Sailaja.

  • How position the cursor in selected screen field insted of defualt field

    Hi All,
    Can you pls let me know , how to position the cursor in selected selection-screen filed. My requirement is i have 3 selection-screen fields, By default cursor is positioned on field screen field, but i want the cursor to be positioned at 3rd screen field to enter input, i want to do this coz i am filling first 2 screen fields with default values, so i need to position the cursor at 3 rd screen filed. let me know if it is possible to achieve this.
    Thanks in advance.
    Regards
    Vishal

    You will need to point it to the LOW field.
    report zrich_0001.
    tables: reguh.
    select-options :
    s_bukrs for REGUH-ZBUKR default 'US10',
    s_laufd for REGUH-LAUFD default sy-datum,
    S_LAUFI FOR REGUH-LAUFI .
    at selection-screen output.
    <b>set cursor field 'S_LAUFI-LOW'.</b>
    Welcome to SDN!  PLease be sure to award points for helpful answer and mark you post as solved when solved completely.  Thanks.
    Regards,
    Rich Heilman

  • In Layout screen, how to validate  i/p field?

    hi,
    in Layout screen at se51, how to validate  i/p field?
    Regards,
    bb.
    Edited by: BBR on Jul 24, 2008 4:23 PM

    Hi
    if u want to validate the screen fields in Module pool programming  then u need to go for
    CHAIN & ENDCHAIN.
    Following is the example which guide u to use the chain and endchain:
    In the flow logic of ur screen before the module write this code
    CHAIN.
    FIELD TABNAME-FIELDNAME(OR SCREEN FIELD NAME).
    MODULE MODULENAME(OR FIELD NAME).
    ENDCHAIN.
    Double click on the module name and write ur validations.
    <removed_by_moderator>
    Regards
    Chandu
    Edited by: Julius Bussche on Aug 6, 2008 1:44 PM

  • 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

  • How to make the selection screen field names to apper as in logon language

    hai
    the selection screen field names should appear
    as that of logon language
    and <u>before that once i logon with a language
    it should pop up the (some)message in the logon language</u>.
    For the selection screen filednames to appear as that
    of the logon language whether i have to maintain the textelements for all screen fields in all possible languages or i have to write only in english and tell mentioning it to change

    In <b>SE38</b> --> Goto --> Translate.
    Choose target language, and start making the translation -;)
    Greetings,
    Blag.

  • How to assign F1 help to the selection screen fields

    Hi All,
    I have a requirement.I have to create a button named "HELP" at the side of Execute button in the selection screen.If I place my cursor in the selection screen field and I press that "HELP" button, I should get the Documentation help for that field.
    Please suggest me on this.
    Thanks in advance.
    Sreeharsha Singuru

    Hi sreeharsha,
    here a short example:
    TABLES: MARA.
    TABLES: SSCRFIELDS.
    TYPE-POOLS: ICON.
    DATA: CURSORFIELD(20).
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    SELECTION-SCREEN: END   OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECT-OPTIONS: S_MTART FOR MARA-MTART.
    SELECTION-SCREEN: END   OF LINE.
    SELECTION-SCREEN: SKIP 3.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: PUSHBUTTON (10) PB01 USER-COMMAND HELP.
    SELECTION-SCREEN: END   OF LINE.
    AT SELECTION-SCREEN.
      GET CURSOR FIELD CURSORFIELD.
      CASE SSCRFIELDS.
        WHEN 'HELP'.
          CASE CURSORFIELD.
            WHEN 'S_MATNR-LOW'.
              CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT' "Make your own Text
                EXPORTING
                  TITEL        = 'Information'
                  TEXTLINE1    = 'Information for field:'
                  TEXTLINE2    = 'S_MATNR-LOW'
                  START_COLUMN = 10
                  START_ROW    = 15.
            WHEN 'S_MTART-LOW'.
              CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'  "Make your own Text
                EXPORTING
                  TITEL        = 'Information'
                  TEXTLINE1    = 'Information for field:'
                  TEXTLINE2    = 'S_MTART-LOW'
                  START_COLUMN = 10
                  START_ROW    = 15.
          ENDCASE.
      ENDCASE.
    INITIALIZATION.
      CONCATENATE ICON_INFORMATION 'Help' INTO PB01.
    START-OF-SELECTION.
      SELECT * FROM MARA WHERE MATNR IN S_MATNR.
        WRITE: / MARA-MATNR.
      ENDSELECT.
    Hope it helps.
    Regards, Dieter

  • Validating a selection-screen field

    Hi all,
    I am Anil.can any body explains me how to validate a selection-screen field for the following scenario?
    I have customer nos ranging from 100-1000.among them i dont have any sales orders for the customers who are in between 150-250.I have sales order(VBELN) as select-options and Plant(WERKS) as Parameter on the selection-screen.I want to validate these fields without hardcaode.How can i do that?Please send me the complete code.
    I am not getting how to validate a field  which is declared as parameter?
    regards and thanks in advance.
    Anil.

    Make sure that u are validating against the header table.
    say eg if u wnat t validate matnr in marc, then do as below.
    SELECT-OPTIONS: s_matnr FOR  marc-matnr.                  "Material No
    AT SELECTION-SCREEN.
    *Validate material no details
      PERFORM validate_matno.
    FORM validate_matno.
    DATA: v_matnr LIEK mara-matnr.
      SELECT SINGLE matnr INTO v_matnr
             FROM <b>mara</b>
             WHERE matnr IN s_matnr.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.
    Dont select from marc.
    Hope this is clear.

Maybe you are looking for

  • How to display the proxy settings for a specific group of servers in an OU ?

    Hi, Can anyone here please assist me in how to display the value of Proxy server settings from the computers in a specific OU member ? $Computers = Get-ADComputer -Filter * -SearchBase "OU=Terminal Servers,OU=Servers,DC=domain,DC=com" | Where-Object

  • Regex to exclude a literal substring

    I am trying to match a set of strings using a regular expression, but I also want to exclude several literals. For example, I want to match all strings starting with root_obj.item_type., except those that end in the literal string emitter. To match i

  • After update xfree- xorg, no kde for regular user (Root o

    In a silly mood I decided to finally move to xorg on my perfectly working laptop (centrino+ intel i810 graphics). It was the only thing that was  not up to date on this machine.  This is where a lot of trouble began: In kdm ( yes the x server works o

  • What is the best way to switch off Daylight Saving Time?

    What is the best way to switch off Daylight Saving Time for a DST enabled timezone?

  • Adobe Reader Xl problem

    I downloaded Adobe Reader Xl and another program (Mcaffe Security Plus) also downloaded itself through the same site. I tried to uninstall Mcaffe through the control panal, but did not see it going through any type of uninstall process. I googled inf