on 05-18-2007 6:17 PM
Hello,
I am using badi BADI_SD_V46H0001~EXIT_SAPLV46H_001
To copy pricing conditions from contract to sales order.
Because the SAP code runs thru the user exit twice, we have to check whether Pricing was already run.
If so then we exit from the user-exit without setting the fields c_vbapkom-kschl4, c_vbapkom-kbetr4 and c_vbapkom-kwaer4.
Ie.
IMPORT global_pricing_type TO ls_global_pricing_type FROM MEMORY ID 'MVLV45PT'.
IF sy-subrc EQ 0.
EXIT.
ELSE.
c_vbapkom-kschl4 = lstr_konv-kschl.
c_vbapkom-kbetr4 = lstr_konv-kbetr.
c_vbapkom-kwaer4 = lstr_konv-waers.
ENDIF.
The above works Perfectly.
The next requirement (in the same badi as above) is to populate the value contract fields by setting
c_vbapkom-wktnr = c_vbapkom-vgbel
c_vbapkom-wktps = c_vbapkom-vgpos.
So that the released value can be updated in the Value contract.
I tried the above two statements in various places in the user exit but it does not work correctly.
The closest I get is as follows, But the result is that an additional pricing record is copied for each line item
IMPORT global_pricing_type TO ls_global_pricing_type FROM MEMORY ID 'MVLV45PT'.
IF sy-subrc EQ 0.
c_vbapkom-wktnr = c_vbapkom-vgbel.
c_vbapkom-wktps = c_vbapkom-vgpos.
EXIT.
ELSE.
c_vbapkom-kschl4 = lstr_konv-kschl.
c_vbapkom-kbetr4 = lstr_konv-kbetr.
c_vbapkom-kwaer4 = lstr_konv-waers.
ENDIF.
Does anybody have any suggestions ?
Thanks
Added a second condition type for the target document to avoid the pricing replication problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are copying pricing conditions, I assume that the sales order has the same materials as the contract. This functionality is available in copy control between contract and sales order at the item level. Set the <b>Cont. item copy mode</b> field to B (Only value contract item material may be copied). In the same screen, you can also set the <b>Pricing type</b> field to D (Copy pricing elements unchanged).
In VOV8, for the sales order, set the <b>Reference mandatory</b> field to G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.