cancel
Showing results for 
Search instead for 
Did you mean: 

badi BADI_SD_V46H0001~EXIT_SAPLV46H_001

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Added a second condition type for the target document to avoid the pricing replication problem.

Former Member
0 Kudos

....and I have the same problem with condition EK01.

I'm aware of OSS note 811030, but.....

When I press button "Billing request" (F5) in DP90 everything works OK.

Anyone ?

Answers (1)

Answers (1)

Former Member
0 Kudos

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