smusba
19th May 2009, 10:29
Please see the above attached report. I want to get item description in report from tiitm001.dsca.
Here is my script.
functions:
function read.main.table()
{
select tdsfl015.*
from tdsfl015
where tdsfl015.shop between :dwar.f and :dwar.t
and tdsfl015.indt between :indt.f and :indt.t
and tdsfl015.fish between :item.f and :item.t
|order by tdsfl015._index1
selectdo
select tiitm001.*
from tiitm001
where tiitm001.item = :tdsfl015.fish
selectdo
endselect
rprt_send()
endselect
}
wiggum
19th May 2009, 11:24
Have you defined tiitm001.dsca as input field in your report? You have also to define table tiitm001 in your session script.
smusba
19th May 2009, 11:27
yes i have decalared
becks22
19th May 2009, 14:09
Please use refers to
baan.kmurali
19th May 2009, 14:38
Make sure the same domain(tcitem) has defined in your field's( tdsfl015.fish) domain.
you better to check in debug mode.
Regards|Murali..
mark_h
19th May 2009, 15:57
Baan.kmurali is correct - make sure the two domains match for tiitm001.item and for tdsfl015.fish. Then the select should work. You might want to also initialize tiitm001.dsca to spaces before the select. This way if there really is an item in the tdsfl015.fish that does not exist in tiitm001, then the description will be empty. Otherwise it will hold the last item description which can be mis-leading.
smusba
20th May 2009, 12:45
I discovered the problem.
In tdsfl015.fish the strings starts with “1adk13043001”
And tiitm001.item starts with “****1adk13043001”
My Sql is as follows
select tdsfl015.*,tiitm001.*
from tdsfl015,tiitm001
where tdsfl015.shop between :dwar.f and :dwar.t
and tdsfl015.indt between :indt.f and :indt.t
and tdsfl015.fish = shiftl$(tiitm001.item(3))
It gives error on compilation. How can I trim this .
Marioth
20th May 2009, 12:48
tdsfl015.fish = trim$(tiitm001.item) will do the job.
smusba
20th May 2009, 13:11
It gives error on compilation.
Marioth
20th May 2009, 14:02
Smusba,
If you debug your program do you see "*" or spaces?
Mario
rameshchinnap
20th May 2009, 14:09
if it is baan IV use tdsfl015.fish = strip$(shiftl$(tiitm001.item))
if it is LN you can use trim$
rameshchinnap
20th May 2009, 14:14
even then you are facing the problem then use tt.align.according.domain
see below example for more clarification:
tt.align.according.domain()
Syntax
long tt.align.according.domain( string string_in(.), ref string string_out(), string domain_name )
Description
This aligns a string according to the alignment method of a specified domain.
Arguments
string_in(.) The input string. This must have the same length as the specified domain. If it is longer than the domain, its final characters are ignored.
The input string remains unchanged by the function.
string_out() The returned string, aligned according to the alignment method of the domain. This must be the same length as the specified domain.
domain_name The name of the domain whose alignment method must be used to align the output string. The alignment method can be left, right, or centered.
Return values
0 success
-1 domain not found or domain is not of type string or multibyte string
Example
table ttiitm001
domain tcitem item
long ret
item = " XY"
ret = tt.align.according.domain(item, tiitm001.item, "tcitem")
| Result tiitm001.item (if left adjusted): "XY
baan.kmurali
20th May 2009, 15:17
declaration:
extern domain tcitm item.code
functions:
function read.main.table()
{
select tdsfl015.*
from tdsfl015
where tdsfl015.shop between :dwar.f and :dwar.t
and tdsfl015.indt between :indt.f and :indt.t
and tdsfl015.fish between :item.f and :item.t
|order by tdsfl015._index1
selectdo
item.code = str$(shiftl$(tdsfl015.fish))
select tiitm001.*
from tiitm001
where tiitm001._index1 = {:itemcode}
selectdo
endselect
rprt_send()
endselect
}
try this...
Regards|Murali
smusba
20th May 2009, 15:57
I cannot get item desc in my report field
mark_h
20th May 2009, 16:17
I discovered the problem.
In tdsfl015.fish the strings starts with “1adk13043001”
And tiitm001.item starts with “****1adk13043001”
My Sql is as follows
select tdsfl015.*,tiitm001.*
from tdsfl015,tiitm001
where tdsfl015.shop between :dwar.f and :dwar.t
and tdsfl015.indt between :indt.f and :indt.t
and tdsfl015.fish = shiftl$(tiitm001.item(3))
It gives error on compilation. How can I trim this .
Are the *'s part of the item number in tiitm001 or are there 4 spaces? What is your domain for tiitm001 - left or right justified? You just have to match the item numbers - so for the find on tiitm001 just make the itemcode in it match exactly the item in tiitm001.
bdittmar
20th May 2009, 16:33
I discovered the problem.
In tdsfl015.fish the strings starts with “1adk13043001”
And tiitm001.item starts with “****1adk13043001”
My Sql is as follows
select tdsfl015.*,tiitm001.*
from tdsfl015,tiitm001
where tdsfl015.shop between :dwar.f and :dwar.t
and tdsfl015.indt between :indt.f and :indt.t
and tdsfl015.fish = shiftl$(tiitm001.item(3))
It gives error on compilation. How can I trim this .
Hello,
if tiitm001 alway starts with 4* then try:
and tdsfl015.fish = tiitm001.item(5;28) | if tcitem is 32 characters.
or tdsfl015.fish = shiftl$(shiftr$(tiitm001.item(5;28)))
It takes only the characters in tiitm001.item without leading and trailing spaces and without the first four characters.
strip$, shiftl$ and shiftr$ always is for trailing or leading spaces.
str$ converts a num expression to string
no of the above will work !
tcitem is a string, so str$ is nonsense and **** is a character, not a leading space.
Regards