Skip to Content
0
Former Member
Jun 02, 2008 at 06:16 PM

MODIFY TABLE does not work..

320 Views

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.