cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking ABAP web dynpro events in back end SAP

Former Member
0 Kudos

Hi Experts ,

I have

Is there any way to capture the events on th ABAP web dynpro in the backend.

The scenario is that i have some particular code which gets executed in the back end when User clicks on any button or tab in the appraisal document , which is ABAP web dynpro application.

I want this code to be executed only when User clicks on particular TAB/BUTTON on the ABAP web dynpro.

Are there any system tables that I can check.I am novice in ABAP Web dynpro.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,

I wud like to demonstrate this with example

suppose in ur WD screenu take the sales organization as input .

and u want to do smthing like this in backend :

u wud like to read VBELN from VBAK where VKORG is with in sales organization range entered in input field

create a context attributeinside a context node in Context Tab inside ur view

first bind the VALUE property of ur Input field to a context attribute

inside the method OnActionClick thn u wud use code wizard (control +f7) to read the context attribute which is binded to input field

u press CONTROL + F7 and select the radio button read context node/attribute


DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr.
*   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   get single attribute
    lo_el_cn_node->get_attribute(
      EXPORTING
        name =  `CA_ATTR`
      IMPORTING
        value = lv_attr ).
// I have read attribute CA_ATTR inside the node CN_NODE

thn u wud put select query to fetch from data base using the value lv_attr


DATA : vbeln type string .
SELECT SINGLE vbeln FROM vbak INTO lv_vbeln
    WHERE vkorg = lv_attr .

I hope it is clear nw

regards,

amit

Former Member
0 Kudos

hi ,

I want this code to be executed only when User clicks on particular TAB/BUTTON on the ABAP web dynpro.

yes this is possible to capture the event

u procced like this :

1 u have ur button UI , and there is a property OnAction for the UI , click on that

2 give some name of the Action suppose Click

3 so there wud be a method created OnActionClick in the Attribute's TAB

4 inside the method , OnActionClick , write ur logic , which ever event u want to capture

regards,

amit