‎2006 Jun 21 8:28 AM
Hi All
Does anyone have the code in Java to create a Sales Order by using BAPI_SALESORDER_CREATEFROMDAT2.
Thanks in advance
Sree Ramya
‎2006 Jun 21 8:50 AM
‎2006 Jun 21 8:41 AM
Hai Ramya,
I Havent used That Bapi , but instead i have used my own RFC ... u can check the coding...
/*
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.hclt.jcocon;
import com.hclt.jcocon.Zwfks_Rfc_Input;
import com.hclt.jcocon.Zwfks_Rfc_Output;
import com.hclt.jcocon.JCOConnect_PortType;
import com.sap.mw.jco.JCO;
/**
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
*/
public class MyMainClass1 {
public static void main(String[] args) {
try
{
Zwfks_Rfc_Input objInput = new <b>Zwfks_Rfc_Input</b>();
objInput.setCcode("01");
objInput.setZcode("000621");
JCO.Client jcoclient =
JCO.createClient(
"800",
"ABCD",
"mdAXc",
"EN",
"XYserver",
"00");
jcoclient.connect();
JCOConnect_PortType portType =
new JCOConnect_PortType();
portType.messageSpecifier.setJcoClient(
jcoclient);
<b>Zwfks_Rfc_Output</b> objOutput = portType.zwfks_Rfc(objInput);
String s = objOutput.getCname();
System.out.println("Output:"+s); jcoclient.disconnect();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
}
and also check these links
http://help.sap.com/saphelp_46c/helpdata/en/76/4a42f4f16d11d1ad15080009b0fb56/content.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
Regards,
Sridhar
‎2006 Jun 21 8:50 AM