This website is not affiliated with, sponsored by, or approved by SAP AG.

"Please enter sold-to party or ship-to party"

Interfaces (ALE, IDOC, RFC, EDI etc.)

Moderators: Snowy, thx4allthefish

Postby venkat_vaishu » Wed Mar 05, 2003 6:40 am

I have also faced same problem.
But when maintained other tables like
order_schedules_in and order_conditions_in
this problem is solved.

Bye
Venkat
venkat_vaishu
 

Create sales order via BAPI

Postby jimli » Wed Mar 05, 2003 8:06 am

Dear all,

I have already followed the steps on sales order creation.

But still can't I create sales order.

try{
m_SapConn.createFunction ("BAPI_SALESORDER_CREATEFROMDAT2");
m_SapConn.setImportValue ("P","BEHAVE_WHEN_ERROR");
JCO.Structure header=m_SapConn.getImportStructure ("ORDER_HEADER_IN");
JCO.Table partner=m_SapConn.getTable ("ORDER_PARTNERS");
JCO.Table item=m_SapConn.getTable ("ORDER_ITEMS_IN");
JCO.Table condition=m_SapConn.getTable ("ORDER_CONDITIONS_IN");
JCO.Table schedule=m_SapConn.getTable ("ORDER_SCHEDULES_IN");
//header
header.setValue("ZBTO","DOC_TYPE");
header.setValue("CZFN","SALES_ORG");
header.setValue("01","DISTR_CHAN");
header.setValue("FN","DIVISION");
header.setValue("20030120","REQ_DATE_H");
header.setValue("20030112","PURCH_DATE");
header.setValue("123456789A","PURCH_NO_C");
header.setValue("20030112","PRICE_DATE");
//partners
partner.appendRow();
partner.setValue("WE","PARTN_ROLE");
partner.setValue("ACQ001","PARTN_NUMB");
partner.appendRow();
partner.setValue("AG","PARTN_ROLE");
partner.setValue("ACQ001","PARTN_NUMB");
partner.appendRow();
partner.setValue("RG","PARTN_ROLE");
partner.setValue("ACQ001","PARTN_NUMB");
partner.appendRow();
partner.setValue("RE","PARTN_ROLE");
partner.setValue("ACQ001","PARTN_NUMB");
partner.appendRow();
partner.setValue("SP","PARTN_ROLE");
partner.setValue("ACQ001","PARTN_NUMB");
partner.appendRow();
partner.setValue("SH","PARTN_ROLE");
partner.setValue("BOT002","PARTN_NUMB");

//items
item.appendRow();
item.setValue("000010","ITM_NUMBER");
item.setValue("000010","PO_ITM_NO");
item.setValue("470008-021","MATERIAL");
item.setValue("CZ01","PLANT");
item.setValue("074F","STORE_LOC");
item.setValue(10D,"TARGET_QTY");
item.setValue("NT45","PMNTTRMS");
//conditions
condition.appendRow();
condition.setValue("000010","ITM_NUMBER");
condition.setValue("EDI1","COND_TYPE");
condition.setValue(510.25D,"COND_VALUE");
//schedule lines
schedule.appendRow();
schedule.setValue("000010","ITM_NUMBER");
schedule.setValue("0001","SCHED_LINE");
schedule.setValue("20030125","REQ_DATE");
schedule.setValue("CP","SCHED_TYPE");

m_SapConn.execute ();

}catch (Exception ex1){
System.out.println (ex1.getMessage ());
}
System.out.println (m_SapConn.getExportValue ("SALESDOCUMENT"));
JCO.Table ret=m_SapConn.getTable ("RETURN");
for (int i=0;i<ret.getNumRows();i++){
ret.setRow(i);
System.out.println (ret.getString("TYPE")+" "+ret.getString("MESSAGE"));
}

try{
m_SapConn.createFunction ("BAPI_TRANSACTION_COMMIT");
m_SapConn.execute ();
}catch (Exception igore){};


Can anybody sugguest me?


jimli@cz.foxconn.com
jimli
 

Postby Guest » Wed Mar 05, 2003 11:52 pm

Instead of partner function in sequence of WE, AG, RG,RE
use AG,RE,RG,WE .
I hope it will work

Thanks
Venkat

Code should look like this
****************************************************
JCO.Table partners = function.getTableParameterList().getTable("ORDER_PARTNERS");
partners.appendRow();
partners.setValue("AG","PARTN_ROLE");
partners.setValue("STEE214","PARTN_NUMB");
partners.setValue("10","ITM_NUMBER");
partners.appendRow();
partners.setValue("RE","PARTN_ROLE");
partners.setValue("STEE214","PARTN_NUMB");
partners.setValue("10","ITM_NUMBER");
partners.appendRow();
partners.setValue("RG","PARTN_ROLE");
partners.setValue("STEE214","PARTN_NUMB");
partners.setValue("10","ITM_NUMBER");
partners.appendRow();
partners.setValue("WE","PARTN_ROLE");
partners.setValue("STEE214","PARTN_NUMB");
partners.setValue("10","ITM_NUMBER");
partners.appendRow();
partners.setValue("SP","PARTN_ROLE");
partners.setValue("STEE214","PARTN_NUMB");
partners.setValue("10","ITM_NUMBER");
Guest
 


Return to Interfaces

Who is online

Users browsing this forum: No registered users and 4 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.