How to disable a input field in OVS search

Hi friends,
I have crated a OVS search help for matnr.
i have two input field like matnr and mat desc.. user can enter any value and hit SEARCH..
im getting results.
Now i want to hardoced a value of matnr = 001.. and make this field read only..
how can we do it..
i just took a example of matnr and mat desc. to make u understand easily...
kindly help.
Niraja

Hi Niraja,
You can initialize the value for MATNR in the phase 1 of the eventhandler method for OVS. Try refer the code segment below. Am initializing the values for MATNR & MAKTX fields in the lines:
ls_search_input-matnr = 'D*'.
ls_search_input-maktx = '*'.
*     pass the values to the OVS component
      ovs_callback_object->set_input_structure(
          input = ls_search_input ).
Regards,
Uday
Below is the complete code from my eventhandler method:
method ON_OVS .
" declare data structures for the fields to be displayed and for the table columns of the selection list
  types:
    begin of lty_stru_input,
"   add fields for the display of your search input here
      matnr type string,
      maktx type string,
    end of lty_stru_input.
  types:
    begin of lty_stru_list,
"   add fields for the selection list here
      matnr type string,
      maktx type string,
    end of lty_stru_list.
  data: ls_search_input  type lty_stru_input,
        lt_select_list   type standard table of lty_stru_list,
        ls_text          type wdr_name_value,
        lt_label_texts   type wdr_name_value_list,
        lt_column_texts  type wdr_name_value_list,
        lv_window_title  type string,
        lv_group_header  type string,
        lv_table_header  type string.
  field-symbols: <ls_query_params> type lty_stru_input,
                 <ls_selection>    type lty_stru_list.
  data: lv_matnr type mara-matnr,
        lv_maktx type makt-maktx.
  case ovs_callback_object->phase_indicator.
    when if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
" in this phase you have the possibility to define the texts,  if you don't want to use the defaults (DDIC-texts)
      ls_text-name  = `MATNR`.  "must match a field name of search
      ls_text-value = `Material Number`. "wd_assist->get_text( `001` ).
      insert ls_text into table lt_label_texts.
      ls_text-name  = `MAKTX`.
      ls_text-value = `Material Description`.
      insert ls_text into table lt_label_texts.
      ls_text-name = `MATNR`.  "must match a field in list structure
      ls_text-value = `Col1 -> Material Number`. "wd_assist->get_text( `002` ).
      insert ls_text into table lt_column_texts.
      ls_text-name = `MAKTX`.  "must match a field in list structure
      ls_text-value = `Col2 -> Material Description`. "wd_assist->get_text( `002` ).
      insert ls_text into table lt_column_texts.
      ovs_callback_object->set_configuration(
                label_texts  = lt_label_texts
                column_texts = lt_column_texts
                group_header = lv_group_header
                window_title = lv_window_title
                table_header = lv_table_header
                col_count    = 2
                row_count    = 10 ).
    when if_wd_ovs=>co_phase_1.  "set search structure and defaults
" In this phase you can set the structure and default values of the search structure. If this phase is omitted, " the search fields will not be displayed, but the selection table is displayed directly.
" Read values of the original context (not necessary, but you may set these as the defaults). A reference to " the context element is available in the callback object.
      ovs_callback_object->context_element->get_static_attributes
                                           ( importing static_attributes = ls_search_input ).
" Setting the default values to be displayed in the selection screen
    ls_search_input-matnr = 'D*'.
    ls_search_input-maktx = '*'.
"     pass the values to the OVS component
      ovs_callback_object->set_input_structure( input = ls_search_input ).
    when if_wd_ovs=>co_phase_2.
"  If phase 1 is implemented, use the field input for the selection of the table
"  If phase 1 is omitted, use values from your own context.
      assign ovs_callback_object->query_parameters->*
                              to <ls_query_params>.
      lv_matnr = <ls_query_params>-matnr.
      lv_maktx = <ls_query_params>-maktx.
replace all occurences of: '*' in lv_matnr with '%',
                           '*' in lv_maktx with '%'.
select a~matnr
       b~maktx into corresponding fields of table lt_select_list up to 10 rows
                 from mara  as a inner join
                 makt as b on a~matnr = b~matnr where
                 ( a~matnr like lv_matnr and b~maktx like lv_maktx and b~spras = 'EN' ).
"     call business logic for a table of possible values
"     lt_select_list = ???
      ovs_callback_object->set_output_table( output = lt_select_list ).
    when if_wd_ovs=>co_phase_3.
"   apply result
      assign ovs_callback_object->selection->* to <ls_selection>.
      if <ls_selection> is assigned.
        ovs_callback_object->context_element->set_attribute(
                               name  = `MATNR`
                               value = <ls_selection>-MATNR ).
        concatenate 'Description from MAKT:'
                    <ls_selection>-MAKTX
                    into <ls_selection>-MAKTX separated by space.
        ovs_callback_object->context_element->set_attribute(
                               name  = `MAKTX`
                               value = <ls_selection>-MAKTX ).
      endif.
  endcase.
endmethod.

Similar Messages

  • How to disable the input fields and labels.

    Hi,
         I have a requirement, when i click on button all the fields and labels in the form will be disable .

    Hi,
    You code wizard, in popup select set radio button and select the attribute and click on Ok, It will generate code automatically. Else find the below code
    DATA lo_el_context TYPE REF TO if_wd_context_element.
    lo_el_context = wd_context->get_element( ).
    CALL METHOD lo_el_context->set_attribute
    EXPORTING
    name = `DISABLE`  " Here disable is the name of attribute which u created in context of type wdy_boolean
    value =  'X' .
    Hope this helps u.,
    Thanks & Regards,
    Kiran.

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • In BSP how to give the input field as mandatory?

    Hi friends,
    In BSP how to give the input field as mandatory?
    In BSP i want to validate the input field (example checking the material no is valid or not)
    if this material no doesnot exit means i want to pass error message.What is the code for that.
    Moosa

    hi
    try this
    in LAYOUT
    <htmlb:inputField id = "vname"  disabled = "False" value = "<%= v_visitor %>"/> <font color="red" size="2"><b><%= page->messages->assert_message( 'vname' ) %></b></font></td>
    in DO_HANDLE_EVENT
    in oninputprocessing
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
        DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
        button_event ?= event.
      ENDIF.
        case event->id.
            when 'select'.
               if v_visitor = ''.
                 page->messages->add_message(
                 condition = 'vname'
                 message   = 'Visitor Name can not be blank'
                 severity  = page->messages->CO_SEVERITY_ERROR ).
              ELSE.
                    here u can write ur when ur field getting filled
            endif.
         endcase.
    endif.
    give marks if it is helpful
    thanks

  • How to put an input field in ALV

    hi
    how to put an input field in ALV

    Hi
    There are 2 ways wherein you can make a field as input enabled.
    One is by setting the edit = 'X' in the fieldcatalog for that field.
    Loop at l_fcat.
    if l_fcat-fieldname = 'FIELD'.
    l_fcat-edit = 'X'.
    modify l_fcat.
    endif.
    Endloop.
    Second method is by using Styles by which you enable a field, disable a field or make it a pushbutton etc..Using Styles can be found in any basic document on ALV.
    Regards
    Navneet

  • 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

  • How to disable certain form fields from a calculation with a check mark fields.

    How to disable certain form fields from a calculation with a check mark fields.
    In Canada we have to taxes
    I create a form that calculate them to a total
    I need to be able to turn off any of those to taxes to participate to the calculation and their visibile field should become 0
    I was thinking using a checkbox (when checkbox is on (Yes) the tax is calculated, Not ticked (Off) the tax is not calculated and the visible field should show 0 or nothing....
    I really need help on this one — I’m a complete newbie....
    Remark that the second tax is calculated on the sum of what the first tax add (first tax is pan-canadian tax (all provinces).
    The second tax is never use alone (Quebec only (on top of the Canadian one)
    Sometime for outside Canada sell - No tax at all is calculated....
    What should I do?

    I want to tank you to help, really appreciate —>
    This is the code and order... I just trow the checkbox in there (they have, so far, no purpose...)
    The code use is
    var a = this.getField("pricehorstx");
    event.value = Math.round (a.value * 7.25) / 100
    I guess -If the checkBox are check - The tax should be calculate — If “Off” the tax should be not calculated and PriceHST and /or PriceQST should show zero or be empty — The HST is always calculated in Canada, but the QST is added only in Quebec.
    I need to turn both to Zero for international sale.
    Message was edited by: Chacapamac

  • How to disable dragging selected text to web search?

    How to disable dragging selected text to web search?

    Hmm, I haven't heard of that before. It's a new tab page with no relation to what you were dragging?
    I wonder whether this might be a feature of one of your extensions. You can review them, and disable/remove any that are nonessential or unrecognized, here:
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    If you disable extensions, usually a link will appear above at least one of them to restart Firefox. You can complete your work on the tab and click one of the links as the last step.
    If that makes no difference, you could test in Firefox's Safe Mode -- that's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • Disable an Input field with the help of a radio button selection.

    Hi Guys,
    I know it is a very basic question and also has many threads for the mentioned query. None of the threads gave me a real clue about the problem. It is as follows:
    Simply, I have an input field and there are two more radio buttons on the screen, say rd1, and rd2.
    Initially Rb_gtgr is active and input field is blank and disabled, and when i select Rb_selgr, input field should be active and mandatory. It means when i try to execute the code with out entering any value after it is enabled, an error message should appear. For this the code is as follows:
    AT SELECTION-SCREEN OUTPUT.
      PERFORM screen_grace_on.
    AT SELECTION-SCREEN ON p_grace.
      PERFORM check_grace_days.
    FORM screen_grace_on .
      DATA: l_v_grace TYPE char2.
      CONSTANTS: l_c_grace TYPE char7 VALUE 'P_GRACE'.
    l_v_grace = p_grace.
    CLEAR p_grace.
      IF rb_selgr EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC'.
            screen-required = 1.
           screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC'.
            screen-input = 0.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " SCREEN_GRACE_ON
    FORM check_grace_days.
      IF rb_selgr EQ c_x AND  p_grace EQ 0.
        PERFORM screen_grace_on.
        MESSAGE e492(/ams/ramfcmess1).          " Enter the number of Grace days
      ELSEIF rb_selgr EQ c_x AND p_grace GE 0.
        PERFORM screen_grace_on.
      ENDIF.
    ENDFORM.
    Ideally this code should work since in the PBO i.e., At selection screen output i am enabling the fields, and also when i select the second radio button i am also checking for the value too..
    I am working on 4.7 version of SAP. The Most interesting observation is it works fine for few variants, and not with others.
    Thank you

    Hi,
    Go through this following code,
    selection-screen begin of block B2 with frame title TEXT-005.
    selection-screen begin of line.
    parameters:     P_BIRPT type C radiobutton group RAD1 default 'X' user-command UCOMM.
    selection-screen comment 3(20) TEXT-002 for field P_BIRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_COLRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-003 for field P_COLRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_PAYRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-004 for field P_PAYRPT.
    selection-screen end of line.
    selection-screen end   of block B2.
    selection-screen begin of block B1 with frame title TEXT-001.
    select-options: SO_KTOKD for  KNA1-KTOKD modif id M4,
              SO_BLART for  BSIS-BLART modif id M2.
    parameters:     P_PAID   type ZCLEAR     modif id M3 as listbox visible length 20.
    selection-screen end   of block B1.
    at selection-screen output.
      loop at screen.
        if P_BIRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2' or SCREEN-GROUP1 = 'M3' .
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_COLRPT eq 'X'.
          if SCREEN-GROUP1   = 'M3'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_PAYRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
          if SCREEN-GROUP1   = 'M4'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        endif.
      endloop.
    Thanks
    Anil D

  • How to add an input field in the web UI of CRM 2007

    Hi everybody.
    I want add an Input field in the Web UI Screen. How it is possible.
    I want get the information with detailed descriptions if possible with screen shorts.
    What type of methods it will be generated and what are the code we entered in those methods.
    Take according to any example. But with detailed description.
    I am new for the CRM 2007. So, please give the screen shorts with proper data.
    Not only adding the field. If any data i entered in the adding field then that will be stored in the tables otherwise no use by adding the field.
    So, Can anybody please send a proper information according to this.
    Here another one How to Add our own table (Ztable) field in the Web UI Screen.
    How to add the same field in the BOL.
    Please expalin about those concepts with full of screen shorts messages.
    Thank You.
    Regards,
    Krishna.

    If you want to add extra standard fields (like one you mentioned), you can use Component Workbench and Copy the configuration and create your own configuration and make the "Available Fields" appear there.
    If the standrd field is not available, you can Add Context Node using wizard and make it visible.
    If its a custom field (a new one); you will have to use EEWB and add the fields and then make it visible in the UI using Component Workbench.
    Regards,
    Alin

  • Disabling one input field if i enter text in second inputfield

    Hi,
    I am new to WebDynpro. My problem is very simple. I have two input fields. When i enter text in one input field i want the second input field to be disabled & Vice versa. The idea is that i want to give the user the option to enter in only 1 input field of his choice. The second input field should automatically get disabled. He can choose any input field of his choice. The second one should get disabled.
    EG: Assume that there are two input fields "Item No" & "Material". The user wants do a search using any one of these parameters, but not both. So, when he chooses to do a search based on "Item No", the "Material" input field should be greyed out(disabled). And, vice versa. The user may decide to choose any one of these fields.
    Please advise.

    This is not possible because there is no "onFocus" event on the input field.
    But you could use two radio buttons R1, R2 to enable exactly one of the input fields F1, F2 at a time.
    In the view designer, set R1.keyToSelect = "1", R2.keyToSelect = "2".
    Bind R1.selectedKey and R2.selectedKey to a common context attribute A (type string).
    If (at runtime) A contains "1", radio button R1 is selected, if A contains "2", radio button R2 is selected.
    To enable input field F1 exactly if R1 is selected:
    Create a calculated boolean attribute E1 that returns the boolean value ("1".equals(A)), bind property F1.enabled to E1. Do the same for F2.
    Armin

  • How to make a Input Field with multiple lines?

    hey folks,
    i need to make a popup window or a dynpro with 2 input fields, where the user can write on multiple lines. why isnt there such an input field in the screen painter? how can i make this? if i can do this with a dynpro it would be nice but a popup with that feature would be better. didnt found any infos anywhere except for that thread, but its answer didnt work with my dynpro:
    How to make a input/output field with multiple lines
    thx for any helping answer

    i made it just like in that thread but there is an error message telling that gv_custom_container is not declared.
    *  MODULE status_0110 OUTPUT
    MODULE status_0110 OUTPUT.
      CREATE OBJECT custom_container
        EXPORTING
          container_name              = 'TEXT_CONTROL'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5.
      CREATE OBJECT text_editor
        EXPORTING
          parent                     = gv_custom_container
          wordwrap_mode              = cl_gui_textedit=>wordwrap_at_windowborder
          wordwrap_to_linebreak_mode = cl_gui_textedit=>false
        EXCEPTIONS
          error_cntl_create          = 1
          error_cntl_init            = 2
          error_cntl_link            = 3
          error_dp_create            = 4
          gui_type_not_supported     = 5.
      SET PF-STATUS 'STATUS_0110'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                    "status_0110 OUTPUT
    Edited by: rafe b. on Oct 26, 2009 2:56 PM

  • How to disable the text field in File upload element?

    Hi,
    How can we disable the text field in the "File upload" UI element so that the user won't be able to type the file path there, but he will still be able to browse the file using the Browse button?
    Regards
    Praveen

    Hi Praveen,
    This is not possible with the Web Dynpro File Upload UI element.
    Thanks,
    Samta

  • How to validate the input field

    Hi,
    I have a input form which is draged from input port of a RFC.
    in this input form i have two input fields nad submit button.
    on of this input field should always take the character values only. it should not take any numeric value
    and other input field should always take numeric value only.
    i.e how to validate this two input fields.
    regards
    srinivas

    Hi,
    U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows
    http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm
    There are two ways to achieve ur task.
    1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following
    http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
    http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW
    2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this
    http://aspzone.com/blogs/john/articles/173.aspx
    Everything has been given for validating in javascript.i hope u also validating in javascript only.
    For more details on "Regular expressions" search google.
    Regards,
    Tamil K

  • How to clear the input fields

    when I click on search button, I get the search result, but along with those results, I see some input fields automatically assigned the values in the search input, which should not be.
    values are assigned to these fields because of controller context field values, once the values are populated these values are assigned everywhere where istle feild referring to.
    How to keep the user input without changes?
    Thanks!

    Naveen,
    You set contradictory requirements: on one hand you have mapping, where values are always synchronized; on other hand you whant them to be unique.
    Just break your existing mappings.
    1. Create separate attributes in view context(s) if you do not need to access them in component controller or you do not need to be synchronized between views.
    2. Create unique set of attributes in component controller for combination of attributes that really must be synchronized. Then map view context attributes accordingly.
    VS

Maybe you are looking for

  • IPad 2 won't restore from backup or connect to the internet

    Hi, I'm having some trouble with a 2-month old iPad 2.  The first of which was a sudden failure to connect to the internet on wifi, despite being able to connect to the network.  Have searched extensively, I tried all the solutions I could: airplane

  • HT204266 The sound no longer works on my ipad?

    The sound no longer works on my iPad although when I put headphones in it does. When I press the volume button it comes up as "sound effects" but with no dots that would normally go up or down. When I double click the start button there is the normal

  • How to open *.pdf files in BOXI r2 inbox

    I am scheduling as  *.pdf file for deski report.After scheduling i am getting *.pdf in my inbox.if the report is deski or webi we can use FC_REPORT_ENGINE or WI_REPORT_ENGINE to open the report's using java code.In same way how to open *.PDF file in

  • Sending mail attachment with long filename in 4.6C

    Hi everyone, Our requirement needs to have a custom program to send a mail with a pdf attachment, which we have managed to work so far.  The problem is that the filename is 37characters long, which is absolutely necessary.  For example, my pdf filena

  • Need a Flash Based Image Editing Plugin

    Hello all, I am looking for a product out there I can plug into a website that will allow users to edit photos (crop, resize, tint, redeye etc). Any technology will be acceptable (Flash, Silverlight, AJAX .NET etc). So basically I am looking for a we