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

Sap script Problem with Variable

Former Member
0 Likes
1,794

Hi all,

Good Day to all of u.

i have a problem with PO in Sap Script. In the output

all values appearing like 1.000,00 which must be 1,000.00

why this problem at the output as i am picking variable by inserting and how to solve this problem.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,176

Thanx for replies, i set the setting but again the problem is same.

how and where to set country in script .

Regards,

Rajvinder

9 REPLIES 9
Read only

Former Member
0 Likes
1,176

Hi rajvinder,

1. This format of output

depends upon the user settings.

2. the user himself/herself

can change their settings,

and things will become allright.

3. SYSTEM------> USER PROFILE -


> OWN DATA

In that there is on tab

DEFAULTS

4. In that there is the field

DECIMAL NOTATION.

(for DOT, COMMA IN NUMBERS AND DECIMAL AS WELL)

regards,

amit m.

Read only

Former Member
0 Likes
1,176

system>user profil-> owndata->default->choose decimal notification of ur choice...

Read only

Former Member
0 Likes
1,176

Hi

The output format depends on the user attributions, if you want to use different attributions use SET COUNTRY statament in sapscript.

Max

Read only

0 Likes
1,176

Thanx Max,

My problem is rectified one more thing i want ask.

I also tried for puting text in the PO by using

DEFINE &PONO& = '&ekpo-ebeln&'

DEFINE &ITEMNO& = '&EKPO-ebelp&'

DEFINE &NUMBER& = '&PONO&&ITEMNO&'

INCLUDE &PONO& OBJECT EKPO ID F01 LANGUAGE 'EN'

where in PONO i am concateing the Po no and item ,

but i am not getting the text. plz. give your suggestion

Regards,

Rajvinder

Read only

0 Likes
1,176

Hi

You can't do the statament CONCATENATE in the sapscript, but in the driven program.

If you don't want or can't change it you should create a routine to do that:

/: PERFORM <form> IN PROGRAM <prog>

/: USING &ekpo-ebeln&

/: USING &EKPO-EBELP&

/: CHANGING &NUMBER&

/: ENDPERFORM

/: INCLUDE &NUMBER& OBJECT EKPO ID F01 LANGUAGE 'EN'

The form for CONCATENATE has to be defined in program <prog> and has to have the followin interface:

FORM <form> TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

DATA: EBELN TYPE EBELN,

EBELP TYPE EBELP.

DATA: TXT_NAME(20).

READ TABLE IN_TAB WITH KEY FIELD = 'EKPO-EBELN'.

IF SY-SUBRC = 0.

EBELN = IN_TAB-VALUE.

ENDIF.

READ TABLE IN_TAB WITH KEY FIELD = 'EKPO-EBELP'.

IF SY-SUBRC = 0.

EBELP = IN_TAB-VALUE.

ENDIF.

CONCATENATE EBELN EBELP TO TXT_NAME.

READ TABLE OUT_TAB WITH KEY FIELD = 'NUMBER'.

IF SY-SUBRC = 0.

OUT_TAB-VALUE = TXT_NAME.

MODIFY OUT_TAB INDEX SY-TABIX.

ENDIF.

ENDFORM.

P.S. use conversion routine ALPHA to convert the output format to input format for field EBELN and EBELP.

Max

Read only

Former Member
0 Likes
1,176

Hi,

this is specific to some countries.

Check your default settings in SU01.

rgds,

latheesh

Read only

Former Member
0 Likes
1,177

Thanx for replies, i set the setting but again the problem is same.

how and where to set country in script .

Regards,

Rajvinder

Read only

0 Likes
1,176

Hi

You should place it at the beginning of text element, anyway before printing the variable.

This is an extract of the help:

..........................................

The formatting for certain field types depends on the country settings. These field types include, for example, date fields and number fields that include either a decimal point or the ‘thousands’ separator character. The formatting options defined in the user master record are usually the ones used here. To choose a formatting option other than the one specified in the user master record, use the SET COUNTRY control command. The country-dependent formatting options are stored in the T005X table.

Syntax:

/: SET COUNTRY country_key

You can enter the country key either as a literal value enclosed in quotes or as a symbol.

/: SET COUNTRY 'CAN'

/: SET COUNTRY &country_key&

Use a blank country name to revert to the setting found in the user master record:

/: SET COUNTRY ' '

This SAPscript command actually calls the corresponding ABAP command internally. This guarantees the effect of the SAPscript command to be identical with that of the ABAP command.

If the formatting turns out not to be as required, then you should check the settings in table T005X.

This is the link:

http://help.sap.com/saphelp_46c/helpdata/en/d2/cb3d07455611d189710000e8322d00/frameset.htm

Max

Read only

vinod_gunaware2
Active Contributor
0 Likes
1,176

Setting the User Decimals Format


Your screen and layout sets decimals are affected by :-


OY01

- Country Global Parameters -> Double click on the country code

SU01

- Maintain users -> Click Defaultsbutton

In the Decimal format section.

Formatting Date Fields: SET DATE MASK

To define the formatting of date fields, use the SET DATE MASK control command. Executing this command causes all subsequent date fields to be printed using the specified format.
Syntax:
/: SET DATE MASK = 'date_mask'
In the date mask, you can use the following codes:
· DD: day (two digits)
· DDD: day name - abbreviated
· DDDD: day name - written out in full
· MM: month (two digits)
· MMM: month name - abbreviated
· MMMM: month name - written out in full
· YY: year (two digits)
· YYYY: year (four digits)
· LD: day (formatted as for the L option)
· LM: month (formatted as for the L option)
· LY: year (formatted as for the L option)
All other characters found in a date mask are interpreted as simple text and are copied straight into the output.

Assuming the current system date is March 1st, 1997.
/: SET DATE MASK = 'Foster City, MM/DD/YY'
&DATE& -> Foster City, 03/01/97
/: SET DATE MASK = 'MMMM DD, YYYY'
&DATE& -> March 01, 1997
The date mask may be reset to the default setting by using an empty string:
/: SET DATE MASK = ' '
The abbreviated and full forms of the names of the days and months are stored in the language dependent TTDTG table under the following keys:
· %%SAPSCRIPT_DDD_dd: abbreviated day name
· %%SAPSCRIPT_DDDD_dd: full form of day name
· %%SAPSCRIPT_MMM_mm: abbreviated month name
· %%SAPSCRIPT_MMMM_mm: full form of month name
dd: day number 01 = Monday,..., 07 = Sunday
mm: month number 01 = January,..., 12 = December

Country-Dependent Formatting: SET COUNTRY

The formatting for certain field types depends on the country settings. These field types include, for example, date fields and number fields that include either a decimal point or the ‘thousands’ separator character. The formatting options defined in the user master record are usually the ones used here. To choose a formatting option other than the one specified in the user master record, use the SET COUNTRY control command. The country-dependent formatting options are stored in the T005X table.

Syntax:

/: SET COUNTRY country_key

You can enter the country key either as a literal value enclosed in quotes or as a symbol.

/: SET COUNTRY 'CAN'

/: SET COUNTRY &country_key&

Use a blank country name to revert to the setting found in the user master record:

/: SET COUNTRY ' '

This SAPscript command actually calls the corresponding ABAP command internally. This guarantees the effect of the SAPscript command to be identical with that of the ABAP command.

If the formatting turns out not to be as required, then you should check the settings in table T005X.

regards

vinod