‎2009 Apr 06 10:30 AM
Hello,
I would like to do a loop at a select-option, the name of the select-option is in charlike field gr_rsel_paras->*-NAME. Both solutions do not work, who can help me? Thanks a lot.
field-SYMBOLS: <fs_range_t> type ANY TABLE,
<fs_range_s> type ACE_PARAM_NAME_RANGE.
loop at gt_RSEL_PARAS REFERENCE INTO gr_RSEL_PARAS where kind = 'S'.
gs_valutab_sel-SELNAME = gr_rsel_paras->*-NAME.
gs_valutab_sel-KIND = gr_rsel_paras->*-kind.
ASSIGN (gr_rsel_paras->*-NAME) to <fs_range_t>.
Short dump
loop at <fs_range_t> into <fs_range_s>.
...
endloop.
loop at (gs_valutab_sel-SELNAME) into <fs_range_s>.
... doesn't work because of the '('
endloop.
‎2009 Apr 06 10:32 AM
‎2009 Apr 06 10:40 AM
I want to fill the table gt_valutab_sel type RSPARAMS_TT with all select-options of my report to hand it over to a function module.
‎2009 Apr 06 10:46 AM
Hi:
Try....
field-SYMBOLS: <fs_range_t> type ANY TABLE,
<fs_range_s> type ACE_PARAM_NAME_RANGE.
loop at gt_RSEL_PARAS REFERENCE INTO gr_RSEL_PARAS where kind = 'S'.
gs_valutab_sel-SELNAME = gr_rsel_paras->*-NAME.
gs_valutab_sel-KIND = gr_rsel_paras->*-kind.
append gs_valutab_sel to gt_valutab_sel (internal table)
ASSIGN gs_valutab_sel-SELNAME to <fs_range_t>.
loop at <fs_range_t> into <fs_range_s>.
...
endloop.
loop at gt_valutab_sel into gs_valutab_sel
assign gs_valutab_sel-SELNAME-SELNAME into <fs_range_s>.
endloop.
‎2009 Apr 06 12:02 PM
Hi, I tested but it doesn't work, the select-options have many entries so I have to loop over the select-options. The name of the select-option is in gs_valutab_sel-SELNAME or gr_rsel_paras->*-NAME. Other suggestions?
‎2009 Apr 06 12:10 PM
Hi,
Use FM PRINT_SELECTIONS to get all your select options/parameters
Regards,
Srini.
‎2009 Apr 06 12:37 PM
Hi, PRINT_SELECTIONS prints the select-options in non-structured table, I finally need the values for further modification in my report in internal table with structure rsparams_tt. Do you know other FM which does this?
‎2009 Apr 06 12:40 PM
Hi..
Loop at the non structured table and move the contents of each iteration to another internal table which has structure similar to rsparams_tt.
Regards.
‎2009 Apr 06 12:47 PM
Hi, would be possible.
Thanks a lot for your help!!!
While testing, I've just found this solution.
FIELD-SYMBOLS: <fs_range_t> TYPE ANY TABLE,
<fs_range_s> TYPE ANY,
<fs_comp> TYPE ANY.
LOOP AT gt_rsel_paras REFERENCE INTO gr_rsel_paras WHERE kind = 'S'.
gs_valutab_sel-selname = gr_rsel_paras->*-name.
gs_valutab_sel-kind = gr_rsel_paras->*-kind.
CONCATENATE gs_valutab_sel-selname '[]' INTO gv_itab.
ASSIGN (gv_itab) TO <fs_range_t>.
LOOP AT <fs_range_t> ASSIGNING <fs_range_s>.
select-option has 4 fields (sign, option, high, low)
DO 4 TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_range_s> TO <fs_comp>.
CASE sy-index.
WHEN 1.
WRITE: / 'Sign: '.
gs_valutab_sel-sign = <fs_comp>.
WHEN 2.
WRITE: / 'Option: '.
gs_valutab_sel-option = <fs_comp>.
WHEN 3.
WRITE: / 'Low: '.
gs_valutab_sel-low = <fs_comp>.
WHEN 4.
WRITE: / 'High: '.
gs_valutab_sel-high = <fs_comp>.
ENDCASE.
WRITE <fs_comp>.
ENDDO.
APPEND gs_valutab_sel TO gt_valutab_sel.
ENDLOOP.
ENDLOOP.