RavCOder
18th September 2019, 10:58
Hi,
I have a question to ask:
I created a table where I inserted fields (business partners, dates, item code, unit of measure, period, and company name). This table is called tdsls900.
These fields are found in another table in tdsls401 and the company name is in the tccom100.
This new table must be viewed in a print report.
I have already created a session with report included that shows me only the business partner, the article and the sum of the quantity for these two fields.
Obviously it takes them in the tdsls401 table.
My question (excuse the digression) is how do I display the rows of the table tdsls400 and tccom100 adding them to the new table tdsls900 I created?
What are the steps to do? I'm still unripe on this topic and haven't found anything in the previous threads.
Regards,
-RavCoder-

RavCOder
23rd September 2019, 10:51
While still having difficulty with this thing, there is someone who can help me.
Regards,
RavCoder

Ajesh
23rd September 2019, 15:55
In the main query for selecting the records for printing you can use something like this



select tdsls900.*,
tdsls400.itbp, |Insert whatever fields which you want to
tccom100.clan |select from tdsls400 and tccom100
from tdsls900,
tdsls400,
tccom100
where tdsls900._index1 inrange {:orno.f} and {:orno.t}
and tdsls400._index1 = {tdsls900.orno}
and tccom100._index1 = {tdsls400.otbp}
selectdo
|List of statements
rprt_send()
endselect


In this way all the referenced records from tdsls400 and tccom100 can be accessed in the Report,provided you have put those fields as "input fields" in the reports

RavCOder
23rd September 2019, 18:33
hi,
I tried this, but didn't work

function insert_field_table(){
select tdsls400.*,tdsls900.*
from tdsls900, tdsls400
where tdsls900.bpid = tdsls400.ofbp
selectempty
tdsls900.nama = tdsls400.nama
tdsls900.item = tdsls400.item
tdsls900.cuni = tdsls400.cuni
tdsls900.odat = tdsls400.odat
tdsls900.orno = tdsls400.orno
tdsls900.qoor = tdsls400.qoor

db.insert(ttdsls900, db.retry)
commit.transaction()

rprt_send()
endselect
}


I think that there are some values that are in another table tdsls401, but I don't know how to put these into tdsls900.
Regards,
RavCoder

VishalMistry
25th September 2019, 10:22
I think in your query, you have written

tdsls900.nama = tdsls400.nama
tdsls900.item = tdsls400.item
tdsls900.cuni = tdsls400.cuni
tdsls900.odat = tdsls400.odat
tdsls900.orno = tdsls400.orno
tdsls900.qoor = tdsls400.qoor

tdsls400 refers to order header table. I think you should try to refer to tdsls401 instead of tdsls400 as it refers to actual sales order lines.

Vishal

RavCOder
25th September 2019, 12:02
Now I have this function :

function update_table(){
db.set.to.default(ttdsls900)
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)



}

Now this function show me some fields except for tdsls900.qoor and tdsls900.cuni. I saw if there are into report as input fields and there are but I don't know where is the error and why don't show me these fields.
Regards,
RavCoder