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

select statement problem in fm

Former Member
0 Likes
370

HI,

I have a custom tabel with fields vbeln primary, erdat, erzet, ernam.

i have a function module which import parameter is SENDER type SIBFLPORB.

the values to sender come from workflow.

code in fm is:

data itab like zsab_test occurs 0 with header line.

select vbeln erdat erzet ernam from vbak into corresponding fields of table itab where vbeln = sender-instid.

modify zsab_test from itab.

but the data is not inserted in zsab_test table.

but in ITAB the record is there..

help me pls...

Regards

Giri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
349

Hello

I believe that you need a small change to the modify statement.

modify zsab_test from itab. " This will try to update zsab_test from the header line of itab which is initial

should be

modify zsab_test from table itab. " This will use the contents of the body of itab to update zsab_test.

Hope this helps.

Regards

Greg Kern

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
349

hi Giri

you are using modify.. its means that if the same pair of primary keys exist before.. it will modify it..

you might be needed to use update or insert statments.

Read only

Former Member
0 Likes
350

Hello

I believe that you need a small change to the modify statement.

modify zsab_test from itab. " This will try to update zsab_test from the header line of itab which is initial

should be

modify zsab_test from table itab. " This will use the contents of the body of itab to update zsab_test.

Hope this helps.

Regards

Greg Kern