Application Development 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: 

Z- table operations

Former Member
0 Kudos

Hi ,

I have a Z table , now I want to perform the following operations on it from my internal table.

1) Move the entire internal table to the Z table and delete the original contents of the Z table.

2) Move selected rows into the Z table from the itnernal table while retaining the original contents of the Z table

Can anyone give me the code for these.

3) Modify the Z table from the internal table and not insert duplicate entries.

I also want to know if coding is the only way to update Z tables , or can we use any SAP function modules.

Thank you .

4 REPLIES 4

Former Member
0 Kudos

hi

good

Loop at Itab.

Write : / itab-matnr,itab-maktx.

read table t_ztable with key itab-matnr.

if sy-subrc = 0.

t_ztable-maktx = itab-maktx.

modify table t_ztable from t_ztable transporting maktx.

else.

t_ztable-matnr = itab-matnr.

t_ztable-maktx = itab-maktx.

append t_ztable.

endif.

Endloop.

modify ztable from table t_ztable.

thanks

mrutyun^

Former Member
0 Kudos

HI,

U can try this for Inserting into Z-Table.

Eg:

TABLES SPFLI.

DATA WA TYPE SPFLI.

WA-CARRID = 'LH'.

WA-CITYFROM = 'WASHINGTON'.

...

INSERT INTO SPFLI VALUES WA.

WA-CARRID = 'UA'.

WA-CITYFROM = 'LONDON'.

...

INSERT SPFLI FROM WA.

SPFLI-CARRID = 'LH'.

SPFLI-CITYFROM = 'BERLIN'.

...

INSERT SPFLI.

For Modifying Z-Table,

MODIFY <Z-Table> FROM <wa> .

Regards,

Padmam.

0 Kudos

I would like to know all the other operations -

like how to delete the contents of the entire table ,

where commit work is used. and all that

Thank you .

Former Member
0 Kudos

You can create data using SE16.

Rob