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 table VBAK

Former Member
0 Likes
1,938

Hi All,

I have a record in vbak table . need to update only a few fields for this particular record. the fields to be updates are in a internal table .

how do i update the table so that only that record is changed ?

Thanks and Regards,

Amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,401

Then use <b>UPADTE</b>


UPDATE vbak    SET   <DB table field1> = <new value> 
               WHERE <DB table field2> =         <b>AND</b>
                     <DB table field3> =         .

<i>Effect</i>

WHERE condition

Updates only those lines which satisfy the

WHERE clause condition.

Regards,

Arun S.

Message was edited by: Arun Sambargi

8 REPLIES 8
Read only

Former Member
0 Likes
1,401

Hi ,

you can use following stmnt.

UPDATE <target> FROM TABLE <itab>.

Regards,

Sumit.

Read only

Former Member
0 Likes
1,401

You have to use

MODIFY TABLE <itab> FROM <wa> [TRANSPORTING <f1> <f 2> ...].

The fields that u entered in TRANSPORTING only omdified.

Regards

Abhishek

Read only

Former Member
0 Likes
1,401

Hi

You can use the MODIFY statement

MODIFY <TABLENAME> FROM <INTERNAL TABLE OR WORK AREA> TRANSPORTING FIELDS <F1> <F2>.

where the fields F1 , F2 are the fields you want to get uodated

Read only

0 Likes
1,401

Hi All,

Thanks for the reply.

I can transport only the specified fields but these will be mass update . my internal table doesnt have primary key .where do i specify this ... so that only that record is updated ?

Thanks,

Amit

Read only

0 Likes
1,401

WHAT FIELDS DOES THE INTERNAL TABLE CONTAIN..... AND WHERE IS THE VBAK KEY FIELD HELD?

Read only

0 Likes
1,401

fields in the internal table are from the append structure . key(vbeln) is available in a field which is not a part of internal table.

Read only

Former Member
0 Likes
1,401

Hi Amit,

Use the <b>MODIFY</b> option.

<b>Inserts new lines</b> or <b>updates existing lines</b> in a database table (s. relational database). If a line with the specified <b>primary key</b> already exists, an <b>UPDATE</b> is executed. Otherwise, an <b>INSERT</b> is performed.


MODIFY  vbak     FROM TABLE it_vbak.
IF sy-subrc EQ 0.
MESSAGE 'Table updated successfully' TYPE 'S'.
ENDIF.

Regards,

Arun S.

Read only

Former Member
0 Likes
1,402

Then use <b>UPADTE</b>


UPDATE vbak    SET   <DB table field1> = <new value> 
               WHERE <DB table field2> =         <b>AND</b>
                     <DB table field3> =         .

<i>Effect</i>

WHERE condition

Updates only those lines which satisfy the

WHERE clause condition.

Regards,

Arun S.

Message was edited by: Arun Sambargi