Debdas Banerjee
1st December 2004, 08:26
Hi Friends

I have developed some maintain session and require some help:-

I want to zoom to a display session and select multiple records from display screen. Now I want to get those record which I select from display session for further processing .

I have use :

zoom.to$("tdclc9480s000",z.session,"tdclc9480s000","",0)

If I select 5 records from display session and press save & exit key message is giving " There are 5 records selected , end not possible"

Hitesh Shah
1st December 2004, 14:58
U need to insert multiple selected records in a temp table with user login code
or create an array of selected items in zoom session and use that in main session .

Array or temp table should be cleared once the main session purpose is
accomplished. We use temp table for such situation.

Debdas Banerjee
2nd December 2004, 05:58
Hi Hitesh

Thanks for replying . I know that is the only way to solve the problem . But I dont know how to handle the data from zoom session . Can give exemple of both case ( make a array or temp table ) how to do.

With best Regards

Hitesh Shah
4th December 2004, 16:37
We have never used array . But theoretically this may be possible.

We have used an interim table and we insert / delete records in the interim table on marking / unmarking the records in the display zoom session . Selected records are displayed with reverse * to indicate their selection . In the main session the selected records are used from the interim table and deleted after it's use in main session.

Example of such subsession

|******************************************************************************
|* tijwx9521 0 VRC B40c c4 cust
|* Display Session
|* 2001-07-10
|******************************************************************************
|* Inline Commenting
|*
|* Purpose :- Genrally in reports we have only from-to selection,if we want to
|* to give specific selection this session is used.
|* Also we can select /deselect all.
|******************************************************************************
|* Main table tijwx921 Display Session, Form Type 2
|******************************************************************************

|****************************** declaration section ***************************
declaration:

table ttijwx921 | Display Session
table ttiitm001 |
domain tcbool rec.marked | to check whether record already marked
domain tcsrno srno,fstmark,totmark,i
domain tcitem titem
extern domain tcstr.12 yeno
domain tcbool mrk(13)
|****************************** form section **********************************
before.program:
|There are 13 lines in form so 13 times making mrk vaiable false.
for i = 1 to 13 step 1
mrk(i) = false
endfor
main.table.io:
after.read:
| check.tijwx921()
field.tiitm001.item:
before.display:
| if record is present in tijwx921 then it will display '******' otherwise
|blank.
check.tijwx921()
if rec.marked then
print cf$(4)
yeno = "******"
else
print cf$(0)
yeno = " "
endif
display.fld(actual.occ,"yeno")

field.tiitm001.dsca:
before.display:
| check.tijwx921()
| if rec.marked then
| print cf$(4)
| else
| print cf$(0)
| endif

choice.prev.set:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor
choice.next.set:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor

choice.first.set:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor
choice.last.set:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor
choice.def.find:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor
choice.find.data:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor
choice.update.db:
before.choice:
for i = 1 to 13 step 1
mrk(i) = false
endfor
choice.user.1:
on.choice:
delete.tijwx921()
execute(first.set)
choice.user.2:
on.choice:
insert.tijwx921()
execute(first.set)
choice.mark.occur:
after.choice:

|mark.table array shows which records have been marked and set to true.
|condition checked to accomodate multiple selection. only last mark selected
|record has to be checked.

if mark.table(actual.occ) <> mrk(actual.occ) then
update.tijwx921()
mrk(actual.occ) = mark.table(actual.occ)
endif
| message("%d %d",totmark,actual.occ)
|****************************functions**************************
functions:
function check.tijwx921()
{
select tijwx921.*
from tijwx921
where tijwx921._index5 = {:logname$,:tiitm001.item}
selectdo
rec.marked = true
selectempty
rec.marked = false
endselect
}
function update.tijwx921()
{
|* if record mark is present in tijwx921 then delete the record else insert.
select tijwx921.*
from tijwx921 for update
where tijwx921._index5 = {:logname$,:tiitm001.item}
selectdo
db.retry.point()
db.delete(ttijwx921,db.retry )
commit.transaction()
yeno = " "
display.fld(actual.occ,"yeno")
selectempty
db.retry.point()
get.serial.no()
db.set.to.default(ttijwx921)
tijwx921.user = logname$
tijwx921.item = tiitm001.item
tijwx921.srno = srno + 1
db.insert(ttijwx921,db.retry )
commit.transaction()
yeno = "******"
display.fld(actual.occ,"yeno")
endselect
}
function get.serial.no()
{
select tijwx921.*
from tijwx921
where tijwx921._index1 = {:logname$}
order by tijwx921._index1 desc
as set with 1 rows
selectdo
srno = tijwx921.srno
selectempty
srno = 0
endselect

}
function delete.tijwx921()
{
db.retry.point()
select tijwx921.*
from tijwx921 for update
where tijwx921._index5 = {:logname$}
selectdo
if not isspace(tijwx921.item) then
db.delete(ttijwx921,db.retry )
endif
endselect
commit.transaction()
}
function insert.tijwx921()
{
select tiitm001.item
from tiitm001
where not exists (select tijwx921.item
from tijwx921
where tijwx921._index5 = {:logname$,tiitm001.item})
selectdo
db.retry.point()
db.set.to.default(ttijwx921)
get.serial.no()
tijwx921.user = logname$
tijwx921.item = tiitm001.item
tijwx921.srno = srno + 1
db.insert(ttijwx921,db.retry )
commit.transaction()
endselect
}