10-05-2009 11:31 AM
Hi,
I am trying to write a method for a class through which I want to automate the Upload and download of data into Application Server from internal table. I will pass the internal table to the method ( number of the fields in the internal table vary ). I am able to get the data into the internal table, but unable to use it. Please help me know how to loop at the dynamic sized internal table and use the TRANSFER statement.
Thanks in Advance,
Regards
ChK
10-05-2009 11:45 AM
Hi,
Make use of field-symbols and use assign component statement.
Refer to this WIKI page to get an idea.
[http://wiki.sdn.sap.com/wiki/x/UYA_Bg]
FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE,
<fs_line> TYPE ANY,
<fs_field> TYPE ANY.
if <fs_table> is assigned
CREATE DATA obj2 LIKE LINE OF <fs_table>.
ASSIGN obj2->* TO <fs_line>.
LOOP AT <fs_table> ASSIGNING <fs_line>.
WHILE SY-SUBRC NE 0.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_line> TO <fs_field>.
IF <fs_field> IS ASSIGNED.
ENDIF.
ENDWHILE
* use TRANSFER over here
ENDLOOP.
endif.
This is just a rough code to make you understand the concept.
You need to build your own code accordingly.
Regards,
Ankur Parab
10-05-2009 11:45 AM
Hi,
Make use of field-symbols and use assign component statement.
Refer to this WIKI page to get an idea.
[http://wiki.sdn.sap.com/wiki/x/UYA_Bg]
FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE,
<fs_line> TYPE ANY,
<fs_field> TYPE ANY.
if <fs_table> is assigned
CREATE DATA obj2 LIKE LINE OF <fs_table>.
ASSIGN obj2->* TO <fs_line>.
LOOP AT <fs_table> ASSIGNING <fs_line>.
WHILE SY-SUBRC NE 0.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_line> TO <fs_field>.
IF <fs_field> IS ASSIGNED.
ENDIF.
ENDWHILE
* use TRANSFER over here
ENDLOOP.
endif.
This is just a rough code to make you understand the concept.
You need to build your own code accordingly.
Regards,
Ankur Parab
10-05-2009 12:14 PM