Skip to Content
0
Former Member
Nov 08, 2006 at 12:56 PM

cannot modify data with a BAPI CHANGE

46 Views

Hi,

I try to change the student address with the bapi : bapi_student_address_change. When I run the application, there is no error, but no data is changed !

Here is my code :

-


public void ExecuteAddressChange( )

{

//@@begin ExecuteAddressChange()

Bapi_Student_Address_Change_Input inputAddressChange =

new Bapi_Student_Address_Change_Input();

wdContext.nodeStudent_Address_Change().bind(inputAddressChange);

Bapi_Transaction_Commit_Input inputCommit =

new Bapi_Transaction_Commit_Input() ;

wdContext.nodeStudentAddressCommit().bind(inputCommit) ;

String address = wdContext.currentAddressdataElement().getStreet();

String postalCode =

wdContext.currentAddressdataElement().getPostl_Cod1();

String houseNo = wdContext.currentAddressdataElement().getHouse_No();

String City = wdContext.currentAddressdataElement().getCity();

String telephone = wdContext.currentStudent_Address_GetdetailElement().getNoTelephone() ;

String mobile = wdContext.currentStudent_Address_GetdetailElement().getNoMobile();

String objectID = wdContext.currentStudent_Address_GetdetailElement().getObjectid();

com.sap.cm.studentchange.model4.Bapibus1006_Address model =

new com.sap.cm.studentchange.model4.Bapibus1006_Address();

model.setStreet(address);

model.setPcode1_Ext(postalCode);

model.setHouse_No(houseNo);

model.setCity(City);

wdContext.nodeAddressdata2().bind(model) ;

Bapibus1006_Address_X modelX = new Bapibus1006_Address_X();

modelX.setStreet(true);

modelX.setPcode1_Ext(true);

modelX.setHouse_No(true);

modelX.setCity(true);

wdContext.nodeAddressdata_X().bind(modelX) ;

try {

wdContext

.currentStudent_Address_ChangeElement()

.modelObject()

.execute();

wdContext

.currentStudentAddressCommitElement()

.modelObject()

.execute() ;

} catch (Exception ex) {

// If an exception is thrown, then the stack trace will be printed

ex.printStackTrace();

}

//@@end

-


Can you help me ?

Thanks,

Mathieu