mathew
28th July 2019, 17:00
Hi Friends,

Can any body given me suggestion to how to combine header display session(type1 single occurrence) with line display session(used type3) as one form in one session

Regards,
Mathew :)

mark_h
29th July 2019, 02:47
Not quite sure what you are trying to accomplish, but you could have 1 form for a single line that has header information. That is just a single occurrence session when you link a line to a header record. Everything else I picture requires multi-sessions and forms kind of like the standard PO lines sessions.

mathew
29th July 2019, 06:22
Hi Mark,

Actually header display session is with header tdsls040 table in the top (already used single occurence), i need tdsls041 line data(used type3) with multiple form like form1, form 2 in the bottom to displaying multiple lines.

Can you explain how to combine header only once at top and line with multiple forms in the bottom displaying multiple lines

Please find the sample screenshot and header display only once at top, highlighted yellow forms at bottom only for lines

Regards,
Mathew

mark_h
29th July 2019, 16:20
Are you talking like these screen shots. The top is a single occurrence of header information, then the bottom is the lines with 2 forms. So the 2 forms on this session have different line information, but the same basic header information. In my case the session is designed to be zoomed from a calling session, but not mandatory. I literally build the querys for next view, previous view, etc. I don't remember all of the ins and outs of why I did what.

I also have another session in this tdexi0110m000 where the header information is at the top, the lines are at the bottom. But this was an input session. That is a whole different critter - using sattr.combined bottom and child processes switching back and forth. It works but was not real pretty like standard baan code.


before.program:
if background then
import("item.filter",item.filter)
import("buyer.filter",buyer.filter)
import("suno.filter",suno.filter)
import("quote.filter",quote.filter)
import("date.filter",date.filter)
import("rfq.filter",rfq.filter)
build.qry.ext()
else
buyer.filter = 0
item.filter = ""
suno.filter = ""
date.filter = 0
rfq.filter = 0
quote.filter = empty
query.extension = "tdexi060.rfqnum > 0 "
endif
functions:
function get.next.view()
{

hold.rfqnum = tdexi060.rfqnum
hold.rfqline = tdexi060.rfqline
sql_query = "select tdexi060.*, tdexi001.* " &
"from tdexi060, tdexi001 " &
"where tdexi060.rfqnum > 0 " &
"and tdexi001.rfqnum = tdexi060.rfqnum " &
"and tdexi060.rfqnum = " & str$(hold.rfqnum) &" and tdexi060.rfqline > " & str$(hold.rfqline)
build.sql.query()
sql_query = sql_query & " as set with 1 rows "
sql_id = sql.parse(sql_query)
sql.exec(sql_id)
e = sql.fetch(sql_id)
if e = enorec then
sql.close(sql_id)
| No records
sql_query = "select tdexi060.*, tdexi001.* " &
"from tdexi060, tdexi001 " &
"where tdexi060.rfqnum > 0 " &
"and tdexi001.rfqnum = tdexi060.rfqnum " &
"and tdexi060.rfqnum > " & str$(hold.rfqnum) &" and tdexi060.rfqline = 1 "
build.sql.query()
sql_query = sql_query & " as set with 1 rows "
sql_id = sql.parse(sql_query)
sql.exec(sql_id)
e = sql.fetch(sql_id)
endif

| Fetch the first record.

sql.close(sql_id)
}
function get.prev.view()
{

hold.rfqnum = tdexi060.rfqnum
hold.rfqline = tdexi060.rfqline
sql_query = "select tdexi060.*, tdexi001.* " &
"from tdexi060, tdexi001 " &
"where tdexi060.rfqnum > 0 " &
"and tdexi001.rfqnum = tdexi060.rfqnum " &
"and tdexi060.rfqnum = " & str$(hold.rfqnum) &" and tdexi060.rfqline < " & str$(hold.rfqline)
build.sql.query()
sql_query = sql_query & " order by tdexi060.rfqnum desc "
sql_query = sql_query & " as set with 1 rows "
sql_id = sql.parse(sql_query)
sql.exec(sql_id)
e = sql.fetch(sql_id)
if e = enorec or e = eendfile then
sql.close(sql_id)
| Get max line from previous RFQ Number
sql_query = "select tdexi060.rfqnum, tdexi060.rfqline " &
"from tdexi060, tdexi001 " &
"where tdexi060.rfqnum > 0 " &
"and tdexi001.rfqnum = tdexi060.rfqnum " &
"and tdexi060.rfqnum < " & str$(hold.rfqnum)
build.sql.query()
sql_query = sql_query & " order by tdexi060.rfqnum desc, tdexi060.rfqline desc "
sql_query = sql_query & " as set with 1 rows "
sql_id = sql.parse(sql_query)
sql.exec(sql_id)
e = sql.fetch(sql_id)
max.line = tdexi060.rfqline
sql.close(sql_id)

sql_query = "select tdexi060.*, tdexi001.* " &
"from tdexi060, tdexi001 " &
"where tdexi060.rfqnum > 0 " &
"and tdexi001.rfqnum = tdexi060.rfqnum " &
"and tdexi060.rfqnum < " & str$(hold.rfqnum) &" and tdexi060.rfqline = " & str$(max.line)
build.sql.query()
sql_query = sql_query & " order by tdexi060.rfqnum desc "
sql_query = sql_query & " as set with 1 rows "
sql_id = sql.parse(sql_query)
sql.exec(sql_id)
e = sql.fetch(sql_id)
endif
}
function build.sql.query()
{
if(rfq.filter>0) then
sql_query = sql_query & " and tdexi060.rfqnum = " & str$(rfq.filter)
endif
if(item.filter<>"") then
sql_query = sql_query & " and tdexi060.item = " & chr$(34) & item.filter & chr$(34)
endif
if(suno.filter<>"") then
sql_query = sql_query & " and tdexi060.suno = " & chr$(34) & suno.filter & chr$(34)
endif
if date.filter > 0 then
sql_query = sql_query & " and tdexi060.rtndte = " & str$(date.filter)
endif
if etol(quote.filter)>0 then
sql_query = sql_query & " and tdexi060.quotstat = " & str$(quote.filter)
endif
if(buyer.filter<>0) then
sql_query = sql_query & " and tdexi001.buyer = " & str$(buyer.filter)
endif
}

mathew
4th August 2019, 16:34
Sorry Mark now little busy with other work, so will try what you have informed then i do reply to you

Regards,
Mathew