2006 Jul 19 3:39 PM
Hi all!, I'm using BAPI_SALESORDER_CREATEFROMDAT2 in release 4.6C and I'm having problems with conditions, when the condition is krech = 'A'.
I select the data from table KONV at internal table t_konv and send the following to BAPI:
t_bapicond-conbaseval = t_konv-kawrt.
t_bapicond-cond_value = t_konv-kbetr / 10.
t_bapicond-condvalue = t_konv-kwert.
t_bapicond-calctypcon = t_konv-krech.
t_bapicond-currency = t_konv-waers.
t_bapicond-itm_number = t_bapiitemin-itm_number.
t_bapicond-cond_count = t_konv-zaehk.
t_bapicond-cond_unit = t_konv-kmein.
t_bapicond-cond_p_unt = t_konv-kpein.
When I go to VA03 with the new sales order, the Condition value is not the one I sent, is incorrect, it seems like the BAPI calculates the Condition value in a diferent way than transaction VA01.
I only have the problem with percentage conditions, type 'A'.
Can anybody help me with my problem? I could not find information in OSS.
Thanks!
Hi all!, I'm using BAPI_SALESORDER_CREATEFROMDAT2 in release 4.6C and I'm having problems with conditions, when the condition is krech = 'A'.
I select the data from table KONV at internal table t_konv and send the following to BAPI:
t_bapicond-conbaseval = t_konv-kawrt.
t_bapicond-cond_value = t_konv-kbetr / 10.
t_bapicond-condvalue = t_konv-kwert.
t_bapicond-calctypcon = t_konv-krech.
t_bapicond-currency = t_konv-waers.
t_bapicond-itm_number = t_bapiitemin-itm_number.
t_bapicond-cond_count = t_konv-zaehk.
t_bapicond-cond_unit = t_konv-kmein.
t_bapicond-cond_p_unt = t_konv-kpein.
When I go to VA03 with the new sales order, the Condition value is not the one I sent, is incorrect, it seems like the BAPI calculates the Condition value in a diferent way than transaction VA01.
I only have the problem with percentage conditions, type 'A'.
Can anybody help me with my problem? I could not find information in OSS.
Thanks!
2006 Jul 19 6:29 PM
Hi,
I think you need to pass the entire condition value instead of dividing by 10.
Instead of:
t_bapicond-cond_value = t_konv-kbetr / 10.
Use:
t_bapicond-cond_value = t_konv-kbetr.
Within include program L2032FXX, form move_condition_out, there is some special code for krech = 'A' that divides condition value by 10 for you. Here is the standard code:
if www_ex_konvkom-krech = 'A'. "prozentual ?
bapi_ex_konvkom-cond_value = www_ex_konvkom-kbetr / 10.
endif.
If that does not work for you, then take a look in include program L2032FXX, form move_condition_out to see some additional special handling for krech = 'A' that may or may not end up affecting your condition value results.
case www_ex_konvkom-krech.
when 'A' or 'H' or 'I'.
bapi_ex_konvkom-conbaseval =
www_ex_konvkom-kawrt.
if not www_ex_konvkom-kawrt is initial and
not da_waer is initial.
clear bapi_ex_konvkom-conbaseval.
call function 'BAPI_CURRENCY_CONV_TO_EXTERN_9'
exporting
currency = da_waer
amount_internal = www_ex_konvkom-kawrt
importing
amount_external = bapi_ex_konvkom-conbaseval.
endif.
when others.
bapi_ex_konvkom-conbaseval =
www_ex_konvkom-kawrt / 10.
endcase.
Regards,
James Gaddis
2010 Apr 06 12:44 PM
Hi Silvia,
Try this:
1) Set correctly your currency field. Be sure it has value (in your case t_konv-waers), if doesn't get it other way.
t_bapicond-currency = t_konv-waers.
2) Set cacltypcon to retain proper type:
t_bapicond-CALCTYPCON
3) Remember to check the update fields at the extended structure:
wa_order_CONDITIONS_inx-COND_VALUE = 'X'.
wa_order_CONDITIONS_inx-CURRENCY = 'X'.
wa_order_CONDITIONS_inx-COND_UNIT = 'X'.
wa_order_CONDITIONS_inx-COND_P_UNT = 'X'.
Please let us know if it works!
Regards,
John
2010 Apr 06 12:54 PM
Before passing into BAPI, add the code
order_conditions_in-cond_value = order_conditions_in-cond_value / 10.Regards
Vinod
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |