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

how to modify dynamic table ?

Former Member
0 Likes
503

i want to modify my dynamic table , but the table not

get the data .

-


this is my code :

read table <GT_TABLE> index g_index into <DYN_TABLE> .

CONCATENATE 'COL' WA_BSIK-BUDAT(4) WA_BSIK-BUDAT+4(2) INTO FIELD1.

ASSIGN COMPONENT FIELD1 OF STRUCTURE <DYN_TABLE> TO <F_FS>.

IF WA_BSIK-SHKZG = 'H'.

<F_FS> = <F_FS> + WA_BSIK-DMBTR * ( -1 ) .

ELSE.

<F_FS> = <F_FS> + WA_BSIK-DMBTR .

ENDIF.

-


i see that <DYN_TABLE> get the data , but the table <GT_TABLE> not get it , why ?

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
481

hi Dakota,

you have to write back the modified data from the work area to the internal table:

MODIFY <GT_TABLE> FROM <DYN_TABLE> INDEX g_index.

(please note you coded READ TABLE ... INTO and not READ TABLE ... ASSIGNING )

hope this helps

ec

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
482

hi Dakota,

you have to write back the modified data from the work area to the internal table:

MODIFY <GT_TABLE> FROM <DYN_TABLE> INDEX g_index.

(please note you coded READ TABLE ... INTO and not READ TABLE ... ASSIGNING )

hope this helps

ec

Read only

uwe_schieferstein
Active Contributor
0 Likes
481

Hello

It seems that there is an additional MODIFY required:


read table <GT_TABLE> index g_index into <DYN_TABLE> .
CONCATENATE 'COL' WA_BSIK-BUDAT(4) WA_BSIK-BUDAT+4(2) INTO FIELD1.
ASSIGN COMPONENT FIELD1 OF STRUCTURE <DYN_TABLE> TO <F_FS>.
IF WA_BSIK-SHKZG = 'H'.
<F_FS> = <F_FS> + WA_BSIK-DMBTR * ( -1 ) .
ELSE.
<F_FS> = <F_FS> + WA_BSIK-DMBTR .
ENDIF.
" Apparently <DYN_TABLE> has the modified value.
" Next update <GT_TABLE>:

  MODIFY <gt_table> FROM <dyn_table> INDEX g_index.

Regards

Uwe

Read only

Former Member
0 Likes
481

thanks both