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: 

Message with Type E coming like that of Type A

Sijin_Chandran
Active Contributor
0 Kudos

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.

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

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.

16 REPLIES 16

SuhaSaha
Advisor
Advisor
0 Kudos

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.

0 Kudos

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.

0 Kudos

Dear Sir,

Shall i stick with SMOD instead or is there any other solution.

abdulbasit
Active Contributor
0 Kudos

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.

0 Kudos

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,

0 Kudos

Shall i stick with SMOD instead or is there any other solution.

For which transaction are you checking this ???

0 Kudos

Read the documentation of the BAdI, you'll know the transaction!

0 Kudos

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

0 Kudos

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 ?

0 Kudos

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 ?

abdulbasit
Active Contributor
0 Kudos

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.

0 Kudos

Dear Sir ,

How to use "CH_FAILED" parameter in BADI for Message throwing purposes how will this make a difference.

abdulbasit
Active Contributor
0 Kudos

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.

kesavadas_thekkillath
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

Very Thanks for the info Maurice .

I had managed that issue.