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

smartforms - date and decimals

Former Member
0 Likes
1,593

Hello all,

I have copied a standard smartform and customized according to the requirements. Right now the dates and decimals are getting printed depending on the logon language(system language).

I want to control this meaning I should be able to print the dates and decimals in whatever format I desire. Could someone help me accomplish this?

Thanks

12 REPLIES 12
Read only

Former Member
0 Likes
1,355

Hi,

I think u have to set ur default user setting. because i don't think its language dependant.

For default user setting go to SYSTEM menu>USER PROFILE>OWN DATA--> goto default tab...

here u maintain date and decimal format as u needed.

Read only

0 Likes
1,355

How to control this? No matter what format a user as, how to print date and decimals in our desired format?

Read only

0 Likes
1,355

What I mean is... if a user has mm/dd/yyyy as his date setting, how can he print date in dd.mm.yyyy without changing his settings? similarly the decimals....

Read only

amit_khare
Active Contributor
0 Likes
1,355

Hi,

You can do that by just writing the desird code in the INITIALIZATION tab of the GLOBAL DEFINITON.

Pass the final values to the TEXT NODE where Date & Decimals are displayin.

For Variable Declarations Use GLOBAL DATA tab.

Check this link for programming in smartforms.

<a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf">Smartforms</a>

Regards,

Amit

Try this code in your smartform.

TYPES: BEGIN OF type_t_date,

mm(2) TYPE c,

filler1(1) TYPE c,

dd(2) TYPE c,

filler2(1) TYPE c,

yyyy(4) TYPE c,

END OF type_t_date.

DATA: t_ddate TYPE type_t_date.

CONSTANTS: c_fil TYPE c VALUE '.'.

t_ddate-mm = rs_sdate-mm.

t_ddate-dd = rs_sdate-dd.

t_ddate-yyyy = rs_sdate-yyyy.

t_ddate-filler1 = c_fil.

t_ddate-filler2 = c_fil.

CONCATENATE t_ddate-mm t_ddate-filler1 t_ddate-dd t_ddate-filler2 t_ddate-yyyy INTO rv_ddate.

Message was edited by:

Amit Khare

Read only

Former Member
0 Likes
1,355

Hi,

You can create a program lines before the text is displayed..

And in that code convert to the format you want..

<b>Example</b>

CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum(4) into v_date.

use the v_date variable to print the date..

Thanks,

Naren

Read only

0 Likes
1,355

it becomes impractical with lots of dates and decimals. there would be one single place to fix this.... I want to know where exactly the form looks for the user settings?

Read only

Former Member
0 Likes
1,355

Hi,

Before the printing the date, the value will be in the internal format..

Which is YYYYMMDD...And this always going to be same for all the users...

So Before printing convert it to the format you want as I mentioned in my earlier reply..

Hope I am clear..

THanks,

Naren

Read only

0 Likes
1,355

Hello Narendran,

You were crystal clear in your first reply. But I am saying is with lot of dates and decimals on a form it becomes difficult and inefficient to use the conversion code for each and every date and decimal.

Instead what I am trying to figure out is where exactly a smartform looks for the user settings. If we could find that place may be it would be just a one step process to fix this issue. Let me know if you have any idea.

Message was edited by:

Raju Boda

Read only

0 Likes
1,355

Why I want to figure this out is... there is one other standard form which is printing the dates and decimals not according to the user settings but according to the recipient(customer in NAST) settings. I dont know where exactly this standard form is looking for this......

Read only

Former Member
0 Likes
1,355

Hi,

You can get the user settings from the table USR01 and field is DATFM

For decimals USR01-XUDCPFM..

Please let me know if this is not what you want..

Thanks,

Naren

Read only

0 Likes
1,355

Hi,

No that is not what I am looking for. I know the table and fields to look at the user settings.

I want to know where the smartform looks for this user settings.....

Read only

Former Member
0 Likes
1,355

Hi,

I believe the smartform is using SET COUNTRY to display the according to the customer's country..

Search for SET COUNTRY..

Thanks,

Naren