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

Update / Modify

Former Member
0 Likes
428

Hi,

I have a ZTAB Table which has 10 fields and already have values in it.

Now I want to update two fields IDoc Number(11th field) and IDoc status(12th field) in table ZTAB.

I tried with both update and modify its not working.

Please let me know the declaration and how to use update and

modify.

Regards,

Priti

3 REPLIES 3
Read only

Former Member
0 Likes
400

hi Prithi,

do this way ..


loop at itab.
 lv_tabix = sy-tabix.
  itab-DOCNUM = '1000'.
  itab-STATUS = 'S'. 
  modify ZTAB from itab transporting docnum status .
endloop. 

Read only

Former Member
0 Likes
400

Hi,

DATA message_wa TYPE t100.

data it_message type table of t00.

loop at it_message into message_wa.

MODIFY t100 FROM message_wa.

ENDLOOP

UPDATE:-

The Open SQL statement for changing data in a database table is:

UPDATE <target> <lines>.

It allows you to change one or more lines in the database table <target>. You can only change lines in an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table <target> either statically or dynamically.

MODIFY:-

To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following:

MODIFY <target> <lines>.

If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, that is, the line is added.

To insert or change several lines in a database table, use the following:

MODIFY <target> FROM TABLE <itab> .

DELETE:-

The Open SQL statement for deleting lines from a database table is:

DELETE FROM <target> <lines>.

It allows you to delete one or more lines from the database table <target>. You can only delete lines from an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table <target> either statically or dynamically.

Regards,

Shiva Kumar

Read only

Former Member
0 Likes
400

solved on my own