cancel
Showing results for 
Search instead for 
Did you mean: 

PO line item's Condition type

Former Member
0 Kudos

We are planning to restrict certain condition types.

When I create a new line item in an existing PO, and if that line item contains the restricted condition type, then it should not allow to save the PO.

But the existing line item can have the restricted condition type, because it was created previously.

Accepted Solutions (0)

Answers (1)

Answers (1)

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Try with badi ME_PROCESS_PO_CUST, method CHECK

Regards

Eduardo

Former Member
0 Kudos

Hi,

The condition types of the new line items of the PO's are not got in that BADI.

Using that BADI "ME_PROCESS_PO_CUST" its possible to restrict only the existing line items condtion types.

Or can u please suggest where does the screen values of the new line items condition types are shown.

Debugged, but coulnt find the screen values of the new line items condition types.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Try something as this in method CHECK


  include mm_messages_mac.

  data: header       type mepoheader,
        items        type purchase_order_items,
        po_line      type mepoitem,
        line_item    type purchase_order_item,
        po_condition type mmpur_tkomv,
        wa_im_komv   type komv,
        eipo_line    type mepo_eipo.
 * .........

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

  loop at items into line_item.

    po_line = line_item-item->get_data( ).

    call method line_item-item->get_conditions
      importing
        ex_conditions = po_condition.

       loop at po_condition into wa_im_komv.
*      here, do your checks, use message 398(00) 
           mmpur_message 'E' '00' '398'
                          'text1' 'text2' 'text3' 'text4'.
       endloop.
  endloop.

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Using this above mentioned code, only the condition types of the existing line items are determined.

But the requirement is the new line items conditions should be found, then compare with the restricted condition type and display an error message.

Also can you please let me know whether all the line items have the same condition types?

For example, if the line item 10 contains the condition types as PBXX, NAVM and SKT0,

should the line item 20 also contain only these 3 condition types or it might be different. Pls suggest

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Then I think that you have to try with requirement VOFM in the pricing procedure (tcode M/08). See SAP Note 156230 - Requirements: What is permitted, what is not?. Although it is tagged as for SD it's also useful for MM.

Regards

Eduardo

Former Member
0 Kudos

Hi Eduardo,

But if we create a new routine, then the existing PO's line items are also getting affected.

The scenario is the existing PO line items should be as it is.

Only for the new line items created in the existing PO, certain condition types are to be restricted.

Regards,

Raaja

Edited by: RaajaKumar on Feb 7, 2012 2:00 PM

goutham2903
Explorer
0 Kudos

Hi Eduardo,

Thanks , Your Code helped me for PO item Condition Checking.

I need Small suggestion ,

My requirement is Which are all the Condition type satisfies my condition should throw a list of msg's.

What is happening in the above code is, if it reached Error msg then it is exiting the CHECK method.

I am able to display the error msg, But it is only displaying single error msg at a time, i want all the Error msg's in a single shot.