‎2015 Jul 30 10:40 AM
Hi,
I am trying to update the AUFK table for a service order that just got created in the previous statement. But the Modify nor update statement does not work.
I have a custom field in the AUFK table that I am trying to update (AUFK-ZFIELD)
Step 1:
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN' " This creates a new service order (IW31) and generates an order number aufk-1234.
Step2:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Step 3
UPDATE aufk
SET ZZ_FIELD = XXXX
WHERE aufnr = aufk-1234.
The above statement returns sy-subrc eq 4
I do not want to use the extension BAPI for this custom field update.
Can someone tell me why this doesn't work? I tried using the modify statement likewise with no effect.
‎2015 Jul 30 10:44 AM
Hi Ramiwal,
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' exporting WAIT = 'X'.
regards,
Archer
‎2015 Jul 30 2:07 PM
Hi Ramiwal,
Agree with Archer .
Reason why 'UPDATE' is not working is, in database the order number(aufnr = aufk-1234) is not yet created in AUFK table . When you are trying to update a field of a record which does not exists in database, its showing sy-subrc = 4 .
Use this CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' exporting WAIT = 'X' for synchronous updating .
Regards
DJ
‎2015 Jul 30 4:48 PM
Hi Archer, Jena,
Thank you for the response, but i believe i solved the issue.
It is because the data element referring to aufk-1234 had a conversion exit , and hence
was required to be converted before passing it to the Update statement.
Issue resolved
‎2015 Jul 31 12:49 PM
Hello Ramiwal,
I suggest you do not modify or update AUFK /any SAP standard tables .
During the BAPI process , look for a exit or Enhancement technique to pass the value of your custom field and let BAPI save the data on it own.
Ground rule is we should not write Modify/update on SAP standard tables.
Let me know if you need any further details.
Thanks,
Suresh Kutam