cancel
Showing results for 
Search instead for 
Did you mean: 

Display multiple records from multiple tables in according to PERNR.

Former Member
0 Kudos

Hi.

I'm new to Adobe Forms and trying to figure out, how I can display records from my five tables according to PERNR records in first ot them. I need to print header information (name, surname, middle name ...). It comes from first table, where PERNR is stored. Then I have to display all records from second third and fourth tables, where pernr is the same (record count is different in all tables). When these blocks end, I have to make page-break and print next PERNR. How should I create Adobe form and may be there is some simple formcalc code for that. I'm pretty tired of searching solution for that. Please help.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

I am assuming that this is an offline form.

First populate internal tables depending on the data you need on each page. Sort the table according to the PERNR.

You can read the internal tables using Javascript -

var varname1 = xfa.resolveNodes("xfa.record.ITAB.DATA[*]");

Add the fields as per the first name - Name, last name etc and populate these fields with the first record from the first internal table. Store the PERNR value in a separate variable (say pernr1).

Now you can querry the second internal table with this pernr, pick up the corresponding record and fill in the 2nd set of fields.

for( var i = 0; i < varname1.length ; i++)

{

if ( varname1.item(i).PERNR.value == pernr1 )

Hope this is a good starting point for you.

Thks, Liz

Former Member
0 Kudos

Hi Liz,

Thanks for your answer. Now I'm trying to understand some things:

1. How I should structure Adobe form? Where to place main (first) table and where others? Under main table (like subforms)? I don't understand, how loop will work in this case?

2. Can you give me exact code and place where I should put this code? Let's say, I have table1 with PERNR,NAME and table2 with PERNR, F1, F2. So table2 will be like subforms under table1 or what?

Sorry, if my questions seems little bit stupid.

Big thanks

OttoGold
Active Contributor
0 Kudos

1) create a DDIC structure in your backend, add fields, structures as you would do for normal ABAP stuff (like report, sapscript etc etc.). Next use this structure as a single node in your form interface, what will speed up all the actions about the data transfer from backend to form

2) there will be no exact code, this is not how we do it here, we offer help, but do not do your job.

write your code into your printing program, I suppose you have one. Or if you cannot do that or you don´t like it, use form routines and initialization in your interface.

3) In my opinion you could use some formal training.

Otto

Former Member
0 Kudos

Hi Otto,

Of course, I understand, that I have to do it by myself.

I red Adobe manuals about Adobe forms and its programming language formcalc, but couldn't find solution for printing info from several tables. In smartform there is possibility to use ABAP for this.

I have ABAP report, whitch gives five tables to Abobe form. I just wanted to know if there is solution for printing records based on pernr, if I have seperated tables. In my last adobe form I had to created in ABAP deep structure, where I had PERNR and "subtables" for each record. That worked, but I didn't like that solution. And is there some useful way, how I can debug javascript in LC Designer 8.0 ? Thanks again.

OttoGold
Active Contributor
0 Kudos

Your best shot is to create DDIC structure(s) the way you want it displayed in the form. Means: if you need to combine the data from five tables into one, then create a suitable DDIC in your backend and looping at your 5 tables (+some READ statements probably) translate the data into this "display" structure and use the form to display this structure for you. If you don´t have to, do not use any in-form scripting and try not to commit a suicide using any special abilities of Adobe forms if that is not absolutely necessary. Otto

Former Member
0 Kudos

Hi

I am assuming that this is an offline form.

First populate internal tables depending on the data you need on each page. Sort the table according to the PERNR.

You can read the internal tables using Javascript -

var varname1 = xfa.resolveNodes("xfa.record.ITAB.DATA[*]");

Add the fields as per the first name - Name, last name etc and populate these fields with the first record from the first internal table. Store the PERNR value in a separate variable (say pernr1).

Now you can querry the second internal table with this pernr, pick up the corresponding record and fill in the 2nd set of fields.

for( var i = 0; i < varname1.length ; i++)

{

if ( varname1.item(i).PERNR.value == pernr1 )

Hope this is a good starting point for you.

Thks, Liz