‎2006 Jul 20 7:38 AM
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
‎2006 Jul 20 8:01 AM
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
‎2006 Jul 20 7:43 AM
Hi ,
you can use following stmnt.
UPDATE <target> FROM TABLE <itab>.
Regards,
Sumit.
‎2006 Jul 20 7:44 AM
You have to use
MODIFY TABLE <itab> FROM <wa> [TRANSPORTING <f1> <f 2> ...].
The fields that u entered in TRANSPORTING only omdified.
Regards
Abhishek
‎2006 Jul 20 7:47 AM
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
‎2006 Jul 20 7:56 AM
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
‎2006 Jul 20 7:58 AM
WHAT FIELDS DOES THE INTERNAL TABLE CONTAIN..... AND WHERE IS THE VBAK KEY FIELD HELD?
‎2006 Jul 20 8:08 AM
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.
‎2006 Jul 20 7:55 AM
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.
‎2006 Jul 20 8:01 AM
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