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

Changing decimal notation dynamically

Former Member
0 Likes
2,591

hi all,

I have a requirement to upload an excel file through BDC.

In that file I have a decimal field.

SAP environment can take it in two formats viz 12.23 or 12,00 which we can set manually in user profile in system option in toolbar.

System -> User Profile -> own data -> default -> decimal notation.

but if the decimal notation in SAP environment is opposite of what we are providing in excel file field,

then it will give an error viz Input must be in ___,____ or ____.____ format

So I want to change my data field in excel to the decimal notation as in SAP environment.

Please suggest. Its urgent.

Thanks in advance

Manish Gupta

Edited by: MANISH GUPTA on Aug 22, 2008 2:34 PM

Edited by: MANISH GUPTA on Aug 22, 2008 2:34 PM

Edited by: MANISH GUPTA on Aug 22, 2008 2:35 PM

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
1,533

Hi Manish,

Take one character variable of sufficient length usually 19 for currency and quantity fields.

Now use WRITE to statement to move data from ur work area to this variable and use this variable while populating the BDC.

It works fine.

What it does is it will write the data absed on user settings.

eg:

DATA: w_currency(19) TYPE c.

WRITE wa-currency TO w_currency.

CONDENSE w_currency.

Now use this variable while populating the BDCdata table.

U have to follow same for date and time fields as well.

Thanks,

Vinod.

5 REPLIES 5
Read only

former_member585060
Active Contributor
0 Likes
1,533

U Upload the Data from Excel sheet into an internal table of all fields character format, then map that to standard sap fields.

As in Data transfer we usually upload data into character field table, so that sap automatically converts the fields to its desired form if the incoming data is of character format.

Read only

Former Member
0 Likes
1,533

Hi

set the decimal places from user data and set accordingly x 123456789.000 like that.

and create ur data in file as decimal places 12.23

This will not throw error.

Read only

vinod_vemuru2
Active Contributor
1,534

Hi Manish,

Take one character variable of sufficient length usually 19 for currency and quantity fields.

Now use WRITE to statement to move data from ur work area to this variable and use this variable while populating the BDC.

It works fine.

What it does is it will write the data absed on user settings.

eg:

DATA: w_currency(19) TYPE c.

WRITE wa-currency TO w_currency.

CONDENSE w_currency.

Now use this variable while populating the BDCdata table.

U have to follow same for date and time fields as well.

Thanks,

Vinod.

Read only

former_member585060
Active Contributor
Read only

Former Member
0 Likes
1,533

Hi gupta,

Go to SU01 transaction and then change ur values

to your required format.

I hope this solve ur problem.

Regards,

Ranjith C.