on 11-01-2006 4:37 PM
Hello Everyone,
I have developed a Web Dynpro application, which makes 3 BAPI calls.
2 of them work fine. However one of the BAPI is giving me the following error message -
connection closed without message (CM_NO_DATA_RECEIVED), error key: RFC_ERROR_COMMUNICATION
I guess, its not the JCO Problem. Is it ?
Am really surprised how come only One BAPI gets this error message.
Please help me figure this out.
Thanks and Regards,
Samta
Samta,
Can you paste me the code on how you are accessing the third RFC. Whats happening here is, either web dynpro application or R/3 is terminated in advance. You can also see it in ST05 transaction.
Paste your code here, I will look for it.
/Raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Raj,
Thanks for your quick response.
The code that i have written in the Web Dynpro application is -
_____________________________________________________
Z_Mm_XX_Create_Ses_Input z_bapi = new Z_Mm_XX_Create_Ses_Input();
//Set the header
Zresm_XX_Header z_header = new Zresm_XX_Header();
z_header.setApprover(wdContext.currentV_UI_ApproversElement().getV_UI_ApproverName());
// z_header.setDate_Worked(wdContext.currentV_UI_Header_DataElement().getV_UI_Date_Worked().);
z_header.setShort_Text(wdContext.currentV_UI_Header_DataElement().getV_UI_Text_Inst());
z_header.setSheettype(wdContext.currentV_UI_New_Edit_InputsElement().getSheetType());
z_header.setVendor(wdContext.currentV_UI_SelectionElement().getV_Vendor_Id());
z_bapi.addTbl_Es_Header(z_header);
//Set the header comments
Zresm_XX_Comment z_hdr_cmt = new Zresm_XX_Comment();
z_hdr_cmt.setComments(wdContext.currentV_UI_Header_DataElement().getV_UI_Comments());
z_bapi.addTbl_Es_Header_Commnt(z_hdr_cmt);
//Set the services table
int node_size = wdContext.nodeV_UI_ThrdPartyList().size();
for(int i=0; i<node_size; i++)
{
wdContext.nodeV_UI_ThrdPartyList().moveTo(i);
if ((!(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType()==null))&&
(!(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType().equalsIgnoreCase("--- Select a service ---"))))
{
Zresm_XX_Lineitem z_services = new Zresm_XX_Lineitem();
z_services.setAsktx(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType());
z_services.setMarkup_Pct(wdContext.currentV_UI_ThrdServicesElement().getV_UI_Markup());
z_services.setPo_Item(wdContext.currentV_UI_Header_DataElement().getV_UI_PO_Item());
z_services.setPonumber(wdContext.currentV_UI_Header_DataElement().getV_UI_PONumber());
z_services.setThirdptyven(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_ThrdPartyVndr());
z_services.setThirdptyinv(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_ThrdPartyVndrInv());
z_services.setThirdptyhrs(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_HrsWorked());
z_bapi.addTbl_Es_Services(z_services);
}
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setPortal_Id(
wdContext.currentV_UI_Header_DataElement().getV_UI_Portal_Id());
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setRelease_Flag("X");
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setCalltype("B");
wdThis.executeZ_Mm_XX_Create_Ses_Input();
________________________________________________________
<b>Does this mean it is reaching the R3 BAPI successfully.
Or does it terminate before it reaches the BAPI, as the error message says communication error.</b>
Am stuck up really.
Please help.
Thanks in advance,
Samta
Message was edited by: samta nichani
Samta,
Please see my comments, unfortunately I dont understand much of your code, as its in a standard way. I have a working code, something similar, I can send you if u want.
-
Z_Mm_XX_Create_Ses_Input z_bapi = new Z_Mm_XX_Create_Ses_Input();
***Binding is missed.
//Set the header
Zresm_XX_Header z_header = new Zresm_XX_Header();
z_header.setApprover(wdContext.currentV_UI_ApproversElement().getV_UI_ApproverName());
z_header.setShort_Text(wdContext.currentV_UI_Header_DataElement().getV_UI_Text_Inst());
z_header.setSheettype(wdContext.currentV_UI_New_Edit_InputsElement().getSheetType());
z_header.setVendor(wdContext.currentV_UI_SelectionElement().getV_Vendor_Id());
z_bapi.addTbl_Es_Header(z_header);
//Set the header comments
Zresm_XX_Comment z_hdr_cmt = new Zresm_XX_Comment();
z_hdr_cmt.setComments(wdContext.currentV_UI_Header_DataElement().getV_UI_Comments());
z_bapi.addTbl_Es_Header_Commnt(z_hdr_cmt);
//Set the services table
int node_size = wdContext.nodeV_UI_ThrdPartyList().size();
for(int i=0; i<node_size; i++)
{
wdContext.nodeV_UI_ThrdPartyList().moveTo(i);
***whats this moveTo statment is doing, I dont know about it.
if ((!(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType()==null))&&
(!(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType().equalsIgnoreCase("--- Select a service ---"))))
{
Zresm_XX_Lineitem z_services = new Zresm_XX_Lineitem();
z_services.setAsktx(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType());
z_services.setMarkup_Pct(wdContext.currentV_UI_ThrdServicesElement().getV_UI_Markup());
z_services.setPo_Item(wdContext.currentV_UI_Header_DataElement().getV_UI_PO_Item());
z_services.setPonumber(wdContext.currentV_UI_Header_DataElement().getV_UI_PONumber());
z_services.setThirdptyven(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_ThrdPartyVndr());
z_services.setThirdptyinv(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_ThrdPartyVndrInv());
z_services.setThirdptyhrs(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_HrsWorked());
z_bapi.addTbl_Es_Services(z_services);
}
***I stronlgy recommend check this loop.....here is the point where u get Communication error.
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setPortal_Id(
You should set the values to the model object that u instantiated z_bapi
wdContext.currentV_UI_Header_DataElement().getV_UI_Portal_Id());
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setRelease_Flag("X");
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setCalltype("B");
wdThis.executeZ_Mm_XX_Create_Ses_Input();
is this how you execute the method?
***usually it should be wdContext.CurrentZ_Mm_XX_Create_Ses_Input().modelObject().Execute();
/Raj.
Hello Raj,
Thanks a lot for your quick response.
Really appreciate your patience.
This is the modified version of the code-
Still its giving me the same error
_________________________________________________
Z_Mm_XX_Create_Ses_Input z_bapi = new Z_Mm_XX_Create_Ses_Input();
//Set the header
Zresm_XX_Header z_header = new Zresm_XX_Header();
z_header.setApprover(wdContext.currentV_UI_ApproversElement().getV_UI_ApproverName());
// z_header.setDate_Worked(wdContext.currentV_UI_Header_DataElement().getV_UI_Date_Worked().);
z_header.setShort_Text(wdContext.currentV_UI_Header_DataElement().getV_UI_Text_Inst());
z_header.setSheettype(wdContext.currentV_UI_New_Edit_InputsElement().getSheetType());
z_header.setVendor(wdContext.currentV_UI_SelectionElement().getV_Vendor_Id());
z_bapi.addTbl_Es_Header(z_header);
wdContext.nodeZ_Mm_XX_Create_Ses_Input().bind(z_bapi);
//Set the header comments
Zresm_XX_Comment z_hdr_cmt = new Zresm_XX_Comment();
z_hdr_cmt.setComments(wdContext.currentV_UI_Header_DataElement().getV_UI_Comments());
z_bapi.addTbl_Es_Header_Commnt(z_hdr_cmt);
wdContext.nodeZ_Mm_XX_Create_Ses_Input().bind(z_bapi);
//Set the services table
int node_size = wdContext.nodeV_UI_ThrdPartyList().size();
for(int i=0; i<node_size; i++)
{
wdContext.nodeV_UI_ThrdPartyList().moveTo(i);
if ((!(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType()==null))&&
(!(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType().equalsIgnoreCase("--- Select a service ---"))))
{
Zresm_XX_Lineitem z_services = new Zresm_XX_Lineitem();
z_services.setAsktx(wdContext.currentV_UI_ThrdServicesElement().getV_UI_ServiceType());
z_services.setMarkup_Pct(wdContext.currentV_UI_ThrdServicesElement().getV_UI_Markup());
z_services.setPo_Item(wdContext.currentV_UI_Header_DataElement().getV_UI_PO_Item());
z_services.setPonumber(wdContext.currentV_UI_Header_DataElement().getV_UI_PONumber());
z_services.setThirdptyven(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_ThrdPartyVndr());
z_services.setThirdptyinv(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_ThrdPartyVndrInv());
z_services.setThirdptyhrs(wdContext.currentV_UI_ThrdPartyListElement().getV_UI_HrsWorked());
z_bapi.addTbl_Es_Services(z_services);
}
}
wdContext.nodeZ_Mm_XX_Create_Ses_Input().bind(z_bapi);
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setPortal_Id(wdContext.currentV_UI_Header_DataElement().getV_UI_Portal_Id());
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setRelease_Flag("X");
wdContext.currentZ_Mm_XX_Create_Ses_InputElement().setCalltype("B");
wdThis.executeZ_Mm_XX_Create_Ses_Input();
_________________________________________________
Please help.
Thanks in advance,
Samta
Samta,
Here is what I have from my purchase order application which is running successfully for last 2 months. Please observe it carefully, and try to understand. If u still have problem, I guess your are in US, I will try to resolve it.
public void executeBapi_Goods_Type1( )
{
//@@begin executeBapi_Goods_Type1()
java.util.Date today = new java.util.Date();
java.sql.Date currDate = new java.sql.Date(today.getTime());
goodsCreateInput = new Bapi_Goodsmvt_Create_Input();
wdContext.nodeBapi_Goodsmvt_Create_Input().bind(goodsCreateInput);
String str = wdContext.currentTable1_WorkListElement().getCharg();
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
try{
//settings values for goods mvt header for Type1 PO
Bapi2017_Gm_Head_01 goodsHeader = new Bapi2017_Gm_Head_01();
goodsHeader.setBill_Of_Lading(wdContext.currentContextElement().getBill_lading().toUpperCase());
goodsHeader.setPstng_Date(currDate);
goodsHeader.setPr_Uname(wdContext.currentUser_InfoElement().getUser_Id());
goodsHeader.setDoc_Date(currDate);
goodsHeader.setRef_Doc_No(wdContext.currentTable1_WorkListElement().getXblnr());
goodsHeader.setHeader_Txt("SCPORTAL");
goodsCreateInput.setGoodsmvt_Header(goodsHeader);
//settings input for goodscode for Type 1 PO
Bapi2017_Gm_Code goodsCode = new Bapi2017_Gm_Code();
goodsCode.setGm_Code("01");
goodsCreateInput.setGoodsmvt_Code(goodsCode);
//setting values for goods movement item for Type 1 PO
Bapi2017_Gm_Item_Create mvtItem = new Bapi2017_Gm_Item_Create();
mvtItem.setMaterial(wdContext.currentTable1_WorkListElement().getMatnr());
mvtItem.setPlant(wdContext.currentUser_InfoElement().getWerks());
mvtItem.setStge_Loc(wdContext.currentTable1_WorkListElement().getLgort());
mvtItem.setMove_Type("101");
mvtItem.setEntry_Qnt(wdContext.currentContextElement().getQty_rec());
mvtItem.setEntry_Uom(wdContext.currentTable1_WorkListElement().getMeins());
mvtItem.setPo_Number(wdContext.currentTable1_WorkListElement().getEbeln());
mvtItem.setPo_Item(wdContext.currentTable1_WorkListElement().getEbelp());
mvtItem.setItem_Text(wdContext.currentContextElement().getVen_batch().toUpperCase());
mvtItem.setMvt_Ind("B");
mvtItem.setMove_Reas("0001");
mvtItem.setVendrbatch(wdContext.currentContextElement().getVen_batch().toUpperCase());
mvtItem.setBatch(wdContext.currentContextElement().getBatch().toUpperCase());
//add is used when there is 1 to n relationship. since there will be multiple items
//for a single purchase order.
goodsCreateInput.addGoodsmvt_Item(mvtItem);
wdContext.currentBapi_Goodsmvt_Create_InputElement().modelObject().execute();
//invalidating the output of the rfc call to update with the new values
wdContext.nodeOutput().invalidate();
wdContext.nodeReturn().invalidate();
//removing the values from the goods mvt item that we have set above to post new values next time.
goodsCreateInput.removeGoodsmvt_Item(mvtItem);
}catch(WDDynamicRFCExecuteException ex){
msgMgr.reportException(ex.getMessage(),false);
}
Hello Raj/LM,
I have changed my code to this -
and i am just setting one node and printing it as a table in the view.
____________________________________________________
Z_Mm_Cmet_Create_Ses_Input z_bapi =
new Z_Mm_Cmet_Create_Ses_Input();
wdContext.nodeZ_Mm_Cmet_Create_Ses_Input().bind(z_bapi);
//Set the header
Zresm_Cmet_Header z_header = new Zresm_Cmet_Header();
z_header.setApprover(list_approver.getV_UI_ApproverName());
z_header.setShort_Text("sam");
z_header.setSheettype("4004");
z_header.setVendor("123456");
z_bapi.addTbl_Es_Header(z_header);
z_bapi.setPortal_Id("123456");
z_bapi.setRelease_Flag("X");
z_bapi.setCalltype("B");
wdThis.executeZ_Mm_Cmet_Create_Ses_Input();
_____________________________________________
Now when i print this model node in the view using apply template - > table i get the table as blank.
Why is the data not setting in the model node.
Am i missing on nything.
I c no issues with the model node properties.
And in the executeZ_Mm_Cmet_Create_Ses_Input() method i have the following piece of code -
__________________________________________________
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
wdContext.currentZ_Mm_Cmet_Create_Ses_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}
__________________________________________________
Please help.
Am really stuck up with this.
Thanks in advance.
Samta
Hi,
In your model binding, check whether you have done the following.
Click on Z_Mm_Cmet_Create_Ses_Input node, right click to say edit model binding. You should have clicked all the input parameters that you have given here, like short_text,sheettype etc. Then,click on output. Under here, you click all the output parameters that you expect(any tables or whatever).
Only then will the nodeOutput.invalidate work.
Regards,
LM
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.