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 TABLE does not work..

Former Member
0 Likes
1,540

Hi,

I have a structure for which I create a work area as well an internal table.

When I populate the work area, the value is filled in for the field status But when i try to do an update of the internal table based on the work area value, the internal table's status is not getting populated and is empty. Why ? I am using MODIFY TABLE itab FROM workarea.

TYPES: BEGIN OF st1,

vbeln TYPE vbak-vbeln,

status(15) TYPE C,

END OF st1.

DATA: ss1 TYPE TABLE OF st1,

workarea TYPE st1.

DATA: l_status TYPE C.

  • data is selectd and filled in ss1.

LOOP AT ss1 INTO workarea.

CLEAR: l_status.

SELECT SINGLE field INTO l_status

FROM tablenm

WHERE vbeln = workarea-vbeln.

IF sy-subrc IS INITIAL.

CASE l_status.

WHEN 'A'.

workarea-status = 'Not yet process'.

WHEN 'C'.

workarea-status = 'Completed'.

ENDCASE.

ENDIF.

MODIFY TABLE ss1 FROM workarea.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,220

Change the line listed here


ENDCASE.
ENDIF.
  MODIFY ss1 FROM workarea.  " <== remove TABLE 
ENDLOOP.

6 REPLIES 6
Read only

amit_khare
Active Contributor
0 Likes
1,220

Either use APPEND <work are> to <internal Table> or Use MODIFY with the TRANSPORTING statement.

Read only

Former Member
0 Likes
1,220

Hi ,

Use the option ( TRANSPORTING .... Field names ) in your MODIFY statemant.

Thanks,

Greetson

Read only

Former Member
0 Likes
1,221

Change the line listed here


ENDCASE.
ENDIF.
  MODIFY ss1 FROM workarea.  " <== remove TABLE 
ENDLOOP.

Read only

former_member125661
Contributor
0 Likes
1,220

try this :

TYPES: BEGIN OF st1,
vbeln TYPE vbak-vbeln,
status(15) TYPE C,
END OF st1.

DATA: ss1 TYPE TABLE OF st1,
workarea TYPE st1.
DATA: l_status TYPE C.

    * data is selectd and filled in ss1.
data: lv_tabix type sy-tabix.


LOOP AT ss1 INTO workarea.

lv_tabix = sy-tabix.
CLEAR: l_status.
SELECT SINGLE field INTO l_status
FROM tablenm
WHERE vbeln = workarea-vbeln.
IF sy-subrc IS INITIAL.
CASE l_status.
WHEN 'A'.
workarea-status = 'Not yet process'.
WHEN 'C'.
workarea-status = 'Completed'.
ENDCASE.
ENDIF.
MODIFY TABLE ss1 FROM workarea TRANSPORTING status index lv_tabix.
ENDLOOP.

Read only

Former Member
0 Likes
1,220

Can you please give me the exact syntax of MODIFY with transporting option ?

i need to update status based on Vbeln.

thanks

Read only

0 Likes
1,220

Pls roll your eye balls o_O

MODIFY TABLE ss1 FROM workarea TRANSPORTING status where vbeln eq ........   .