cancel
Showing results for 
Search instead for 
Did you mean: 

Table content only shown in the first master page but not on the next pages

frank_bork
Participant
0 Kudos

Hi all,

I have 2 master pages. On both pages I have a footer area to print e.g. the payment terms.

If I have only 1 page the footer area is showing the payment terms correctly.

If I have more then 1 page the second master page contains the footer area. Here I see no payment terms.

All other fields in the footer area correct filled on all pages.

The difference to the other fields is that I hold the payment terms in a table. I checked all settings between the 2 master pages but cannot see any differences 😞

A second problem: I have a in the item loop a sub table. Here I will print the sub table line only if the table is filled. If the table is not filled I will hide the line.

This is working only for item line 1 all other lines shows me a space line or if available the correct table content. How can I prevent the space line?

In the initilize part of the table I set the following javascript statement:

if (data.main.Maintable.Main.item_line.upcharges[0] != null ) { data.main.Maintable.Main.item_line.upcharges.presence = "visible" ; }

Table is set to invisible. (Tried it also vice versa)

Can somebody help?

Many thanks in advance.

Kind regards

Frank

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member704548
Discoverer
0 Kudos

You can concatenate all the rows in the table and add a line between two rows by concatenating cl_abap_char_utilities=>NEWLINE with the same and store everything in a variable and then use that variable in the master page. Now it will repeat for every page.

former_member558073
Discoverer
0 Kudos

Can you please provide code sample here that will be helpful

former_member704548
Discoverer
0 Kudos

@selvapriya10

gt_partner = CORRESPONDING #( gs_header_stat-partenrs ). " getting data in a temp table
DATA(line) = cl_abap_char_utilities=>newline. "store new line in a var


LOOP AT gs_header_stat-partenrs ASSIGNING FIELD-SYMBOL(<lfs_partner>). "loop on the table that you need in header
gs_header_stat-list = |{ gs_header_stat-list }{ line }{ <lfs_partner>-name1 }| "concatinate every row value in a variable
ENDLOOP.

"gs_header_stat-list this can be displayed in form by binding it to a text field

pavan_prabhu
Active Participant
0 Kudos

Hi Frank,

     For first issue, You are not able to get the payment terms in footer in second page because the table which you mentioned containing the payment terms has already been processed in sub form of first page. So what you need to do is declare another table in form interface and copy the contents of that table to new table and use the new table in second master page. Then this issue will be solved.

frank_bork
Participant
0 Kudos

Hi Pavan,

Many thanks for your reply.

Indeed it is working if I generate a new table with same content.

But is this the right solution?

Does it mean that I cannot process a table 2 times on the same layout? This sounds not really flexible.

Kind regards

Frank

pavan_prabhu
Active Participant
0 Kudos

Hello Frank,

     Unfortunately there is no straight forward solution to this. The form consumes all the data it can into the repeating elements until there is none left and it is not reused.

If you want the identical data in 2 different sub forms, then you would have to use Java script to do that since you can't give a sub form a "global" binding. And also 2 different sub forms in the form with the same name doesn't mean will have the same instances.

So what you need to do is write a script in the Initialize event of parent sub form containing the first sub form with payment terms data. Now use the Instance manager of the sub form with payment terms data and iterate through the instances. For each instance, extract the data and add new instance with the same data into the 2nd sub form.

You can refer the below link.

http://forums.adobe.com/thread/1162190

Hope it will help you.

varun_vadnala3
Active Participant
0 Kudos

Hello Frank,

Please check the properties of table subform is it "Flowed".And also check what you have given in pagination part of the subform.

Please be clear on issue 2.

Rgds,

Varun

frank_bork
Participant
0 Kudos

Hi Varun,

Many thanks.

To clear point 2.

I have the following layout:

Main-Tab

     Sub-tab1

     Sub-tab2

Both sub-tabs on the same level directly under one dataset of the main-tab.

For example

10     Material     500 USD/1PC     1 PC     500 USD     = main tab

     merchant disc.      3%                           15 USD     = sub-tab1

     discount                2 %                          10 USD     = sub-tab1

     delivery dest. Hamburg                                            = sub-tab2   

                                                                                 = space line

20     Material     200 USD/1PC     2 PC     400 USD     = main tab

     delivery dest. Hamburg                                            = sub-tab2   

In item 20 the layout generate a space line although the table is empty.

How can I avoid this space line?

Thank you.

Kind regards

Frank

pavan_prabhu
Active Participant
0 Kudos

Hello Frank,

      For Point 2, I hope you have designed 3 different internal tables(main_tab, sub_tab1 and sub_tab2 ). And sub_tab1 and sub_tab2 are linked with main_tab using a common field. main_tab, sub_tab1 and sub_tab2 will be in 3 different sub forms.

Keep the main_tab as parent sub form and sub_tab1 and sub_tab2 as child sub forms.

--->main_tab


     ---> common_field(drag the common field of main_tab to same level of sub_tab1 and sub_tab2)

     ---> sub_tab1

            ---> common_field

            ---> field1

            ---> field2

    ---> sub_tab2

            ---> common_field

            ---> field1

            ---> field2

Write the below Java Script on sub form of sub_tab1.

if ( this.common_field.rawvalue != this.parent.common_feild.rawvalue )

{

   this.presence = "hidden";

}

Also apply the same code on sub form of sub_tab2. Because the same problem might occur there.

frank_bork
Participant
0 Kudos

Hi Pavan,

many, many thanks for your replies.

I have not so much experience in LiveCycleDesigner and I think I made small faults which have big impact.

Below a screen shot of the design view. I have 3 subforms under my body row. All subforms flowed. The first subform includes the other 2 subforms. Now I will print the 3rd subform (upcharge) only if I have data in the table for this item. I tried what you described above. But I cannot avoid the space line after my item_detail.

And today I have another problem. I need to print the decimals field depending on the customer country. I set the pattern to "viewer´s system locale". Some customers need the notation as comma other customers as period. How can I control the output notation?

pavan_prabhu
Active Participant
0 Kudos

Hello Frank,

1st Point- Hiding the Table

     If you have written the Java script code on sub form upcharge and if still it is not working, please follow the steps below. Please ensure that you do not miss even the single below steps to work the functionality perfectly. And please create a Test form by copying your form and Test Interface before you do the changes in the Original form.

     There are lot of factors including how you have designed the context node also. Many developers use different methods to bifurcate the parent table and child table ( two popular methods are using conditional breaks and Creating loop with where condition in context node itself). I normally prefer the second method(Creating loop) since it is very neat and elegant from my experience so far. 🙂 . I hope you will get the 3 tables Main table 1, sub table 1 and sub table 2 in the import parameters or Global data of the Form Interface.


First drag the main table in the context node. Then the main table is expanded and you can see the DATA part. Then drag the sub table 1 on the DATA part level of Main table 1. Now click on the sub table 1 in the context node. Then click on WHERE conditions and create the condition as shown below.

common_field_name = main_table_name-common_field_name.

>>>>>>The above condition will link the parent table with child table<<<<<<<<<

Repeat the same steps for sub table 2 as well.

Now when you enter the Layout, in the DATA VIEW you will be able to see main table under which there are two tables sub table 1 and sub table 2.

Step 1 - Now in the design view, drag only the DATA part of main table(not the full table). check the repeat sub form for each item check box for this DATA sub form. Do not check the allow page break within content for this DATA sub form. Then wrap this DATA sub form in a parent sub form with name main_tab.

Keep the main_tab sub form as FLOWED, Check the Allow Page breaks within content. Bind it with main_table directly which you dragged it in context node. Do not check the repeat sub form for each item check box.

Step 2 - Now in the design view, drag only the DATA part of sub table 1 (not the full table). check the repeat sub form for each item check box for this DATA sub form. Do not check the allow page break within content for this DATA sub form. Then wrap this DATA sub form in a parent sub form with name sub_tab1.

Keep the sub_tab1 sub form as FLOWED, Check the Allow Page breaks within content. Bind it with sub_table1 directly which you dragged it in context node inside DATA of main_tab. Do not check the repeat sub form for each item check box.

Now place this sub_tab1 sub form inside the DATA sub form of main_tab.

Step 3 - Now in the design view, drag only the DATA part of sub table 2 (not the full table). check the repeat sub form for each item check box for this DATA sub form. Do not check the allow page break within content for this DATA sub form. Then wrap this DATA sub form in a parent sub form with name sub_tab2.

Keep the sub_tab2 sub form as FLOWED, Check the Allow Page breaks within content. Bind it with sub_table2 directly which you dragged it in context node inside DATA of main_tab. Do not check the repeat sub form for each item check box.

Now place this sub_tab2 sub form inside the DATA sub form of main_tab.

Now on both sub_tab1 sub form and sub_tab2 sub form write the below Java script code in the Initialize event.

if ( this.DATA.common_field_name.rawvalue != this.parent.common_field.rawvalue )

{

   this.presence = "hidden";

}

Note: Basically the above Java Script code checks whether there is even a single record in sub table 1 and sub table 2 for each record of main table. If there is no matching record, then it will hide the corresponding table.

Please be careful. Do not manually type the whole code in the script editor. While you press "." key, it should automatically give you the drop down with field names in the script editor. If it doesn't show you, some thing is wrong some where.

2nd Point - Decimal Field Issue


I would suggest you not to use the Decimal fields directly in the Adobe Layout. Instead change the field type in layout to normal text field. And convert the decimal field value to user profile at the SAP level itself and not at the Adobe(ALD Level).

In ABAP, make use of the WRITE TO statement.

While filling the structure or Internal table, use the WRITE TO statement . It will fill the value of decimal in the pattern according to the viewer´s locale system which is also known as User Profile in SAP terminology.