Help BADI ME_PROCESS_PO_CUST !?!?
Hi Friends,
I've created an implementation for BADI ME_PROCESS_PO_CUST to enhance TCode ME21n. I use method CHECK to check line item but I don't know how to collect the message error if any wrong data exists in that line item.
My message(s) will be collected as the original program do i.e :
Typ | Message text |
|----
|
Item 20 Sched.line 1
w | Can delivery date be met? |
When you chose that line above, program will bring you to the screen field that have wrong value.
Any one can help me collect the message(s)? Please!
Thanks,
Gy
Check if it's useful
DATA : lt_items TYPE purchase_order_items ,
ls_item TYPE purchase_order_item,
CALL METHOD im_item->get_data
RECEIVING
re_data = lt_item.
give the condition for the Error message
mmpur_metafield mmmfd_cust_01 .
mmpur_message_forced 'E' 'ME' '083' text-003 '' '' ''.
LOOP AT lt_items INTO ls_item.
CALL METHOD ls_item-item->invalidate( ).
ENDLOOP .
Similar Messages
-
Urgent Help Needed in BAdI ME_PROCESS_PO_CUST
Hello friends,
I m workin on BAdI ME_PROCESS_PO_CUST , my requirement is to store header level text in po if it is left blank by user , for this i have creadted standard text for every po header text , and implemeted method POST of the badi. so when user is saving the po , i m checking whether all header text is filled by user or not , for this i have called method GET_TEXT , if the text is blank i m reading data from standard text using READ_TEXT function module and setting in perticular text by using method SET_TEXT , every thing is working fine , the respective text ifrom standard text getting filled to the perticular text of the po , if left blank by the user . But the actual problem is that when i m going to display the same po again , the text that i was supplied by standard text is not showing in po.
is there is anything that i missed out , i also done coomit work , but its not working ,
so please suggest.......
dont worry abt pointsDear Mr Mahesh
I also face similar problem . But my limitation is that I am new to BADI . Sir it will be great help if you can please mail me the steps / procedure and code to be written for implementing the above BADI .
Sir , I look forward for your kind help please .
Regards
B V Mittal
[email protected] -
Custom tab data not saving in ME22N w/ BAdI ME_PROCESS_PO_CUST
Hello all,
I have implemented BAdis ME_PROCESS_PO_CUST & ME_GUI_PO_CUST and created a custom tab at the header level in ME21N/ME22N. I have fields such as Delivery Date and Ex Factory Date in my tab.
We are able to put data in these fields and have that data populate their respective fields in the Purchase Order.
Our users would like to be able to run ME22N and select certain line items and have only those items changed with the data from the custom fields.
So, my question is how do I handle line selection in the context of these BAdIs? Is there a way to know which lines have been selected and then only change the data in those items?
I have looked in Class CL_PO_ITEM_HANDLE_MM for an attribute or method that might help but I haven't found anything as of yet.
I have found that the field MEPO1211-TCSELFLAG is set when a line is selected in ME22N. However, I haven't found a way to work with it. It doesn't get passed to any of the methods in the BAdIs, as far as I know.
January 27, 2012 **************
We were able to capture the lines selected by using code from method mass_change in Include LMEGUICJK, Function Group MEGUI. The lines are in the lt_models table.
So, now my issue is getting data to save in ME22N. When I put data in my custom tabs and select a line, the data gets changed on the screen but does not save. It does work when I make a change in another field, like changing the description for instance. I'm using the set_changed method in Process_Header from ME_PROCESS_PO_CUST but it doesn't work.
I'm getting the idea that I'm the first ABAP developer to try this...
Thanks for any help.
Kind Regards,
Chris
Edited by: Chris Mowl on Jan 11, 2012 10:33 AM
Edited by: Chris Mowl on Jan 11, 2012 4:24 PM
Edited by: Chris Mowl on Jan 27, 2012 10:57 AM
Edited by: Chris Mowl on Jan 27, 2012 2:00 PMHi,
Checkout the below link :
<link to blacklisted site removed by moderator>
Shailaja Ainala.
Edited by: Thomas Zloch on Jan 28, 2012 9:06 PM -
BADI ME_PROCESS_PO_CUST
hi experts,
we are using me59n to create the stock transfer orders from stock transport requisitions. the requirement is during the creation of STO we need to stop the creation of STO for some of the STR based on custom logic. the logic needs the STR number.
i tried "check" method of BADI ME_PROCESS_PO_CUST and it seems working. i was able to stop the creation of PO based on some condition. but, in the actual requirement i need to to know STR ( that is purchase requisition number ) number in the method. based on the values in STR i need to stop the PO creation. i have checked the import parameters of the method but could not find anything.
but when i went inside IM_HEADER associated type IF_PURCHASE_ORDER_MM I this is the importing parameter of the "check" method) i found a method IF_MESSAGE_OBJ_MM~GET_PARENT. I am not sure whether this will help? or is there any other way u think i can get the STR number in this method.
or is there any other BADI / exit to meet this requirement.
thanksno replies from anybody
-
BADI - ME_PROCESS_PO_CUST - To update Condition Types at time of creation
Hi All
I'm relatively new to Implementing BADIs. I'm using the BADI ME_PROCESS_PO_CUST.
I have to update certain condition types with values determined from a custom table maintained for related Vendors.
I have created a 'Z' implementation for ME_PROCESS_PO_CUST and activated the implementation. But when I try to create a PO, the code doesn't seem to be execute!
Following is the code bundle -
METHOD if_ex_me_process_po_cust~process_header .
DATA : l_items TYPE purchase_order_items.
DATA : l_single TYPE purchase_order_item.
DATA : l_item_cond TYPE mmpur_tkomv.
CALL METHOD im_header->get_items
RECEIVING
re_items = l_items.
LOOP AT l_items INTO l_single.
CALL METHOD l_single-item->get_conditions
IMPORTING
ex_conditions = l_item_cond.
ENDLOOP.
ENDMETHOD. "IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER
Could you please give me your inputs on this?
Regards
Kripal
[email protected]Kripal,
The method PROCESS_HEADER gets trigerred only when you make an entry in any of the header fields and then press ENTER or do some action.
For a simple case of analysis put a break-point at
CALL METHOD im_header->get_items
RECEIVING
re_items = l_items.
in your code.
Now if you execute ME21N you will see that the code will not get triggered.But make an entry for one of the fields say fpr purchasing organisation.Now if you press ENTER or click on any other tab your code will get triggered.
Hope this helps.
<i>Reward helpful answers</i>
Cheers
Nishanth -
BADI ME_PROCESS_PO_CUST - DOES NOT CLEAR OUT ERROR
In ME21N I want to validate the field Commodity Code - STAWN. I have used the BADI ME_PROCESS_PO_CUST*
. Have used get_foreign_trade() in the PROCESS_ITEM method . I am able to throw an error . It is doing it but*
after throwing error then when we give a valid Commoditycode too it is still showing the error and not clearing the error .*
As suggested by Dean Q I used INCLUDE mm_messages_mac,
tried im_item->set_foreign_trade( ls_mepo_eipo) still when a valid Commodity code is entered after an invalid one it does not clear out the error. In fact on checking using break-point I found that the second time it does not enter into the method PROCESS_ITEM. Any help is welcome
NiveditaHi,
In SE18 give ME_PROCESS_PO_CUST as the enhancement spot and display. At the left side of the screen you can see the badi definition ME_PROCESS_PO_CUST. Expand the tree and double click on implementations. You can see the enhance implementations created. Double click on the enhancement implementation and in that screen there is a check box 'Implementation is active' and field 'Effect in current client'.
If you know the enhancement implementation name(not the badi implementation name), you can check it directly from se19.
Regards,
Poornima -
How to issue warning message in BADI ME_PROCESS_PO_CUST
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.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 -
Badi-- ME_PROCESS_PO_CUST, PROCESS_ACCOUNT method
Hi,
My requirement is that While Creating PO,if the first four characters of Cost Center and FundsCenter is not equal to Plant then an error message should be raised . For this i used
Badi>ME_PROCESS_PO_CUST and Method->PROCESS_ACCOUNT .
The problem is that in PROCESS_ACCOUNT method the parameter IM_ACCOUNT doesn't contain Plant value.
If I am using PROCESS_ITEM method,in this IM_ITEM is not capturing Fundscenter value.
Please help in solving the issue. Is there any User Exit or Badi which gives me Plant,CostCenter,FundsCenter Values.?
Thanks
K SrinivasHi,
You can use same Badi for getting Plant,CostCenter,FundsCenter. what are all values you are not getting for that you use field-symbols. like here for getting Plant value Try these steps.
1. Press F1 on PO Screen Plant value. Get Program name, screen field structure from that.
2. declare one variable as field as field-symbols, in badi.
FIELD-SYMBOLS: <lv_var> type any.
Assign '((SAPLMEGUI)MEPO1211-NAME1) to <lv_var>.
Here SAPLMEGUI is Program Name And MEPO1211-NAME1 is field structure of your program screen.
in <lv_var> you will get the value of plant.
Same process you can try for other fields also.
Regards
Vishnu Gupta -
Implementing Badi ME_PROCESS_PO_CUST
Hi all,
I'm trying to implement the BADI ME_PROCESS_PO_CUST, the method PROCESS_ITEM, and I'm trying to change the field ls_positem-lebre, but it doesn't works. I've seen that this field is in the mepoitem_tech structure in the method set_data and it restores this value to his old value, anyone knows how to change this field?
..and another question...
In the same BADI, I'm trying to change the sale's area in the shipping data, but when I call the method set_shipping_data there is a firewall that only allows me to change the fields vstel, lprio, vsbed, route and ablad. Is there any way to change the other fields?
Thanks,
XaviHi,
By implementing the above badi you can change limited fields at item level.
I am using this to change the following and it is working fine for me.
a) Chaning field -- PLIFZ and RESWK and NETPR based on some header conditions
DATA : LS_MEPOITEM TYPE MEPOITEM.
DATA : ZZPLIFZ TYPE EKPO-PLIFZ.
Get the Item data
LS_MEPOITEM = IM_ITEM->GET_DATA( ).
LS_MEPOITEM-PLIFZ = ZZPLIFZ.
LS_MEPOITEM-NETPR = V_NETPR.
Set the Item data
CALL METHOD IM_ITEM->SET_DATA
EXPORTING
IM_DATA = LS_MEPOITEM.
Try this.
I hope this will help.
Message was edited by: Lanka Murthy -
BADI ME_PROCESS_PO_CUST Implementation is not called
Hello,
I have created a test implementation(local object) for BADI ME_PROCESS_PO_CUST and implemented the Process_Item method to compare item price with material master commercial price. I have also activated the implementation.
When I create a PO using ME21N, this implemenation is not getting called. I have put a breakpoint in the implementation but processing doesn't stops here. Also I am not able to find 'Where used' of the BADI name or the interface 'IF_EX_ME_PROCESS_PO_CUST'.
What are the reason for above behaviour? Do we maintain this BADI name in some Customizing Table?
Please help.
Regards,
Shubhami did the same as you did and the code is clearly getting triggerred.
Samle Code:
DATA : l_header TYPE REF TO if_purchase_order_mm.
DATA : l_conditions TYPE mmpur_tkomv.
DATA : l_item LIKE LINE OF l_conditions.
DATA : l_data TYPE mepoheader.
CALL METHOD im_item->get_header
RECEIVING
re_header = l_header.
CALL METHOD l_header->get_data
RECEIVING
re_data = l_data.
CALL METHOD im_item->get_conditions
IMPORTING
ex_conditions = l_conditions.
CALL METHOD im_item->set_conditions
EXPORTING
im_conditions = l_conditions.
if i put break-point on any of these methods the implementation is getting trigerred. -
Badi ME_PROCESS_PO_CUST-PROCESS_ITEM
Hi,
I have using the badi ME_PROCESS_PO_CUST-PROCESS_ITEM and the works fine.
But i need to write in a item field that the status is "display", in that status the badi does not write in the field.
To write i have to change the status to "optional entry" in spro, but the ideia is the field is the field stay non-edit.
Can someone help with that question?Can everyone help me?
-
BADI ME_PROCESS_PO_CUST not getting triggered
Hello Experts,
i implemeted BADI ME_PROCESS_PO_CUST to ZME_PROCESS_PO_CUST.
there is only one badi implemented for this.
And it is working fine in development and transported to Quality system.
in Quality system this badi itself is not getting triggered.
Please help me any body have any idea about this.
Thanks in advance
Mahammad FarooqHi,
check the below thread:
LINK[BAdi - ME_PROCESS_PO_CUST not trigger.;
if every thing is active then the only issue could be multiple implementatins
check in table SXC_EXIT to check the status .
if there are any inactive implementations delete all and put in a request and transport to you QA system.
Regards,
Himanshu -
BADI ME_PROCESS_PO_CUST Method:PROCESS_ITEM
Hi,
I have to update the vendor material field through BADI ME_PROCESS_PO_CUST.
I have created an implementation for this BADI.Can anyone help me find the solution for the same.
Thanks.DATA: wa_ekko TYPE ekko,
wa_ekkn TYPE ekkn,
wa_ekpo TYPE ekpo,
wa_vbap TYPE vbap.
DATA : lt_item TYPE mepoitem.
IF im_item->is_persistent( ) EQ mmpur_no. "Only check for new items
* Retrieve item data into BADI buffer
*get data
CALL METHOD im_item->get_data
RECEIVING
re_data = lt_item.
ENDIF.
SELECT SINGLE * FROM ekko
INTO wa_ekko
WHERE reswk NE ''.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM ekkn
INTO wa_ekkn
WHERE ebeln = wa_ekko-ebeln.
IF wa_ekkn-vbeln <> ''.
SELECT SINGLE * FROM ekpo
INTO wa_ekpo
WHERE ebeln = wa_ekko-ebeln
AND idnlf = ''.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM vbap
INTO wa_vbap
WHERE vbeln = wa_ekkn-vbeln
AND posnr = wa_ekkn-ebelp.
IF sy-subrc EQ 0.
lt_item-idnlf = wa_vbap-kdmat.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* Update changes
CALL METHOD im_item->set_data
EXPORTING
im_data = lt_item. -
BADI ME_PROCESS_PO_CUST get item nr
Hi experts,
I would like to get the item number EBELP in a purchase order ME21N, ME22N.
My problem is that when I change of item, I can't get the item n° in the BADI ME_PROCESS_PO_CUST
Thks for help,
AntYes , you can get that values.check this .
badi: ME_PROCESS_PO_CUST
method:PROCESS_ITEM
data:ls_mepoitem TYPE mepoitem,
ls_mepoitem_prev TYPE mepoitem,
ls_mepoitem = im_item->get_data( ).
CLEAR ls_mepoitem_prev-netpr.
SELECT SINGLE netpr FROM ekpo
INTO ls_mepoitem_prev-netpr
WHERE ebeln = ls_mepoitem-ebeln
AND ebelp = ls_mepoitem-ebelp.
if ls_mepoitem-netpr GT ls_mepoitem_prev-netpr.
MESSAGE 'Not Allowed to change values of Previous years WBS'
TYPE 'E'.
ENDIF. -
BADI ME_PROCESS_PO_CUST AND BADI ME_DEFINE_CALCTYPE
Hi,
How do I change the pricing type when creating aPurchase Order using BADI ME_PROCESS_PO_CUST and ME_DEFINE_CALCTYPE.
I need to set the value IM_DATA-Calctype = 'B' (Calctype) on the first badi.
Please help!hi this is the code:
method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
DATA: RE_DATA TYPE MEPOITEM,
IM_DATA TYPE MEPOITEM.
CALL METHOD IM_ITEM->get_data
RECEIVING
RE_DATA = RE_DATA.
MOVE 'B' TO RE_DATA-calctype.
CALL METHOD IM_ITEM->set_data
EXPORTING
IM_DATA = RE_DATA.
endmethod.
Upon creation of PO error message prompt
'Data from Business Add-In ME_PROCESS_PO_CUST not adopted'
Maybe you are looking for
-
Is anyone else having these problems? - How do I get past this 'glitch' in the system? - Account is valid, password is valid, iTunes appears to be accessing the store when these 'security procedures' commence and then access to store stops and timed
-
Error when import metadata: java.lang.ArrayIndexOutOfBoundsException: 1
hello i made changes to the mapping in DEV env; exported mdl and now im trying to import this mapping into TEST; i receive error message: Error at line 8,487: MDL1261: Error importing MAPPING xxxx Detailed Error Message: java.lang.ArrayIndexOutOfBoun
-
Ethernet connection lost after update to 10.5.7
I lost my Ethernet connection after the 10.5.7 update. I have checked all cables and ports. Any ideas?
-
Error in handling quicktime file
Hi, When I try to transcode a quicktime-format movie to another file, it has the following errors. $ java Transcode -o a.avi file:/c:/a.mov - create processor for: file:/c:/a.mov Failed to configure: com.sun.media.ProcessEngine@c2ff5 Bad header in th
-
Hi Experts, Pls check the below screen shot of planning book, the issue is related to safety stock.I have maintained safety sock method AT,service level,Demand Fcast Err&RLT Fcast Error and run safety stock planning but system didn't create any stock