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: 

How to issue warning message in BADI ME_PROCESS_PO_CUST

vinod_vemuru2
Active Contributor
0 Kudos

Hi Guys,

I have already checked the forum regarding this. There are lots of threads. Unfortunately none of them helped me. I must be missing some thing in my code.

I tried issuing warning message in BADI ME_PROCESS_PO_CUST and method PROCESS_ITEM.

First i tried with normal message statement

MESSAGE w001(00) WITH text-001 text-002.

Didn't worked.

Next tried calling standard macros


  DATA:mmmfd_cust_01 TYPE mmpur_metafield VALUE 90000000.
  call method cl_contextfield_mm=>set_current_field
                                  exporting im_field = mmmfd_cust_01.
  mmpur_metafield mmmfd_cust_01.

mmpur_message_config 'W' 'X' ' '.      "Tried all permutations here
mmpur_message_forced 'W' '00' '001' text-001 text-002 '' ''.

Still no solution

Tried with macro mmpur_message also

Can some one helpme out to solve this issue.

Thanks,

Vinod.

1 ACCEPTED SOLUTION

former_member181995
Active Contributor
0 Kudos

MESSAGE WITH text-001 text-002 type 'W'.?Did you try this way?

17 REPLIES 17

former_member181995
Active Contributor
0 Kudos

MESSAGE WITH text-001 text-002 type 'W'.?Did you try this way?

0 Kudos

Hi Amit,

Thanks for the reply.

This syntax won't allow. I am in 4.7 system. We have to specify message ID and number.

Tried like this.

MESSAGE W001(00) WITH text-001 text-002.

MESSAGE WITH text-001 TYPE 'W'.

No use again:(

I think we have to explicitly handle the I/W/S messages in BADI's. If i give the as error it works. But i need warning.

I have checked Example implementation class CL_EXM_IM_ME_PROCESS_PO_CUST. They are handling using the macros i told in my first post.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Jan 10, 2009 11:17 AM

0 Kudos

Sorry for Syntax,though i'm away from SAP right now.I apologias for that.

0 Kudos

Hi all,

Does any one has any ideas!!!

What will be the implications if i issue error message with MESSAGE statement.

In BADI documentation it is mentioned that we should not use message statement.

But my req is to give error message and should be able to save PO.

If i give error message with message statement that is what happening.

Thanks,

Vinod.

0 Kudos

hi,

you can issue error messages in BADI.

We are using the same in IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM



   IF ls_mepoaccounting-ps_psp_pnr NE
       ls_mepoaccounting_prev-ps_psp_pnr.
  MESSAGE 'Not Allowed to change Accounting data of Previous years WBS '  TYPE 'E'.
      CALL METHOD im_item->invalidate( ).
      CONTINUE.
    ENDIF.

or



 IF sy-subrc NE 0.  " creating new line item in the old po
      CHECK ls_mepoaccounting-psp_pnr NE space.
      CHECK ls_mepoaccounting-psp_pnr(02) LT year+2(2).
      CONCATENATE 'WBS Element of Fiscal Year:' year ' IN Item:'
      ls_mepoaccounting-ebelp INTO l_text.
      mmpur_message_forced 'E' 'ME' '083' l_text ' '  ' '  ' '.
      CALL METHOD im_item->invalidate( ).
      CONTINUE.
    ENDIF.

0 Kudos

Hi all,

Thanks for the responce.

Not sure whether you have looked into BADI documentation or not. Please check below.


"Further notes
The above-mentioned macros are defined in the program MM_MESSAGES_MAC. Please include this program in your own application.
Never issue messages in BAdI ME_GUI_PO_CUST! This is the task of the business logic and must therefore be done via the BAdI ME_PROCESS_PO_CUST.
"Never use the ABAP statement MESSAGE in the BAdI ME_PROCESS_PO_CUST. Please use the macro mmpur_message_forced only. This macro only writes a message in the message collector.
If you wish to mark the business object as invalid in order to prevent posting, you must additionally use the INVALIDATE ( ) method of the relevant interface. In this connection, see also the code example in the PROCESS_ITEM method of the BAdI ME_PROCESS_PO_CUST.

I have tried almost all macros including mmpur_message_forced 'E' 'ME' '083' l_text ' ' ' ' ' '.

Not sure where i am missing:(

If i give error using MESSAGE statement it is working perfectly i.e. give error and save the PO. Only wanted to know if there are any implications.

Thanks,

Vinod

0 Kudos

Dear Sir,

Very Helpfull To Display error Message In ME29N..

ME_PROCESS_PO_CUST'

Regards,

uday..,

Former Member

Hi,



 INCLUDE mm_messages_mac. "useful macros for message handling
 mmpur_message_forced 'W' 'ME' '303' text-001 '' '' ''.

Regards

Sandipan

0 Kudos

Work! Thank you. in this case:

i try use MESSAGE 'TEST' TYPE 'E', it can be display in PO check dialog.but MESSAGE 'TEST' TYPE 'W' not work!

At last   

INCLUDE mm_messages_mac. "useful macros for message handling
mmpur_message_forced 'W' 'ME' '303' 'testtest' '' '' ''.

thank you again!

Former Member
0 Kudos

Hi Vinod,

Did you find any solution for this issue? as even I am facing the same issue.Request your help.

Thanks

SV

Former Member
0 Kudos

Hi,

Any solutions to issue warning message while creating a PO. I am also facing the same issue and searched all over the SDN but cudn't find exact solution for this.

If any one has found a solution please do post it.

Thanks & Regards.

Kumar.

Former Member
0 Kudos

Hi,

Any solutions to issue warning message while creating a PO. I am also facing the same issue and searched all over the SDN but cudn't find exact solution for this.

I would need to display the warning message at the bottom of ME21N tcode while creating PO.

If any one has found a solution please do post it.

Regards,

Rpn

0 Kudos

Any solution for this ,even I'm facing the same issue now.Pls help me.

Pranitha

renzodumo1
Explorer
0 Kudos

Use this function  POPUP_TO_DISPLAY_TEXT never fail

former_member207205
Discoverer

New OSS note released for this issue 1709562.

0 Kudos

The macro mmpur_message should be work.

MMPUR_MESSAGE ‘W’ ‘MM’ ‘123’ msgv1 msgv2 msgv3 msgv4.

0 Kudos

Hi vinod.vemuru2 and everyone,

I am facing issue while displaying warning message for multiple schedule quantity on status bar.

It shows warning message on status bar for only one schedule quantity out of 4, but it is showing all the 4 warning msg on information tab.

How can i display all warning msg on status bar as well.