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: 

Assign a unstructured string to a dynamic generated structure

Former Member
0 Kudos

Hello,

i want to assign a unstructured string to a dynamic generated structure, sp that i have acsess to the specific fields. How to do that?

Best regards,

TomSd

4 REPLIES 4

Former Member
0 Kudos

Hi Thomas,

You can use Field Symbols for that purpose.

Use the following syntax:

ASSIGN unstructured string TO <fs_table> CASTING TYPE (INT_TBL_NAME).

Where <fs_table> can be declared as follows:

FIELD-SYMBOLS: <fs_table> TYPE ANY.

And INT_TBL_NAME is a variable that holds the name of the dynamic structure.

Regards,

Urmila

Former Member
0 Kudos

Please reward points if this was useful.

0 Kudos

Hi,

the (INT_TBL_NAME) is generated dynamic by the method CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE. there i get a table RESULTDATA but i can't use this here.

after that i do following:

      • So RESULTDATA now points to our dynamic internal table.

ASSIGN RESULTDATA->* TO <FS_RESULTDATA_TABLE>.

      • Next step is to create a work area for our dynamic internal table.

CREATE DATA RESULTDATA_LINE LIKE LINE OF <FS_RESULTDATA_TABLE>.

      • A field-symbol to access that work area

ASSIGN RESULTDATA_LINE->* TO <FS_RESULTDATA_LINE>.

Best regards,

Thomas Strehle

0 Kudos

Thomas,

ASSIGN LS_RESULTDATA-DATA TO <FS_RESULTDATA_LINE>

Looking at it closely, you are already assigning a specific column of LS_RESULTDATA to the field synbol. So, the field symbols will point only a column of the work area. Why would DATA column again other columns like BASE_UOM?

Regards,

Ravi