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: 

BADI for the transaction s ME51n and ME52n

Former Member
0 Kudos
829

Hi friends,

Can i get the code and particular BADI ME51n where the conditions are

In the purchase requisition the field (EBAN- PREIS) valuation price is configured as “required”, and the value is adopted from the material master record field (MBEW-VERPR) moving price. This moving price may differ on the same material based on the assigned plant. For example:

Material Plant Moving Price

1234 1000 9.10

TA10 5.00

TA12 7.00

The plant field in the Purchase Requisition is mandatory except for document type RV. When this document type is assigned SAP doesn’t know which moving price to apply and so the user is prompted to manually enter a value.

To ensure an appropriate value is entered SAP should apply the value from the material master record plant 1000 where the plant field in the RV Purchase Requisition field is blank.

Essentially the same scenario applies to the Purchasing Group. As with the plant, the Purcahsing Group should be copied from the plant 1000 material master record.

SAP should apply the value from the material master record plant 1000 where the plant in the RV Purchase Requisition (EBAN-WERKS) is blank:

EBAN- PREIS = MBEW-VERPR

EBAN-EKGRP = MARC-EKGRP

Charita

2 REPLIES 2

Former Member
0 Kudos
130

Check the same here

SPRO --> Materials Management --> Purchasing --> Business Add Ins for Purchasing

All the BADI's r available there

You can choose based on requirement...

Reward if helpful...

Former Member
0 Kudos
130

hi charitha

i can help u out in getting the values to the fields mentioned irrespective of document type which u can do i think and i'm here with the piece of code as follows :

Go to se19 to implement badi and give the name say zxyz and give the definition name as me_process_req_cust and implement the method called process_item

and write the following code.

data : wa_item type mereq-item,

v_ekgrp type marc-ekgrp,

v_preis type mbew-verpr.

select single ekgrp

from marc

into (v_ekgrp)

where werks = '1000' and matnr = '100-100'.

select single verpr

from mbew

into (v_preis)

where matnr = '100-100'

and bwkey = '000'.

call method im_item->get_data

receiving

re_data = wa_item.

wa_item-ekgrp = v_ekgrp.

wa_item-preis = v_preis.

wa_item-waers = 'INR'.

if im_count = 1.

call method im_item->set_data

exporting

im_data = wa_item.

endif.

hope this code will help in passing the data to the tcode me51n and if any issues let me know.

reward point if helpful

sandhya