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_COMMIT and MESSAGE in IF_EX_ME_PROCESS_PO_CUST~CLOSE

Former Member
0 Likes
1,330

Hallo Everybody,

I´ve got the following Problem:

In ME21n when creating a Order I Need to Create Equipments with BAPI and therefor I have to process a BAPI_COMMIT and also I want to give the User some Messages TYPE 'I'.

Now I´ve read that in IF_EX_ME_PROCESS_PO_CUST~CLOSE it´s not allowed to use the Statement MESSAGE or send any commits.

No I wonder how to solve my Problem.

In RFC I can not send Messages or get USER-Inputs which I Need in my Function.

In IF_EX_ME_PROCESS_PO_CUST~CLOSE I'm not able to send Messages and use commits

In an USER Exit the DATA is not Committed and If something goes wrong I created Equi´s to which there is no Order.

Anyways the USER-Exit seems like the only possible way.

Is there one after the commit of ME21N ?

If not which would be the latest?  I mean one in which the commit to db was send already or one short before that.

I hope u can help me solving this Problem, any ideas and hints will be appreciated.

THX Richard

Thanks Klaus,

I left everything in the Method Close, because there is everything already on the Database in Table EKKO and EKPO and I´m sure that my Equi´s need to be created.

I left out my DB commit and my BAPI Commit and it works. Í don´t understand the Logic in it but it does what it should.

I mean it´s strange that when I am in the Method Close the Datset in EKKO is already on the DB, the one in EKPO is on the DB 1 Second later, I have to make a Do 10 times wait up till 1 seconds to be sure to read the ekpo.
So I guess there is a commit done in the standard.

Anyways in the end of the whole process the standard makes another commit, otherwise my equi´s wouldn´t be there and also my entrys in an z-table would be missing.

So Thanks a lot again and have a nice weekend!

Richard

7 REPLIES 7
Read only

Former Member
0 Likes
1,254

Hi Richard,

please read the documentation of interface IF_EX_ME_PROCESS_PO_CUST.

Try to use method POST instead of CLOSE for posting own data.

Regards,

Klaus


Read only

0 Likes
1,254

Additional Info:

If method POST has not the needed data, please try EXIT_SAPMM06E_013 of Enhancement MM06E005.

Regards,

Klaus

Read only

0 Likes
1,254

I guess I´ll prefer to go with the Exit.

I´ve got all the Data I need in it.

With all the method´s I have the Problem that I´ve read in the Documentation that Commits are not allowed. So if I want to Create some equi´s it is impossible without commit.

I could program all the User Communication with Dynpro´s and create the equi´s via rfc in other task but then I don´t know if everythin was succesfull.

Anny suggestions? - Otherwise I just go with the EXIT.

Thanks

Read only

0 Likes
1,254

Hi Richard,

I don't think you need a COMMIT in method POST., because all data will be comitted together from the transaction during UPDATE.

Regards,

Klaus

Read only

0 Likes
1,254

Thanks Klaus,

I left everything in the Method Close, because there is everything already on the Database in Table EKKO and EKPO and I´m sure that my Equi´s need to be created.

I left out my DB commit and my BAPI Commit and it works. Í don´t understand the Logic in it but it does what it should.

I mean it´s strange that when I am in the Method Close the Datset in EKKO is already on the DB, the one in EKPO is on the DB 1 Second later, I have to make a Do 10 times wait up till 1 seconds to be sure to read the ekpo.
So I guess there is a commit done in the standard.

Anyways in the end of the whole process the standard makes another commit, otherwise my equi´s wouldn´t be there and also my entrys in an z-table would be missing.

So Thanks a lot again and have a nice weekend!

Richard

Read only

0 Likes
1,254

Oh No,

now I found out it´s not like I thought. it´s even more STRANGE

Like I said before:

when entering my function inside the method close the ekko dataset is already on the DB, the ekpo is being committed and on the DB after 1 Second.

Afterwards I Create some Equi´s without BAPI_COMMIT.

Then I put in some entry in a Z-Table without commit.

Then I Leave the method CLOSE and the Process of the Order is finished.

Now comes the Strange part. The Dataset in my Z-Table is on the DB - got committed somehow.

The Equi´s are not there, they are not commited and not on the DB.

I Put in for Test a Commit Work and Wait Statement at the very end of the method CLOSE and I have my Equi´s on the DB.

This works but is obviously not right - the documentation of the method close says: Don´t use Commits!

So I guess I have to move to a method more early, like Klaus said method POST.

But I need the Ekpo and Ekko Data. In the POST Method I only have the header.

I´ll try first if in method Post I get equis and z-table entrys without manual commits on the db.

Any hints welcome.

Richard

Read only

0 Likes
1,254

Hi Richard,

seems that your isuue is, that you are in COMMIT and the BAPI for equipment creation needs a COMMIT.

One idea could be to write a RFC enabled function module, which you call with

CALL FUNCTION ... STARTING NEW TASK ...

If this is possible during COMMIT, then you have the option to pass all needed data to the fucnction module and there call your BAPI and then BAPI_TRANSACTION_COMMIT, because you have left your UPDATE task.

I don't know, if this will work, but you can give it a try.

Regards,

Klaus