‎2008 Nov 07 5:14 PM
Hi, i'm creating a FM that all that have to do is insert some data from one itab into a ztable, but when i use the MODIFY command doesn't insert the values that the itab have, it only insert one record with all the values with blanks, i check the sy-subrc but it says 0, heres my code:
FUNCTION YPRUEBA.
*"----------------------------------------------------------------------
*"*"Interfase local
*" TABLES
*" PZDSDE_INVENTARIO STRUCTURE ZDSDE_INVENTARIO
*"----------------------------------------------------------------------
DATA: ti_zcmtt_inventario TYPE STANDARD TABLE OF zcmtt_inventario WITH HEADER LINE,
wa_zcmtt_inventario LIKE zcmtt_inventario.
LOOP AT pzdsde_inventario.
CLEAR wa_zcmtt_inventario.
wa_zcmtt_inventario-clientesap = pzdsde_inventario-kunnr.
wa_zcmtt_inventario-fecha = pzdsde_inventario-datum.
wa_zcmtt_inventario-material = pzdsde_inventario-matnr.
wa_zcmtt_inventario-uniliq = pzdsde_inventario-zunidades.
APPEND wa_zcmtt_inventario TO ti_zcmtt_inventario.
ENDLOOP.
MODIFY zcmtt_inventario FROM ti_zcmtt_inventario.
ENDFUNCTION.
Thanks,
Sergio
‎2008 Nov 07 5:30 PM
Hi,
You have to use MODIFY z...FROM TABLE ...
Ex..
MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario.Thanks
Naren
‎2008 Nov 07 5:19 PM
‎2008 Nov 07 5:27 PM
‎2008 Nov 07 5:23 PM
use commit work after the modify .
modify .....
if sy-subrc eq 0.
commit work.
endif.
‎2008 Nov 07 5:27 PM
‎2008 Nov 07 5:30 PM
Hi,
You have to use MODIFY z...FROM TABLE ...
Ex..
MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario.Thanks
Naren
‎2008 Nov 07 5:32 PM
‎2008 Nov 07 6:26 PM
‎2008 Nov 07 5:31 PM
Check the internal table have all the data which you want to save.
Try to do that:
MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario[].Edited by: Alvaro Achin on Nov 7, 2008 6:32 PM
‎2008 Nov 07 5:31 PM
Hello
Try changing
MODIFY zcmtt_inventario FROM ti_zcmtt_inventario
to :
MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario
Regards
Greg Kern