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

modify statement

Former Member
0 Likes
617

I want to modify one internal table from another internal table.

I have my code as below

it2_vbrk = it1_vbrk.

DELETE it2_vbrk WHERE aubel <> space.

SELECT vbelv

vbeln

INTO it_vbfa

FROM vbfa

FOR ALL ENTRIES IN it2_vbrk

WHERE vbeln EQ it2_vbrk-vbeln

AND vbtyp_v EQ 'C'.

ENDSELECT.

DELETE ADJACENT DUPLICATES FROM it_vbfa.

LOOP AT it_vbfa.

it1_vbrk-aubel = it_vbfa-vbelv. "sales order

MODIFY it1_vbrk WHERE vbeln = it_vbfa-vbeln

TRANSPORTING it_vbfa-vbelv.

ENDLOOP.

REFRESH : it2_vbrk.

CLEAR it2_vbrk.

I am having problems in the loop endloop of the table it_vbfa at the modify statement.

Shejal Shetty.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

Hi,

I think transporting should come first and then the where condition..

MODIFY it1_vbrk TRANSPORTING aubel

WHERE vbeln = it_vbfa-vbeln.

It should be AUBEL instead of vbelv, since you are trying to modify aubel..

Thanks,

Naren

5 REPLIES 5
Read only

Former Member
0 Likes
580

Hi,

You have to give transporting vbelv instead of it_vbfa-vbelv

MODIFY it1_vbrk WHERE vbeln = it_vbfa-vbeln

TRANSPORTING <b>vbelv</b>.

Thanks,

naren

Read only

0 Likes
580

Thanks Naren,

I tried it still has an error.

error-

"WHERE VBELN = IT_VBFA-VBELN" is not expected.

any suggestions.

shejal

Read only

Former Member
0 Likes
581

Hi,

I think transporting should come first and then the where condition..

MODIFY it1_vbrk TRANSPORTING aubel

WHERE vbeln = it_vbfa-vbeln.

It should be AUBEL instead of vbelv, since you are trying to modify aubel..

Thanks,

Naren

Read only

0 Likes
580

Thanks Naren.

Shejal Shetty.

Read only

Former Member
0 Likes
580

hi,

try this..

MODIFY it1_vbrk TRANSPORTING vbelv WHERE vbeln = it_vbfa-vbeln.

or

LOOP AT it_vbfa.

it1_vbrk-aubel = it_vbfa-vbelv. "sales order

if it1_vbrk-vbeln = it_vbfa-vbeln.

MODIFY it1_vbrk TRANSPORTING vbelv.

endif.

ENDLOOP.

hope this helps