Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using data from the internal table

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member555112
Active Contributor
0 Kudos

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

2 REPLIES 2

former_member555112
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks a Lot!!! I could use your concept to solve my issue.