How to check validation for a input field?

For example, I need to check the validation of a field, if OK, then the field will be inputted, otherwise, there will rise a message, how can I implement that?
Thanks and best regards,
Anders

Hi Andres,
U can write a code in Request Processing--DO_VALIDATE_INPUT
DATA: LR_BTADMINH       TYPE REF TO   CL_CRM_BOL_ENTITY.
  LR_BTADMINH  ?= ME->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
    LV_ZZAFLD000057 = LR_ENTITY->GET_PROPERTY_AS_STRING( 'ZZAFLD000057' ).
IF  LV_ZZAFLD000057 IS INITIAL.
DATA: L7_MSG_SERVICE TYPE REF TO CL_BSP_WD_MESSAGE_SERVICE,
          LVSP_MSG_V1  TYPE STRING VALUE 'Spare in Progress'.
    L7_MSG_SERVICE = ME->VIEW_MANAGER->GET_MESSAGE_SERVICE( ).
    L7_MSG_SERVICE->ADD_MESSAGE(
        IV_MSG_TYPE       = 'E'
        IV_MSG_ID         = 'ZBSP'
        IV_MSG_NUMBER     = '008'
        IV_MSG_V1         = LVSP_MSG_V1 ).
ENDIF.
Regards,
Lokesh.

Similar Messages

  • How to provide validation for a particular field of screen

    Hi Experts,
    For my project, I have created a screen. In the screen, we have one field. For this field we have provided F4 help. When the user clicks on the F4 list of values is displayed.
    I have to provide following condition for this field.
    User should only select values from this F4 list only. If the user tries to enter any data which is not contained in the list, system should throw message that 'Invalid data. Select valid values".
    Can you please let me know how I can do so?
    The relevant portion of code is
    CASE save_ok_code.
        WHEN 'EXIT'.
         LEAVE PROGRAM.
        WHEN 'BACK'.
          PERFORM exit.
        WHEN 'CANCEL'.
         LEAVE PROGRAM.
        WHEN 'SAVE'.
          CALL FUNCTION 'MESSAGES_INITIALIZE'.
          PERFORM check_batch CHANGING fl_error.
          IF fl_error IS INITIAL.
            PERFORM save.
            IF sy-subrc EQ 0.
              CLEAR gv_deleted.
              PERFORM update_alv_grid_display.
    ***for message display
              CALL FUNCTION 'MESSAGES_SHOW'.
            ENDIF.
          ELSE.
            CALL FUNCTION 'MESSAGE_STORE'
              EXPORTING
                arbgb  = 'ZEX_MYPROJECT'
                msgty  = 'S'
                txtnr  = '053'
                msgv1  = text-008
              EXCEPTIONS
                OTHERS = 3.
            CHECK sy-subrc = 0.
            CALL FUNCTION 'MESSAGES_SHOW'.
          ENDIF.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
    I am totally new for ABAP. So, please help me out.
    Thanks
    Smith

    Hi,
    Try this.
    Create an internal table and populated it with the values present in the F4 help of the field. Then in AT SELECTION-SCREEN event check the value of the field with the values in the internal table and display the appropriate message.
    Sharin.

  • How to restrict number of characters for an input field

    Hi All,
    I have an input field.
    The max number of characters for this input field is 10.
    when a user enter more then 10 characters. it should prompt for an error or the input field should not allow to accpet the 11 character.
    how we do this in VC.
    need your helpful answers
    Rgds
    Srinivas

    Hi Srinu
    You could achieve this by configuring error messages under the formula:-
    Select the control properties and in the Input field at the Display tab write the formula
    "IF((@<LEN(text)>10),'appropriate message','Records available')"
    Note :- there is a LEN(text) under text functions in formula tab.
    Regards
    Navneet
    Message was edited by:
            Navneet Giria

  • How to prepopulate value in webapps input fields or for any custom fields in for any other forms?

    How to prepopulate value in webapps input fields or for any custom fields in for any other forms?

    What do you want to populate the form with?

  • Multiple select options for an input field

    Hi All,
    We have a requirement where in we need to provide multiple select options for an input field in a BSP application and get output relevant to all the given inputs(do not require range).
    Please do let me know how to solve this.
    Thanks & Regards,
    Lavanya .

    Hi,
    The requirement is : Suppose there is a input field PLANT.
    If we give input for plant it gives related output.
    Now if it is required to give 5 or 6 inputs..like plant1,plant2...plant6 and get the output related to all 6 inputs.
    (Like we implement in ABAP)
    Please do let me know how can this be implemented in BSP.
    Thanks & Regards,
    Lavanya.

  • Reg:How to check Vendor for particular Asset

    HI
    How to check Vendor for particular Asset?
    regards
    JK rao

    Hi,
    Good morning and greetings,
    It would be very difficult to go into each and every asset and display the asset...instead create a quick viewer query using SQVI and use the table ANLA and the field name is LIFNR for Vendor Code and for Asset Number it is ANLN1.
    Please reward points if found useful
    Thanking you
    With kindest regards
    Ramesh Padmanabhan

  • F4 help for a Input Field

    Hi Experts,
    I am New to web Dyn Pro Java.
    I have a requirement in which  I need to impplement F4 help for a input Field. For this I should not use the Back end. I am suppose to hard code the values that will appear in the F4 help. Can I implement it and how?
    Please respond. Thanks in Advance.
    Regards,
    Rohan

    Sure,
    Go by this-->
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0ab331b-97c6-2a10-f982-c9f972c34e51|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0ab331b-97c6-2a10-f982-c9f972c34e51]
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e038cf90-0201-0010-0a9a-ec69262a1564|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e038cf90-0201-0010-0a9a-ec69262a1564]
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cf40cf90-0201-0010-4a85-e5a207b900d8|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cf40cf90-0201-0010-4a85-e5a207b900d8]
    kunal

  • Setting the colour red for an input field or a text-field in a table

    Hy,
    I am using an input-field or text-field within a table-cell. For some rows in the table the text in the input-field / text-field should be red. How can I do this ?
    Florian Hroch

    Create a new attribute "TextColor" of type "com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor" (local DDIC types), under the table's data source node.
    Bind the "TextView.semanticColor" property of the table cell editor to this attribute.
    If you cannot add new attributes under the data source node (this is the case if there is a structure binding), add a value node "TableProperties" (cardinality 1:1, selection 1:1) under the data source node and add the attribute there.
    Then you can control the color of the TextView in table row at index i by setting the "TextColor" value for node element at index i.
    For an input field, you cannot set the text color, a workaround might be adding an icon in an extra column.
    Armin

  • How to  adjust the text in input field

    Hi Expert,
    New in VC development. Can someone guide how to adjust the text in input field? Because of  long text length it  is not displaying fully in visual composer iView so user are not able to see the entire text in input fields

    HI Kundan,
    I assume that you have already tried different options perent in Label Postion for the field.
    If none of these options meet your requirement then you can try the following workaround:
    In the display properties, select label position as no label.
    In the form view add a new UI Control for Plain Text or HTML text and change its Label to "Material Number".
    Now place this new UI Control in before your actual Input field such that it appears as the field label.
    Hope this helps.
    Regards,
    Rk

  • How to write Validations for Sample Data??

    Hi Frnds,
    I want to know how to write validations  for sample oracle data?? Can anyone explain anyone clearly??
    Regards,
    Raj

    Hi shushma,
    Simply put a check that:
    If(wdContext.current<YOUR_NODE>Element().get<YOUR_ATTRIBUTE_NAME> !=null){
    else{
    // Show the error messages
    //Displaying the error message is very easy.
    //You can report exception using the message manager API's. You will get this easily on SDN.
    I hope this helps! if you need ay further help please let me know.
    Thanks and Regards,
    Pravesh

  • How to write Validations for RadioButton

    Hi All,
    in my Application , two RadioButtons and one submitbutton is there, in that
    1. yes
    2. no
    both are radio buttons
    when i click on submit button, without selecting any one of those radiobuttons ,
    it shud display error message, this errormessage i have written in iwdmessage.
    it shud show this error message, instead of displaying nullpointer exception.
    how to write validation for this.
    please help me.
    regards
    sush

    Hi shushma,
    Simply put a check that:
    If(wdContext.current<YOUR_NODE>Element().get<YOUR_ATTRIBUTE_NAME> !=null){
    else{
    // Show the error messages
    //Displaying the error message is very easy.
    //You can report exception using the message manager API's. You will get this easily on SDN.
    I hope this helps! if you need ay further help please let me know.
    Thanks and Regards,
    Pravesh

  • How to restrict the length of input field

    Hi,
    How to restrict the length of input field. That is we should not be able to enter more thatn 10 charecters.
    Regards,
    H.V.Swathi

    Hi swathi,
    For this you have to create a simple data type. No need of writing a code.
    Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".
    Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.
    Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.
    Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.
    Regards
    Manohar

  • How to provide hyperlink for a particular field in ALV

    Hi,
      How to provide hyperlink for a particular field in alv report.
    Regards,
    Ramu.

    Yes you can do that. using the fieldcatalog there is an option for that. give HOT_SPOT = 'X'. for the column you want.
    wa_field-hotspot = 'X'.
    REPORT  ztest_alv.
    TYPE-POOLS:slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         wa_field LIKE LINE OF it_fieldcat.
    DATA: BEGIN OF it_likp OCCURS 0,
           vbeln TYPE likp-vbeln,
          END OF it_likp.
    DATA: layout TYPE slis_layout_alv.
    wa_field-fieldname = 'VBELN'.
    wa_field-tabname = 'IT_LIKP'.
    wa_field-hotspot = 'X'.
    wa_field-outputlen = 10.
    wa_field-no_zero = 'X'.
    wa_field-seltext_l = 'Sales'.
    APPEND wa_field TO it_fieldcat.
    SELECT vbeln FROM likp
    UP TO 10 ROWS
    INTO TABLE it_likp.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        is_layout               = layout
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = it_likp
      EXCEPTIONS
        program_error           = 1.
    *&      Form  user_Command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM user_command USING ucomm TYPE sy-ucomm
                        selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          SET PARAMETER ID 'VL'  FIELD selfield-value.
          CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.                    "user_Command

  • How to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?

    hi frnds.
    My problem is in module pool screen how to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?And how to do GUI STATUS and GUI TITLE? IN SE80.
      ITS URGENT.POINTS WILL BE REWADED.THANKS  IN ADVANCE.

    Hi,
    Go through this thread.
    [expand and collapse|expand and collapse]
    Cheers,
    Simha.

  • How to populate values for a new field in target infoprovider

    Hi Experts,
    am new to BI. i would like to know on how to populate values for a new field in the target cube with start rotuine.In my case,  i have a source infoprovider, which has 3 fields and a target infoprovider, which has 5 fields. i need to populate the new 2 fields in start routine. i dont want to populate using Field routine and am using 3.5 version. please assist with code on how to solve this issue.
    Thank you,
    Chitra.
    Edited by: Chitra_BI on Jun 13, 2011 10:23 AM

    Debug the standard code and see where the other fields are getting update. you can use the similar approach and area to code for the new field.
    Regards,
    Lalit Mohan Gupta.

Maybe you are looking for

  • What is the best way to approach making a grid inside a div? Use ul ?

    For example, I'd like to make an evenly spaced set of images on my main content div.  (I don't want to make a table.)  I assume I want to start with  <li> items inside my html?  But in CSS, how do I get them to align evenly from left to right and top

  • In the invoice

    in delivery note materials  have picked quantity ZERO ( 0) , on proforma output everything is zero ( which is strange , because usually items which are not delivered are not on proforma) , and on the invoice output  pricing exist and quantity exist,

  • PO delivery schedule "Statistics-relevant delivery"

    Hi, Please suggest PO item level delivery schedule tab- "Statistics-delivery date" how it get influence in PO and specific funtion for this. if we are changing delivery date and not changing this after Printout any where will cause problem. JACK

  • Why Adobe Flush Player 11 cannot be installed?

    Hi, Every time I installe Adobe Flush Player, it does not work. My system is Windows 7, 32 bit - default browser is Internet Explorer 9. Each time I try to play a video clip, messaging me "you don't have a latest version of adobe flush player-get it

  • @variable syntax

    (abc.xyz LIKE '%@variable('BOUSER')%' OR abc.mnp = @variable('BOUSER')) is this a correct syntax....I get parsing error in universe conditions....says missing right parenthesis..... any inputs appreciated. Pali