2023 Apr 20 11:56 AM
I want to use country specific format in smartform.
I used SET country 'DE', but its not taking from country specific format. Its displaying in user format only, even though user_settings = ' ' is passed while calling smartform.
2023 Apr 20 12:22 PM
Which format/value do you expect for SET COUNTRY 'DE' and which format/value do you actually get?
Did you make sure that nobody changed the default number format for country DE? (Germany)
Did you debug and make sure that SET COUNTRY is not called somewhere after you ran it?
Are you sure the variable is not formatted without using the default number format?
NB: I am not aware that USER_SETTINGS is related to SET COUNTRY. SAP documentation - Parameters of the Generated Function Module says:
If the parameter is set ('X'), SAP Smart Forms copies the user defaults for the Spool Control, which you set under System User Profile Own Data ( Output Device, Print Immediately, Delete after Output). If it is not set, SAP Smart Forms instead evaluates the following parameters of the structure for the output options ( SSFCOMOP):
Printer specifications ( TDDEST, TDPRINTER, RQPOSNAME)
TDIMMED (Print immediately)
TDDELETE (Delete after print)
2023 Apr 20 12:29 PM
@Sandra: Yes I have checked everyhting.
Set country is not working with smartforms for me.
2023 Apr 20 1:51 PM
Basically, SET COUNTRY works for anyone. I can't evaluate how you did it wrong, please share relevant information.
2023 Apr 20 2:26 PM
OY01:
But on print i am still getting the output based on my usersettings.
Please see my next comment for smartform output.
2023 Apr 20 2:27 PM
Above screenshot is from smartform print preview.
The data type for this field is ACCP.
Also, I noticed it's happening only for this field, other decimal fields work's fine.
Could it be because the data type used in YYYYMM which is ACCP? For this field its taking up format from my user profile.
2023 Apr 20 4:14 PM
I found the answer. It's because the field has conversion routine and its converting default to USER settings.
Need to use conversion routine in code to convert values for this field, based on format mentioned in T005 for countries.
Thanks for all your support.!
2023 Apr 20 5:09 PM
Well done! Yes ACCP is not a numeric type, it's character-like type, so the number format doesn't apply. Note that you have confused "number format" and "date format". As you could see, the conversion routine assigned to the domain has used the day/month/year separator from the "date format" (which could be dot, slash or hyphen).