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

Error in Modify

sergio_cifuentes
Participant
0 Likes
1,361

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,259

Hi,

You have to use MODIFY z...FROM TABLE ...

Ex..

MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario.

Thanks

Naren

9 REPLIES 9
Read only

Former Member
0 Likes
1,259

I dont understand why are you using Modify, use append.

Read only

0 Likes
1,259

APPEND to a ztable? how?

Read only

Former Member
0 Likes
1,259

use commit work after the modify .

modify .....
if sy-subrc eq 0.
 commit work.
endif.

Read only

0 Likes
1,259

thank's but it doesn't work.

Read only

Former Member
0 Likes
1,260

Hi,

You have to use MODIFY z...FROM TABLE ...

Ex..

MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario.

Thanks

Naren

Read only

0 Likes
1,259

Thanks Naren it Works!!

Read only

0 Likes
1,259

Sergio,

Sorry I did not read your question properly.

Read only

Former Member
0 Likes
1,259

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

Read only

Former Member
0 Likes
1,259

Hello

Try changing

MODIFY zcmtt_inventario FROM ti_zcmtt_inventario

to :

MODIFY zcmtt_inventario FROM TABLE ti_zcmtt_inventario

Regards

Greg Kern