Application Development 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: 

How to get Conditions data in BADI " IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM"

Former Member
0 Kudos

Dear SAP Gurus,

My requirement is as follows,

I need to put a check in BADI "IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM" based on KSCHL filed, It is available in the BADI(GET_CONDITIONS, SET_CONDITIONS). I am not able to get the values in internal table.

Please help,

Thanks & Regards,

pavan

1 ACCEPTED SOLUTION

madhu_vadlamani
Active Contributor
0 Kudos

Hi Pavan,

You have to check your code and get the item data using class. Then do your check points here. Please paste your code here.Have you seen sample code of that badi.

MESSAGE 'God' TYPE 'I'.

    • BREAK-POINT.

    • INCLUDE mm_messages_mac.

**

    • DATA: header TYPE mepoheader,

    • items TYPE purchase_order_items,

    • po_line TYPE mepoitem,

    • line_item TYPE purchase_order_item.

**

  • header = im_header->get_data( ).

  • items = im_header->get_items( ).

**

    • LOOP AT items INTO line_item where matnr = ekpo-matnr.

**

    • po_line = line_item-item->get_data( ).

**

    • "here, you must have all data, so, check that matnr is not repeated.

    • "after, with message 398(00) as example

      • mmpur_message 'E' '00' '398'

      • string1 string2 string3 string4.

**

    • ENDLOOP.

Can you check like this.

Regards,

Madhu.

Edited by: madhurao123 on Aug 31, 2011 12:21 PM

5 REPLIES 5

madhu_vadlamani
Active Contributor
0 Kudos

Hi Pavan,

You have to check your code and get the item data using class. Then do your check points here. Please paste your code here.Have you seen sample code of that badi.

MESSAGE 'God' TYPE 'I'.

    • BREAK-POINT.

    • INCLUDE mm_messages_mac.

**

    • DATA: header TYPE mepoheader,

    • items TYPE purchase_order_items,

    • po_line TYPE mepoitem,

    • line_item TYPE purchase_order_item.

**

  • header = im_header->get_data( ).

  • items = im_header->get_items( ).

**

    • LOOP AT items INTO line_item where matnr = ekpo-matnr.

**

    • po_line = line_item-item->get_data( ).

**

    • "here, you must have all data, so, check that matnr is not repeated.

    • "after, with message 398(00) as example

      • mmpur_message 'E' '00' '398'

      • string1 string2 string3 string4.

**

    • ENDLOOP.

Can you check like this.

Regards,

Madhu.

Edited by: madhurao123 on Aug 31, 2011 12:21 PM

0 Kudos

Hi,

Thanks for the reply,

However,

I need to get condition records(KOMV),

Thanks & Regards,

Pavan.

0 Kudos

Hello Pavan ,

Hi once you call the instance methode get_condition it returns you a export parameter MMPUR_TKOMV which is a type pool and contains TKOMV , TKOMK ,and TKOMP that is all you want .


Data :           l_tkomv  type mmpur_tkomv .

 CALL METHOD im_item->get_conditions
         IMPORTING
           EX_CONDITIONS = l_tkomv.  .

IM_TYPE is already there in process_item as import parameter refering to IF_PURCHASE_ORDER_ITEM_MM .

You will have everrthing in your l_tkomv and do what you want based on that .

Hope that solves your problem .

Thanks,

Anjaneya .

Edited by: Anjaneya Bhardwaj on Aug 31, 2011 9:55 AM

Edited by: Anjaneya Bhardwaj on Aug 31, 2011 9:56 AM

0 Kudos

Hi Pavan,

Is it solved.

Regards,

Madhu.

0 Kudos

Hi,

Thanks for the reply, SOLVED....

Regards,

Pavan.