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
824

hi,

LOOP AT i1_bsak.

READ TABLE i2_bsak WITH KEY augbl = i1_bsak-augbl.

IF sy-subrc = 0.

i1_bsak-wskto = i1_bsak-wskto - i2_bsak-wskto.

MODIFY i1_bsak TRANSPORTING wskto.

MODIFY i_bsak FROM i1_bsak TRANSPORTING wskto WHERE bschl = '31' and augbl = i1_bsak-augbl.

DELETE i_bsak WHERE bschl = '21' and augbl = i1_bsak-augbl.

ENDIF.

ENDLOOP.

the second modify statement is not working.

its telling i_bsak and i1_bsak is not compatible.

what do i need to do.??

8 REPLIES 8
Read only

Former Member
0 Likes
808

poonam,

here is your second modify statement:

MODIFY i_bsak FROM i1_bsak TRANSPORTING wskto WHERE bschl = '31' and augbl = i1_bsak-augbl.

you are looping on i1_bsak and reading i2_bsak table than how can you expect to modify i_bsak table.it is not in exsitance in your piece of code.

kindly check and confirm.

Amit.

Read only

0 Likes
808

even then its telling me the same error.

Read only

Former Member
0 Likes
808

Structure i_bsak and i1_bsak must be same

Regarsd

Rajesh

Read only

0 Likes
808

hi,

if the structure is not the same then wat do i need to do.

any other option?

Read only

Former Member
0 Likes
808

hii poonam,

it will work for i1_bsak but not for i_bsak. as you are not looping or reading i_bsak table.if you want to perform on i_bsak then have one more loop on i_bsak then use MODIFY statement.

regards

twinkal

Read only

0 Likes
808

i have used read i_bsak.

even then the same error.

Read only

0 Likes
808

i have used read i_bsak.

even then the same error.

Read only

0 Likes
808

Hi

LOOP AT i1_bsak.
   READ TABLE i2_bsak WITH KEY augbl = i1_bsak-augbl.
   IF sy-subrc = 0.
      i1_bsak-wskto = i1_bsak-wskto - i2_bsak-wskto.
      MODIFY i1_bsak TRANSPORTING wskto.
*MODIFY i_bsak FROM i1_bsak TRANSPORTING wskto WHERE bschl = '31' and augbl = i1_bsak-augbl.
      i_bsak-wskto = i1_bsak-wskto. 
      MODIFY i_bsak TRANSPORTING wskto WHERE bschl = '31' and augbl = i1_bsak-augbl.
      DELETE i_bsak WHERE bschl = '21' and augbl = i1_bsak-augbl.
    ENDIF.
ENDLOOP.

Max