Application Development 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: 

Narendran - "safety" when using MB_CF001/EXIT_SAPLMBMB_001/ZXMBCU01 ???

Former Member
0 Kudos

Narendran -<br><br>

As per your instructions here:<br><br>

<br><br>

I have researched enhancement MB_CF001, and in particular the exit EXIT_SAPLMBMB_001 with include ZXMBCU01.

<br><br>

The documentation on the enhancement itself says specifically that the function module EXIT_SAPLMBMB_001 is called BEFORE the commit work on MSEG.

But this documentation also says that you can't change the data going into MSEG via this exit - all you can do is find out what record is about to be posted.

<br><br>

So - here is my first question for you.

<br><br>

<b>Background:</b>

<br><br>

First, the customer has asked us to do an append structure on MSEG with four new fields. (I won't bother explaining right now why they want an append structure rather than a custom table.)

<br><br>

Second, in the ZXMBCU01 include called by EXIT_SAPLMBMB_001, the customer wants us to:

<br><br>

a) pop a screen to capture the four new fields for the append structure;

<br><br>

b) update the MSEG record with these fields, i.e. populate the append structure of the record.

<br><br>

<b>Obvious Question:</b>

<br><br>

If the exit and the include are called BEFORE the COMMIT WORK on the MSEG insert, how can I code (a) and (b) to make sure that the MSEG record is actually committed BEFORE I try to update it with the custom fields captured from the screen? Do I have to code an asynch module with a "try" that keeps on trying for the "committed" mseg mblnr?

<br><br>

A related question is whether I can actually call the screen from somewhere inside the include (e.g. my own FM), or whether this is not possible because the exit is actually in an update task.

<br><br>

Please let me know how you would do (a) and (b), assuming that it is possible to do them.

<br><br>

Thanks<br>

djh

8 REPLIES 8

former_member181923
Active Participant
0 Kudos

Please also see this related thread in workflow:

Former Member
0 Kudos

Hi,

The user exit that I had mentioned..Is for capturing the values that is getting stored in MKPF & MSEG..

If you see the FM MB_DOCUMENT_POST.

The user exit is getting called after the INSERT MKPF & INSERT MSEG ..statement..

I thought your requirement was to capture the values of MKPF & MSEG to be stored in custom tables..

Also if you want to modify the data in the MSEG data..I believe the BADI MB_DOCUMENT_BADI (Methods BEFORE_UPDATE & IN_UPDATE) & EXIT_SAPLMBMB_001 cannot be used...

So to answer your question..

a) A popup screen cannot be called in this user exit..As this user exit is called in UPDATE TASK..

b) I believe you cannot update the MSEG values in this user exit..

I will also check if there is any user exit or BADI for your scenario..

Thanks,

Naren

0 Kudos

Hi Narendran -

When I try to call a screen from within the 001 exit, the update terminates, and this termination verifies what you were saying - the screen can't be popped directly.

I want to try a submit program/return and see if this will work ...

thanks again ...

djh

Former Member
0 Kudos

Hi,

What are you planning to have in the SUBMIT program??

Thanks,

Naren

0 Kudos

Hi Naren -

I was going to try and call the data capture screen from the submitted program, but this won't work either.

When I invoke the exit with the submit program statement in the include, the MIGO update terminates.

This is getting very frustrating ... I'm thinking I may have to use the IQSM0007 exit to pop the screen, export the data to memory, and then import it back from memory in the 001 exit. That way, all I have to do is update my custom table in the 001 - no need to pop a screen or submit a program - I would use the background FM like you suggested.

If you have the time, please let me know what you think of this approach.

Thanks again

djh

Former Member
0 Kudos

Hi,

Looks like it will work...

Also Please keep me updated on this...

Thanks,

Naren

former_member181923
Active Participant
0 Kudos

If it doesn't work, I will let you know in a new thread ... and then maybe we can figure out what to do next ...

thanks very much again ...

djh

Former Member
0 Kudos

Sure..

Thanks,

Naren