‎2015 Aug 14 8:25 AM
Hi Guys,
We have a Z-program with which we are uploading the inspection characteristics and its value from a text file in Z table in SAP.
While uploading the data, If the value is 9,235, It is uploaded correctly with my id but the same file when uploaded by the user from Europe.
It is showing the abnormal behavior as the uploaded value is in decimal format like 9.235. and they do expect in comma format.
The user setting are same in SU01.
The program doesn't refer any country specific setting for format. How can be two different users are getting two different results?
‎2015 Aug 14 8:55 AM
You say 'When uploading'.... not 'When displaying' or 'When entering'.
So what is the decimal settings for the program used to generate the text file ? If it's Excel then that could be the cause - Windows regionalisation.
‎2015 Aug 14 8:34 AM
Can you please post his and your SU01D screenshot. That is the only thing which can cause issue.
‎2015 Aug 14 8:34 AM
This is happening due to issue with user format in SU3. You need to generate the data based on thousand seperator and decimal seperator using FM: CLSE_SELECT_USR01
‎2015 Aug 14 8:36 AM
Hi Pravin,
It's due to user parameters in SU01. Both the users might have different parameters.
Check the parameters below,
In this case, ',' will be taken as a decimal point. So the program is taking the entry which you are trying to insert as a decimal number and the table field will be of type Whole number.
You can try to change your user parameters to the above format and for sure you will get same error.
In order to solve this, all the users using the program needs to have same Parameters, or it should be handled programmatically.
Regards,
Deepan Swaminathan.
‎2015 Aug 14 8:42 AM
Hi
Both the users have same user settings in SU01.
I have checked that already.
‎2015 Aug 14 8:55 AM
Hi,
Then it might be due to the file.. There will be mismatch in the file which has been uploaded by other user.
Kindly cross check !!
Regards,
Deepan.
‎2015 Aug 14 8:55 AM
You say 'When uploading'.... not 'When displaying' or 'When entering'.
So what is the decimal settings for the program used to generate the text file ? If it's Excel then that could be the cause - Windows regionalisation.
‎2015 Aug 14 9:08 AM
Pravin K wrote:
Hi Guys,
We have a Z-program with which we are uploading the inspection characteristics and its value from a text file in Z table in SAP.
While uploading the data, If the value is 9,235, It is uploaded correctly with my id but the same file when uploaded by the user from Europe.
It is showing the abnormal behavior as the uploaded value is in decimal format like 9.235. and they do expect in comma format.
The user setting are same in SU01.
The program doesn't refer any country specific setting for format. How can be two different users are getting two different results?
HI Pravin,
Try with below code.
data:
lf_dcpfm type usr01-dcpfm, " User's decimal notation
lf_thousand_sep(1) type c, " Thousands separator
lf_decimal_sep(1) type c, " Decimal separator
lf_amt type konp-kbetr.
**-Get user's decimal notation
select single dcpfm
into lf_dcpfm
from usr01
where bname = sy-uname.
if lf_dcpfm = c_x. " 1,234,567.89
lf_thousand_sep = c_char_comma.
lf_decimal_sep = c_dot.
elseif lf_dcpfm = c_y. " 1 234 567,89
lf_thousand_sep = ' '.
lf_decimal_sep = c_char_comma.
elseif lf_dcpfm is initial. " 1.234.567,89
lf_thousand_sep = c_dot.
lf_decimal_sep = c_char_comma.
endif.
**-Convert string to amount
CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
EXPORTING
STRING = pc_kbetr
DECIMAL_SEPARATOR = lf_decimal_sep
THOUSANDS_SEPARATOR = lf_thousand_sep
* WAERS = ' '
IMPORTING
BETRG = lf_amt
EXCEPTIONS
CONVERT_ERROR = 1
OTHERS = 2 .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
**---Move amount back to string
move lf_amt to pc_kbetr.
condense pc_kbetr.
ENDIF.
Regards,
Pravin
‎2015 Aug 14 12:05 PM
Thanks all,
I am able to replicate the issue with my user id.
Yes It is Windows regionalisation issue.
‎2015 Aug 14 12:12 PM
Hi Pravin ,
Its Windows Issue. Its a z-program just if you find '.' in value change it to ','.
replace all occurrences of '.' in lv_value with ','.
‎2015 Aug 14 12:42 PM
Changing a numbers group separators and decimal points to the 'normal' decimal point and no separators is not as easy as what Asim states. His fix will not work in all cases.
Regards
Rich