Screen field validation

Hi,
    My requirement is to validate a particular screen field.......while  user enters the value on that field....(i.e) the message should not come after the user action....it should get displayed while entering the value itself.....is it possible...if so...how.?
Thanks in advance,
Varsha..

Hi Varsha,
If you use a field of type NUMC the system doen't allow you to enter CHARS
i dont to that deapth, even for type i  and type SY-DATUM Fields system doesnt allow to enter chars aswell.
Check this out.
CL_GUI_DATAMANAGER
in the above class there is a method ON_INPUT
CL_PARSER_PII
in the above classes there is a method PARSE_INPUT which might work as on focus event
but we need to know the functionality in deapth.
which might be useful to you
Regards
Ramchander Rao.K
Edited by: Ramchander Krishnamraju on Dec 26, 2008 8:09 AM
Edited by: Ramchander Krishnamraju on Dec 26, 2008 8:11 AM

Similar Messages

  • Selection-screen fields validation for dialog

    Hello ABAP Gurus
    Requirements: this is a report wherein , depending upon the correct select-options , user will pick some field values from table and some will be entered by the user in the next se51 custom screen for creation of a record in a ztable .
    the problem is :without validating select-options values , it calls the se51 screen 100.
    How to keep the cursor at the selection-screen field until & unless user enters the correct i/p s .if i/p are correct then only it should call screen 100 otherwise remain in the selection screen only .
    *& Report ZSD_REP_QUOT_BANK_CREATE *
    REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.
    DATA: OK_CODE LIKE SY-UCOMM,
    SAVE_OK_CODE LIKE SY-UCOMM,
    WA_ITAB LIKE ZSD_TABL_QOTBANK,
    ANSWER TYPE C,
    COPIED ,
    STS TYPE N,
    EMGRP LIKE MARA-EXTWG,
    QTY LIKE ZSD_TABL_QOTBANK-QTY,
    UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,
    TOT LIKE ZSD_TABL_QOTBANK-TOT,
    INO LIKE VBAP-POSNR.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO
    NO INTERVALS NO-EXTENSION OBLIGATORY,
    S_ITNO FOR ZSD_TABL_QOTBANK-ITNO
    NO INTERVALS NO-EXTENSION OBLIGATORY.
    S_MATNO FOR ZSD_TABL_QOTBANK-MATNO
    NO INTERVALS NO-EXTENSION. "
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
    SELECT SINGLE VBTYP
    INTO VBAK-VBTYP
    FROM VBAK
    WHERE VBELN IN S_QTNO.
    IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.
    MESSAGE I005(ZQOTBANK).
    SET CURSOR FIELD S_QTNO-LOW.
    SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
    ENDIF.
    CLEAR WA_ITAB.
    SELECT SINGLE QTNO ITNO
    INTO WA_ITAB
    FROM ZSD_TABL_QOTBANK
    WHERE QTNO IN S_QTNO
    AND ITNO IN S_ITNO.
    IF SY-SUBRC EQ 0.
    MESSAGE I001(ZQOTBANK).
    SET CURSOR FIELD S_QTNO-LOW.
    SET CURSOR FIELD S_ITNO-LOW.
    SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
    ENDIF.
    *START-OF-SELECTION.
    END-OF-SELECTION.
    CALL SCREEN 0100.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS '0100'.
    SET TITLEBAR '0100'.
    ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.
    SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT
    KNUMV
    INTO (ZSD_TABL_QOTBANK-CCODE,
    ZSD_TABL_QOTBANK-SORG,
    ZSD_TABL_QOTBANK-DISTCHAN,
    ZSD_TABL_QOTBANK-DIV,
    ZSD_TABL_QOTBANK-CUSTNO,
    ZSD_TABL_QOTBANK-QTDAT,
    ZSD_TABL_QOTBANK-QTVALDAT,
    VBAK-KNUMV)
    FROM VBAK
    WHERE VBELN IN S_QTNO
    AND VBTYP = 'B'.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE KWMENG POSNR MATNR
    INTO (QTY , INO , ZSD_TABL_QOTBANK-MATNO)
    FROM VBAP
    WHERE VBELN IN S_QTNO.
    SELECT SINGLE EXTWG
    INTO EMGRP
    FROM MARA
    WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.
    ZSD_TABL_QOTBANK-ITNO = INO.
    ZSD_TABL_QOTBANK-EMATGRP = EMGRP.
    ZSD_TABL_QOTBANK-QTY = QTY.
    SELECT SINGLE KBETR
    INTO UPRICE
    FROM KONV
    WHERE KNUMV = VBAK-KNUMV
    AND KPOSN = INO
    AND KSCHL = 'PR00'.
    ENDIF.
    ZSD_TABL_QOTBANK-UPRICE = UPRICE.
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-CGL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-CGL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.
    UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.
    UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-TELK_QTY.
    UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-TELK_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-OTH_QTY.
    UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-OTH_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'SAVE'.
    INSERT ZSD_TABL_QOTBANK.
    IF SY-SUBRC EQ 0.
    MESSAGE I000(ZQOTBANK).
    COMMIT WORK.
    CALL SELECTION-SCREEN 1000.
    ELSE.
    MESSAGE E001(ZQOTBANK).
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module EXIT_COMMAND INPUT
    text
    MODULE EXIT_COMAND INPUT.
    SAVE_OK_CODE = OK_CODE.
    CLEAR OK_CODE.
    CASE SAVE_OK_CODE.
    WHEN 'CANCEL'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TITLEBAR = 'Quotation Bank Entry'
    TEXT_QUESTION = 'Do you want to Cancel ?'
    TEXT_BUTTON_1 = 'Yes'
    TEXT_BUTTON_2 = 'No'
    DEFAULT_BUTTON = '2'
    IMPORTING
    ANSWER = ANSWER.
    IF ANSWER = '1'.
    LEAVE PROGRAM.
    ELSE.
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    WHEN 'EXIT'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TITLEBAR = 'Quotation Bank Entry'
    TEXT_QUESTION = 'Do you want to Exit ?'
    TEXT_BUTTON_1 = 'Yes'
    TEXT_BUTTON_2 = 'No'
    DEFAULT_BUTTON = '2'
    IMPORTING
    ANSWER = ANSWER.
    IF ANSWER = '1'.
    LEAVE PROGRAM.
    ELSE.
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    ENDCASE.
    ENDMODULE. " EXIT_COMMAND INPUT
    Thnx in Advance

    Put the statement
    CALL SCREEN 100
    in the event <b>AT SELECTION-SCREEN</b> and NOT in <b>END-OF-SELECTION</b>.
    Regards,
    Subramanian V.

  • Standard screen field validation : ME21n/ ME22n

    Hi experts,
    I have a requirement in which we are supposed to do field validations while creating or changing POs/Purchase requistions.
    Suppose if at item level in Account assignment category is 'F' and the order entered by user is of type 'Z560' then in that case user will be allowed to enter only specific G/L account for eg : 712546 or 715486.
    Please guide how can that be accompalished. I couldn't find any proper exit for this.
    Thanks
    Vishal

    Hi Vishal,
    there is a very helpful BAdI for this: ME_PROCESS_PO_CUST.
    Re: user exit/ badi for me21n
    Roy
    Edited by: RobbdB on Jun 30, 2010 9:09 AM

  • SELECTION-SCREEN FIELD VALIDATION

    Hi All!
             I am trying to write this ABAP program in 4.7 Enterprise. I wish to selectively display (based on radio buttons) selection screen blocks and make them mandatory in runtime. I use code like this:
    AT SELECTION-SCREEN ON SAL_ORG.    (this is one of the fields that will be obligatory)
        IF RD2 EQ 'X'.
            IF SAL_ORG IS INITIAL.
                 MESSAGE 'THIS FIELD IS MANDATORY' TYPE 'I'.
            ENDIF.
        ENDIF.
    Now, if I execute this as is, then I will get this message as soon as the block is displayed, not just after hitting the execution button. Can you please tell me how I should put a condition on this checking. I know it is triggered by SY-UCOMM = 'ONLI' but i am not sure where to put the condition.
                   Thanks in advance!

    hello J.C.!
                  this is what worked for me finally:
                  AT SELECTION-SCREEN.
                  CHECK sy-ucomm EQ 'ONLI'.
                  IF RD2 EQ 'X'.
                      IF SAL_ORG IS INITIAL.
                          MESSAGE 'THIS FIELD IS MANDATORY' TYPE 'I'.
                      ENDIF.
                  ENDIF.
    SAP says sscrfields-ucomm is unrecognized. can you please tell me what it is actually? why did you prefer using it instead of SY-UCOMM? If possible, please direct me to some good reference on calling selection screen.
    I have given your answer 10 points by the way. I am very new here, so i don't know what exactly it's role is, but i figured it is something significant.

  • Screen fields validations

    Hi Guys,
    I have a requirement to display an error message if any of the fields are modified EXCEPT the tel. no. field.
    What is the most efficient way to check if any of the fields have been modified except the telephone number field?
    Regards,
    ~Mark

    solved.

  • 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.

  • Validations on the screen fields in a module pool program

    Hi all
    i am creating a sales order against a purchase order ,i am selecting a PO click on a button to call another screen which has all the mandatory fields of the SO i want validations on the screen fields or the input fields as when i enter the header data and the items data and the partner data from the input serach help that is already enabled on the screen fields ,if there is any mismatch among the fileds and an error message is displayed for example:-" material no 100-100 does not exist for  sales area" then only that field where this message is present should be field enabled and the rest of the fields should be field disabled.
    also the error message i m displaying is in short text form and not in long text i clicked on it (long text) however how to use it was not known to me .
    thanks
    varun
    Moderator message: please do more research before asking, try solving problems yourself first, look for previous discussions of similar issues, post texts in more readable format, you have been warned several times before.
    Edited by: Thomas Zloch on Feb 7, 2012

    i want to have input search help as if i select sales document type then corresponding sales organizations should appear
    This would be quite opposite of what h_vakz does. h_vakz gives Sales document based on Sales org..and you want vice versa. Create a simple SH with
    selection method : TVAKZ
    AUART as importing only
    VKORG as exporting only. So when you enter an AUART you get all VKORG it is defined in. I'm not aware of a standard search help which matches the requirement. If anybody does please help me.
    i have header data (only mandatory fields),items data,partner data(all mandatory fields)
    and when i select all the header data the search help that is on the material number and partners role and number should appear corresponding to that header data
    You will have to be more specific sir..
    not able to apply please guide someone
    As for that just mention them in SCREEN->ELEMENT LIST->REFERENCES

  • Validating Screen Fields in FD32 - BTE 1520

    Hello everyone,
    I have a requirement to make various checks before saving in FD32. For example I want to make sure that KNKK-DBEKR will be less than or equal to KNKK-KLIMK.
    I have searched SCN and I have implemented BTE 1520 (you can see an example thread here).
    My problem is that while in BTE 1520 I don't have the screen fields available (or at least I don't know how to make them available to my function module).
    Has anyone done something similar?
    Thank you in advance.

    Thanks Neal, but I already tried that. The function module (a copy of SAMPLE_INTERFACE_00001520) uses only two variables I_KUNNR and I_KKBER.
    As you can see in the screenshot below (from the debugger), I have been trying to find whether I have anything else available at that point.

  • How to skip the mandatory field validation for clearing the screen fields

    Hi Friends,
      I have created a module pool screen, and made some fields mandatory. after entering some fields, if i try to clear the fields, am unable to clear. Its throwing the error "Enter all required fields"., since some mandatory fields are there. But i could able to navigate through other screen. Both the "CLEAR" and "NEXT" command are given in the at-exit command only. Next is working but clear is not working.
    Please  provide me the solution.
    Thanks
    Karthikeyan.L

    Hi,
    To avoid automatic input checks you have to assing function type - E to appropriate screen field, which is not to be checked.
    These function codes don't trigger PAI processing, instead they go directly to
    MODULE mod AT EXIT-COMMAND.
    ..placed in PAI of the screen. In this way you can ommit automatic checks performed by system on mandatory fields. Please ensure you have assing E type to next and clear functions in GUI status.
    Regards
    Marcin

  • 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

  • Screen level validation on xk01 with holding tax screen .

    Hi,
    Can someone suggest a suitable way by which I can do screen level validation on xk01 screen 610,so that in case of
    user not giving proper inputas the concerned field is open for user input .
    Right now I am using an exit but it is triggered afete all data is collected form all sceens thus the error
    appears on the last screen of the chaion and does not give the usr the option to correct the error.
    He has to start all over again.

    Hi,
    inside your exit routine, you should call the standard routine NAVIGATE_TO_AFFECTED_SCREEN of the main program SAPMF02K
    In the below little test I implemented the EXIT_SAPMF02K_001.
    *-> SDN Begin
    * In this validation example we check if  the Exemption certificate number field
    * is filled with numeric characters only
    DATA :     l_dynnr        TYPE sydynnr VALUE '0610',
               l_scrgr        TYPE vend_scgr,
               l_fcode        TYPE taxitabs-fcode,
               l_ltsnr        TYPE ltsnr,
               l_werks        TYPE werks_d,
               l_target_dynnr TYPE sydynnr.
    *  PERFORM determine_target_screen(sapmf02k) USING l_dynnr
    *                                          l_scrgr
    *                                          l_fcode
    *                                          l_ltsnr
    *                                          l_werks
    *                                 CHANGING l_target_dynnr.
      LOOP AT t_lfbw .
        IF t_lfbw-wt_exnr IS NOT INITIAL AND
           NOT t_lfbw-wt_exnr Co '1234567890 '.
          l_target_dynnr = l_dynnr.
          IF NOT l_target_dynnr IS INITIAL.
            MESSAGE ID 'S1' TYPE 'I' NUMBER '333' DISPLAY LIKE 'E' WITH 'Exemption certificate number data is not'(001)
                                                                        ' filled with numeric chars'(002).
            PERFORM navigate_to_affected_screen(sapmf02k) USING l_target_dynnr
                                                      l_scrgr
                                                      l_fcode
                                                      l_ltsnr
                                                      l_werks.
            exit. "From loop
          ENDIF.
        ENDIF.
      ENDLOOP.
    *<-- SDN End
    Regards,
    Andrea

  • What  are the usual date field validations

    Hi all,
    can you please tell me what  are the usual date field validations in selection Screen
    Thanks and regards ,
    Madhavi pilla

    Once you declare it as TYPE SY-DATUM, usually that is enough.  Sometimes we will also check that it is not less than '18000101' or greater than '99991231'.  Or if you have a specific date range that applies to your program you could check the field contents against that. I hope this helps.
    - April King

  • MB_MIGO_BADI - Not able to bring data to screen fields

    Hi there,
    I'm trying to add a new tab in the item level in the MIGO screen. In the new tab, I am placing a custom screen with some fields containing purchase order details. I am using the BADI MB_MIGO_BADI for this task. Now I'm able create a new tab and place the screen inside. But I'm not able to place bring the data to the screen fields in the new tab. I'm writing the code for including the screen in the method PBO_DETAIL. And this method do not have any parameters of purchase order details.
    Have any one of you came across such situation??? If any one of can give a solution to work out this problem, it will be very helpful.

    Under PAI method declare the field to u2018Xu2019. 
    Under the line modify method declare a flag and set to u2018Xu2019 checking for material document number by which we can set the fields to be in display mode when we open MIGO for display of material document created after doing goods receipt.
    Under the POST_DOCUMENT method write the code for appending the value to Z table along with the values of the line item (In this case production order number, material, u2026u2026.). For these values to be available here in this method use the memory concept u201CExport to memory idu201D in the method LINE_MODIFY. 
    In order to do any validations to the custom fields, go to transaction SE80 and mention the program Name created and in PROCESS ON VALUE_REQUEST create a module and provide the validations required for those custom Fields.
    In order to make the fields to be in display mode during the display of material document, create a module under PBO and import the flag value and the production order number details in the method LINE_MODIFY and if that flag = u2018Xu2019, use  
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'XXXXXX'.
    SCREEN-INPUT = '0'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.Retrieve the values from the Z table matching the key field (production order number) and pass the value of the custom field on to the screen. 
    Thanks,
    Shailaja Ainala.

  • Re: Changes to screen field date was not updated

    Hi,
    I had a dialog screen showing a valid from date as 10.10.2007. I changed it to 15.10.2007 and click on other details tab. when I returned, it is still showing the old values.
    When I did a DEBUG, upon changing and hitting enter key, the new dates for the screen field is not changed. it is still showing the old date for the screen field.
    why is it so?
    I think this is the cause of why the old values is still displaying. How can I get the field updated to my internal table. It need to be filled with the new values before I can updated to my internal table and then re-displayed again.
    How to get the new values into the screen field?

    Hi..
    As i understatnd this field is in TABLE Control.
    In that case you must Update the Internal table in the PAI .. Inside LOOP .. ENDLOOP.
    Process After Input.
      LOOP AT ITAB.
       Module Update_itab.  "Calling the module
      ENDLOOP.
    <b>In Module pool</b>
       Module Update_itab INPUT. 
        modify itab from wa index TABCON-CURRENT_LINE.
       ENDMODULE.
    Note: Here WA is the work area of the Screen fields and TABCON is the Table control variable.
    <b>Reward if Helpful.</b>

  • Hi gurus how to provide the table field validations

    hi gurus how to provide the table field validations , plz help me

    Hi,
          Say you need to provide valdiation for WERKS(Plant) field.
    Goto SE11. Find the domain of the field. (Say WERKS in our case.) now goto the domain, click on value range. Now at the bottom you will find the value table. Note this table (T001W).
    In your report, at selection screen, you need to validate the field against this table. like this
    At selection-screen,
    select single werks from T001W where werks = p_werks.
    if sy-subrc NE 0
    message e000 with 'Plant not found'.
    endif.
    Reward points if useful.

Maybe you are looking for