mahasund
6th June 2002, 20:08
Hello folks,

I want to have texts defined say for Item Master Data, but while printing the text in Sales Order reports for that Item, I want to dynamically insert a value from another field into the text.

i.e. similar to passing parameter values in a message at runtime.

Here are my questions.

1. Is it possible?
2. If it is, should I use, text.to.buff, sprintf$ functions to merge the text and the parameter.

3. If I am way out of line, could you please guide me,


Your input is greatly appreciated,

Thanks a lot in advance,

mahasund

~Vamsi
6th June 2002, 20:21
Check out the help topic "Expanding text variables". I am posting it here for your convenience.

Variables or expressions in text lines can be expanded or substituted for report purposes. You must set the variable lattr.textexpand=TRUE. The expressions are internally evaluated using the function expr.compile(). The customer must be told, though, which variables are allowed where, and when (create separate manual for each report):

§ All report input fields

§ Externally declared variables and database fields.

Syntax for the use of variables in text lines:

$variable or #variable

${expression} #{expression}

$ : expand : Text moves over
# : substitute : Exactly where specified in the line.

Attention! Text is overwritten!!

Example of text created via the text manager:

To: $surname $christian name #date , Ede
$address

$ZIP code $city
Dear $christian name:

We have the pleasure to inform you that as of $date your salary has
been raised with 5%. For you this implies a gross amount of

${edit( salary + ( salary * 0.05 ), "ZZZZ9,ZZ" )} per month.

Kind regards, $Mgr.

© 1998 Baan Development B.V. All rights reserved

mahasund
10th June 2002, 21:14
Thanks a lot Vamsi,

This is exactly what I am looking for!!!