Want to validate a field on screen

want to validate a field on screen w/o pressing enter after the input is given either thru f4 help or manually.
Its a normal selection screen it is not a dynpro
is it possible?
The customer wants it to be so!!!
Can i assign user-command to a field on screen?
please help me asap. all suggestion would be rewarded.
Regards

Hi,
   You can do via F4 help validation but for manual enter it is not possible as you need some action.
Try out The Sample Code for F4
TYPES: BEGIN OF t_reques,      
       lgnum TYPE lgnum,          
       END   OF t_reques.
DATA:i_reques TYPE STANDARD TABLE OF t_reques. 
SELECTION-SCREEN: BEGIN OF BLOCK b1.
  PARAMETER:        p_ware  TYPE lgnum    OBLIGATORY.          
SELECTION-SCREEN: END   OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ware.
  SELECT lgnum
         FROM T301
         INTO TABLE i_reques.                 
  PERFORM f4_help USING i_reques CHANGING p_ware.    "SUBROUTINE FOR F4 HELP.
      SUBROUTINE FOR F4 HELP.                                        *
     -->P_I_REQUES  text
     <--P_P_WARE  text
FORM f4_help  USING    p_i_reques
              CHANGING p_p_ware.
           CALLING FM F4IF_INT_TABLE_VALUE_REQUEST FOR F4 HELP.      *
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      ddic_structure   = 'LINK'
      retfield         = 'LGNUM'
      dynpprog         = sy-repid
      dynpnr           = sy-dynnr
      dynprofield      = 'P_P_WARE'
      callback_program = 'ZTEST'   <<Your Program Name
    TABLES
      value_tab        = i_reques             
    EXCEPTIONS
      parameter_error  = 1
      no_values_found  = 2
      OTHERS           = 3.
  IF sy-subrc <> 0.                          
    MESSAGE i006(zmm_ab).                    
  ENDIF.
ENDFORM.                                                    " F4_HELP
Rgds,
Abhishek

Similar Messages

  • 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 validate the field values in module pool program?

    Hi Guys
         I am working with module pool programming.
         Here I want to validate the fields like below.
         with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled.  This can be done by checking all the fields individually.
         I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
         If it is possible, can anyone help me?

    You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
    If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
    CHAIN.
    FIELD: <f1>, <f 2>,...
    MODULE <mod1>.
    FIELD: <g1>, <g 2>,...
    MODULE <mod2>.
    ENDCHAIN.
    all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
    Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
    ashish

  • In the component overview screen of CO01 I want  to disable all  the field in  screen of table control.I want to make it as output screen only.

    Hi all
      In the component overview screen of CO01 I want  to disable all  the field in  screen of table control.I want to make it as output screen only.
    Thanks & Regards,
    Rajib.

    Isn't that just exactly what transaction CO02 does? CO01 is for creating production orders so what sense does it make to have it display mode only?
    Maybe your goal is to stop then end user changing the component assignment that is automatically  detected by the system. If so, personally I think a better starting point would be PP configuration or user authorizations rather than looking to change the screen by whatever method. As we don't know what you are trying to achieve it's hard to offer much more advice maybe all you need is to change transaction to CO02

  • How do we validate input fields on the selection screen

    How do we validate input fields on the selection screen

    hi balram,
    u can validate input fields using <b>AT SELECTION-SCREEN</b>  Event.
    PARAMETERS : p_werks TYPE marc-werks.
    AT SELECTION-SCREEN ON p_werks.
    SELECT SINGLE *
    FROM t001w
    WHERE werks = p_werks.
    IF sy-subrc <> 0.
    MESSAGE 'Invalid Plant' TYPE 'I'.
    ENDIF.
    Like this, we can validate user input for plant.
    check this link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    Reware me if useful......
    Harimanjesh AN

  • Error while Adding field on Screen Variant

    Hi SAP Gurus,
    I want to add one field Trading partner in Fast entry screen.
    I am getting below error message while adding one field Trading Partner in Screen Variant ES007(O7E6)
    FIELD instruction for field BSEG-VBUND missing on template screen
    Message no. F4171
    Please let me know where do I have to maintain Trading partner field in template screen.
    A quick response on this is highly appreciate.
    Regards,
    SATVIR SINGH
    Edited by: Satvir S Digwa on Oct 6, 2010 12:41 PM

    Hi
    Go through the below link:
    Re: Trading partner in Field Status Group
    Rgds
    Vani

  • How to validate required fields before executing menu item ("Save As") using cutom Javascript?

    Hi,
    Sorry, I am new to PDF Development. I tried creating PDF using Acrobat XI Pro. During creation, I have encountered issues in running custom JavaScript. The requirement is to validate all the required fields before saving the PDF. I tried using the following scripts to validate the said required fields. But, it's not working.
    Option 1: If the field is null, a message box will appear.
    if(this.getfield("textbox") = null){
    app.alert("required");
    else {app.execMenuItem("SaveAs");}
    Option 2: If the field is required, a message box will appear.
    var f = this.getField("textbox");
    f.required = true;
    if(f = true)
    app.alert('required');
    else
    app.execMenuItem("SaveAs");
    The scripts mentioned above are not working. I wanted to validate the required fields before saving the PDF.
    In addition, I tried validating each field using the following script:
    f = getField(event.target.name)
    if (f.value.length == 0)
        f.setFocus()
        //Optional Message - Comment out the next line to remove
        app.alert("This field is required. Please enter a value.")
    When I open the PDF, the script is working. However, when the message box pops out, the "OK" button is not working as expected. The message box is not closing. I tried opening the form in a site in different Java versions (like 7-11 and 7-67). It's working in version 7-67. I tried upgrading the Java version from 7-11 to 7-67. Still, it doesn't work.
    I would appreciate your feedback on this matter.

    If you set the fields as required, then when the user hits the print button you could run this script:
    var txt = form1.execValidate();
    if (txt == true){
    print command
    This code assumes that the root node of your form is form1. Also ensure you put a message into the Empty Message parameter for each field that you want to mark s required.

  • How to validate date fields in the flash form

    i want to validate the date fields to make sure the values
    are not greater than today's date and from-date is less than or
    equal to to-date in the flash form. Does the actionscript have a CF
    DateDiff function for the validatation?
    Thanks

    I finally (after much reading up on actionscript) figured out
    my problem with date validation...which was similar to yours...
    I posted the solution I found for my AS date validation issue
    here:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=22&threadid=1232361
    I hope it helps!!!

  • How to change the property of the fields on screen while using BDC

    Hello,
    I am working on a program where I am using BDC call transaction method to update vendor master data using Fk02. I need to call the transaction in mode 'E'. As per the requirement I don't want user to see all the fields available on that screen. For example on Payment transactions screen I only want user to see fields like Bank key, bank number in the editable mode and rest all the fields on the screen should be greyed out.
    Can you please help with how can i do this.

    Hi,
    I think you can achieve this using transaction variant. Create a transaction variant using SHD0 and grey out the fields which you want. After that in BDC, instead of calling FK02, call the transaction variant you created. you may have to change the BDC recording a bit, but i think you can give it a try?
    Do let me know if it helps you.
    Regards,
    Raghav.

  • How to validate editable field in ALV

    Hi All,
    I have a alv program using OOPS concept where two fields(columns) are editable in the alv output. These two columns contain table names and field names which can be edited.
    I just want to validate these table and field names when we press the save button. If the edited entry is valid,i.e., the tablename is existing in the database, then it must update the entered value oftbl name to the db. else it shud give a error msg.
    Please help with this code.
    Thanks in Advance.

    Hey!!!
    Try using this...
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS : handle_data_changed FOR EVENT data_changed
                                      OF  cl_gui_alv_grid
                                      IMPORTING er_data_changed.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_data_changed.
        PERFORM data_changed USING er_data_changed.
      ENDMETHOD.   
    ENDCLASS.
    form DATA_CHANGED  using p_er_data_changed
                             TYPE REF TO cl_alv_changed_data_protocol.
      DATA : ls_mod_cells TYPE lvc_s_modi,
                   declare a variable for your table or field name.
      LOOP AT p_er_data_changed->mt_good_cells INTO ls_mod_cells.
          CASE ls_mod_cells-fieldname.
          WHEN 'LIFNR'.
              CALL METHOD p_er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = ls_mod_cells-row_id
                i_fieldname = 'LIFNR'
              IMPORTING
                e_value     = The variable you have defined.
    put ur condition according to variable here, if the condition is not satisfied, then throw a message like this.
            CALL METHOD p_er_data_changed->add_protocol_entry
                EXPORTING
                  i_msgid     = 'ZFI'
                  i_msgno     = '999'
                  i_msgty     = 'E'
                  i_msgv1     = 'Employee Number Doesn''t Exist'
                  i_fieldname = ls_mod_cells-fieldname
                  i_row_id    = ls_mod_cells-row_id.
              EXIT.
            ENDIF.
    Hope this helps.
    Regrds,
    Abhinab Mishra

  • How to validate Quantity field in TV - Inputfield ?

    Hello All,
            I'm using a table view to show the output .
    IN this table view I made 2 fields as Input fields.
    Both the fields are Quantity fields.
    Now when the user enters a value in this Quantity field I want to validate it with respect to it's units .
    How can I do that ?
    In my case if the user enters correct value it works but when he enters a wrong value my BSP is going for a dump.
    I tried to debug the<b> LIPS table</b> to verify how SAP was handling this checking for the field <b>LFIMG</b>. But there there is a statement called chain --endchain.
    SO there is no chance for debugging.
    My code is as follows :-
            LOOP AT gt_final INTO wa_final.
              CLEAR: gv_row,lv_qty,lv_string,gv_len,gv_cell_id1.
              gv_row = sy-tabix.
              gv_len = STRLEN( gv_row ).
              gv_len = gv_len - 1.
    * Modify the Third Column
              CONCATENATE 'INB01_TV_ID' '_' gv_row(gv_len) '_' '3' INTO gv_cell_id1 .
              lv_string = request->get_form_field( name = gv_cell_id1 ).
              WRITE lv_string TO lv_qty  UNIT wa_final-units.
              CLEAR :wa_final-del_quantity.
              wa_final-del_quantity = lv_qty.
              MODIFY gt_final FROM wa_final TRANSPORTING del_quantity.
            ENDLOOP.
    Can anyone tell me how to validate the entry for the Quantity filed ?
    Regards,
    Deepu.K
    I have one more Question .
    Whenever BSP goes for a dump in this case I want to handle this by a message .
    Is it possible ?
    Message was edited by:
            deepu k

    Hello Raja,
           I want to validate the entry in the QUantity field with respect to the Unit of the Quantity.
    I.e say for example I have a unit as PC (pieces) then the quantity must be only of thousands,lakks and so..on......but not in points i.e a piece quantity must be full either 200 ,2 lakhs or 2 pieces but not 2.5 pieces.
    SO now if the user enters 2.5 it's a wrong value as the quantity for the Unit PIECES can't have half-piece. (2.5 = 2 + 0.5) .SO i want to validate this .
    I hope I'm clear.
    How should I do ?
    Regards,
    Deepu.k

  • How to validate the field when i am populating the data cursor to block

    Hi,
    I am populating data cursor to multi record block.
    Block contain 5 items. I am populating data cursor to block for 4 items. User will enter one item value that is quantity field.
    If user enter negative values and decimal points in quantity filed i need to display message to user item level.
    Please do the needful how to do it.

    902434 wrote:
    Hi,
    I am populating data cursor to multi record block.
    Block contain 5 items. I am populating data cursor to block for 4 items. User will enter one item value that is quantity field.
    If user enter negative values and decimal points in quantity filed i need to display message to user item level.
    Please do the needful how to do it.If you want to validate at entry level then use When-Validate-Item trigger and check the input and show message. Like
    If :quentity <0 then
    message('do not enter negative value');
    message('do not enter negative value');
    raise form_trigger_failure;
    end if;Why u open same thread again ? not closing one.. check this one
    </a>
    How to validate the field when i am populating the data cursor to block
    Hopes this helps
    If someone's response is helpful or correct, please mark it accordingly.

  • How to add new field to Screen Modifications

    Hi,
    I want to get P0002-CNAME in screen modifications of Infotype 02. At present i have other 23 fields for which i can set display attributes. This new field is to be added in infotype 02 and also some coding is to be put for this. How this can be achieved ?
    One solution is to enhance infotype and add some Z field,but i would like to use the existing structure field.
    Please let me know proper way for this.
    Thanks.

    Hi,
    I want to get P0002-CNAME in screen modifications of Infotype 02. At present i have other 23 fields for which i can set display attributes. This new field is to be added in infotype 02 and also some coding is to be put for this. How this can be achieved ?
    One solution is to enhance infotype and add some Z field,but i would like to use the existing structure field.
    Please let me know proper way for this.
    Thanks.

  • I want to make Requistioner field Mandatory in the Purchase requistion.

    Whenever i create purchase requistion i want to make  Requistioner field mandatory. I have checked the filed selection NBB and changed to mandatory and ME51 also  made mandatory after that also whenever i create with ME51 PR is going to next screen without asking for requistioner.
    Please let me know where actullay i have to make mandatory so that whenever i create it should ask the requistioner.
    Thanks.

    H,
    You also select the field Requisitioner as mandatory for below field selection>
    AKTH,ME51 & ME51N
    Because always the field selection: mandatoey , display & optional    will work in
    Setting Priority
        Hide 1
        Display 2
        Required entry 3
        Optional entry 4
    SAM
    Edited by: Saminathan Gopalan on Jun 22, 2010 3:25 PM

  • Want to add new field in QA32/QA11 transaction under inspection lot stock

    Dear Experts,
    I want to add new field in QA32 transaction under inspection lot stock tab or under characteristic tab.
    The reason behind is: Depends upon UD decision i want to assing customer name. So already we are having one Z Report for all the lots against this lot we have to display customer name.
    So in order to fetch customer name in the Z report we want to assing customer through F4 selection in the usage decision  screen.
    I know this is possibe for Make to order scenario, but our senario is make to stock.
    Please advice your valuable inputs.
    Regards.

    Hi Sujit,
    Can you please elaborate it,coz i'm using the same but if i place the break-point in PBO of sub screen,the break-point won't be triggered.and is there any additional step to get the data from function group? if yes, please explain me indetail.
    If possible please provide the sample code for this.
    Thanks Inadvance.
    Madan
    Edited by: Madan.ngt on Mar 3, 2011 7:16 AM
    Edited by: Madan.ngt on Mar 3, 2011 7:17 AM

Maybe you are looking for

  • How can i get the SSO to work successfully?

    How can i get the SSO to work successfully?  I followed the note for configuring infoview with ad sso using kerveros & .net. Adding the AD group into the win ad authentication configuration page creates the user group but the members of the group are

  • Equivalent of visual Basic static variable in LabVIEW

    Hi all! I am doing a project where I am counting the values. After i Close/Stop the program I want the value to be intact and continue with the last value. I know this in Visual Basic. By using the Static variable we can retain the value even we clos

  • Finding a Rogue Formula

    Post Author: mfewtrell CA Forum: .NET Hi there I have a report on which I have changed the bindings (so that the report data now comes from a dataset). When I run the report I get an exception: Error in formula  <Object_Visibility>. 'PercentOfDistinc

  • How to render cids images

    I have an email read with CFPOP, with 2 embeded images. I did a cfdump of the cids : I can see the 2 images names and cids, But is it possible to render at least one image in the webmail via the CFPOP ? Thanks for help.

  • How to check the contents of Control file, Log file & Parameter file

    Can anybody help me how i can check the contents of Control file, Log file & Parameter file. Arif