Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Java Code for creating Sales Order

Former Member
0 Likes
1,103

Hi All

Does anyone have the code in Java to create a Sales Order by using BAPI_SALESORDER_CREATEFROMDAT2.

Thanks in advance

Sree Ramya

1 ACCEPTED SOLUTION
Read only

Former Member
2 REPLIES 2
Read only

sridharreddy_kondam
Active Contributor
0 Likes
542

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

Read only

Former Member