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

Excel Formatting Issue for data downloaded from SAP

Former Member
0 Likes
939

Hello,

We have developed a bespoke program to extract data from SAP into Microsoft Excel. The program is extracting data as per our expectations, expect for the one field. In the program the net price field in converted to #,000 format and downloaded to excel. This is working fine for users from many countries except for Poland users. For the PL version users it is displayed either in numeric format or text format.

Can any one help me how to correct this in the program or excel for this users in Poland without affecting the other users.

Regards

Raj

Hello,

We have developed a bespoke program to extract data from SAP into Microsoft Excel. The program is extracting data as per our expectations, expect for the one field. In the program the net price field in converted to #,000 format and downloaded to excel. This is working fine for users from many countries except for Poland users. For the PL version users it is displayed either in numeric format or text format.

Can any one help me how to correct this in the program or excel for this users in Poland without affecting the other users.

Regards

Raj

5 REPLIES 5
Read only

Former Member
0 Likes
879

hello,

you could create for example a configuration table which identifies attributes output format which depends on users country.For example:

1) get required master data about user (via user name).

2) select fields format from your custom table (if there is no pattern for this country in your table then use default one);

3) output data into excel using defined pattern;

br,

dez_

Read only

0 Likes
879

Thanks for the reply dez.

To add to my previous issue, the #,000 format in the program is resulting in a numeric value with . (dot) before the number.

Eg: 500,150 is coming as .500.150 and also

values like 600,00 is inconsistent like it is correct coming in few case and in some it is coming as just 600.

This is creating lot of problem for the user, can you please help me to correct this either in the program or excel.

Many Thanks

Raj

Read only

0 Likes
879

hi,

i did not understand the question. could you reformulate it? i just need to know what are you getting as input and what do you want to get as final result.

br,

dez_

Read only

0 Likes
879

On downloading the report to excel, values for example are coming as .500.50 instead of 500.50, there is a dot being introduced in some cells before the number. I need to eliminate this. in the program my technical consultant has considered #,000 format and this problem occurs only for Poland users for the rest of the world it is coming correctly.

Regards

Raj

Read only

0 Likes
879

hello,

you could insert check statement before the data've been outputted.

use FM SUSR_USER_ADDRESS_READ to get country code via username and if country code is equal to PL then:

data: lv_amount type string value '.500.50',
        lt_result    type type match_result_tab,
        lv_regex    type ref to cl_abap_regex.

create object lv_regex
    exporting
      pattern = '^\.'.

find all occurrences of regex lv_regex in lv_amount results lt_result.

check sy-subrc eq 0.
  replace first occurrence of '.' in lv_amount with ''.
  condense lv_amount no-gaps.

this is just an example if you do not want to use regular expressions do not. use basic check statement:

check lv_amount(1) eq '.'.

br,

dez_