giggty
20th April 2018, 15:51
Hello,
so my requirement is to recreate tisfc0105m300 but instead of tisfc001.mitm it should display ticst001.sitm. I created a session, added all the fields from tisfc005 I need to the form (cprj - this is view field, cspa, cact and pdno) and ticst001 (sitm and ques). Now because tisfc005 has no references to ticst001 I need to link these two somehow. query.extend functions seem like a perfect tool for this. So I added this code:
before.program:
query.extend.select("ticst001.sitm, ticst001.ques", EXTEND_OVERWRITE)
query.extend.from("ticst001", EXTEND_OVERWRITE)
query.extend.where("ticst001._index1 = tisfc001.pdno", EXTEND_OVERWRITE)
And it doesn't work.
1. ticst001.sitm and ticst001.ques values are joined in some chaotic manner (definitely not by where-clause), there are less rows than should be and when i resize window i see as different values are fetched each time. Here is the resultant query that gets executed:
SELECT tisfc005.*,tisfc001.pdno,tisfc001.osta, ticst001.sitm, ticst001.ques
FROM tisfc005,tisfc001,ticst001
WHERE tisfc005._index2 = { :tisfc005.cprj} AND (
(ticst001._index1 = tisfc001.pdno)) AND
tisfc005.pdno REFERS TO tisfc001
|Based on index:2
ORDER BY tisfc005.cprj,tisfc005.cspa,tisfc005.cact,tisfc005.pdno,tisfc005.effn,tisfc005.dlin
2. Because there is one to many relationship between tisfc005.pdno and ticst001.sitm (ticst001 key is {pdno, pono}) for every row in tisfc005 there are multiple items in ticst001, they all should be displayed. But those are considered as one row, so when I try to mark one of them, the whole group (with identical tisfc005.pdno) gets marked :confused:
3. LN UI filters are absent for ticst001 fields (see attachment)
I tried populating ticst001 fields in read.view: section with pretty much same results. The best picture I can get is by adding this into before.display.object:
before.display.object:
select ticst001.sitm, ticst001.ques
from ticst001
where ticst001._index1 = {:tisfc005.pdno}
selectdo
endselect
but still only one ticst001.sitm is fetched for every tisfc005.pdno.
How this should be done properly? I have spent like two days on this already and I'm out of ideas :(
so my requirement is to recreate tisfc0105m300 but instead of tisfc001.mitm it should display ticst001.sitm. I created a session, added all the fields from tisfc005 I need to the form (cprj - this is view field, cspa, cact and pdno) and ticst001 (sitm and ques). Now because tisfc005 has no references to ticst001 I need to link these two somehow. query.extend functions seem like a perfect tool for this. So I added this code:
before.program:
query.extend.select("ticst001.sitm, ticst001.ques", EXTEND_OVERWRITE)
query.extend.from("ticst001", EXTEND_OVERWRITE)
query.extend.where("ticst001._index1 = tisfc001.pdno", EXTEND_OVERWRITE)
And it doesn't work.
1. ticst001.sitm and ticst001.ques values are joined in some chaotic manner (definitely not by where-clause), there are less rows than should be and when i resize window i see as different values are fetched each time. Here is the resultant query that gets executed:
SELECT tisfc005.*,tisfc001.pdno,tisfc001.osta, ticst001.sitm, ticst001.ques
FROM tisfc005,tisfc001,ticst001
WHERE tisfc005._index2 = { :tisfc005.cprj} AND (
(ticst001._index1 = tisfc001.pdno)) AND
tisfc005.pdno REFERS TO tisfc001
|Based on index:2
ORDER BY tisfc005.cprj,tisfc005.cspa,tisfc005.cact,tisfc005.pdno,tisfc005.effn,tisfc005.dlin
2. Because there is one to many relationship between tisfc005.pdno and ticst001.sitm (ticst001 key is {pdno, pono}) for every row in tisfc005 there are multiple items in ticst001, they all should be displayed. But those are considered as one row, so when I try to mark one of them, the whole group (with identical tisfc005.pdno) gets marked :confused:
3. LN UI filters are absent for ticst001 fields (see attachment)
I tried populating ticst001 fields in read.view: section with pretty much same results. The best picture I can get is by adding this into before.display.object:
before.display.object:
select ticst001.sitm, ticst001.ques
from ticst001
where ticst001._index1 = {:tisfc005.pdno}
selectdo
endselect
but still only one ticst001.sitm is fetched for every tisfc005.pdno.
How this should be done properly? I have spent like two days on this already and I'm out of ideas :(