2007 Jul 30 5:46 PM
Hi Good People
Im trying to add an additional check to a purchase order item through a Badi implementation by using a ME_PROCESS_PO_CUST definition with method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM
Im debugging the Purchase Order program but I dont have any clue on how to deal with the IM_ITEM importing parameter which this method uses..
This parameter is of type TYPE REF TO and it contains a reference value on debugging mode. How can I get normal item data (material number, material group, plant, etc) from this parameter, so I can perform my checks later on?
Many Thanks
Nuno Natividade
2007 Jul 31 10:25 AM
Hi Good People
Im trying to add an additional check to a purchase order item through a Badi implementation by using a ME_PROCESS_PO_CUST definition with method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM
Im debugging the Purchase Order program but I dont have any clue on how to deal with the IM_ITEM importing parameter which this method uses..
This parameter is of type TYPE REF TO and it contains a reference value on debugging mode. How can I get normal item data (material number, material group, plant, etc) from this parameter, so I can perform my checks later on?
Many Thanks
Nuno Natividade
2007 Jul 30 6:00 PM
Hiou
U need to do a double click on the interfaced used to build the BADI, you'll to SE24 where you can see all components, in particular the methods and their parameters.
Max
2007 Jul 30 6:41 PM
Hi Max
Yes, that's what I have done before. I can see that for interface IF_EX_ME_PROCESS_PO_CUST and method PROCESS_ITEM there is a parameter IM_ITEM. But this parameter is of type TYPE REF TO. When I'm working on debug mode this parameter is filled with , instead of the traditional field / values...
2007 Jul 30 6:43 PM
2007 Jul 30 7:10 PM
Hi Rich
Sorry, i'm not sure i follow you. Why should it require an instance from another class interface (in this case CL_PO_ITEM_HANDLE_MM). why and how should I pass an object to this IM_ITEM parameter which belongs to another interface (IF_EX_ME_PROCESS_PO_CUST) . Sorry , but as i said i'm still too fresh about these object language business...
thanks for your help.
2007 Jul 31 10:14 AM
2007 Jul 31 10:25 AM
2007 Jul 31 12:14 PM
Hi Uwe
You really hit the spot with that one. Thank you very much. I'm starting with the object-oriented programming and i really don't know how to start. Do you think you can send me any valuable literature or references about the subject to [email protected].
Once again many thanks
Nuno
2007 Jul 31 11:20 AM
In transaction SE19, if you display the BADI then select menu option goto>sample code>display, you will be able to drill down on the PROCESS_ITEM method to some SAP supplied sample code.
This includes the definitions and method calls to get the item data:
DATA: ls_mepoitem TYPE mepoitem.
ls_mepoitem = im_item->get_data( ).
You then just change relevant fields in structure ls_mepoitem and call the set_data method to pass the data back
call method im_item->set_data exporting im_data = ls_mepoitem.
Take care with what you change - SAP does not validate that you have passed back correct / consistant data.
Andrew
2007 Jul 31 12:19 PM
Hi Andrew
I got the answer from Uwe's post just before. But you're answer is helpuful just the same. Do you think you can send me any valuable literature or references about object-oriented programming to [email protected].
many thanks
Nuno
2007 Jul 31 11:25 AM
Further to my previous reply, I suggest you look at using the CHECK method for PO checking as well, depending on how you want the error showing.
If you use the MACRO's as in in the sample SAP code, you will get the messages integrating into the ME21N error list that shows when you try to save or check. To do this you need to also call the INVALIDATE() method of the Header and Line items - this is also in the SAP example.
Andrew
2007 Jul 31 12:25 PM
Hi ..
Can you please write this code in the method PROCESS_ITEM of your BADI implementation.
DATA : item_data TYPE MEPOITEM .
CALL METHOD im_item->get_data
receiving
re_data = item_data .
You will have the item data in variable item_data.
Hope I understood you requirement correctly...
Message was edited by:
Pawan Kesari