11-09-2006 3:58 PM
Hi everyone
We have program that identifies existing sales orders that we need to re-price due to a change in the customer's status. The sales orders consist of some standard items that have a priced associated with their material but they also have some items that do not. When this second group of items are added to the sales order during creation they are assigned a pricing condition type of VA00 to which a variable value is assigned at creation. I hope that makes sense!
The problem we are having is that when the batch job runs it is set to trigger the 'New pricing document' function. This works exactly as required for the items with an associated price but the VA00 condition seems to get removed during this. Is there anyway that I can prevent the VA00 conditions from being deleted?
I have tried USEREXIT_NEW_PRICING_VBAP and USEREXIT_NEW_PRICING_VBKD and set the 'new_pricing' flag to both A and C but it doesn't seem to have worked - the VA00 condition seems to have been deleted before it gets to this point.
Kind regards
Andy
11-09-2006 4:07 PM
Hi,
How does the batch job update the pricing of the sales order...
When the batch job updates use the pricing type as C
C - Copy manual pricing elements and redetermine the others
THanks,
Naren
11-10-2006 9:54 AM
Hi Naren
The batch job is updating the pricing by using the Fcode 'KONB' - this triggers the new pricing document function from the sales order screen (Edit | New Pricing Document).
I have tried using the two userexits previously mentioned by setting the new_pricing flag to 'C' but it does not seem to prevent the deletion of the VA00 condition.
Thanks
Andy
11-10-2006 12:44 PM
Hi Andy!
The default re-pricing character is not defined in the user exits. but in the definition of the calculation schemata. Go to transaction V/08 and assign the pricing type C.
Regards,
Christian
11-10-2006 7:47 PM
I think you can use the following FM to reprice item and in this case pricing type is first determined from memory ID and the popup appears only if inport from memory fials, so if you set this memory ID (MVLV45PT) to 'C' it's not going to show popup.
call function 'SD_SALES_DOCUMENT_PERFORM'
exporting
in_program = 'SAPFV45P'
perform = 'PREISFINDUNG_NEU'
exceptions
error_message = 01.
NOTE: you have to use document_read Fm first then SD_...Perform and then SD_..._SAVE. I would suggest you check where 'SD_SALES_DOCUMENT_PERFORM' is used to see what is the right sequence of FM calls.
OR try to use BAPI_SALESORDER_CHANGE passing the parameter LOGIC_SWITCH-PRICING = 'C'