romz.baan
7th July 2011, 06:12
Im trying to get the selected report so i could run my function but im getting an "ERROR: Argument 1 for function 'choice.report' should be call by reference".
I want to know what reference should i look for and if my coding is correct..

any help will be appreciated.. thank u..

Here's my code:

choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()

|this is where im trying to call my choice report
if choice.report("tfcmg1220mr012") then
exec.copy() |This is my function
endif

else
choice.again()
endif

kishoremeher
7th July 2011, 06:32
check the help for choice.report() function.

proper program will be :-

choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
choice.report(report.name) |this return the selected report code
if reportname = "rtfcmg1220mr012" then |compairing the report code
exec.copy()
endif
else
choice.again()
endif

romz.baan
7th July 2011, 08:28
I tried debugging the program but the process stop at choice.report(reportname). if im correct report.name and reportname are the same variable right?


choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
choice.report(report.name) |The process stops right here. so the following lines are not executed.
if reportname = "rtfcmg1220mr012" then
exec.copy()
endif
else
choice.again()
endif

romz.baan
7th July 2011, 09:25
i got it now kishoremeher.. the choice.report() is a command to execute the form for the report choices. I used the spool.report to get the name of the chosen report. thx for the reply kishoremeher it helped me alot..


I used this codes:

choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
if spool.report = "rtfcmg1220mr012" then
exec.copy()
endif
else
choice.again()
endif