‎2008 Jun 02 7:16 PM
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.
‎2008 Jun 02 7:28 PM
Change the line listed here
ENDCASE.
ENDIF.
MODIFY ss1 FROM workarea. " <== remove TABLE
ENDLOOP.
‎2008 Jun 02 7:23 PM
Either use APPEND <work are> to <internal Table> or Use MODIFY with the TRANSPORTING statement.
‎2008 Jun 02 7:27 PM
Hi ,
Use the option ( TRANSPORTING .... Field names ) in your MODIFY statemant.
Thanks,
Greetson
‎2008 Jun 02 7:28 PM
Change the line listed here
ENDCASE.
ENDIF.
MODIFY ss1 FROM workarea. " <== remove TABLE
ENDLOOP.
‎2008 Jun 02 7:29 PM
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.
‎2008 Jun 02 7:41 PM
Can you please give me the exact syntax of MODIFY with transporting option ?
i need to update status based on Vbeln.
thanks
‎2008 Jun 02 7:43 PM
Pls roll your eye balls o_O
MODIFY TABLE ss1 FROM workarea TRANSPORTING status where vbeln eq ........ .