cancel
Showing results for 
Search instead for 
Did you mean: 

table inside a table

Former Member
0 Kudos

Dear all,

I am working on PO form, which a ZFORM. I have to print the long description of the Material PO text and PO Item text. For this i have taken 2 tables, table1 will contains the item level data and table 2 will contain the long descriptions. Table 2 i put in a subform. As of now this is working fine. But the problem is when the table2 is empty, still the space is printing on the form. To overcome this issue i wrote JAVA script on the table1 to hide the subform of table2. its not working fine. The code is as follows. Please do let me know whether the code is correct or not.

var norows = xfa.resolveNodes("data.ZLINE_ITEM.DATA[*]").length;

var no;

for ( var i=1; i<=norows; i++)

{

no = xfa.resolveNodes("data.ZLINE_ITEM.DATA<i>.SS.GT_ILTEXT.DATA[*]").length;

if(no == 0)

{

xfa.resolveNodes("data.ZLINE_ITEM.DATA<i>.SS").presence = "hidden";

}

}

I wrote this code in 'Calculate' event.

Language - JAVA script

Run at - Client

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

solved it by self

OttoGold
Active Contributor
0 Kudos

Hello, have you solved your problem? Is there any experience or solution you can share with us? That would be great, Otto

Former Member
0 Kudos

Hi,

Use "xfa.resolveNodes" to find the length, where as to refer to a single attribute i.e. the elements then use "xfa.resolveNode".

Regards

Pradeep Goli

OttoGold
Active Contributor
0 Kudos

You send the text into a text field. Lets have a text field with the name TST.

You test the value like (if TST.rawValue = NULL || TST.rawValue = "")

you react like TST.presence = "hidden";

if you place the script on every text field it should hide, you can simplify things using this.rawValue and this.presence and you don´t have to loop at the table.

Otto

p.s.: start reading here: http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

Former Member
0 Kudos

Hi Otto,

The long description of a Material would be some pages. Its not like a single line. Hence i cannot put it into a text field.

OttoGold
Active Contributor
0 Kudos

Of course you can, but you need to make some changes in the field setup:

1) tab layout: expand to fit = true (the field will change its height to fit in the text)

2) tab object: allow multiple lines = true (so it can handle any number of lines your text may have)

Regards, Otto

OttoGold
Active Contributor
0 Kudos

First: why do you have two tables and not one? Why don´t you merge it in ABAP? It will improve your performance and will make your form solution "maintainable".

Is the number of the long texts the same as the number of the items? Or you pass the long texts for all possible items and pair them to the runtime items of the PO? All this is weird.

The problem is not in your coding. The problem is in your design.

Please describe your data instead of the coding and we can work on it. Otto

Former Member
0 Kudos

hi,

i am extracting the long description of the PO line item by using READ_TEXT function module. The output of this FM will be 'N' number of lines. Hence i have used table inside a table.

OttoGold
Active Contributor
0 Kudos

Hello,

please check the scripting guide here: http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

Especially the end of the "book" where there are some very useful code snippets/ typical solutions.

Regards, Otto

chintan_virani
Active Contributor
0 Kudos

Set the parent level subform Content property to Flowed from Object Palette.

Chintan

Former Member
0 Kudos

Hi Chintan,

i maintained the parent subform content as 'flowed' already. Still the JAVA code is not working. Is it correct?

chintan_virani
Active Contributor
0 Kudos

Is ZLINE_ITEM name of your table? If yes then use following code:-

ZLINE_ITEM.presence = "hidden";

Chintan

Former Member
0 Kudos

Hi Chintan,

ZLINE_ITEM will have PO line item details and for each line item i am extracting long description by using READ_TEXT. The table GT_ILTEXT will have the descriptions. I want to hide this table if no data for the line items.