cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase info record price simulation

Former Member
0 Kudos

Hi all,

I need to emulate the process used by transaction me1l in order to make a price simulation to obtain the net price and the effective price from the purchase info record related to a PO item.

I have to calculate them from the standard info record (info category = 0) using:

- pricing date = PO creation date

- simulation quantity = PO item quantity

- base unit of measure = PO item unit of measure

I have tried to use the function module ME_PRICING_INFORECORD but I haven't obtained the same values as using the transaction me1l. I don't know if I have used the correct input parameters but I have tried several options and I haven't obtained the correct values for any of them.

The parameters used are:

infoa = info record data obtained from table eina

infoe = info record data obtained from table eine

inpreissim -> simulation data:

inpreissim-simng = PO item quantity

inpreissim-simme = PO item unit of measure

inpreissim-sidat = PO creation date

inpreissim-pseff = 'X' for the effective price

inpreissim-pseff = ' ' for the net price

simulation = 'X'

Does anybody know how I can emulate boton 'Price Simulation' in the transacction me1l in my code?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

After some investigations I have solved the problem:

Function module ME_PRICING_DIALOG must be called before calling function module ME_PRICING_INFORECORD, with the following parameters:

dunkel = 'X'

effektiv = ' ' for net price

effektiv = 'X' for effective price

infoa = info record data obtained from table eina

infoe = info record data obtained from table eine

matnr = PO item material number

meins = PO item unit of measure

menge = PO item quantity

After that, ME_PRICING_INFORECORD must be called with the following parameters:

infoa = info record data obtained from table eina

infoe = info record data obtained from table eine

simulation = 'X'

And retrieve the output parameters preisp and e_currency:

preisp-netpr is the price calculated

preisp-kpein is the contidion pricing unit

preisp-kmein is the condition unit

e_currency is the price currency

For example, if we obtain 630 EUR per 100 PC:

630 is the price

100 is the condition pricing unit

PC is the condition unit

EUR is the price currency

Former Member
0 Kudos

Hi Carmen,

i have the solution below

but for several rows i received wrong value for net_price and currency ( i suppose that the problem is with RM06I, missing CLEAR statement)

maybe the solution - CLEAR RM06I in ME_PRICING_DIALOG, because is not set up as initial, and takes values from previous row, if menge is initial

/*

IF NOT MENGE IS INITIAL.

RM06I-SIMNG = MENGE.

RM06I-MEIN2 = MEINS.

KOMK-PRSDT = TERMIN.

ENDIF.

*/

Do you have anybody the solution how set CLEAR RM06I ( i cannot modify SAP FM) or something else?

-


CALL FUNCTION 'ME_PRICING_REFRESH'.

  • Provides dialog box for entry of simulation parameters

CALL FUNCTION 'ME_PRICING_DIALOG'

EXPORTING

dunkel = 'X'

infoa = la_eina

infoe = la_eine

meins = i_meins

menge = i_menge

termin = i_termin.

  • Price computations in Purchasing

CALL FUNCTION 'ME_PRICING_INFORECORD'

EXPORTING

dialog_not_by_zero = 'X'

infoa = la_eina

infoe = la_eine

simulation = 'X'

IMPORTING

preisp = la_komp

preisk = la_komk

e_currency = l_currency.

-


Thanks for advice

Martin