‎2007 Aug 24 6:47 AM
Which of these statements is correct. caz the ABAP editor gives no syntax error on any of these.
UPDATE PA0003 SET AEDTM = SY-DATUM UNAME = SY-UNAME BDERR =
VALID_DATE WHERE PERNR = INNNN-PERNR.
UPDATE PA0003 SET: AEDTM = SY-DATUM , UNAME = SY-UNAME , BDERR = VALID_DATE WHERE PERNR = INNNN-PERNR.
‎2007 Aug 24 6:48 AM
‎2007 Aug 24 6:49 AM
If both statement is true.
Then plz debugg your program and see the above mentioned syantax effec. As data is coming properly or not.
regards,
rewards point.
‎2007 Aug 24 6:50 AM
Hi,
Try this one always put try code when use update.
TRY.
UPDATE (table)
SET (set_expr)
WHERE (condition).
CATCH cx_sy_dynamic_osql_error.
MESSAGE `Error in update!` TYPE 'I'.
ENDTRY.
Rewards points if it is useful.
‎2007 Aug 24 6:52 AM
Hi,
Both are correct <b>as you might be knowing ':' is the operator used to list objects seperated by commas the second syntax is also fine.</b>
Regards,
Sesh
‎2007 Aug 24 6:58 AM
<b>both do the same</b>.
In 1st stament u r updating AEDTM , UNAME , BDERR fields of DB table hitting it only once.
In 2nd stament u r updating AEDTM , UNAME , BDERR fields of DB table one by one hitting the table thrice.
So 2nd is prefferable.
reward if helpful
‎2007 Aug 24 7:15 AM
For the 1st statement i got the three fields updated for the given PERNR
But the second statement changes BEDRR field of the given PERNR and AEDTM and UNAME for each and every entry in the table. damn it changes the whole table.
Message was edited by:
bilal sohaib