06-17-2011 5:54 AM
Hi ALL.
I have a Zprogram using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.
and, I coded SD user-exit (FORM USEREXIT_SAVE_DOCUMENT_PREPARE (MV45AFZZ))
user-exit code is below:
-
FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
...
MESSAGE W0001(ZSD).
...
ENDFORM.
-
I'd like to get message of user-exit message from BAPI return,
but I can't get that.
I cna get only SAP standard messages from BAPI return.
If you know how to do, let me know please.
Regards.
Rie.
06-17-2011 6:40 AM
We have the following three options.
1.You can try exporting the message and importing after BAPI call.
2. Otherwise check how BAPI fills the message.
3. Look for some exit or implicit enhancement.
Hope it helps.
Thanks
Nabheet
06-17-2011 6:26 AM
Hi Rie,
please try
MESSAGE W001(ZSD).
instead of
MESSAGE W0001(ZSD).
The userexit is for changes and checks, so we used it only with error messages. If the above logic doesn't work, please make a try with E001 instead of W001. Just to check, that the message is given back to you.
Regards,
Klaus
Edited by: Klaus Babl on Jun 17, 2011 7:26 AM
06-17-2011 6:43 AM
Thank you, Klaus Babl .
I try to code 'MESSAGE E001(ZSD)'.
I can get the message, but it can't create sales order... of course...
I'd like to get the Warning message from BAPI return, and also it is not Error so I'd like to create a sales order.
is it impossible?
or I can do it using another user-exit??
If you know that, please let me know.
Regards,
Rie.
Edited by: Rie Nagakura on Jun 17, 2011 7:48 AM
06-17-2011 6:58 AM
Hi Rie,
did you try W001 instead of W0001? Cuase W0001 was too long for a message number it couldn't work. Are you sure that you don't get W001?
Regards,
Klaus
06-17-2011 7:06 AM
Hi, Klaus .
>did you try W001 instead of W0001? Cuase W0001 was too long for a message number it couldn't work. Are you sure that
>you don't get W001?
oh, I made a mistake typing...sorry.
first, I coded 'W001'.
but I can't get a message from BAPI return.
we can't get a message of type W?? only type E??
I tried also type S and type I, but I can't get.
if you have a good idea, please let me know.
Regards.
Rie.
06-17-2011 7:23 AM
Hmm,
found SAP note 1054781 which says "only errors" will be filled into bapi return table.
Please have a look at this note for further informations.
Regards,
Klaus
06-17-2011 7:42 AM
Thank you, Klaus .
The note is very helpful for me .
I try to FM 'BALW_BAPIRETURN_GET2' that I get the information from the note.
and if I can do it, I share the infomation.
Please wait for your award points!!
Regards,
Rie.
06-29-2011 7:33 AM
Hi.
I tried to use 'BALW_BAPIRETURN_GET2', but I don't know how to use the FM.
so I solved using ABAP memory.
I greatly appreciate your reply.
Regards
Rie.
06-17-2011 6:40 AM
We have the following three options.
1.You can try exporting the message and importing after BAPI call.
2. Otherwise check how BAPI fills the message.
3. Look for some exit or implicit enhancement.
Hope it helps.
Thanks
Nabheet
06-17-2011 6:47 AM
Thank you, nabheetmadan09.
>1.You can try exporting the message and importing after BAPI call.
You mean try to use ABAP memory?
I think It's an good idea.
>2. Otherwise check how BAPI fills the message.
>3. Look for some exit or implicit enhancement.
Do you know these exit or enhancement??
Regards,
Rie.
06-17-2011 6:51 AM
Hi,
Yes i am talking about ABAP memory.
What version of SAP are you using...?If it is ECC then you can use the concept of Implicit enhancements.
For exit... please let me know what are we trying to acheive then we can look at it.
Thanks
Nabheet
01-08-2013 8:52 PM
U can use abap memory but its not the right way of doing it .. call the following code in the user exit and it will return the message in the BAPI.
perform message_vbfs_aufbauen(sapfv45l) using 'V1'
'041'
'S'
space
space
space
space.
02-16-2022 6:47 AM
Thanks former member, who may never see this reply. But this was exactly what I was looking for and it worked with BAPI 'SD_SALESDOCUMENT_CREATE'.
Example on how I used it:
PERFORM MESSAGE_VBFS_AUFBAUEN(SAPFV45L) USING 'ZXXX' '049' 'E' XVBAP-POSNR SPACE SPACE SPACE.