cancel
Showing results for 
Search instead for 
Did you mean: 

Data type conversion JCO To ABAP( Double to DEC)

Former Member
0 Kudos

Hi,

I want to update a field having data type as DEC with length 11 in APO system using JCO.Whatever i give as input is not getting reflected in APO system. Instead i get some different value.

It seems that there is some data type conversion for that field..

Thanks

Archana

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Can you post the source code how you set the value

Kind Regards

Mukesh

Former Member
0 Kudos

if(tableName.equals("BAPI10001LOCPRDVERS2"))

{

table.appendRow();

//System.out.println("getting inside table "+tableName);

table.setValue("SOP112","PRODUCT");

table.setValue("SCMTEST111","LOCATION");

table.setValue("1001","LOCTYPE");

table.setValue("SCMTEST111","LOCATION_INT");

table.setValue("000","PLANNING_VERSION");

table.setValue("5000","SAFETY_DAYS_SUPPLY");//this is the field having problem

table.setValue("5","SAFETY_STOCK");

table.setValue(" ","SAFTY_STOCK_CALC_METHOD");

table.setValue("5.00","OPENING_PERIOD");

table.setValue("15","FORECAST_HORIZON");

table.setValue(("20000"),"VMI_PROM_LEAD_TIME");

table.setValue("0","MINIMUM_LOT_SIZE");

table.setValue(bd1,"TARGET_DAYS_SUPPLY");

}

Former Member
0 Kudos

Hi

Are you complecate at OPENING_PERIOD as decimal?

try this

table.setValue(new Double("5.0"),"OPENING_PERIOD");

// which field you want to set as dec set like that

Kind Regards

Mukesh

Former Member
0 Kudos

Hi

I think BigDecimal will work for your problem. Try like this

table.setValue(new BigDecimal("5000"),"SAFETY_DAYS_SUPPLY"); // Import java.math.BigDecimal

Regards,

Giri

Former Member
0 Kudos

Hi Giri,

Thanks for the reply.

I tried this but it is not working for me.

Let me give an example :

table.setValue(new BigDecimal("5000"),"SAFETY_DAYS_SUPPLY");

If I do this, the value updated in APO is 0.03.

How this conversion occurs?? Again if I try to display

new BigDecimal("5000") on console, the result is 5000.

Archana

Former Member
0 Kudos

Hi Mukesh,

Thanks for the reply.

I tried this but it is not working for me.Can you suggest me some other way.

Thanks,

Archana