cancel
Showing results for 
Search instead for 
Did you mean: 

How to set 'Explanation property of input field of form, on action of event

Former Member
0 Kudos

Hi

I need to set 'Explanantion' property of input field on action of an event. I want to add text to explanation of the field dynamicly.

Kindly suggest.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

sahai
Contributor
0 Kudos

hi,

kindly explain your problem in detail.

regards,

sahai.s

Former Member
0 Kudos

Hi

for an input field, we see a list of properties. explanantion is one of the properties of input field. It is used to display help for that field.

[http://help.sap.com/saphelp_crm70/helpdata/EN/d7/ef8841e3af1609e10000000a155106/frameset.htm]

Please find the below link to get details for explantion property:

[https://cw.sdn.sap.com/cw/docs/DOC-20301]

Now, i have a requirement, that i am displaying errors on validation of a field in a message error. On click of error link, user should be navigated to the field and error will become explantion of the input field.

I am able to reach the field on navigation from error link. But i am not able to reach the explanantion property..

Kindly help to change the explanation text dynamicly

thanks!

gill367
Active Contributor
0 Kudos

Hello Ekta,

you can achieve this by wirting the code in wddomodify of the view to get the input field and change the explanation prperty of the field.

You can save the error you want to display in one of the context attribute when the event handler runs. and then in teh wddomodify wll change the explanation field accordingly.

here is the sample code which you need to write in wddomodify


data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,
      lr_inptfld type ref to cl_wd_input_field.
lr_inptfld ?= view->GET_ELEMENT( 'DEALER' ).
  DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_explanation LIKE ls_context-explanation.
* get element via lead selection
  lo_el_context = wd_context->get_element(  ).

* get single attribute
  lo_el_context->get_attribute(
    EXPORTING
      name =  `EXPLANATION`
    IMPORTING
      value = lv_explanation ).



lr_inptfld->SET_EXPLANATION( VALUE = LV_EXPLANATION ).


Please revert back for any issue.

Thanks

Sarbjeet Singh

Answers (0)