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

syntax

Vijay
Active Contributor
0 Likes
314

Hi,

I have a scenario where I need to modify a Ztable field from an internal table.

Can anyone help me with a sample piece of code.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
296

Hi,

You can loop at your internal table you are using and then simply use the SET statement to modify the field of Z table.

You can even use a 'where' condition.

Here is a small example which i used in my program.

loop at IT_ITEM_EXP into WA_ITEM_EXP.

IF wa_item_exp-SFINPLAN = 01 AND

wa_item_exp-SGROUP_PLAN = 01.

update /rpm/item_d

set ZZFLD_YTDCAP = wa_item_exp-AMOUNT_REV

where EXTERNAL_ID = V_EXTERNAL_ID.

ENDIF.

endloop.

Thanks

reward points if useful

2 REPLIES 2
Read only

Former Member
0 Likes
297

Hi,

You can loop at your internal table you are using and then simply use the SET statement to modify the field of Z table.

You can even use a 'where' condition.

Here is a small example which i used in my program.

loop at IT_ITEM_EXP into WA_ITEM_EXP.

IF wa_item_exp-SFINPLAN = 01 AND

wa_item_exp-SGROUP_PLAN = 01.

update /rpm/item_d

set ZZFLD_YTDCAP = wa_item_exp-AMOUNT_REV

where EXTERNAL_ID = V_EXTERNAL_ID.

ENDIF.

endloop.

Thanks

reward points if useful

Read only

Former Member
0 Likes
296

Hi,

Try like:

DATA message_wa TYPE t100.

message_wa-sprsl = 'EN'.

message_wa-arbgb = 'MYMSGCLASS'.

message_wa-msgnr = '100'.

message_wa-text = 'Some new message ...'.

MODIFY t100 FROM message_wa.

Regards,

Shiva Kumar