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: 

PO error message.

Former Member
0 Kudos

Hi people,

I'm tryin to change a Error message to Warning on PO, when the Vendor of the header is not equal the Vendor of the Item .

I changed the message when I insert the 1st contract item, but when I insert the 2st item the error appears again and don't change.

I insert the code bellow:

  • ----------------------------------------------------------------

if gw_mepoheader-lifnr ne v_lifnr.

ls_item = im_item->get_data( ).

gf_id = ls_item-id.

mmpur_metafield mmmfd_vendor.

if not gf_id is initial.

mmpur_remove_messages_by_id ls_item-id.

mmpur_business_obj_id ls_item-id.

endif.

mmpur_metafield mmmfd_vendor.

message id '06' type 'W' number '047' into gl_dummy.

mmpur_message_forced 'W' '06' '047' v_lifnr gw_mepoheader-lifnr '' ''.

call method im_item->invalidate( ).

endif.

*----


How can I change this status from 'E' to 'W' always this type message appears ?

Some one can help-me ?

tks to all...

1 ACCEPTED SOLUTION

tushar_shukla
Active Participant
0 Kudos

Flavio,

Few suggestions:

1. You should not issue message using 'MESSAGE' statement in the BADI implementation as this is not recommended. You are already using macro for this.

2. I think statement "call method im_item->invalidate( )" should not be used in case of Warning messages .

After this

3. If you are issuing the original message in your badi implementation e.g. during header processing or in any other methods of BADI, then remove the message and insert at item record processing method of the badi.

2 REPLIES 2

Clemenss
Active Contributor
0 Kudos

Hi Flavio,

I think this is a restriction that you have exactly one vendor in a purchase order. SAP system integration will create the respective open items for the vendor and trigger all the financial background for settlement.

Before you eliminate the error, the functional guy should explain how account determination and output control is handled for a purchase order with multiple vendors.

If you have to use different customer names for your supplier (because they are specific to products or product ranges), enter a value in the Vendor parts range in the additoinal data for the order item. The system uses this value as the Customer Identification Code in the SPEC message.

You can only do this, if you have maintained the possible types of vendor parts ranges in Customizing.

Regards,

Clemens

tushar_shukla
Active Participant
0 Kudos

Flavio,

Few suggestions:

1. You should not issue message using 'MESSAGE' statement in the BADI implementation as this is not recommended. You are already using macro for this.

2. I think statement "call method im_item->invalidate( )" should not be used in case of Warning messages .

After this

3. If you are issuing the original message in your badi implementation e.g. during header processing or in any other methods of BADI, then remove the message and insert at item record processing method of the badi.