Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Implementing BADI ME_PROCESS_PO_CUST ??

Former Member
0 Likes
2,043

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,047

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.

Read only

Former Member
0 Likes
1,047

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

Read only

0 Likes
1,047

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

Read only

0 Likes
1,047

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

Read only

Former Member
0 Likes
1,047

Thanks for all the support...