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

BAPI

sujoy_chowdhary
Product and Topic Expert
Product and Topic Expert
0 Likes
546

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

3 REPLIES 3
Read only

Former Member
0 Likes
512

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

Read only

0 Likes
512

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

Read only

0 Likes
512

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.
ENDIF

that 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