08-09-2012 2:13 AM
Dear Experts,
I have dynamic structure and a dynamic table.
FIELD-SYMBOLS : <fs_range> TYPE index table,
<fs_wa> TYPE ANY.
DATA : r_range TYPE REF TO data,
*Static Structure
DATA : BEGIN OF rr_log ,
sign TYPE bapisign,
option TYPE bapioption,
low TYPE acc_stddest, "Char 45
high TYPE acc_stddest," Char 45
END OF rr_log.
LOOP AT lt_variant INTO ls_variant.
* Get range table of S_matnr
r_range = wd_this->M_HANDLER->get_range_table_of_sel_field( lv_id ).
ASSIGN r_range->* TO <fs_range>.
rr_log-sign = ls_variant-sign.
rr_log-option = ls_variant-opt.
rr_log-low = ls_variant-low.
rr_log-high = ls_variant-high.
ASSIGN rr_log TO <fs_wa>.
APPEND <fs_wa> TO <fs_range>.
" <FS_WA> has all the value i.e. low & high but while appending it to <FS_RANGE>, value for HIGH is getting truncated because <FS_WA>-LOW & <FS_WA>-HIGH is of CHAR45 and RANGE TABLE for MATNR i.e. <FS_RANGE>-LOW & <FS_RANGE>-HIGH is of CHAR18,
Endloop.
Please help me in fixing this.
Best Regards,
Bhupinder
08-09-2012 4:54 AM
HI,
Try a SHIFT LEFT DELETING LEADING SPACE on rr_log-low and rr_log-high.
But your main problem is that you are appending a mis-matched structure onto a table.
Instead of doing an ASSIGN, then an APPEND, do the following:
APPEND INITIAL LINE TO <fs_range> ASSIGNING <fs_wa>.
MOVE-CORRESPONDING ls_variant to <fs_wa>.
Then you can see in debug what is happening to those values - you still may need to individually map the high and low fields...
Cheers,
Phil