function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LavanyaLavanya 

Salesforce integrataion with SAP using Apex class generated by WSDL

Hi All, I have apex code  generated by WSDL for SAP. My requirement is using this code i need to connect my salesforce with SAP(table) which is  to get the data from SAP table and display it in Salesforce. First this i need made a connection with my salesforce and SAP. I tried a lot for this connect but i can't connect this. Kindly tell me the step for how to connect this using Apex code.

 

Generated code for WSDL to Apex:

 

//Generated by wsdl2apex

public class sapComDocumentSapSoapFunctionsMcS {
public class zsd_cust_det_webservice {
public String endpoint_x = 'http://serverapp5.cssydney.local:8000/sap/bc/srt/rfc/sap/zsd_cust_det_webservice/100/zsd_cust_det_we...
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCertName_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style', 'sapComDocumentSapSoapFunctionsMcS', 'urn:sap-com:document:sap:rfc:functions', 'sapComDocumentSapRfcFunctions'};
public sapComDocumentSapSoapFunctionsMcS.ZsdTCustDet ZsdCustWebservDemo(String IvAcctNo) {
sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemo_element request_x = new sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemo_element();
sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element response_x;
request_x.IvAcctNo = IvAcctNo;
Map<String, sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element> response_map_x = new Map<String, sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'urn:sap-com:document:sap:soap:functions:mc-style',
'ZsdCustWebservDemo',
'urn:sap-com:document:sap:soap:functions:mc-style',
'ZsdCustWebservDemoResponse',
'sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.EtAccDet;
}
}
public class ZsdCustWebservDemo_element {
public String IvAcctNo;
private String[] IvAcctNo_type_info = new String[]{'IvAcctNo','urn:sap-com:document:sap:rfc:functions','char10','1','1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'IvAcctNo'};
}
public class ZsdSCustDet {
public String AcctNo;
public String SalesOrdNo;
public String PoNo;
public String PoDate;
public String NetVal;
public String Currency_x;
private String[] AcctNo_type_info = new String[]{'AcctNo','urn:sap-com:document:sap:rfc:functions','char10','1','1','false'};
private String[] SalesOrdNo_type_info = new String[]{'SalesOrdNo','urn:sap-com:document:sap:rfc:functions','char10','1','1','false'};
private String[] PoNo_type_info = new String[]{'PoNo','urn:sap-com:document:sap:rfc:functions','char20','1','1','false'};
private String[] PoDate_type_info = new String[]{'PoDate','urn:sap-com:document:sap:rfc:functions','date','1','1','false'};
private String[] NetVal_type_info = new String[]{'NetVal','urn:sap-com:document:sap:rfc:functions','curr15.2','1','1','false'};
private String[] Currency_x_type_info = new String[]{'Currency','urn:sap-com:document:sap:rfc:functions','cuky5','1','1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'AcctNo','SalesOrdNo','PoNo','PoDate','NetVal','Currency_x'};
}
public class ZsdTCustDet {
public sapComDocumentSapSoapFunctionsMcS.ZsdSCustDet[] item;
private String[] item_type_info = new String[]{'item','urn:sap-com:document:sap:soap:functions:mc-style','ZsdSCustDet','0','-1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'item'};
}
public class ZsdCustWebservDemoResponse_element {
public sapComDocumentSapSoapFunctionsMcS.ZsdTCustDet EtAccDet;
private String[] EtAccDet_type_info = new String[]{'EtAccDet','urn:sap-com:document:sap:soap:functions:mc-style','ZsdTCustDet','1','1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'EtAccDet'};
}
}

 

Thanks,

Regards,

Lavanya.

 

Roopa SarathkumarRoopa Sarathkumar
Hi Lavanya,

Did you solve this is?

I am trying to do the same thing, can u help me?