cancel
Showing results for 
Search instead for 
Did you mean: 

changing date+price format in Smartform driver program based on co. code

Former Member
0 Kudos

Hi Guys,

I need some help from you people.There is a requirement which says that the date and the price format must be different

for different company codes like say for company code 0100 the price format and date format is 1.000,00 and MMDDYYYY respectively while for company code 0101 the same should be 1,000.00 and DDMMYYYY respectively.Normally we can set the formats using tcode OY01 based on country but I could not find any tcode which sets the date and price format based on company code.Another thing is in the customer address I need the customer name only in bold-I have copied from a standard program which is using an address node-so how to do that?

Please help. Thanks a lot !

Edited by: Hasso14 on Jul 26, 2010 9:10 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. To convert your date to dd.mm.yyyy ,, you can use fuction module CONVERT_DATE_FORMAT .. put a condition to call it as per your company code ..

2. To convert your date to mm.dd.yyyy ,, you can use below logic ,,

CONCATENATE actuale_date+4(2) '.' actuale_date+6(2) '.' actuale_date+0(4) INTO w_converted_date.

put a condition to call it as per your company code ..

3. As far as i know, it would not be possible to Bold out only one line, in a address node ..

Former Member
0 Kudos

Hi Lokesh,

thanks for your reply-the problem is the date is used in many places-do I have to change it as many times based on company codes?it will be very cumbersome-same logic applies for price also-I have thought of both these solutions before.What I need is a tcode like OY01 where you can set the formats based on country-I need something like that for company codes also.

Regarding the bolding of one line do you know of any alternate solution?

Former Member
0 Kudos

Hi,

For your first question: SAP does not provide you tool to set company code setting for date and currency format. You can only set it in OY01 as you know. I think if you have company code cross-country and want to display base on each nation, please select country of company code and set country for form.

For your 2nd question: I don't know any alternative solution, if you know please post here for our references.

Thanks

Former Member
0 Kudos

Hi,

1. Pls understand your driver program and form .. I will suggest you to just first convert date according to logic that i have provided you. keep it in a variable,, call that variable if samrtform,, and display it wherever you wud like to .

2. i hv no idea about OY01 so can not suggest you anything related to that ..

3. Alternative for Adress node is not going to be easy.. For this you need to fetch the data from tables like ADRC, ADR3 , ADR2 and others ..

Former Member
0 Kudos

Hi Thien Pham Minh,

the company codes belong to the same country only-USA. So is it possible to do that in that case?

As regards the bolding of customer name I think we can delete the address node altogether and use the FM 'ADDRESS_INTO_PRINTFORM' and then create text elements and make them bold-is that feasible?

Former Member
0 Kudos

Hi Hasso,

If all your co.code in USA, it's so hard to solve the problem. you must do it manual for each company. That will take too much time ,contains serious risk and not ease to maintain after. So, contact your functional to find another way.

You can use FM 'ADDRESS_INTO_PRINTFORM' to get data of customer address to print out in form ('cause SAP use this FM for printing address) but the problem is the address format, you should care to print it right to your country.

regards,

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Thien Pham Minh,

thanks a lot for your reply-but thing is I need to set the date format based on company code-I know it can be fixed using SU01-but I need to do this for specific company codes only-you get it?for price also I need to do the same thing i.e. fix it according to the company code and not according to the currency format of the system.

Regarding the making of customer name as bold I have already created a style and defined it in smartform.the problem is I am using an address node where there is no option to make only 1 line bold-I want to know what are the solutions to these?

Former Member
0 Kudos

Hi friend,

I think:

- Date format in smartforms will base on user default parameter (you can find in tcode SU01) or try to use this code in INITIALIZATION in global definition of smartforms:


SET COUNTRY '[COUNTRY_NAME]' "get country base on company code

- Price (currency format?) will base on Currency unit of your system.

- You need to print customer name bold: first you define a smartstyle and assign it to your smartforms style (or output option/style in your text node).

Regards,