Application Development and Automation 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: 
Read only

Error message & warning message while creating PO

jaheer_hussain
Active Contributor
0 Likes
4,559

Hi,

I have one requirement like when user create PO with 'critical material',while saving PO,user should get message "critical material".

For this ,in the enhancement MM06E005,EXIT_SAPMM06E_012(functional module),

I have written piece of code

***************************************************

*critical Material by Jaheer,ABAP & MM specialist

***************************************************

LOOP AT TEKPO.

IF TEKPO-MATKL EQ '9068'.

MESSAGE ID 'ZMM' TYPE 'W' NUMBER '013' with TEKPO-MATNR.

ENDIF.

endloop.

Here whenever I put message type 'E',I am getting message "critical material".But I donot want error message ,I want only warning message,so when I changed message type as "W",I am not getting any message while checking My PO.

What is the reason?

please,Can somebody throw some light on this?

With Reg,

Jaheer

6 REPLIES 6
Read only

Former Member
0 Likes
3,353

Hi Hussain,

You can try below option

MESSAGE ID 'ZMM' TYPE 'E' NUMBER '013' with TEKPO-MATNR DISPLAY LIKE 'W'.

Thanks,

Pawan

Read only

0 Likes
3,353

Hi,

it is not working with display like 'W'.

Any other solution????

Jaheer

Read only

madhu_vadlamani
Active Contributor
0 Likes
3,353

Hi Jaheer,

If you go with badi you can use macro then this issue will resolved.There also u can check with item level.

Regards,

Madhu.

Edited by: madhurao123 on Sep 21, 2011 4:03 PM

Read only

Former Member
0 Likes
3,353

Hi

Use this BADI ME_PROCESS_PO_CUST.

then use method POST, and get the items using method GET_ITEMS. Once you get the Material check for the requirement and pass the message.

If you want to check whenver the item is entered then use method PROCESS_ITEM

Shiva

Read only

eduardo_hinojosa
Active Contributor
0 Likes
3,353

Hi

Use the badi ME_PROCESS_PO_CUST, method CHECK, with a coding as this



  include mm_messages_mac.

  data: header       type mepoheader,
        items        type purchase_order_items,
        po_line      type mepoitem,
        line_item    type purchase_order_item.

  header = im_header->get_data( ).
  items  = im_header->get_items( ).

LOOP AT items INTO line_item.
 IF condition IS TRUE.  "critical material (line_item-matnr)
       mmpur_message 'W' 'ZMM' '013' line_item-matnr ' ' ' '  ' '.
 ENDIF.
ENDLOOP.

I hope this helps you

Regards

Eduardo

Read only

jaheer_hussain
Active Contributor
0 Likes
3,353

closed.Thanks to ALL....

Jaheer