03-13-2009 5:02 AM
Dear Gurus,
LOOP AT <selopt_range_table> ASSIGNING <selopt_range_line>.
I mean <selopt_range_line>-low is what I want but It will give me syntax error saying <selopt_range_line> is not a structure of table so has no value. In debug mode I can see that value but it will give me a syntax error if I say something like <selopt_range_line>-lowu2026. so let me know how do I.
Thanks in Advance,
Regards,
Satya
03-13-2009 5:11 AM
Hi Satya,
1. create another field symbol.
FIELD-SYMBOLS: <field> TYPE ANY.
2. Assign the field like this.
ASSIGN COMPONENT 'Low' OF STRUCTURE <selopt_range_line> TO <field>.
you may now use the field symbol <field> like this:
[variable] = <field>.
Regards,
Peter
03-13-2009 5:09 AM
Hi,
It seems there is problem in structure mismatch between structure of table and work area.
Thanks,
Asit Purbey.
03-13-2009 5:10 AM
Hi
Since it is a dynamic structure, it wont have the filed LOW while doing syntax check.
So you have to assign the field dynamically using ASSIGN COMPONENT.
Declare a FS,
FIELD-SYMBOLS: <gfs_field> TYPE ANY.
LOOP AT <selopt_range_table> ASSIGNING <selopt_range_line>.
ASSIGN COMPONENT 'LOW' OF <selopt_range_line> TO <gfs_field>.
IF sy-subrc = 0.
" Process <gfs_field>
ENDIF.
..
ENDLOOP.
03-13-2009 5:11 AM
Hi Satya,
1. create another field symbol.
FIELD-SYMBOLS: <field> TYPE ANY.
2. Assign the field like this.
ASSIGN COMPONENT 'Low' OF STRUCTURE <selopt_range_line> TO <field>.
you may now use the field symbol <field> like this:
[variable] = <field>.
Regards,
Peter
03-13-2009 5:14 AM
Hi,
Refer wiki code:
https://www.sdn.sap.com/irj/scn/wiki?path=/display/scm/apo%252bdelete%252bmaster%252bdata
Hope this helps you.
Regards,
Tarun
03-13-2009 5:20 AM
If you want to access field of a structure then you have to declare field symbols using
FIELD-SYMBOLS <FS> [<type>|STRUCTURE <s> DEFAULT <wa>].
else you can declare it as any and should use offset method to read required value from field sysmbol.
Hope this will help to clear your doubts.
Edited by: Sunil Sawaikar on Mar 13, 2009 6:20 AM
04-03-2009 6:09 AM