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 return value ?

nikhil_bose
Active Contributor
0 Likes
2,422

Is it mandatory to set BAPIRETURN structure as return value for every BAPIs which we are creating?

The Function Module (remote) when i tried to wrap in the SWO1, it is not showing the output/table structure

where i may went wrong?

nikhil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,403

a RETURN structure is defined as an interface parameter of a BAPI which is used to log all the errors, warnings and the successful processes tha are triggered in the course of execution of a BAPI.

A successful execution of a BAPI requires the data to be commited and this process of performing a COMMIT is achieved by calling the BAPI_TRANSACTION_COMMIT' explicitly if there are no errors logged in the RETURN structure.

Hence it is mandatory to pass BAPI Return structure.

Reward Points if useful.

7 REPLIES 7
Read only

Former Member
0 Likes
1,404

a RETURN structure is defined as an interface parameter of a BAPI which is used to log all the errors, warnings and the successful processes tha are triggered in the course of execution of a BAPI.

A successful execution of a BAPI requires the data to be commited and this process of performing a COMMIT is achieved by calling the BAPI_TRANSACTION_COMMIT' explicitly if there are no errors logged in the RETURN structure.

Hence it is mandatory to pass BAPI Return structure.

Reward Points if useful.

Read only

Former Member
0 Likes
1,403

Yes it is mandatory to pass BAPI Return structure.

Try again obviously it will show the output/table structure.

Better u can elaborate your need. and actual requirement.

Regards

Srimanta

Read only

former_member156446
Active Contributor
0 Likes
1,403

there will be a chance of short dump.. may be in background processing..

Read only

former_member404244
Active Contributor
0 Likes
1,403

Hi,

yes we should maintain return structure for the bapi...becoz we have to capture the messages that will arise after executing the bapi...for a noraml function module we fenerally use exceptions to handle the errors but for bapi we use return structure for the same.

Regards,

nagaraj

Read only

rajesh_akarte2
Active Participant
0 Likes
1,403

yes u should declare the BAPIRETURN structure,otherwise it gives error in SWO1.

u can update the values in BAPIRETURN structure using the system variables like

r eturn-id = sy-msgid.

return-type = sy-msgty.

return-number = sy-msgno.

return-message_v1 = sy-msgv1.

return-message_v2 = sy-msgv2.

return-message_v3 = sy-msgv3.

return-message_v4 = sy-msgv4.

Reward if helpful............

Regards,

Rajesh Akarte

Read only

Former Member
0 Likes
1,403

Hi,

We need to release the function module after u create generally we do tht mistake then only it wont be visible in the swo1 tcode. So to release the function module u can go to se37 give ur fm name and in tht first page itself u will hav an option like release the fm so release it. Then u can view it in SWo1,..

Hope it will solve ur problem.

Regards,

Sana

reward if u found useful///

Read only

nikhil_bose
Active Contributor
0 Likes
1,403

thanks to all participants for quick response