2006 Dec 08 1:22 AM
Hey All,
I've created a program which is using BAPI_SALESORDER_ CREATEFROMDAT2 to create sales orders. The sales orders were successfully created but with the wrong tax condition (except the first sales order). I didn't fill the ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX internal tables since the requirement is to let the system generating the pricing itself automatically. When I created the sales order thru VA01, the tax condition was determined by SAP using the value in county field of ship-to partner.
The following is brief overview of the program logic,
LOOP AT sales_order_to_be_created_itab.
Change the KNA1-COUNC field (county code) of the ship-to partner using XD02 transaction. (note: BDC process)
Delay 3 seconds.
Free up all the previous filled internal tables and populate the new info into the internal tables which is needed by BAPI_SALESORDER_CREATEFROMDAT2.
Call BAPI_SALESORDER_CREATEFROMDAT2 to create the sales order.
Call BAPI_TRANSACTION_COMMIT to commit the creation.
ENDLOOP.
The first sales order was generated with the correct county tax condition. But, the rest of the sales orders were created with incorrect county tax condition (note: it seems that the BAPI determined the tax condition using the county value from the first sales order). Has any one encountered this issue before? If yes, can you please kindly give some advise how to solve this problem?
Thanks in advance,
Eddie
Hey All,
I've created a program which is using BAPI_SALESORDER_ CREATEFROMDAT2 to create sales orders. The sales orders were successfully created but with the wrong tax condition (except the first sales order). I didn't fill the ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX internal tables since the requirement is to let the system generating the pricing itself automatically. When I created the sales order thru VA01, the tax condition was determined by SAP using the value in county field of ship-to partner.
The following is brief overview of the program logic,
LOOP AT sales_order_to_be_created_itab.
Change the KNA1-COUNC field (county code) of the ship-to partner using XD02 transaction. (note: BDC process)
Delay 3 seconds.
Free up all the previous filled internal tables and populate the new info into the internal tables which is needed by BAPI_SALESORDER_CREATEFROMDAT2.
Call BAPI_SALESORDER_CREATEFROMDAT2 to create the sales order.
Call BAPI_TRANSACTION_COMMIT to commit the creation.
ENDLOOP.
The first sales order was generated with the correct county tax condition. But, the rest of the sales orders were created with incorrect county tax condition (note: it seems that the BAPI determined the tax condition using the county value from the first sales order). Has any one encountered this issue before? If yes, can you please kindly give some advise how to solve this problem?
Thanks in advance,
Eddie
2006 Dec 08 2:13 AM
HI Eddie
Can you re-check the logic and process of:
<b>Change the KNA1-COUNC field (county code) of the ship-to partner using XD02 transaction. (note: BDC process)</b>
Any tracking of the same???
Maybe you can try, changing the country codes of all customers(ship-to) and then proceed to create the sales orders.
You can consider using BAPI: BAPI_CUSTOMER_CHANGEFROMDATA1 for changing the ship-to party country code.
Kind Regards
Eswar
2006 Dec 08 4:12 PM
Hey Eswar,
Thanks for the reply. The issue that I was encountered is on COUNTY field of the customer, not the country field. The county field is not included in the BAPI_CUSTOMER_CHANGEFROMDATA1. The tax calculation for some of the states in US are based on county. The ship-to customer (one and only one) that I was used in the logic is only acted like a county determination factor inside the tax calculation process. Therefore, the change county BDC must proceed before sales order creation BAPI.
Thanks for your kindly help,
Eddie
2007 Feb 07 2:56 AM
Hi Eddie,
Just curious why do you need to moidfy the county of the customer just before creating an order.
Normally the tax is based on the ship-to party and should be calculated based on the tax jurisdiction code which would include state/county and the city. This is assuming you are using the taxusj or a copy of the same as tax procedure.
Above should not require you to change the county code on the customer every time you are creating the orders.
Thanks
Deep
2007 Feb 07 4:36 PM
Hi Deep,
The reason is due to the business behaviour within the industry of the company I work for. We sell products to our customers (sold-to customer in SAP) which have different projects in different locations (ship-to customer/partner in SAP). We try to avoid to create the ship-to customer/partner of our customers during the sales order creation process. Most of these ship-to customer/partner will be used only once. Therefore, a virtual ship-to customer has been created in the system that will be used in the sales order creation process to handle this business scenario. But, the county of this virtual ship-to customer must change before the sales order creation process in order to properly determination of the taxes of the order.
Eddie
2006 Dec 08 4:08 AM
hi
good
go through this weblog, i hope this ll help you to solve your probelm
/people/flavio.ciotola3/blog/2006/09/19/sap-and-php-an-easy-way-for-sd-sales-order-entry
thanks
mrutyun^
2006 Dec 08 3:54 PM
Hi Mrutyun,
Thanks for the help. All the information that were mentioned in the link are already included in my program logic, except the pricing condition logic which is not needed for the business requirement as mentioned before.
Thanks for everything,
Eddie
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |