RavCOder
2nd September 2019, 10:48
Hi everyone,
I have another problem: I have to see the data from a table existent.
From what I understand I have to create a script and inside the declaration I have to insert the name of the existing table, then in the section of the program I have to add the query: I thought of putting a query string in the declaration that stores the query I have to create.
The query I thought of creating is the following:


-----program section----
before.program:
query = SELECT ttdsls400.*
from tdsls400

Are there any other things I need to add besides the select?
Doing the conditions for domains?

Thanks and regards,
-RavCoder-

bdittmar
2nd September 2019, 17:18
Hello,
think you mean .
View data from another existing table ?

Example:

you have a table field like "yourtable.item" and want to display the item description from item master table (tcibd001)

|In declaration of your display session, something like this :

table ttcibd001

|in field section of the source

field.yourtable.item:
before.display:

select tcibd001.dsca
from tcibd001
where tcibd001._index1 = {:yourtable.item}
selectdo
endselect


Regards

RavCOder
2nd September 2019, 17:34
I mean, I have a table and I want to display the existing table fields for example:



declaration section

table ttable 0001

field section

select tdsls0001.*
from tdsls0001
where
field_index = { field.table} || Here I have to insert fields?
....
selectdo || I don't know what I have to enter here
endselect



The goal is to display the data found on the table using a script.

Regards,
-RavCoder-

bdittmar
2nd September 2019, 19:29
Hello,
if you have a table (tcabc001) create a display session "tcabc0501m000" as listfield session.

In DFE (DynamicFormEditor) assign all table fields.

After compile the session should display all data from the table in order of index1.

The 4GL-Engine does the select for you.

Session naming conventions.

Sessiontype 2= Update, 1=Maintain, 5=Display, 4=Print
|
tc abc 0 0 00 m 000 means
|| ||| | ||
Package Modul Table^ ^^ m=Mainsession,s=subsession



Naming conventions

The naming syntax for tables, record buffers, and table fields is as follows:

tppmmmxxx | table
rcd.tppmmmxxx | record buffer of table
ppmmmxxx.ffffffff | logical field of table
where t stands for table, pp is the package code, mmm is the module code, xxx is the tablenumber (range 000 to 999), and ffffffff is a field name (maximum 8 alphanumeric characters, starting with an alphabetic character).


Regards

RavCOder
3rd September 2019, 11:54
Hello,
thanks for your suggestion, I have to create a non-standard session (with the script) that I can view data from an existing table.

this is my code:


declaration section

table ttdsls400
string old.ofbp || Business partner

****PROGRAM SECTION*****
before.program:
view_data()
*********MAIN TABLE SECTION**********
main.table.io:
after.read:
if old.ofbp = tdsls400.ofbp then
skip.io("") || This to don't duplicate value of business partner
else
old.ofbp = tdsls400.ofbp
endif
**********FUNCTION SECTION **********
functions:
function view_data()
{
select tdsls400.ofbp
from tdsls400
selectdo
endselect
}






But it still doesn't show me the data

Regards,

-RavCoder-

RavCOder
3rd September 2019, 18:29
how can I not display duplicate values?