cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_CONTRACT_CREATE item condition order

Former Member
0 Likes
5,663

Hi all,

I tried to create a contract with item condition with BAPI "BAPI_CONTRACT_CREATE", and I already input the "COND_COUNT" in parameter "ITEM_CONDITION".

the contract created successfully, but the order of item condition was wrong, can anyone give me some advise?

Thanks and best regards,

Shujian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

After a longer discussion we got a final answer (works as designed).

In fact there are two different ways to sort the added conditions.

ME31K / ME32K do not notice the order given by the counter of the calculation scheme.

Using the BAPI step and counter is taken into account.

Solution will be to adjust the calculation scheme or enhance the custom specific coding.

Best regards

Axel

Answers (3)

Answers (3)

JL23
Active Contributor

How does your system behalf if you do it in its normal maintenance transaction ME31K / ME32K?

If I am not mistaken then the positions of the conditions are defined in the calculation schema and not freely exchangeable

Former Member
0 Likes

Hi Jürgen,

ME31K / ME32K remains the order as typed in. No change within the order.
Further tests using the BAPI did show different system behaviour using additional manual Condition Types.
Some of them are taken in the order we expect, others are shifted according to the counter within the Calculation Scheme.
Checking the Condition Master Data we could not find any difference.

Thanks for any helpful hint.

Axel

JL23
Active Contributor
0 Likes

And what does SAP do if you exchange the sequence of conditions in the BAPI ? Does it post then correct or does this not change anything? How is the sorting then, is it in alphabetical order or just random clutter?

what values are actually maintained in

ITEM_COND_VALIDITY
ITEM_COND_VALIDITYX
ITEM_CONDITION

ITEM_CONDITIONX

Former Member
0 Likes

Hi There, i created a program using "BAPI_CONTRACT_CREATE" for contracts, there is an issue, the percentage values RA00 and RA01 is always showing as zero.

Below is the code wrt RA01, can anyone give me some advise?

l_wa_item_condition-item_no = v_item_bapi.

l_wa_item_condition-cond_type = g_wa_srce-kdisc ."Discount

l_wa_item_condition-cond_value = g_wa_srce-cval2 ."Condition Value

l_wa_item_condition-calctypcon = 'A' . "percentage indicator

l_wa_item_condition-serial_id = vn_counter_serial_id.

l_wa_item_condition-cond_count = 03.

APPEND l_wa_item_condition TO l_tab_item_condition.

CLEAR :l_wa_item_condition.

l_wa_item_conditionx-item_no = v_item_bapi.

l_wa_item_conditionx-cond_type = c_x.

l_wa_item_conditionx-cond_value = c_x.

l_wa_item_conditionx-calctypcon = c_x.

l_wa_item_conditionx-serial_id = vn_counter_serial_id.

l_wa_item_conditionx-cond_count = 03.

l_wa_item_conditionx-item_nox = c_x.

l_wa_item_conditionx-cond_countx = c_x.

l_wa_item_conditionx-serial_idx = c_x.

APPEND l_wa_item_conditionx TO l_tab_item_conditionx.

CLEAR :l_wa_item_conditionx.

NTeunckens
Active Contributor
0 Likes

Hello Shujian

Please verify how the Sorting of Item Conditions in a 'regular' (Manually) created Contract is registered in the Tables "A016" or "A068".

Verify the Relationship of the "ITEM_NO" / "SERIAL_ID" / "COND_COUNT" of such a Regularly created Contract via BAPI "BAPI_CONTRACT_GETDETAIL" and emulate that type of Logic ...

(So I'm assuming the Links between those Fields are not respected in your Custom Development ...)

Further, check the SAP ONE Support for SAP-KBA's on the BAPI as there are some recent Updates in the form of SAP-KBA's, there are dozens of new SAP-KBA's ...


Hope that helps

Nic T.

varunsabbani
Newcomer
0 Likes
Hi There,