Application Development 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: 

Remove special character from number field while downloading data to XLS

Former Member
0 Kudos

data : var type p decimal 2.

var = 11000.00.

while downloading var its showing 11,000.00. i need to download only 11000.00 with out converting var to character field.

How to remove special character ',' without changing data type while downloading to XLS.

Please help.

Moderator message: duplicate post.

Edited by: Thomas Zloch on Dec 25, 2010 4:53 PM

6 REPLIES 6

Former Member
0 Kudos

Hi,

This depends on the excel sheet cell attributes.

In Format cells instead of currency select 'General' or 'Number'.

Regards,

Srini.

Former Member
0 Kudos

i do not want do any format changes to XLS Sheet.

0 Kudos

Sunil,

That is not possible if you use VAR of type P.

You need to convert your field to CHAR type OR else use excel settings.

Former Member
0 Kudos

Try using submit statement. Not sure weather this will solve your problem..

Create one report ZREP1with the desired output. Get the output into Memory.

Create one more report where you can call ZREP1 by SUBMIT statement. Download it to Excel.

Subhankar
Active Contributor
0 Kudos

Hey Sunil,

This is not possible with out changing the format of the cell. This is excel natural features. Forget about SAP, can you do manipulation of large number in excel with out changing the format and comma's will not come?? suppose you have a number

123123213 and it will come as 1.23E+08. To make it proper we did format as numeric or text etc..

So if you want make the format as text and then download it.

You can take reference to make the format text.

CALL METHOD iref_spreadsheet->set_format

EXPORTING

rangename = 'PRANGE'

typ = 0

currency = 'USD'

no_flush = 'X'

IMPORTING

error = iref_error.

Thanks

Subhankar

ajay_mukundan2
Explorer
0 Kudos

TRY THIS CODE:

DATA L_MSTRING(480).

Pass value to L_MSTRING.

IF L_MSTRING CS ','.
          REPLACE ',' WITH SPACE INTO L_MSTRING.
        ENDIF.
        CONDENSE L_MSTRING.

Now you can download to excel using L_MSTRING.