cancel
Showing results for 
Search instead for 
Did you mean: 

How i can set date in a tabla sap?

Former Member
0 Kudos

Hi all,

I'm working in a proyect where i like do a Sales order with a aplication web, in Sap Netweaver developer studio, and i use the bapi: "BAPI_SALESORDER_CREATEFROMDAT2".

First i have:

**********************************************************

JCO.Structure Tb = function.getImportParameterList().getStructure("ORDER_HEADER_IN");

Tb.setValue("ZNAC","DOC_TYPE");

Tb.setValue("1000","SALES_ORG");

Tb.setValue("10","DIVISION");

Tb.setValue("10","DISTR_CHAN");

JCO.Table Tab = function.getTableParameterList().getTable("ORDER_ITEMS_IN");

nfilas=Tab.getNumRows();

for(int i=0; i<nfilas;i++){

Tab.setRow(i);

Tab.setValue("000010","ITM_NUMBER");

Tab.setValue("201311630P05000032","MATERIAL");

Tab.setValue("10","TRAGET_QTY");

}

JCO.Table Tab2 = function.getTableParameterList().getTable("ORDER_PARTNERS");

nfilas=Tab2.getNumRows();

for(int i=0;i<nfilas;i++){

Tab2.setRow(i);

Tab2.setValue("AG","PARTN_ROLE");

Tab2.setValue("100003","PARTN_NUMB");

}

**********************************************************

Second execute the function:

**********************************************************

mConnection.execute(function);

**********************************************************

But the result isn't not equal that the result that i get if i have it in SAP with same value. In the table "Return" that it's where is the result isn't equal.

Any idea?

Thank's

PD: Excuse me for my english

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Naresh,

Thank's for your help. I have solved my problem.

Great

Vicente Zaragoza

Former Member
0 Kudos

Hi,

The only change which I can suggest by looking at code is to modify the line below

Tab2.setValue("100003","PARTN_NUMB");

to

Tab2.setValue("0000100003","PARTN_NUMB");

As the Partner Number Length is "10" in the table ORDER_PARTNERS, it may help if u pad it with zeros.

Regards,

Naresh