cancel
Showing results for 
Search instead for 
Did you mean: 

How to get values in the parameters of a class CL_WD_CUSTOM_EVENT?

Former Member
0 Kudos

Hello All,

I have an object WDEVENT TYPE REF TO CL_WD_CUSTOM_EVENT.

now i have written the below code.

   DATA LT_PARAMS TYPE WDR_EVENT_PARAMETER_LIST.
   DATA LS_PARAMS TYPE WDR_EVENT_PARAMETER.  
  

*Check if toggle cell is getting expanded or colapsed.
  
LT_PARAMS = WDEVENT->PARAMETERS.
   READ TABLE LT_PARAMS INTO LS_PARAMS WITH KEY NAME = 'EXPANDED'.

   IF
LS_PARAMS-VALUE = 'X'. i.e. node expanded.

       I want to do some coding here to populate a table popin based on my requirement.   

But the problem is i am getting an syntax error saying i can not compare the ls_params-value with 'X' as ls_params-value is refreing to generic data type DATA.

i tried to get this value into fieldsymbol but still facing the same problem.

Pls suggest how can i compare this value? or how can i get the value in ls_params-value into any charecter variable?


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

solved my self..thankyou.. i have done in this way

   DATA LT_PARAMS TYPE WDR_EVENT_PARAMETER_LIST.
   DATA LS_PARAMS TYPE WDR_EVENT_PARAMETER.
   FIELD-SYMBOLS : <FS_VALUE> TYPE STRING.
   DATA : LV_VALUE TYPE C.

*Check if toggle cell is getting expanded or colapsed.
   CLEAR : LT_PARAMS[],LS_PARAMS.
   LT_PARAMS = WDEVENT->PARAMETERS.
   READ TABLE LT_PARAMS INTO LS_PARAMS WITH KEY NAME = 'EXPANDED'.
   ASSIGN LS_PARAMS-value->* TO <FS_VALUE> CASTING.


Answers (2)

Answers (2)

ThomasZloch
Active Contributor
0 Kudos

Moved to correct space as suggested by Amy.


Thomas

amy_king
Active Contributor
0 Kudos

Hi Ramanuja,

I think you didn't get any replies because the discussion is in the wrong forum. I think you wanted the community, Web Dynpro ABAP.

I know you've already solved the issue yourself, but in case it is helpful to you, class CL_WD_CUSTOM_EVENT has methods that will let you read an individual parameter and automatically cast it to a non-generic data type. For example,

  wdevent->get_char(
    exporting
      name =  'EXPANDED'
    importing
      value = lv_char01  ).

  if lv_char01 = 'X'. 
  *  node is expanded   
  endif.

You can also read all parameters at once, casting the name/value pairs to type string.

  wdevent->get_data(
    exporting
      name =  if_wd_application=>all_url_parameters
    importing
      value = lt_parameters  ). " type tihttpnvp

Cheers,
Amy