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 - urgent

Former Member
0 Likes
497

hi all,

in PM module i m using "BAPI_EQUI_DISMANTLE" bapi and then "BAPI_transaction commit"..

Now my requirement is that after commit is one of my condition fails i need to revert bak/ Roll back the operation performed by BAPI_EQUI_DISMANTLE..

can any one suggest me some thing related to this..?

thnx

3 REPLIES 3
Read only

Former Member
0 Likes
422

Wait until you check the condition before doing the commit.

Rob

Read only

former_member186078
Active Participant
0 Likes
422

Hi Neha,

I dont much about that particular BAPI function module. But, one thing I can suggest you if you want to check the condition b/w BAPI fn module and commit:

If you are working in ECC 6.0 environment, then you are having a new concept called Enhancement spots which is similar to User exits/BADIs. By using that concept, inside the BAPI function module, search for an enhancement spot and create a new implementation and write your check and add a message into the return table the function module is returning. Now, between the BAPI call and the BAPI transaction commit function modules in ur code, check for that particular message and do not execute ur commit function module if u find that particular message. This only helps if you are using ECC 6.0.

But, if you want to check the condition after complete updating the data, then check for any simulate function module.

From,

Adithya K

Read only

Clemenss
Active Contributor
0 Likes
422

Hi neha,

if the documentation of this BAPI is correct:

Return Parameter                                                                                
Description                                                                                
In the event of error, this structure contains the following               
    information:                                                                                
o   Message type (Field TYPE)                                                                                
o   Message code (Field CODE)                                                                                
o   Message text (Field MESSAGE)                                                                                
In the event of success, the message type is set to 'S', otherwise the     
    structure is empty.                                                        

After callin FM BAPI_EQUI_DISMANTLE, check the RETURN-parameter::

IFreturn-type = 'S'.
** do all your follow-up actions here ***
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.

Regards,

Clemens

Message was edited by:

Clemens Li