cancel
Showing results for 
Search instead for 
Did you mean: 

how to use the is_selected method of if_wd_context_element API

former_member187977
Participant
0 Kudos

HI,

scenario : if the element is selected, I want to pass some of its attributes to the backend.

description : In a Context node, I want to check which elements are selected by the user. For this there is a method in the in if_wd_context_elemenent API in web dynpro ABAP. The method is called is_selected. How to use this method ?

Please give me an example. What does this method return. can I use it in the if condition.

Regards

seventyros

Edited by: seventyros on May 5, 2011 9:32 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member187977
Participant
0 Kudos

thanks !

Former Member
0 Kudos

Hi tryos,

IS_SELECT method is available at element and node level.

check this...

http://help.sap.com/saphelp_nw04s/helpdata/en/fd/be5b4150b38147e10000000a1550b0/content.htm

Check this is set_selected method, try with is_select also...

if lo_el_it_lips->is_selected ( flag = abap_true ).

endif.

// Node

DO count TIMES.

lo_nd_it_lips1->is_selected( // lo_el_it_lips - element has no index, only flag.

flag = abap_true

index = int ).

ADD 1 TO int.

ENDDO.

Cheers,

Kris.

Edited by: kissnas on May 5, 2011 9:49 AM

former_member187977
Participant
0 Kudos

hi,

The forum link you provided does not talk about is_selected. it talks about set_selected. I found that is_selected does not have any parameters. how can we use flag = abap_true in the bracket like IS_SELECTED( flag = abap_true ).

even if I use it as suggested by you, following error comes when compiling

formal parameter ' flag'' is not an importing parameter. It is a returning parameter.

Regards

seventyros

Former Member
0 Kudos

Hi,

if_wd_context_node - contains flag and index as parameters.

if_wd_context_element. - contains flag as parameter check once.

try like this..

data flag type wdy_boolean.

flag = lo_el_it_lips->is_selected( ).

if flag = 'X'. // row is selected else not.

endif.

Cheers,

Kris.

Edited by: kissnas on May 5, 2011 10:26 AM

former_member187977
Participant
0 Kudos

hi,

OK, I figured it out from some other resource on the internet.

the answer is : To check whether an element is selected in a node of selection 1..n, we need to do following

if elem->is_selected() is not initial.

// do something if node element is selected.

endif.

regards

seventyros

http://learnsaponline.blogspot.com

Edited by: seventyros on May 8, 2011 7:04 AM