on 02-04-2014 12:13 PM
Hi,
I have a subform with name formz007 with only one field.
This subform is binded to table data and the field is binded to the field of table data.
Repeat subform with min 1 is applied to subform.
I need to hide the subform when the table data is empty.
Please provide me the java script or form calc and the event in which I need to write.
I tried all the ways but I'm helpless.
Hello Swat,
There are two ways in which you can hide the subform dynamically.
1.Check the records of the table, if its '0' , then pass a flag to the form.
2.Now in the form add a text field(ABC) above the subrofmz007 and bind this flag to that textfield.Text field will be hidden.
3.Now write the formcalc in the event:FormReady of the subform :
if($.parent.ABC == 'X');
$.presence = "hidden"
endif
the other way is directly write the formcalc script in the calculation event of the subform.Hope you know the field(mandatory) which fills,if that field doest fill then the table is hidden.
if (Not(HasValue($.subformz007.rawValue))) then
$.presence = "hidden"
endif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
In the form interface or in your driver program count number of records by using .
Describe table I_TAB lines lv_lines.
if lv_flines = 0 .
lv_nooutputflag = 'X'.
endif.
Pass this parameter lv_nooutputflag to Data view of form.
In the same subform (Table ) pass you lv_nooutputflag. Make it hidden from layout.
Now in your subform initialize, form ready and layout ready even
Write Java script or Calc
If (lv_nooutputflag == 'X')
$.presence = "hidden".
endif
Thanks & Regards,
Abhijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Swat,
There are many ways to achieve this.
One easy way is to send a flag as an importing parameter in the Form Interface. It goes like this.
Set the flag when the table is empty as below in ABAP.
IF int_table IS INITIAL.
flag = 'X'.
ENDIF.
Now in Layout, drag and drop the flag parameter from DATA VIEW into formz007 sub form.
Now write the below Java script on formz007 Sub form in Initialize event.
if ( this.flag.rawvalue == "X" )
{
this.presence = "hidden";
}
The script will hide the sub form(entire table) when the flag is set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.