How to validate input's in selection-screen

Hi ,
can any one how to validate input's field's  in selection-screen and each field has diffirent tables and what is the table name which has all the validating fields??
Thank's in advance..

hi,
  You can use validate selct-options using select query by obtaining the realtionship from table .Using the selection-screen events You can write code for validation as follows.
tables:
  kna1.                                " General Customer data
*"Selection screen elements............................................
select-options:
  s_kunnr for kna1-kunnr.              " Customer number
*"Data declarations...................................................
Data declaration of the structure to hold kna1 details              *
data:
  begin of fs_customer,
    kunnr type kna1-kunnr,             " Customer number
    adrnr type kna1-adrnr,             " Address
    anred type kna1-anred,             " Title
    erdat type kna1-erdat,             " Created on
    ernam type kna1-ernam,             " Created by
  end of fs_customer.
*"Constants declarations..............................................
constants
  w_path type string value 'D:\DOWNLOAD\CUSTOMER'.
Internal table to hold customer details                             *
data:
  t_customer like
    standard table
          of fs_customer.
                      AT SELECTION SCREEN OUTPUT                    *
at selection-screen.
  perform retrieve.
Form  RETRIEVE                                                     *
This subroutine retrieve customer data from table kna1             *
There are no interface parameters to be passed to this subroutine. *
form retrieve .
  select kunnr                         " Customer number
         adrnr                         " Address
         anred                         " Title
         erdat                         " Created on
         ernam                         " Created by
    into corresponding fields of table t_customer
    from kna1
   where kunnr in s_kunnr.             " END SELECT
  if sy-subrc ne 0.
    message text-001 type 'E'.
    exit.
  endif.                               " IF SY-SUBRC NE 0
endform.                               " RETRIEVE
regards,
veeresh

Similar Messages

  • How to hide input fields on selection screen using variant attribute

    Hello all,
    I want to know how to hide input fields on selection screen using variant attribute conpletely.
    As you know, when setting the attribute of variant "Hide field" checked, the field is temporarily hidden, but when clicking "All Selections(F7)" button on the selection screen, the fileds become appeared.
    I want to hide the field completely. Di you know how to do ?
    Thank you for your support.
    Regards,
    Hideki Kozai

    Use this attribute hide field and save the variant. Then create transaction for this program setting default variant for parameter Start with variant . The user who runs it will have it by defualt set.
    Otherwise
    in PBO simply use LOOP at screen and output = 0 for this field. This will ensure that field is invisible in any case.
    Regards
    Marcin

  • How to validate ch field in selection screen

    hi experts.......
    how to validate ch field selection screen......... and which function module is used to validate parameter field i.e character

    Hello,
                Is your requirement to Validate the Character Field? This is what I understand. If it is right, then do you want to Validate whether a Character Value is entered?
                Check the below Sample Code.
    At Selection-Screen on P_CHARFIELD.
        IF P_CHARFIELD CA '1234567890'.
            Message 'Enter an Alpha Character only' Type 'E'.
        Endif.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • How to accept multiple attachments on selection screen?

    Hi All,
    I need to know how to accept multiple attachments on selection screen and send them as email to external system (outlook).
    Basically, my req is to send a common email with attachments to certain users. These users are displayed in ALV. User will select ALL or specific user from ALV and send an email with message entered on selection screen.
    I used text editor control to input message body. I need to know how to accept attachments and send them.
    Appreciate any inputs.
    Thanks,
    SKJ

    SAP uses a nifty little button called 'Object Services' on ME23N (top left) which you can use to attach documents to business objects.
    http://help.sap.com/saphelp_nw70/helpdata/EN/be/3fe63659241157e10000009b38f889/frameset.htm
    It's a complicated way of doing it but might give you extra functionality in the long run.

  • How to make a field in selection screen as READ_ONLY !!

    Hi,
       How to make a field in selection screen as READ_ONLY !!.
    Thanks,
    Senthil

    This is the code you need to have in your program.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF SCREEN-NAME = 'MYSELFLD'.
        SCREEN-INPUT = 0.
        MODIFY-SCREEN.
      ENDIF.
    ENDLOOP.

  • Month/year input field in selection screen

    Hi,
    Can anyone tell how to declare an input field in selection screen in the format month/year with out day.
    Thanks.
    Prasad.

    hi ,
    I have the same doubt ,
    but its taking invalid input also as in if i enter 13/2006
    Can it be avoided,
    also can the calender be displayed at F4 on such field.
    Thanks in advance
    Regards
    Bijal

  • HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?

    HI,
    HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
    thanks,
    samba.

    By selection screen, what do you mean?   There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component?  Are you wanting to call a standard transaction via ITS - SAPGUI for HTML?  Please provide more details to your question.

  • Input Variable on Selection screen in BEx

    Hi Team,
    Is there a way to change the sequence of Input variables on Selection screen in BEx ?
    Thanks in Advance.

    Hi,
    Go to query designer - query poperties - you find variable sequence tab
    you change the sequence of your variables
    Thanks,
    pk.

  • How to default date values in Selection Screen

    Hi everyone,
    I would like to display the 1st day of the previous month into the I_GSTRP-LOW field and the last day of the current month into the I_GSTRP-HIGH field.
    For example, this in the 5th month of the year (May), therefore, in the selection screen it should appear like this:
    Basic Date: <u>01.04.2006</u>    to   <u>31.05.2006</u>
    How do i do it?
    *& SELECTION-SCREEN                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS:
      I_AUFNR FOR AFIH-AUFNR,                           "ORDER NUMBER
      I_GSTRP FOR AFKO-GSTRP,                           "BASIC DATE
      I_BUDAT FOR AUFM-BUDAT,                           "POSTING DATE
      I_IWERK FOR AFIH-IWERK DEFAULT '6010' OBLIGATORY, "PLANNING PLANT
      I_ARBPL FOR CRHD-ARBPL,                           "WORK CENTER
      I_ERNAM FOR AUFK-ERNAM,                           "CREATED BY
      I_MATNR FOR RESB-MATNR,                           "MATERIAL
      I_KTEXT FOR AUFK-KTEXT.                           "EQUIPMENT
    SELECTION-SCREEN END OF BLOCK 1.

    Here is the code to populate default values,as per your requirement.
    data : V_date type sy-datum,
           v_month(2) type c,
           v_low_value(8) type c,
           v_high_value(8) type c,
           v_month1(2) type n,
            V_NO_OF_DAYS type T009B-BUTAG,
           v_curr_month type T009B-BUMON,
           v_curr_year  type T009B-BDATJ.
           select-options : i_gstrp for sy-datum.
    initialization.      
    v_date = sy-datum.
    v_month1 = v_date+4(2) - 1.
    write v_month1 to v_month.
    concatenate v_date+0(4)
    v_month
    '01'
    into v_low_value.
    I_GSTRP-LOW = v_low_value.
    v_curr_month = sy-datum+4(2).
    v_curr_year  = sy-datum+0(4).
    CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
      EXPORTING
        par_month       = v_curr_month
        par_year        = v_curr_year
    IMPORTING
       PAR_DAYS        = V_NO_OF_DAYS
    concatenate sy-datum+0(6)
    V_NO_OF_DAYS
    into v_high_value.
    I_GSTRP-HIGH = v_high_value.
    I_GSTRP-sign = 'I'.
    I_GSTRP-OPTION = 'EQ'.
    APPEND I_GSTRP.
    regards
    srikanth

  • How to disable save button on selection screen (1000) run from other report

    Hi Experts,
    Can any one let me know how to disable save button on selection screen (1000) run from other report.
    Say I am running from report R1 which submits report R2, but the save button should be disabled on
    report R2(selection screen 100).
    Thanks in advance.
    Regards
    RP.

    Hi RPReddy16 ,
    Try this:
    DATA :BEGIN OF t_extab occurs 0,
                     fcode like rsmpe-func,
                 END OF t_extab.
    REFRESH T_EXTAB.
    MOVE 'SAVE' TO T_EXTAB-FCODE.
    APPEND T_EXTAB.
    CLEAR T_EXTAB.
    SET PF-STATUS 'STATUS' EXCLUDING T_EXTAB.
    Regards,
    José

  • How to validate input fields as the user is filling up a form with jQuery?

    Hello EA friends.
    Someone has experimented on how to validate input fields as the user is filling up a form with jQuery?, if the field is numeric and insert an A for example, an alert appears showing "insert a number" or not allowed to enter anything until a number is entered.
    Thanks and regards.
    Fer

    Hi Sudeshna.
    Sorry for not responding on time, how can I be included in this code?
    sym.setVariable("typeActivity", "input")
    var Element_1=document.createElement(typeActivity);
    $(Element_1).css({"text-align": "center"});
    //Answer
    sym.setVariable("Answer_1", "4");
    sym.$("box_1").append(Element_1)
    This code is on my creationComplete and it works fine.
    Would greatly appreciate your help.
    Regards.
    Fer García

  • How to Add Push Button On Selection Screen

    Hi Experts,
    How to add Push button on Selection Screen.
    Points will b rewarded for useful help.
    Bohra.

    Hi,
    To create a pushbutton on the selection screen, you use:
    SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>
    USER-COMMAND <ucom> [MODIF ID <key>].
    The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.
    <push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.
    For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREENevent.
    Ex.
    REPORT DEMO.
    TABLES SSCRFIELDS.
    DATA FLAG.
    SELECTION-SCREEN:
    BEGIN OF SCREEN 500 AS WINDOW TITLE TIT,
    BEGIN OF LINE,
    PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1,
    PUSHBUTTON 12(10) TEXT-020 USER-COMMAND CLI2,
    END OF LINE,
    BEGIN OF LINE,
    PUSHBUTTON 2(10) BUT3 USER-COMMAND CLI3,
    PUSHBUTTON 12(10) TEXT-040 USER-COMMAND CLI4,
    END OF LINE,
    END OF SCREEN 500.
    AT SELECTION-SCREEN.
    CASE SSCRFIELDS.
    WHEN 'CLI1'.
    FLAG = '1'.
    WHEN 'CLI2'.
    FLAG = '2'.
    WHEN 'CLI3'.
    FLAG = '3'.
    WHEN 'CLI4'.
    FLAG = '4'.
    ENDCASE.
    START-OF-SELECTION.
    TIT = 'Four Buttons'.
    BUT1 = 'Button 1'.
    BUT3 = 'Button 3'.
    CALL SELECTION-SCREEN 500 STARTING AT 10 10.
    CASE FLAG.
    WHEN '1'.
    WRITE / 'Button 1 was clicked'.
    WHEN '2'.
    WRITE / 'Button 2 was clicked'.
    WHEN '3'.
    WRITE / 'Button 3 was clicked'.
    WHEN '4'.
    WRITE / 'Button 4 was clicked'.
    WHEN OTHERS.
    WRITE / 'No Button was clicked'.
    ENDCASE.
    This example defines four pushbuttons on a selection screen that is displayed as a
    dialog box. The selection screen is defined in a statement chain for keyword
    SELECTION-SCREEN.
    If the text symbols TEXT-020 and TEXT-040 are defined as 'Button 2' and 'Button 4',
    the four pushbuttons appear as follows on the selection screen displayed as a dialog box.
    Regards,
    Bhaskar

  • How to get default values on selection screen(multiple ranges)?

    i want to know how to maintain default ranges in selection screen...like 2000 to 3000 and 7000 to 8000 and 11000 to 15000
    all the above ranges must get by default how to provide those to selection screen by default...please give me idea...with example...

    Hi Suresh,
    You can either use select-options or Ranges. If you want the selection screen to be displayed with allwoing user to enter values apart for the default ones use select options else use ranges. With ranges what ever values use hard code would be set and the end user will not be able to add any more values (or range of values).
    Simply write the following code
    tables : <name of the table from which the field belongs>
    select-options <fieldname> for <tablename>-<fieldname>.
    <fieldname>-sign = 'I'.
    <fieldname>-option = 'BT'.
    <fieldname>-low = '7000'.
    <fieldname>-high = '8000'.
    append <fieldname>..
    similiarly add all the ranges that you need to include as default and in your select statement use the IN operator inthe where clause to include the range.
    If using range replacethe select-option with the range statement.
    Thanks.

  • How to make required field on selection screen in Query

    i'm now working with query(SQ01).
    but don't know how to make required field on selection screen in Query.
    thanks in advance

    i'm now working with query(SQ01).
    but don't know how to make required field on selection screen in Query.
    thanks in advance

  • How to hide F8 function on selection screen.

    Hi,
    How to hide F8 function on selection screen.

    Just create a customer status and SET this status in your INITIALIZATION block.
    <i>You can copy the standard status from program RSSYSTDB status %_00.</i>
    Regards

Maybe you are looking for

  • Asset report with master data fields

    It seems like that all standard asset reports can not display fields from the master record of the asset like room, user fields, etc. But those fields are there in the selection screen of standard reports. Is there standard report that can show me th

  • After upgrade to ios 6 apps are crashing

    I upgraded to ios 6 recently some of my apps, safari & app store are crashing very frequently also ios6 is a drain on battery life. Any remedy?

  • How to export region code 2 movie to other TV's

    I have programmed the iMac for region 2 and it plays the DVD. How do I get the movie out to play on another TV. How do you get video out of the iMac that is HDMI or what ever compatible. This is a special movie (restored "The Red Shoes") which is onl

  • Product id/serial number/ license code storage program

    hey, i'm looking for a good program to store and organize all my license codes for various pieces of software, does anyone have any good suggestions?

  • Remote Management - Rights Authentication Failed

    Since upgrading from zenworks 10 to zenworks 11 I am getting the following error when I try to remote to workstations. I am not receiving this on all workstations, just some. Zenworks Remote Management Rights Authentication failed. An internal error