‎2011 Jul 01 4:10 AM
Hi Friends,
I need to update the field KWERT - Pricing Value in the saler order that I'm creating using BAPI_SALESORDER_CREATEFROMDAT2. When I pass values to CONDVALUE, the sales order item conditions is not updated with these values. The Pricing condition type and pricing amount is just fine. Problem is only with the Pricing value corresponding to each condition type.
Can someone please help me with how to populate values under Pricing value using this BAPI. It would be of great help.
Thanks,
Dikshitha G
‎2011 Jul 01 4:34 AM
Hi,
One of the resone for not updating price is, condition record is not ticked for manul entries.
You can check this using transaction V/08 - choose pricing procesure ( This you can get in KONV table also ) and then choose Control you will find the checkbox for Manual entry.
Secondly you can check whether you are passing Step number and condition counter correctly.
Also Pass values in CONDITION_INX table with flag values.
You can also try to pass LOGIC SWITCH - pass B in field PRICING of structure LOGIC_SWITCH in the bapi.
Search SDN for CONDITION or PRICING IN BAPI_SALESORDER_CREATEFROMDAT2
Thanks and regards,
Anmol.
Edited by: anmol112 on Jun 30, 2011 11:35 PM
‎2011 Jul 01 5:13 AM
My condition type is a manual entry one in V/06 and the Pricing 'B' does not help. Also all the checkboxes in CONDITION_INX is checked. The Condition value is not getting overwritten by what I pass. I checked SDN and couldn't find anything relevant for this.
Please help.
Regards,
DIkshitha G
‎2011 Jul 21 11:41 PM
Hi Dikshita,
Were you able to solve this issue? If yes, can you please tell how?
Thank you,
vamshi.
‎2011 Jul 22 3:42 AM
Hi,
I was unable to change the condition value using the BAPI. So wat I did was created the sales order using the BAPI with the system calculated condition value and then I did a BDC of VA02 with the sales order created and changed the values in the BDC. It is working now.
perform bdc_dynpro using 'SAPMV45A' '0102'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-VBELN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-VBELN'
v1_vbeln.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=ITEM'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\05'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG'.
loop at it_lineitem.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KWERT(04)'.
perform bdc_field using 'KOMV-KWERT(04)'
it_item-t1disval.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KWERT(06)'.
perform bdc_field using 'KOMV-KWERT(06)'
it_item-t1disval.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KWERT(09)'.
perform bdc_field using 'KOMV-KWERT(09)'
it_item-z004val.
endloop.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(01)'.
call transaction 'VA02' using bdcdata mode 'N' update 'S'
messages into messtab.
Let me know if you need any more details
‎2011 Jul 22 4:17 PM
‎2011 Jul 22 7:30 PM
Hi Dikshita,
Just FYI...
My requirement was for certain commission related condition types I had to update KWERT with the value coming in the IDOC, So, I was using SD_SALESDOCUMENT_CHANGE function module to update. If I pass SALES_CONDITIONS_IN-CONDVALUE the value wasn''t getting updated in the sales order. I debugged and saw that KWERT will only get updated with CONDVALUE if you pass either SALES_CONDITIONS_IN-CURRENCY_2 or SALES_CONDITIONS_IN-CURR_ISO_2.
I passed SALES_CONDITIONS_IN-CURRENCY_2 with currency and SALES_CONDITIONS_IN-CONDVALUE with value comingin the IDOC and KWERT is getting updated fine in the sales order.
Thanks once again for your response.
Vamshi.
‎2011 Jul 25 3:45 AM
Hi Vamshi,
In my case I'm using the BAPI to create SO. When I passed currency_2 my condition value still remains unchanged. That's the reason I went for the BDC to change the SO. Never mind now your problem and my problem is resolved
Cheers,
Dikshitha G