Application Development and Automation 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: 
Read only

BAPI_QUOTATION_CREATEFROMDATA2 does not create and update custom condition value.

former_member295881
Contributor
0 Likes
1,191

Hi experts,

I create quotations by using the function module BAPI_QUOTATION_CREATEFROMDATA2. So far I was able to create price conditions on the item level by using the following code:

I Switch for activating the new condition item handling:
Import parameter LOGIC_SWITCH-COND_HANDLE = 'X'.
<br>
  1. wa_cond-itm_number = wa_data-linenumber.
  2. wa_cond-cond_type = 'PR00'.
  3. wa_cond-cond_value = 10.
  4. wa_cond-currency = 'CAD'
  5. insert wa_cond into table tab_cond.
  6. wa_cond_inx-itm_number = wa_data-linenumber.
  7. wa_cond_inx-cond_type = 'PR00'.
  8. wa_cond_inx-updateflag = 'U'.
  9. wa_cond_inx-cond_value = 'X'.
  10. wa_cond_inx-currency = 'X'.
  11. insert wa_cond_inx into table tab_cond_inx.

However, when I try to create with custom (ZI30) condition values, the standard BAPI doesn't work. I checked ZI30 via VK12, and I was able to see all variant details.

  1. wa_cond-itm_number = wa_data-linenumber.
  2. wa_cond-cond_type = 'ZI30'.
  3. wa_cond-cond_value = 3.
  4. wa_cond-currency = 'CAD'.
  5. insert wa_cond into table tab_cond.
  6. wa_cond_inx-itm_number = wa_data-linenumber.
  7. wa_cond_inx-cond_type = 'ZI30'.
  8. wa_cond_inx-updateflag = 'U'.
  9. wa_cond_inx-cond_value = 'X'.
  10. wa_cond_inx-currency = 'X'.
  11. insert wa_cond_inx into table tab_cond_inx.

Unfortunately the above piece of code does not work. When I call the BAPI I don't even get any error message in return table of BAPI.

When I create a quotation manually I can add the condition with an new value via GUI.

Is there a special flag which I have to set when I want to create a custom condition?

regards and many thanks in advance.

0 REPLIES 0