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

asign field value

Former Member
0 Likes
485

Hi all,

I have table ZTAB1 with field name IDPAR value 'RSK1' an field FRPA vith value '10'.

how can I asign value 10 to structure ZREX-RSK1.

situation is tat field value of IDPAR will be name of structure field ZREX as I told.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
435

Hi,

try like dis....

FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE OF ZREX, u201C Dynamic internal table name

<fs_dyntable> LIKE LINE OF ZREX, u201C Field symbol to create work area

<fs_fldval> type any. u201C Field symbol to assign values

LOOP AT it_ztab1 into wa_ztab1.

ASSIGN COMPONENT wa_ztab1-idpar

OF STRUCTURE <fs_dyntable> TO <fs_fldval>.

<fs_fldval> = wa_ztab1-frpa.

ENDLOOP.

  • Append to the dynamic internal table

APPEND <fs_dyntable> TO <t_dyntable>. "the final work area with all the columns of ZREX with values

Hi,

try like dis....

FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE OF ZREX, u201C Dynamic internal table name

<fs_dyntable> LIKE LINE OF ZREX, u201C Field symbol to create work area

<fs_fldval> type any. u201C Field symbol to assign values

LOOP AT it_ztab1 into wa_ztab1.

ASSIGN COMPONENT wa_ztab1-idpar

OF STRUCTURE <fs_dyntable> TO <fs_fldval>.

<fs_fldval> = wa_ztab1-frpa.

ENDLOOP.

  • Append to the dynamic internal table

APPEND <fs_dyntable> TO <t_dyntable>. "the final work area with all the columns of ZREX with values

1 REPLY 1
Read only

Former Member
0 Likes
436

Hi,

try like dis....

FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE OF ZREX, u201C Dynamic internal table name

<fs_dyntable> LIKE LINE OF ZREX, u201C Field symbol to create work area

<fs_fldval> type any. u201C Field symbol to assign values

LOOP AT it_ztab1 into wa_ztab1.

ASSIGN COMPONENT wa_ztab1-idpar

OF STRUCTURE <fs_dyntable> TO <fs_fldval>.

<fs_fldval> = wa_ztab1-frpa.

ENDLOOP.

  • Append to the dynamic internal table

APPEND <fs_dyntable> TO <t_dyntable>. "the final work area with all the columns of ZREX with values