01-04-2012 10:24 AM
Hello all ,
I have came across a really strange situation.
I have done my coding in BADI ME_HOLD_PO as follows :
if im_ekko-bedat is not initial.
if im_ekko-bsart ne 'ZSTM'.
if im_ekko-bedat < sy-datlo.
message 'Purchase order date is in the past' type 'E'.
endif.
endif.
endif.
Now the problem is that the above message is not coming as an error message (at status bar) instead its coming like a message with that of type 'A' i.e the message is being displayed as a pop up and the screen is reseted with the press of enter.
01-04-2012 10:36 AM
Hello,
You've to understand in which programming event this BAdI is called to understand this behavior. You can also read the SAP documentation on the [behavior of messages|http://help.sap.com/abapdocu_702/en/abenabap_messages_types.htm].
BR,
Suhas
PS: Check out the demo program DEMO_MESSAGES to have a feel of how messages react during different programming events.
01-04-2012 10:36 AM
Hello,
You've to understand in which programming event this BAdI is called to understand this behavior. You can also read the SAP documentation on the [behavior of messages|http://help.sap.com/abapdocu_702/en/abenabap_messages_types.htm].
BR,
Suhas
PS: Check out the demo program DEMO_MESSAGES to have a feel of how messages react during different programming events.
01-04-2012 10:44 AM
Very thanks for ur prompt reply ,
can u tell me how to display it like a E message , that is at status bar and after the display of the message the user can be able to edit the field.
01-04-2012 11:06 AM
Dear Sir,
Shall i stick with SMOD instead or is there any other solution.
01-04-2012 11:09 AM
Hi,
You cannot simply put error message into every badi and expect to see error message on the calling screen. It might be running in update task and it should rollback previous updates in case of any error. It seems that the badi you are using is like that. Check your BADI parameters and try to find a suitable parameter to send back error message. If not, search for another BADI.
Abdulbasit.
01-04-2012 11:11 AM
Hello,
I see that the BAdI is called in the PBO module & hence the error message is behaving like this.
You can try something like this:
MESSAGE 'I think you shouldn't be doing this' TYPE 'S' DISPLAY LIKE 'E'.
NB: DISPLAY LIKE addition only changes the appearance of the message, but the behavior remains the same as TYPE.
BR,
Suhas
PS: If you read the BAdI documentation, this is meant to activate/deactivate the "Hold" function for PO. You should try to search for other BAdIs involved & implement the best one as per your requirement,
01-04-2012 11:15 AM
Shall i stick with SMOD instead or is there any other solution.
For which transaction are you checking this ???
01-04-2012 11:16 AM
Read the documentation of the BAdI, you'll know the transaction!
01-04-2012 11:19 AM
Suhas ...Already checked
I am in lower version of SAP now and no documentation available. I assume its ME21 or ME21N or ME22 or ME22N
01-04-2012 11:25 AM
Hello All ,
I am working on check for PO creation ( me21n).
I think BADI ME_PROCESS_PO_CUST and CHECK method inside it will be a better alternative.
Will the message type 'E' work properly inside this BADI ?
01-04-2012 11:32 AM
Hello Abdulbasit Sir ,
I think BADI ME_PROCESS_PO_CUST and CHECK method inside it will be a better alternative.
Will the message type 'E' work properly inside this BADI ?
01-04-2012 11:41 AM
Nobody here can address you the correct BADI. You need to test alternatives until you find the correct BADI.
In method CHECK of BADI ME_PROCESS_PO_CUST, there is a "CH_FAILED" parameter in this BADI. Try to use this parameter instead of sending message inside BADI.
01-04-2012 11:53 AM
Dear Sir ,
How to use "CH_FAILED" parameter in BADI for Message throwing purposes how will this make a difference.
01-04-2012 11:57 AM
I don't know. I just guessed by looking at the parameter list.
If you make a little search, I'm sure you fill find lots of documentation.
01-04-2012 10:56 AM
This badi is not suitable for raising messages. You are just validating the PO header values, please check for other customer exits and available badis for this check. As you have not mentioned the transaction used its hard for us to give you a solution. So search for available exits and Badi's in SCN.
Kesav
01-22-2013 9:17 PM
I had the same issue. Implement your check in ME_PROCESS_PO_CUST~CHECK and issue message as follows.
CH_FAILED = MMPUR_YES.
MMPUR_MESSAGE_FORCED <your message data>.
-----------------------------------------
Then maintain an implicit enhancement spot in class CL_PO_HEADER_HANDLE_MM method GET_TRANSACTION_STATE and set the flag EX_PARKING_ALLOWED_FINAL = MMPUR_NO.
I exported a flag to memory in the CHECK method and imported it into GET_TRANSACTION_STATE to determine when to not allow parking.
This will prevent the user from being prompted with an option to HOLD/PARK the PO.
01-23-2013 5:01 AM