cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer FM PRICING result (KOMV) to FM SD_SALESDOCUMENT_CREATE

Former Member
0 Kudos

Hi experts !

I have realized a customer own function (fast sales order entry), where I use the function modules PRICING and PRICING_COMPLETE to simulate pricing. That works fine so far.

Now I have to transfer the pricing results (KOMV) from the above function modules to function module SD_SALESDOCUMENT_CREATE.

I have to create the sales order with exactly the same pricing as I get it from the PRICING function module.

Has anyone an idea who to get that work right ? How do I have to interpret the result from the PRICING FM ?

Which are the active / valid items ? And how do I have to fill the COND_IN and LOGIC_SWITCH parameters of the above FM to create the sales order ?

I am happy for any help !

Thanks, Holger

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Holger,

The function module "MAP2E_KOMV_TO_BAPICOND" should handle the

activity flag (KOMV-KINAK) too.

I suggest you to get all the KOMV entries, convert them to BAPICOND type,

and pass all of them to the SO creation BAPI.

BR,

Barna

Former Member
0 Kudos

Hi Barna !

Thank you for your reply. But this answers only one part of my question.

The more important question for me is, how to get the right conditions from the PRICING_xxx-FM.

There are a lot of different flags in KOMV table, and I do not know the exact meaning of them.

How can I read the active conditions (which flags do I have to interpret in which way) to transfer them to the BAPI ?

Regards, Holger

Former Member
0 Kudos

Hi Holger,

There is a function module "MAP2E_KOMV_TO_BAPICOND" for transferring

KOMV structure data to BAPIMEPOCOND structure data. This structure is more or less the same

as BAPICOND, try it with a "move-corresponding" after FM call to see if all the fields are populated.

Then you should fill this data into parameter SALES_CONDITIONS_IN for FM "SD_SALESDOCUMENT_CREATE"

and also fill parameter SALES_CONDITIONS_INX with updateflag = 'I' and put 'X' to cond_value,currency,

cond_unit,cond_p_unit.

You should leave "logic_switch-cond_handl" empty for SO creation.

(It has to be 'X', when you 're updating exiting conditions)

BR,

Barna