cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Update

Former Member
0 Kudos

Hello Friends,

I am using the BAPI "BAPI_BUPA_CENTRAL_CHANGE", in order to update the SAP Business Partner data. But dont know what is wronge, its not working, here is my sample code.

ftemplate = repository.getFunctionTemplate("BAPI_BUPA_CENTRAL_CHANGE");

ftemplatecommit = repository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT");

if(ftemplate != null) {

// Create a function from the template

function = ftemplate.getFunction();

commit = ftemplatecommit.getFunction();

// Set up Import Parameters

function.getImportParameterList().setValue("0000000001", "BUSINESSPARTNER");

str = function.getImportParameterList().getStructure("CENTRALDATAPERSON");

str.setValue("Ammar","FIRSTNAME");

str.setValue("Rizvi","LASTNAME");

JCO.Table table = function.getTableParameterList().getTable("RETURN");

if (table.getNumRows() >0){

System.out.println(table.getString("MESSAGE"));

}

mConnection.execute(function);

mConnection.execute(commit);

After executing the above code, when i check the firstName and lastName of the specified Business Partner, it shows me the same old values.

It would be very nice if some one pls let me know what is possibally wronge with my code!

Many thanks!

Marek

Accepted Solutions (0)

Answers (2)

Answers (2)

Anupama1
Explorer
0 Kudos

Hello Raja,

I am facing a problem in executing the BAPI_BUPA_CENTRAL_CHANGE. I'm trying to run it on the system directly and am filling the BusinessPartner field, and the CENTRALDATAPERSON, and CENTRALDATAPERSON_X for the respective update.

But it just fails and when I debug, I realise that there is no active implementation for the exit "BUPA_FURTHER_CHECKS".

Any ideas here?

Thanx,

Anupama

gregorw
Active Contributor
0 Kudos

Hello Marek,

you have to fill also the Structure "CENTRALDATAPERSON_X" to mark the Fields which should be updated.

Regards

Gregor

Former Member
0 Kudos

Hello Gregor,

Thanks for your reply,

I have seted the CENTRALDATAPERSON_X, structure also, but still not updating the business partner.

I have added these lines of code,

str = function.getImportParameterList().getStructure("CENTRALDATAPERSON_X");

str.setValue("Ammar","FIRSTNAME");

str.setValue("Rizvi","LASTNAME");

Can you pls help me in identifying the possible problem,

Many thanks

Marek

Message was edited by: Marek Jöricke

athavanraja
Active Contributor
0 Kudos

Hi,

I am not sure how you would handle commit from java, but normally within ABAP after calling BAPIs for updating we call BAPI_TRANSACTION_COMMIT for commit work. May be try calling this BAPI immediately after you make the changes.

I see a code for commit in your code, but try this method it may be of help.

Regards

Raja

gregorw
Active Contributor
0 Kudos

Hello Raja,

he is already using the BAPI. Look at the line:

ftemplatecommit = repository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT");

Regards

Gregor

athavanraja
Active Contributor
0 Kudos

Hi,

Sorry didnt notice it.

Regards

Raja