kphipps
28th September 2002, 13:50
How to create multiple date formats & currency formats by user.
The following files are required:
1. ntbshell.exe ($BSE\bin)
2. datecurr ($BSE\lib)
3. ipc_info ($BSE\lib)

Steps:
1. edit ntbshell.exe code and change the datecurr file name to datecuxx.
2. after making changes to ntbshell.exe save to a new filename (i.e. xxntbshell.exe)
3. add the line ‘xxbshell s ${BSE}\bin\xxntbshell.exe’ to the ipc_info file.
4. modify the fomats to your liking in datecurr file and save to datecuxx.
5. save all code to the orignal location you found it.
6. Change the bshell name in the BW configuration and login.

Below is a explination of the formats of the datecurr file.
There are the following indexes:
========================
Index Applies to: Line in datecurr starts with:
1 Default Currency of a Company A
3 Format of a Currency C
5 Format of a Date D
7 Format of a Time T
9 Format of a UTC Time U


Actions to take to solve the problem:

Index 1. When searching for the default currency code for a company.
=======================================================
The Default Currency for a company is specified in tools session ttaad1100m000 Companies.
The information is converted to runtime, and dumped in the file $BSE/lib/datecurr, and you will see a line like:

A|589|USD|001|001|

Example
When the format of the Default Currency for company 589 has to be retreived, the bshell looks for a line in datecurr, starting with:

A|589|

The line, read from datecurr, in that case is for example:

A|589|USD|001|001|

A: Means this line specifies the Default Currency of the Company
589: Company
USD: Default Currency

In case there is not a line in datecurr for the Default Currency of a company the following error is logged.

get_format_entry pattern '818' index 1 entry 0 not found

Here:
pattern '818' = indicating company 818
index 1 = indicating it is a line from datecurr, starting with the "A"
entry 0 = always 0 in this case.

so, the line:

A|589|USD|001|001|

is not in datecurr.

To solve this problem add this currency (Generic Unit).
(session ttaad1100m000 Companies)


Index 3. When searching for the format of a currency.
==========================================
The currencies are defined via session ttaad1106m000 Generic Units, as Generic Units.
For example:
Gen.Unit: USD

The format of the currencies (Generic Units) are defined via session ttaad1107m000 Formats by Generic Unit.
For example:
Generic Unit: USD
Format: ZZZZ9

The currencies (Generic Units) are grouped in Format Codes.
A Format Code has a number, for example, Format Code 001.
Each Format Code applies to certain functional areas.

For example:
Format Code 001: Rates Manufacturing
Format Code 002: Rates Trans
Format Code 003: Prices.

The information is converted to runtime, and dumped in the file $BSE/lib/datecurr, and you will see a line like:

C|001USD|USD|ZZZZ9|

Here:

C: Means this line specifies a currency format
001USD: Format Code 001, and currency (Generic Unit) USD
ZZZZ9: The format itself.

In case you get for example the following error message:

get_format_entry pattern '003' index 3 entry 0 not found

here:

pattern = indicating the Format Code, so in this case Format Code 003
index 3 = indicating it is a line starting with "C", so it's about a format of a currency
entry 0 = always 0

So, for Format Code 003 and a certain currency (not know which from the error), the format cannot be found.
This means there is no line for this combination (Format Code 003 and the currency) in the datecurr.

To solve this problem, you have to find out which currency is used at the moment the error is logged, and add the format for this currency as Generic Unit. (Session ttaad1107m000 Formats by Generic Unit).


Index 5. When searching for the format of a date.
=======================================
The line in datecurr, for example:

D|0011|DMY|%02d-%02m-%02y|

An error can be:
get_format_entry pattern '001' index 5 entry 0 not found

where:
pattern '001' = Date format 001
index 5 = indicating it is a line starting with "D", so it's about a format of a date.
entry 0 = always 0


Index 7. When searching for the format of a time.
=======================================



Index 9. When searching for the format of a utc time.
==========================================
For example, line from datecurr:

U|0011||%02H%x%02m%x%02s|
:p

rpura1
1st October 2002, 16:22
this is fantastic, they should name the next release after you!!!!

richard
22nd September 2003, 15:17
the bshell6.1 is an executable and can't be changed.

Is the only solution, a second baan in a specific envirionment ?

Regards

richard
22nd September 2003, 17:28
It's a little far-fetched,

1) bshellu in ipc_info
2) bshellu: cp datecurruk datecurr
3) and a startup session to copy the original datecurr ...

The risk of user connecting during these seconds is low but not null.

regards

nick_rogers
9th October 2003, 16:19
On our new baan server we now will have 3 different companies from 3 different geographic locations...2 comps want the date format (MM-DD-YYYY), the other comp wants the date format (DD-MM-YYYY).

Can this be done using some of the techniques above ??

richard
9th October 2003, 18:58
Here our unix:

#!/bin/ksh
#bshellu utilise pour societes anglaises
. /administration/setenv
cd $BSE/lib
cp datecurr datecurrfr
cat datecurrfr | sed -f /administration/datecurr-sed > datecurr
$BSE/bin/bshell6.1 $*
cp datecurrfr datecurr
# ce cp est aussi fait dans la session de startup #tccom0500m911, datecurr est genere par convert

/baan/app/bse/bin: cat /adm*/datecurr-sed
1,$s/V,/V./
1,$s/9,V/9.V/
1,$s/Z\.Z/Z,Z/g

Regards

Kozure Ohashi
9th November 2005, 15:19
Konichiwa,

to modify the appearance of the date in the menu browser status line to us style, please modify the following lines in the $BSE/lib/user/u<username> file:

old:
dateformat: DDMMYY
datesep:.

(european format)

new:
dateformat: MMDDYY
datesep:/

(US format)

This will show the date e.g. 11/09/2005 (=09-NOV-2005) on the menu browser for e.g. a user working with language 2 on a US System in a company running language 2 in europe and us style using the datecurr solution of this thread.

Please be aware that a convert of "user data to runtime data dictonary" will overwrite this modification.