cancel
Showing results for 
Search instead for 
Did you mean: 

convert WDR_CONTEXT_ATTR_VALUE_LIST to generic DATA type

Former Member
0 Kudos

Hi,

I have got value in one internal table of type WDR_CONTEXT_ATTR_VALUE_LIST. But to use the select option method

add_selection_field and use the parameter it_data , I need to convert it into generic type, because


DATA it_data type ref to DATA.

May I know how to do it?

regards,

Amit

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos
Former Member
0 Kudos

hi Amith ,

below code will work for your requirement ,

plz run this sample program in debugging mode and see how the value transfer to the variable of type type ref to

data :lt_range  type  WDR_CONTEXT_ATTR_VALUE_LIST ,
      ls_range like LINE OF  lt_range.

data : lt_tab type ref to data .
FIELD-SYMBOLS : <fs> type ANY TABLE .
*FIELD-SYMBOLS : <fs> type WDR_CONTEXT_ATTR_VALUE_LIST .

ls_range-value = 'test1'.
ls_range-text = 'one'.

APPEND ls_range to lt_range.
ls_range-value = 'test2'.
ls_range-text = 'two'.
APPEND ls_range to lt_range.

 create data lt_tab type  WDR_CONTEXT_ATTR_VALUE_LIST.
 ASSIGN lt_tab->* to <fs>.
 <fs>[] = lt_range.  " here your will get the value in type ref to data variable 

hope it will work .

Thanks & regards

chinnaiya .P

Former Member
0 Kudos

You can use Field simbols instead:

field-symbols: <FS> type any.

FIELD-SYMBOLS: <table> TYPE ANY TABLE.

Former Member
0 Kudos

hi,

can u pls explain this with an example? I want to assign range to the accounting group ( KTOKK).



DATA lt_range1 TYPE WDR_CONTEXT_ATTR_VALUE_LIST.
CALL FUNCTION 'ZVM_GET_ACCOUNTING_GRP'
  EXPORTING
    iv_uname               = sy-uname
 IMPORTING
   ET_KTOKK               = lt_range1. // ET_KTOKK is of type WDR_CONTEXT_ATTR_VALUE_LIST



// this it_range1 , I cannot assign in the parameter it_result
 wd_this->g_helper->add_selection_field( i_id = `KTOKK`
                                      it_result = // ?? how to pass range here
                                      I_DESCRIPTION = 'Accounting Group          '
      

                            I_NO_INTERVALS = ABAP_TRUE ).

thanks,

Amit

Edited by: amit saini on May 17, 2010 1:19 PM

Former Member
0 Kudos

DATA: lt_range TYPE STANDARD TABLE OF wdr_context_attr_value,

lt_range1 TYPE STANDARD TABLE OF wdr_context_attr_value,

ls_range TYPE wdr_context_attr_value.

FIELD-SYMBOLS: <ls_range1> TYPE ANY.

ls_range-value = 'Test'.

ls_range-text = 'Check'.

APPEND ls_range TO lt_range.

LOOP AT lt_range INTO ls_range.

ASSIGN ls_range TO <ls_range1>.

APPEND <ls_range1> TO lt_range1.

ENDLOOP.

Now you can use lt_range1whereever you want...

Hope it works for you.