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: 

How to change number format in smartforms ?

0 Kudos
793

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.

7 REPLIES 7

Sandra_Rossi
Active Contributor
0 Kudos
697

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)

0 Kudos
697

@Sandra: Yes I have checked everyhting.

Set country is not working with smartforms for me.

Sandra_Rossi
Active Contributor
0 Kudos
697

Basically, SET COUNTRY works for anyone. I can't evaluate how you did it wrong, please share relevant information.

0 Kudos
697

OY01:

But on print i am still getting the output based on my usersettings.

Please see my next comment for smartform output.

697

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.

697

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.!

697

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).