Application Development and Automation 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: 
Read only

Assign a unstructured string to a dynamic generated structure

Former Member
0 Likes
692

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
Read only

Former Member
0 Likes
652

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

Read only

Former Member
0 Likes
652

Please reward points if this was useful.

Read only

0 Likes
652

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

Read only

0 Likes
652

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