cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding Table rows in subsequent pages incase of blank data

Former Member
0 Kudos

Dear Experts,

I am new to SAP Adobe form, so unable to find some solutions. So I need your kind guidance in this.

My requirement is to show a table where data will be flowing to next subsequent pages if it exceeds the pgae content area. And for my requirement I have taken the table with 1 header and 6 rows manually for showing the line items in the particular content area. So when ever I am getting more less than 6 rows, the remaining rows are coming as blank with empty cells. Now my requirement is to hide the blank rows in the current page and also in the subsequent pages if lines exceeds more than 6. I tried to write some java script in 'initialize / Validate ' events but didn't work for me.

Also Need to hide the Columns where it is coming completely blank

Please look at the screen shot,

Note: in my requirement it is needed to desgin 6 rows manually, else I could have gone for 1 header and 1 row with repeating the body row.

Kindly give some suggestions.

Thanks in Adavnce,

Sriyash

Accepted Solutions (1)

Accepted Solutions (1)

rakesh_m2
Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Dear Rakesh,

Thanks for your reply. Actually I have to populate 4 headers for that internal table and they should come in borders. Also there anothe similar internal table in the same page i there, so how would I proceed. Can you elaborate your answer please.

Regards,

Sriyash

Answers (4)

Answers (4)

Former Member
0 Kudos

Dear All,

Thanks for your valuable suggestions, My problem got partially resolved as I came out with a solution for keeping a single body row with min 1 to max x numbers for as per the records get fit for the specified content area. So in this way there is no need of hiding the body rows because the no of rows will be displayed as per the no of records only.

Even though, I am having the same requirement for the header rows which are fixed for the content area and as I have said already there are 4 header rows. Now amongst these I have to hide the 2nd and 3rd rows for some cases. Here as per the suggestion given by you people I wrote java script in each field and rows. The rows are getting hidden but the space occupied by the rows are not omitting.

And some of guys have advised to use subform as table, 1st of all I think I can not get the all the header rows using the subform and second evenif this logic would be the right one, I can not revert my design to this one, as I have to modify so many things. And now my development is almost ready with some lil drawbacks, which I think can be resolved. Sorry guys, I appreciate your suggestions. I would rather try this logic with some other development in future.

Still I would be waiting for some more suggestions to hide the header rows from all of you.

Regards,

Sriyash

pavan_prabhu
Active Participant
0 Kudos

I see your requirement is a lot more static.

According to the design done by you, you can do as below.

On each row, write the Javascript below.

if ( this.rawvalue == NULL )

{

this.presence = "hidden";

}

But I personally suggest you to design using sub forms, then you will not be having such problems because sub forms itself are dynamic. What you need to do is just bind the internal table to this sub form and the rows will be shown only if there is data in it unless(explicitly you insert a blank row in the interface).

And if you really want to show two tables in same page, you can also achieve this using sub form itself. Here you just need to define two content areas in same page. You need two content areas because the two tables will be positioned.

page1-->content area1-->1st  subform--> table1

page1-->content area2-->2nd subform--> table2

Please Confirm whether in future the table can contain much data. In that case, the tables might get overflowed. And this is where you will have to use sub forms in any case. Sub form works perfect for static as well as dynamic content.

Former Member
0 Kudos

Dear Pavan,

Thanks for your reply, Actually I have achieved the functionality for populating the two table in the same page already with some other approach but not as you are suggesting. And the suggestion give by you has been already been tried by me and was unable to achieve the exact result. What I remember I tried to take two content area and populating the subforms in the required position with two tables. But the output was not coming as expected, Actually there several stuffs in the same page as say, header and footer elements and some of the elements in these are, too dynamic, so was not achieving the perfect stuff.

And regarding hiding the rows, as you are suggesting the javascript coding, I have already incorporated the things. and its working fine for the text fields not for entire row. It will be great if you can provide me the logic for hiding a complete row if it coming blank.

Now regarding your point using the subform instead of table, which looks really interesting, I have not tried this yet. Actually I have very less time to complete the object, so I think it will be difficult to incorporate the same logic now. even though I will surly try if time permits.

Regards,

Sriyash

pavan_prabhu
Active Participant
0 Kudos

Hello Sriyashis,

You can use the 2 approaches as given below.

1st approach


If you have N number of fields in each row, check if all these fields are blank. Check if it is space instead of NULL. Suppose if you have 7 fields in a row, do as below.


if ( this.field1.rawvalue == " " and

     this.field2.rawvalue == " " and

     this.field3.rawvalue == " " and

     this.field4.rawvalue == " " and

     this.field5.rawvalue == " " and

     this.field6.rawvalue == " " and

     this.field7.rawvalue == " " )

{

   this.presence = "hidden";

}


Write this code on all 6 rows. I hope you have wrapped each row in a separate sub form.

You can use text fields as a type for all fields in a row.

Note: Beware of data elements where the initial value might not be blank. They might also be 0.00 in case of currency for example. In that case, you need to compare its initial value rather than blank or you can follow 2nd approach


2nd approach (for data elements whose initial values may not be blank and can be blank)

Create one extra field(column for example dummy) in all 6 rows since you have designed 6 rows manually. Hide all these dummy fields in the layout. Check in the form interface if the row is initial(empty). If the row is empty, fill the value X in the dummy field for that row. So in the form, the rows which are empty will now contain the value X in their respective dummy fields. In Java script, on each row, check if this dummy field is X. If yes, hide that row. Write this code on all rows.

if ( this.dummy.rawvalue == "X" )

{

   this.presence = "hidden";

}


After hiding the rows


For example, out of 6 rows if 3rd and 5th row are empty, make sure that it gets displayed as below


row1

row2

row4

row6


and not as below.


row1

row2

           -----> row 3 is blank

row4

           -----> row 5 is blank

row6


To achieve this, your design should in a sub form of type flowed.

1) wrap each row in a sub form of type flowed.

2) After wrapping all 6 rows in their sub forms, wrap these 6 sub forms in a parent sub form of type flowed.

Former Member
0 Kudos

Dear Pavan,

I have already tried the 1st approach, which was not working as the row gets omited but the ocupied space does not omit. And 2nd approch I tried as per your suggestion but the same result.

The result is like

row1

row2

           -----> row 3 is blank

row4

           -----> row 5 is blank

row6

And my tables are wrapped in subforms with flowed layout.

Just one thing I am not getting, you have suggested to wrap each row in a subform and all of them should be wrapped in a parent subform but how it would be done, I could not find any way to wrap the rows into separate subforms.

Can you guide me ?

Thanks,

Sriyash

pavan_prabhu
Active Participant
0 Kudos

Check if all the rows are wrapped in sub forms. If not, Right Click on each row. Select "Wrap in Sub form" with type "Positioned" or Flowed(direction Western Text).

Now after all the rows are wrapped in their sub forms, Click the CTRL button and select all the rows(sub forms). Then right click on one of the rows and select "Wrap in Sub form" and type "Flowed" and direction "Top to Bottom".

Former Member
0 Kudos

Dear Pavan,

I am able to wrap the complete table into subform but not each row of the table. Kindly see the given screen shot.

So kindly suggest, if there is really a way to wrap each into a subform.

And what is the effect of 'Western Text' here , could you please put some light on this.

Thanks,

Sriyash

pavan_prabhu
Active Participant
0 Kudos

Hello Sriyashis,

     You are not able to wrap each of the rows into their sub forms because you have dragged the table directly into the layout.

So what you can do is instead of dragging the whole table, you can also drag only the DATA part of the table. This you need to do as many number of times the number of rows you have( If you have 6 rows you do it 6 times). So these all row DATA will act as different sub forms by default. Keep them Flowed. Then wrap all these sub forms in a parent sub form and bind the table to this parent sub form.

And regarding Western Text, the Western Text is a style of displaying the data fields beside each other. The fields in a row are displayed one beside the other(horizontally) which are called as Western Text. There is another option Top to Bottom (which is showed vertically one below another) which is the other way around. Data in rows are usually showed in Western Text.

navip
Active Participant
0 Kudos

Hi Sriyash,

Declare a Flag at the top of the table and write the below FormCalc code in the event Form:ready on every row:

if ($.Flag name == null ) then

$.presence = "hidden"

else

$.presence = "visible"

endif

---

Naveen

 

 

Message was edited by: Naveen Pathipaka

Former Member
0 Kudos

Dear Naveen,

Thanks for your reply,

I have tried your logic with javascript in event Form Ready, but it was not working for me. I would request you to elaborate your suggestions little more with Formcalc coding details. As I dont know FormCalc lang and my coding might be wrong, because which the logic given by you is not working.

Regards,

Sriyash

navip
Active Participant
0 Kudos

Sriyash,

  Please try the logic with FormCalc (not with Javascript)....

----

Naveen

Former Member
0 Kudos

Dear Navin,

Can you provide me the logic in details for writing in Formcalc.

I am unable to write the proper syntax as per your logic.

And also using your logic is it possible to hide the complete column if it is coming blank ?

Please reply soon.

Thanks,

Sriyash

Former Member
0 Kudos

Hi Sriyashis,

If i were you, i will do the filtering delete any row by checking on certain fields which is blank in form interface, initialize event coding.

Import you table into this event, do ABAP coding to delete any row(s), and export the table .

Hope this helps.

regards,

Xiang Li

Former Member
0 Kudos

Mr Xiang,

Thanks for your reply,

Can you please elaborate your reply, I am not getting your points. To inform you, I have taken some fixed rows for showing the internal tables, lets say in page 6 rows and 4 headers are there. And there is another similar internal table which would come in the same page. At first it was difficult for me to populate the two internal tables in the same page with specified content areas without overlapping the data with each other or into footer areas. And this problem got solved when I came up with strategy to keep some fixed rows . But when I am keeping this fixed rows, there are some lines which remain blank. And what I think I have to go for witting some JavaScript with the relevant event. And also I tried to make the borders as 'None'  for the respective rows so that the empty rows would not be displayed, but this strategy is also not working as the lines are still displaying.

Now if you can help me witting the Javascript/ Formcalc for achieving my functionality.

Regards,

Sriyash

Former Member
0 Kudos

This message was moderated.