on 02-07-2012 9:31 AM
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.
Hi
Try with badi ME_PROCESS_PO_CUST, method CHECK
Regards
Eduardo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
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
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.
User | Count |
---|---|
106 | |
12 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.