Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
100%
Handover everything to System Integrator from drawing BP till implementation of ERP
0%
Hire more inhouse skilled & capable IT Resource to work directly with SI
0%
Rely on SI Architects/Consultants
0%
Total votes: 1

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 30th September 2019, 11:56
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
Problem show me record in a report
Baan: Other/Unknown
C/S: None/Unknown

Hi,
I will explain my problem: I have a table that allows to insert record into from another tables. I created this function to insert my records.
Code:
function insert_field_table(){

			select tdsls900.* , tdsls400.ofbp, tdsls400.odat, tccom100.nama, 
		tdsls401.orno, tdsls401.cups, tdsls401.item , tdsls401.qoor
			from 
		tdsls900, tdsls401, tdsls400, tccom100
			where tdsls400.ofbp = tdsls401.ofbp 
			and tdsls400.orno = tdsls900.orno
			and tccom100.bpid = tdsls900.bpid
			
				selectdo
				tdsls900.bpid = tdsls400.ofbp
				tdsls900.nama = tccom100.nama
				tdsls900.item = tdsls401.item 
				tdsls900.cuni = tdsls401.cups
				tdsls900.odat = tdsls400.odat
				tdsls900.orno = tdsls401.orno 
				tdsls900.qoor = tdsls401.qoor 
				
				db.insert(ttdsls900, db.retry)
				
				
				
			 
			rprt_send()
			endselect
				commit.transaction()

}
However my function doens't work corretcly because don't show nobody records and show me only report's labels.
Regards,
RavCoder
Attached Images
File Type: png Capture_8.PNG (2.6 KB, 8 views)
Reply With Quote
  #2  
Old 30th September 2019, 13:26
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,436
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Where is your retry point? I would put it in debug mode - and put the commit right after the insert just to make sure it is really inserting any records. In debug mode you can check the selected fields to make sure they have data.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 30th September 2019, 14:16
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
It still doesn't work

It still doesn't work, I put your suggestions but I do not access the function I wrote, so I don't see if my data is saved or not.

Code:
function insert_field_table(){
			db.retry.point()
			select tdsls900.* , tdsls400.ofbp, tdsls400.odat, tccom100.nama, 
		tdsls401.orno, tdsls401.cups, tdsls401.item , tdsls401.qoor
			from 
		tdsls900, tdsls401, tdsls400, tccom100
			where tdsls400.ofbp = tdsls401.ofbp 
			and tdsls400.orno = tdsls900.orno
			and tccom100.bpid = tdsls900.bpid
			
				selectdo
				tdsls900.bpid = tdsls400.ofbp
				tdsls900.nama = tccom100.nama
				tdsls900.item = tdsls401.item 
				tdsls900.cuni = tdsls401.cups
				tdsls900.odat = tdsls400.odat
				tdsls900.orno = tdsls401.orno 
				tdsls900.qoor = tdsls401.qoor 
				commit.transaction()
				db.insert(ttdsls900, db.retry)
				
				
				
			 
			rprt_send()
			endselect
				

}
Reply With Quote
  #4  
Old 30th September 2019, 14:30
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,436
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
In debug mode as you step thru it you should see this function get called - if not there is another issue. So where are you calling this function from? Post the code so we can see where it gets called from.

And put the commit right after the insert.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 30th September 2019, 14:37
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
here below:

Code:
|****************************** choice section ********************************

choice.cont.process:
on.choice:
   execute(print.data)

choice.print.data:
on.choice:
   if rprt_open() then
       read.main.table()
	  
	   ||update_table()
	   sum_order()
	   sum_period()
	   insert_field_table()
       rprt_close()
   else
       choice.again()
   endif
Reply With Quote
  #6  
Old 30th September 2019, 14:58
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,436
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Not sure what each function does. But you should see it open the report, then call read.main.table() and return from that function. Then call sub_order and return from that function. Same with sum_period() - if it calls each of those and then returns it should call the insert_field_table function. So step thru it in debug mode. If it is not calling that function something is wrong somewhere else.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 30th September 2019, 15:21
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
Hi,
Thanks for your help, unfortunately it doesn't tell me exactly where the problem is and even if it were somewhere else I wouldn't know where it is.
Regards,
RavCoder
Reply With Quote
  #8  
Old 30th September 2019, 19:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,436
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
It has to help - I mean in debug mode you step thru the script and see exactly what happens when. There has to be a reason that code never gets called.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #9  
Old 1st October 2019, 09:26
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
I don't know what to do anymore

Hi,
unfortunately I debugged my code but didn't jump out.
This is all my code:
Code:
****************************** declaration section ***************************
declaration:

  table   ttdsls400 | Ordini di vendita
  table   ttdsls401 | Righe ordini di vendita 
  table   ttdsls900 | Nuova tabella che prende i record della tabella tdsls401
  table   ttccom100
   extern  domain  tcorno           orno.f    fixed
   extern  domain  tcorno           orno.t    fixed
   extern  domain  tcyesno  txta.txt
   extern  domain  tcyesno  txtb.txt
   extern string tdsls900.bpid
   extern string tdsls900.nama
   extern string tdsls900.item
   extern string tdsls900.cuni
   extern long tdsls900.odat
   extern string tdsls900.orno
   extern double tdsls900.qoor
  
   
  
   extern domain  tdsmo     somma  
   extern domain  tdqper     quantita_periodo
   
   
      
|****************************** program section ********************************


|****************************** group section **********************************

group.1:
init.group:
   get.screen.defaults()
   

	

|****************************** choice section ********************************

choice.cont.process:
on.choice:
   execute(print.data)

choice.print.data:
on.choice:
   if rprt_open() then
       read.main.table()
	  
	   
	   sum_order()
	   sum_period()
	   ||update_table()
	   insert_field_table()
       rprt_close()
   else
       choice.again()
   endif


|****************************** field section *********************************

field.orno.f:
when.field.changes:
   orno.t = orno.f


  

 

|****************************** function section ******************************

functions:

function read.main.table()
{
    select tdsls400.*
	from tdsls400
    where   tdsls400._index1 inrange {:orno.f}
                                  and {:orno.t}
    
	
	order by tdsls400._index1 
	
	
	
	selectdo
       rprt_send()
  endselect
}






function sum_order() {

	somma = 0
	select tdsls401.ofbp,tdsls401.item
	from   tdsls401 
	
	group by tdsls401.ofbp,tdsls401.item
	
	selectdo
		select tdsls401.qoor
		from tdsls401
		where tdsls401.item = :tdsls401.item
		 and tdsls401.ofbp = :tdsls401.ofbp
		
		selectdo
			somma = somma + tdsls401.qoor 
			

		endselect
	
		rprt_send()
	endselect
	
	


}


function sum_period() 
{
	quantita_periodo = 0
	select tdsls401.ofbp, tdsls401.odat
			from tdsls401
			group by tdsls401.ofbp, tdsls401.odat
			selectdo
				select tdsls401.qoor
				from tdsls401
				where tdsls401.ofbp = :tdsls401.ofbp
				and tdsls401.odat  =  :tdsls401.odat
				
				selectdo
				quantita_periodo = quantita_periodo + tdsls401.qoor
				endselect
			rprt_send()
			
			endselect
}


function insert_field_table(){
			db.retry.point()
			select tdsls900.* , tdsls400.ofbp, tdsls400.odat, tccom100.nama, 
		tdsls401.orno, tdsls401.cups, tdsls401.item , tdsls401.qoor
			from 
		tdsls900, tdsls401, tdsls400, tccom100
			where tdsls400.ofbp = tdsls401.ofbp 
			and tdsls400.orno = tdsls900.orno
			and tccom100.bpid = tdsls900.bpid
			
				selectdo
				tdsls400.ofbp=tdsls900.bpid 
				tccom100.nama = tdsls900.nama 
				tdsls401.item =	tdsls900.item
				tdsls401.cups = tdsls900.cuni 
				 tdsls400.odat = tdsls900.odat
			     tdsls401.orno = tdsls900.orno 
				 tdsls401.qoor= tdsls900.qoor 
				db.retry.point()
				
				db.insert(ttdsls900, db.retry)
				commit.transaction()
				
				
			 
			rprt_send()
			endselect
				

}
I hope that someone tell me some suggestion.
If there are parts that are not understood, I will clarify.
Thanks and regards,
RavCoder
Reply With Quote
Sponsored Links
  #10  
Old 1st October 2019, 11:41
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,844
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox Tools 10.7 - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Multiple rprt_sent() ?

Hello,

rprt_sent() is called 4 times in report.open ?
As Mark suggest, trace the variables data in debug mode.

Regards
__________________
//Bernd
Reply With Quote
  #11  
Old 1st October 2019, 11:56
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
Hi,

How to track variables in debug mode? I'm a little confused about it
I wrote rprt_sent() because without it don't execute my script.
Regards,
RavCoder
Reply With Quote
  #12  
Old 1st October 2019, 12:27
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,844
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox Tools 10.7 - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Debugger !

Hello,
here are the debugger commands.
Code:
Debugger commands
Debugger commands consist of from one to three words; the words can be separated from each other by one or more spaces. The assignment command is an exception. Here the variable and the value to be assigned are separated by a ':=' sign. Most commands require a line number and/or a source name. If no source name is specified, the default is the current source.

When you start the debugger for an object, the source used by the debugger is first searched for by using the directions in the file fd x.x.<pack.comb.> (where x.x is the bshell version), then it is searched for in the $BSE/tmp directory, and finally in the current directory.

Command Action 
b [[source] line_number] Toggle a break point on the current or specified line of the current or specified source. The line is highlighted, when break point is set.

Note that you cannot set break points in included parts in a source. Instead the break point must be set in the included file.
 
B [source] Display all set break points in the current or specified source. 
c [number] Continue (execute the source) up to the next break point. If you specify a number, the debugger skips that number of break points. The executed source lines are not displayed. 
CC [number] Same as 'c', except that the executed source lines are displayed. 
cc Change the size of the command window. This is valid only when application and debugger are in the same window. 
cs Change the size of the source window. This is valid only when the application and debugger are in the same window. 
d [source line_number] Delete the break point on the specified line number in the source. If you do not specify a line number, the debugger provides the opportunity to interactively delete any break point in the current source file. 
D [source] Delete all set break points in the specified or current source. 
delete all Delete all traces and stop instructions. 
delete number Delete a specified trace or stop instruction. 
ds Delete the source window. 
dd Generate a dump of the data dictionary. 
<expression> Execute the specified expression. 
f [noarg|noname][number] Display stack trace (present nesting of functions), with the arguments of the functions. If you specify a number, only that number of nestings is displayed.

noarg         only the names of functions are displayed

noname     arguments are displayed but not their names
 
fdebug Show the open tables on the command window. 
Fdebug Print the open tables to the spooler. 
g [source] line_number Continue program execution at the specified line number (goto). 
help (or ?) Start the Help Viewer for debugger options. 
l Display the full list of program variables. 
L Display the list of program variables that have a value, and display their current values. To stop displaying the contents of an array, enter 'n' at the question 'More ?'. 
lp Print the output of the 'l' command. 
Lp Print the output of the 'L' command. 
mem Generate a dump including information about the memory allocated. 
p Go to the source line currently being processed (this is useful after the view or seek command). The line is indicated by a greater than (>) sign before the line number. 
q Exit the debugger (quit). 
return Continue execution until the end of the current function. 
s [number] Execute the program step by step, the specified number of instructions at a time (default is 1). During execution, the intermediate source lines are not displayed. 
S [number] Similar to 's', except that a function call is executed as a single statement. 
slow [number] Reduce the rate of running source code. The maximum number is 100; the minimum (and default) number is 0. 
split number Split the command and source window. The specified number is the last line of the command window. This is often used after resizing the Debugger window. 
status [trace|stop|number] Display traced variables and/or stop instructions. If you specify a number, only that traced variable or stop instruction is displayed. 
stop if <expression> Stop execution when expression is True. 
stop in <function> Stop execution when function is entered. 
sym Generate a dump of the symbol table. 
trap off Disables ‘trap on’. This command is available only when the bshell was started with the -dbgcpu flag. 
trap on The debugger stops after execution of every function call. This command is available only when the bshell was started with the -dbgcpu flag. 
swin off There is a separate window for stack, array and long string in debugger. The appearence of this second window can be switched off with "swin off". 
swin on There is a separate window for stack, array and long string in debugger. The appearence of this second window can be switched on with "swin on". 
t variable Trace the specified variable during program execution. The execution of the program stops every time the value of the variable is changed. You cannot trace array variables or common variables. 
T variable [value] Same as 't', except that program execution is not stopped when the variable changes. If you specify a value, execution stops when the variable gets that value. 
u [variable] Stop tracing the specified variable. If no variable is specified, you can stop tracing each variable interactively. 
U Stop tracing all variables currently being traced. 
v [source] line_number Display a specified source line in the source window (view). If line_number is greater than the total number of lines, the last line is displayed. 
v {+-} number Shift the display to the source line that is number lines before or after the current source line. 
/pattern Seek a matching text pattern in the current source and display that line. 
[function.]variable [/option] Display the value of a specified variable. If you specify a function, the value of the local variable of that function is displayed. Otherwise, the value of the variable of the current function or the global variable is displayed. If a variable has no value (empty string or zero number), the value is not displayed.

/ option can have the following values:

/ Use to display the value of a variable that has the same name as a Debugger command. For example, ‘b/’ displays the value of variable b. 
/d Print the flags of the variable and the dimension for arrays. 
/D Display the number of bytes allocated in a long or double variable. Display the number of bytes for one element in a string array. 
/g For a string containing the compact string representation of a UUID, display the standard string representation of the UUID. See UUID overview. 
The following options are useful for record buffers and binary data. They display the value of a string variable with its full declared length, regardless of NUL characters. 
/x NUL characters are displayed as ‘^@’. 
/X Characters with values 0 to 31 are displayed as ‘\x<value in hex>’. 
/b All characters are displayed as ‘ \x<value in hex>’. 
/l Interpret field as UTC field and print in local time and prints current time zone. 
/u Interpret field as UTC field and print in utc time. 
 
 
variable := value Assign a value to a variable. The value can be:

a string constant or expression

a numeric constant or expression

a variable name
 
vi Activate the vi editor for the current source at the current source line. Changing the source has no influence on the source displayed by the debugger in the source window. 
width value Change the width of command and source window. You can specify any value in the range 80 to 132. 
<Ctrl>D/<Ctrl>U Page down or up in source. 
<Esc> Toggle between normal and history mode. 
<Arrow up>/ <Arrow down> In history mode, these display previously executed commands on the command line. In normal mode, these move the cursor through the source.
Regards
__________________
//Bernd
Reply With Quote
  #13  
Old 1st October 2019, 12:47
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
Thanks for sending me the debug commands but keep showing me the record data on my report.
Reply With Quote
  #14  
Old 1st October 2019, 13:52
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,436
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Maybe this will help you understand report. So first comment out these three lines: sum_order()
sum_period()
insert_field_table()
That leaves only the read main table.
Code:
function read.main.table()
{
   select tdsls400.*
   from tdsls400
   where   tdsls400._index1 inrange {:orno.f}  and {:orno.t}
   order by tdsls400._index1 
   selectdo
        rprt_send()
   endselect
}

The above is going to take an input range of orders, find every tdsls400 record in the range and send all of the fields to the report. So now you get a report on tdsls400.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #15  
Old 1st October 2019, 14:18
RavCOder's Avatar
RavCOder RavCOder is offline
Senior Member
 
Join Date: Jul 2019
Posts: 106
RavCOder is on a distinguished road
Baan: 10.3 - DB: SQL Server - OS: Windows
Thanks this I got it into my head, but my problem as I have already said in other threads was that from this main table and from other tables (tdsls400 and tccom100) I have to display certain fields in a new table that I already created (tdsls900 ). I had created a function to do that takes the tables and inserts them into the external variables I created.
This one:
Code:
function insert_field_table(){
			db.retry.point()
			select tdsls900.* , tdsls400.ofbp, tdsls400.odat, tccom100.nama, 
		tdsls401.orno, tdsls401.cups, tdsls401.item , tdsls401.qoor
			from 
			tdsls900, tdsls401, tdsls400, tccom100
			where tdsls400.ofbp = tdsls401.ofbp 
				and tdsls400.orno = :tdsls900.orno
				and tccom100.bpid = :tdsls900.bpid
			
				selectdo
				tdsls900.bpid = tdsls400.ofbp
			    tdsls900.nama = tccom100.nama
				tdsls900.item = tdsls401.item 
				tdsls900.cuni   = tdsls401.cups
				tdsls900.odat   =  tdsls400.odat 
			    tdsls900.orno  = tdsls401.orno
				tdsls900.qoor = tdsls401.qoor
			 
				
				db.insert(ttdsls900, db.retry)
				commit.transaction()
				
				
			 
			rprt_send()
			endselect
then the other two were other functions that I needed to make simple sums and those in my report can be seen if I put in after reading the main table.
I tried to do as you said but I still don't see the values, I also checked if I had input fields and they are in my report.
Now it displays the report but without displaying the values ​​of the records.

I'm in a blind alley for now and I can't do anything else, maybe I'm missing certain logics.
Regards,
RavCoder
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: Problem creating new report with report generator bhushanchanda Tools Development 2 15th January 2013 11:51
Problem in Report Layout Field alexbaan Tools Development 1 22nd October 2005 12:19
Problem in report script to extract more than one record mattan Tools Development 3 22nd July 2005 12:49


All times are GMT +2. The time now is 03:29.


©2001-2018 - Baanboard.com - Baanforums.com