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: 

Wrong CFOP determination via BAPI BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Kudos

Hello Gurus,

I need some help on the following:

When I create a Sales document manually (tcode VA01), CFOP code is determined correctly. But when I try to do the same process, using BAPI BAPI_SALESORDER_CREATEFROMDAT2, with same data ( Sold-To Party and Ship-To Party, material code...), CFOP code is determined wrong.

The SD consultant already checked the configuration in SPRO and everything looks fine.

I went thru debug and found that the FM SD_PARTNER_DATA_GET is called for both process, but internal table GVT_LOCAL_MEMORY is NOT filled when running BAPI and it IS filled when running VA01 (this internal table has VBPA - Partners - data).

This causes a NO_OBJECT_FOUND exception, which makes the program to read the address data from KNA1 (FM J_1B_SD_ADDRESS_READ), with the wrong address number, instead the address form Sales Order, since it's an On Time Customer - WE.

The weirdest thing is that it was working perfectly 3 days ago. We first noticed the problem in QAS environment, but in DEV Sandbox the error is the same now.

The scenario is an Interstate Sales Order. We are about 30 days from Go-Live and now this came thru.

Thanks in advance!

4 REPLIES 4

Former Member
0 Kudos

Thiago,

If this was working good all this while, the easiest way is to identify all the transports that moved to Q in the last 3 days. You should be able to able to pin point the one that is causing the issue.

Vikram.M

0 Kudos

Thanks for the reply Vikram.

I already have done that. There was no transport request (workbench or customizing) that could have changed anything.

I checked that BAPI doesn't pass on the same functions as VA01, such as SD_PARTNER_DATA_PUT, SD_PARTNER_SINGLE_MODIFY, among others.

0 Kudos

Thiago, if you suspect the problem with BAPI, I wonder why. How could your bapi have worked all this while and stopped suddenly? was there any note applied on the system?

0 Kudos

Vikran.

That's something we are investigating, but there´s nothing much left to look for since I did not change BAPI's standard code.

Meanwhile, to bypass this problem, I'll try to re-determinate CFOP.

Thanks.