2008 Sep 17 3:29 AM
Hi All,
I want to implement BADI ME_PROCESS_PO_CUST to Z_ME_PROCESS_PO_CUST. Under this I need to use method CHECK to validate the header Level EKGRP (Purchasing Group) with the Info Record item Level EKGRP (Purchasing Group). If both are different, then I need to throw message with setting parameter CH_FAILED = 'X'.
Now my question is I can get the header level EKGRP by IMPORTING parameter IM_HEADER (IF_PURCHASE_ORDER_MM) has a method GET_DATA which returns the header data (structure MEPOHEADER). But to get the Item level info records EKGRP I will call method IM_HEADER->GET_ITEMS to retrieve PO item level data. Can you please tell me how to get the info record data from there and how to go ahead further??
Thnks,
Raghu Posani
Hi All,
I want to implement BADI ME_PROCESS_PO_CUST to Z_ME_PROCESS_PO_CUST. Under this I need to use method CHECK to validate the header Level EKGRP (Purchasing Group) with the Info Record item Level EKGRP (Purchasing Group). If both are different, then I need to throw message with setting parameter CH_FAILED = 'X'.
Now my question is I can get the header level EKGRP by IMPORTING parameter IM_HEADER (IF_PURCHASE_ORDER_MM) has a method GET_DATA which returns the header data (structure MEPOHEADER). But to get the Item level info records EKGRP I will call method IM_HEADER->GET_ITEMS to retrieve PO item level data. Can you please tell me how to get the info record data from there and how to go ahead further??
Thnks,
Raghu Posani
2008 Sep 17 3:42 AM
IM_HEADER->GET_ITEMS will give you the item objects.
suppose if you want item10 detiails then you can loop at item object table , each object is of type
IF_PURCHASE_ORDER_ITEM_MM
from there you can use get_Data method.
2008 Sep 17 3:47 AM
Hi ,
If u want Purchase Info record details u need to get it from table EINA , i dont think in that BADI u will get these data by calling any method .
regards
Prabhu
2008 Sep 17 4:17 AM
Hi Thank for the relplies!!
You mean to say that i need to loop around the internal table, and chekk my condition?
As i dont know much OO concepts, that y i am looking for help. Can you have any snippet or code what you can put in BADI method??
Any way thanks for the support..
Thnks
Raghu Posani
2008 Sep 17 4:35 AM
Hi Raghu ,
try Method PROCESS_ITEM , correct me if i'm wrong , Info record will be avail at item level right ?, so this Method ( which will tigger for each line item , so need of loop at items , plz check ), get the header data and get Info record data from table EINA and do the validations.
u got header data in ls_header , item data ls_item based that info record , fetch Info record details
data: ls_eina type LS_EINA.
SELECT SINGLE * FROM EINA INTO LS_EINA WHERE conditions.
do validations if its fails then invalidate that Item ,
MMPUR_METAFIELD MMMFD_CUST_01.
MMPUR_MESSAGE_FORCED 'E' 'ME' '083' TEXT-004 '' '' ''.
invalidate the object
CALL METHOD IM_ITEM->INVALIDATE( ).
and u can also see the sample code of this method .
Se18---->BADI name ->GOTO->Sample Code->display->select Method PROCESS_ITEM.
regards
Prabhu
2008 Sep 17 4:42 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |