cancel
Showing results for 
Search instead for 
Did you mean: 

Help on the Transactional BAPI - Writing to R/3 BAPI

Former Member
0 Kudos

1)I have imported and created Model for a custom BAPI ZPM_CREATE_ORDER and TRANSACTIONAL BAPIs i.e., COMMIT & ROLLBACK bapis.

2)I have mapped the context from Model to Custom Controller and then to View Controller. Also, did the UI Element Binding.

3) Added the methods callBapi_Create_Order and callBapi_Transaction_Commit which contain the Bapi executin in Cust Controller.

But nothing happening if I click on the Create Order button of the View.

My onActionCreateOrder() Method contains just 2 lines of code 1) To call the callBapi_Create_Order of Custom Controller 2) To call callBapi_Commit()

No issues with connecting to R/3 i.e JCO Destinations etc., are good since the Retrieval BAPI works with no problems.

Am I missing something here ? Any help is appreciated....

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member205624
Contributor
0 Kudos

hi, vivek

just check your custom controller code.

like binding of node and execution of modal objects.

or you can send me your custom controller code.

regards

jitender

Former Member
0 Kudos

Thank You. Here is my code. I am only showing the code that I have changed:

View Controller Action Method:

public void onActionCreateOrder

{

//@@begin onActionCreateOrder(ServerEvent)

wdThis.wdGetCreteOrderCustControllerController().callBapi_Zpm_Create_Order();

wdThis.wdGetCreteOrderCustControllerController().callBapi_commit();

//@@end

}

The Custom Controller code:

public void wdDoInit() {

Zpm_Create_Order_Input input = new Zpm_Create_Order_Input();

Zpm_Vmo_Hdr ordHdr = new Zpm_Vmo_Hdr();

input.setOrder_Header(ordHdr);

wdContext.nodeZpm_Create_Order_Input().bind(input);

Bapi_Transaction_Commit_Input

Bapi_Transaction_Commit_Input inputCommit =

new Bapi_Transaction_Commit_Input();

wdContext.nodeBapi_Transaction_Commit_Input().bind(inputCommit);

}

public void callBapi_Zpm_Create_Order( ) {

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentZpm_Create_Order_InputElement().modelObject().execute();

wdContext.nodeOrder_Header().invalidate();

}catch(Exception e){

manager.reportException(e.getMessage(),false);

}

}

public void callBapi_commit( )

{

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentBapi_Transaction_Commit_InputElement().modelObject().execute();

}catch(Exception e){

manager.reportException(e.getMessage(),false);

}

//@@end

}

Former Member
0 Kudos

Hi

1.Have you linked the onAction...() with the button ?

2.Put some reportSuccess("i am here") dummy messages in callBapi_Zpm_Create_Order( ) & callBapi_commit( )

to check the program contol flow.

3. Try to put BAPI transaction Commit function logic in R/3 only.

4. Check the context mappings.

Hope this solves the problem if not POST

Regards

Ananda