‎2010 Jan 29 11:59 AM
Hello Frnds
How do I create an Update BAPI, from what I have known till now in SE37 when I create a FM under attributes either I can select
> remote enabled
or
> Update
I cant select both so how do I go about this? additionally how can I have a return attribute in the update function module as its not allowed to have one?
Any help would be appreciated.
Regards
Sujoy
‎2010 Jan 29 2:02 PM
Hi friend, I think you got the concepts confused. Remote-Enabled function modules are functions that can be called from other systems, say SAP PI for example. Update Modules are called withing SAP programs using the addition IN UPDATE TASK and the behaviour is defined by the radio buttion you select under "Update module". This can be usefull (for example) if you need to update some tables in a user-exit and you only want them to be updated if the transaction commits, not even before of after that. That's to maintain the consistency. So...please tell me what is your requirement and I'll see if I can help you.
Regards,
Pablo
‎2010 Jan 29 2:25 PM
Well Pablo
Thanks for finding time to have a look into the issue.
Just got a code snippet which resolved my doubt , well I have still one doubt how a commit in a BAPI works, is it automatically called , as even if I register FM as Update task and dont do an commit work how the FM registered as update task will be called?
Regards
Sujoy
‎2010 Jan 29 3:03 PM
Usually BAPIs don't do the COMMIT WORK. They used to, but now they don't. You can always take a look at the code and see if there is any commit work.
Beware, sometimes you will find something like this:
a = 2.
IF a = 1.
COMMIT WORK.
ENDIFthat will obviously not do a COMMIT WORK, but if you are testing in SE37 and want to do a commit, just set a break-point and change the "a" value. If you are calling the BAPI from another system, you can use BAPI_TRANSACTION_COMMIT.
I hope I have helped you. Regards,
Pablo