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: 

BAPI Not checking Vendor existance (BAPI_VENDOR_EXISTENCECHECK)

Former Member
0 Kudos

Hi all.

My BDC will created and update the vendor. code is

Check the vendor existance using BAPI_VENDOR_EXISTENCECHECK.

IF VENDOR exist.

Update the VENDOR.

ELSE.

Create VENDOR.

ENDIF.

But the problem is, in case of update record come very next one of the creation of same record.

For the first record BAPI giving vendor doesn't exist and creating, it is fine but

For second one BAPI is giving vendor doesn't exist but the same is exist.

data

(1000091098 ''''''''' 1st record'

1000091098 ''''''''''') 2nd record

I can't use the select statement instead of BAPI.

Why the BAPI is getting fails to do. i am using commit work after BDC also.

Regards,

Sri

4 REPLIES 4

former_member75463
Participant
0 Kudos

Hi,

there is nothing wrong with BAPI. There are two ways to solve this,

1) Put wait after vendor creation

2) Call BAPI & creation of vendor only one time.Why we need to check the same vendor again

Former Member
0 Kudos

I got it.

The BAPI is getting from the data and keeping in buffer.so at next time it is checking against buffer values.

I copied BAPI into ZBAPI and passing buffer as X.

Regards,

Sri

0 Kudos

I know it's solved (thank you for the feedback), but...

> The BAPI is getting from the data and keeping in buffer.so at next time it is checking against buffer values.

> I copied BAPI into ZBAPI and passing buffer as X.

As you are talking about a buffer, I thought you might be interested by this [wiki which explains why you MUST use BAPI_TRANSACTION_COMMIT instead of COMMIT WORK|http://wiki.sdn.sap.com/wiki/display/ABAP/BAPI_TRANSACTION_COMMITversusCOMMIT+WORK] when you use BAPIs, and what is this buffer about.

> i am using commit work after BDC also

Executing COMMIT WORK after a CALL TRANSACTION will have no effect on what is done inside the CALL TRANSACTION because it's done in a different LUW (see [sap library|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbae4135c111d1829f0000e829fbfe/frameset.htm]).

0 Kudos

Thank you Sandra Rossi for clarification.