Freely Programmed Value Help in the WebDynpro application (WebDynpro for ABAP)

...Previous

Go to Used Components tab and include the component created previously ZWDC_HELP_1 and name it as FREE as shown bellow...

Go to COMPONENTCONTROLLER and further to properties tab... Include that Used Component FREE as shown below...

Go to the Context of the COMPONENTCONTROLLER and there you will see the Interface node ND_TEXT which you have created in the previous component... Drag and drop it...

Create another Node ND_RESULT and an Attribute RESTEXT with Type as STRING, Input Help Mode as Freely Programmed and include the component name which you have defined as shown below...

 

Go to Methods tab and create an Event Handler Method TEST and include the event VH_DATA_SELECTED in the component use FREE as shown...

Double click that Event Handler Method TEST and write the following coding for getting the Input field value from FREE component and setting that value to the Attribute which you have created in this component... ( Get coding from the Read Context in Wizard )

   DATA LO_ND_ND_TEXT TYPE REF TO IF_WD_CONTEXT_NODE.
   DATA LO_EL_ND_TEXT TYPE REF TO IF_WD_CONTEXT_ELEMENT.
   DATA LS_ND_TEXT TYPE WD_THIS->ELEMENT_ND_TEXT.
   DATA LV_INPUT_1 LIKE LS_ND_TEXT-INPUT_1.

   DATA LO_ND_ND_RESULT TYPE REF TO IF_WD_CONTEXT_NODE.
   DATA LO_EL_ND_RESULT TYPE REF TO IF_WD_CONTEXT_ELEMENT.
   DATA LS_ND_RESULT TYPE WD_THIS->ELEMENT_ND_RESULT.
   DATA LV_RESTEXT LIKE LS_ND_RESULT-RESTEXT.
*   navigate from <CONTEXT> to <ND_TEXT> via lead selection
    LO_ND_ND_TEXT = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ND_TEXT ).

*   get element via lead selection
    LO_EL_ND_TEXT = LO_ND_ND_TEXT->GET_ELEMENT(  ).

*   get single attribute
    LO_EL_ND_TEXT->GET_ATTRIBUTE(
      EXPORTING
        NAME =  `INPUT_1`
      IMPORTING
        VALUE = LV_INPUT_1 ).

* navigate from <CONTEXT> to <ND_RESULT> via lead selection
  LO_ND_ND_RESULT = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ND_RESULT ).

* get element via lead selection
  LO_EL_ND_RESULT = LO_ND_ND_RESULT->GET_ELEMENT(  ).
LV_RESTEXT = LV_INPUT_1.
* Set single attribute
  LO_EL_ND_RESULT->SET_ATTRIBUTE(
    EXPORTING
      NAME =  `RESTEXT`
      VALUE = LV_RESTEXT ).

Click here to continue...

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image