Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to update "scales" in a contract

Former Member
0 Kudos
1,135

Hi friends,

I am using BAPI_CONTRACT_CHANGE for updating price in the contract which I completed. Now, I need to add the functionality of updating the scales in the contract. Please guide me on this.

Thanks in advance.

1 ACCEPTED SOLUTION

former_member214131
Active Contributor
0 Kudos
359

Hi,

You can update the scales of a contract header condition via structure HEAD_COND_SCALE_VAL - Value Scale and HEAD_COND_SCALE_QUAN - Quantity Scale.

Similarly for Conditions at Psoitions/Items ITEM_COND_SCALE_VALUE, ITEM_COND_SCALE_QUAN could be used.

Good BAPI documentation is available for the BAPI.

Hope this helps,

Best Regards, Murugesh

3 REPLIES 3

former_member214131
Active Contributor
0 Kudos
360

Hi,

You can update the scales of a contract header condition via structure HEAD_COND_SCALE_VAL - Value Scale and HEAD_COND_SCALE_QUAN - Quantity Scale.

Similarly for Conditions at Psoitions/Items ITEM_COND_SCALE_VALUE, ITEM_COND_SCALE_QUAN could be used.

Good BAPI documentation is available for the BAPI.

Hope this helps,

Best Regards, Murugesh

Former Member
0 Kudos
359

In BAPI_CONTRACT_CHANGE function module, we have the below mentioned internal table parameters.

1. ITEM_COND_SCALE_VALUE

2. ITEM_COND_SCALE_QUAN

First one provides the provision to update value scales and the second one provides the provision to update quantity scales.

0 Kudos
359

READ TABLE it_konm INTO wa_konm WITH KEY knumh = wa_a090_1-knumh.

IF sy-subrc = 0.

l1_tabix = sy-tabix.

lx_konm_staf-knumh = wa_konm-knumh.

lx_konm_staf-kopos = wa_konm-kopos.

lx_konm_staf-klfn1 = wa_konm-klfn1.

* lx_konm_staf-KSTBW =

lx_konm_staf-kstbm = wa_konm-kstbm.

lx_konm_staf-kbetr = wa_zcontract_price-new_price.

* lx_konm_staf-KZBZG =

lx_konm_staf-updkz = 'U'.

APPEND lx_konm_staf TO lt_konm_staf.

CLEAR lx_konm_staf.

ENDIF.

CALL FUNCTION 'CND_PRICES_DETAILS_SAVE' "This works for VA42 t-code updating scales "for Meter billing scenarios

TABLES

db_xkonh = lt_konhdb

db_xkonp = lt_konpdb "this updates KONP table

db_xstaf = lt_konm_staf "this updates KONM table

EXCEPTIONS

OTHERS = 1.

IF sy-subrc = 0.

COMMIT WORK AND WAIT.

ENDIF.