cancel
Showing results for 
Search instead for 
Did you mean: 

delete alv table from view dynamically

Former Member
0 Kudos

Hi WD guru's,

I do not have much experience with WD ABAP, but I have to finish one application.

I need to know how to delete / hide or somehow make invisible alv table if there is no data in the table, table is generated dynamically, and its content depends on submitted report (chosen from drop-down list in view) Binding and selection of data is done in one method of COMPONENTCONTROLER. I managed to remove the child note from context and show message that no data were selected, but the table is still shown on the view (data in the table is from previously run report)

method in COMPONENTCONTROLER,

takes input data from view ("web site")

submits report (FM submit_report) also is there any way how to put errors from submitted reports to table and hadle

them myself? thats probably for other thread

reads report result from memory

if there is list in memory

creates context node / child for alv table

creates fieldcatalog

bind data

else

this is where I would like to delete / hide table, if there is no data and the node is created, currently I just show

message and remove child from root element, but the shown table is not deleted from web site / view

endif

endmethod.

I have no idea how to do this, every suggestion will be welcomed and appreciated

Thank You

Best Regards

Martin

Accepted Solutions (0)

Answers (2)

Answers (2)

gill367
Active Contributor
0 Kudos

Check the size of the node which is mapped to DATA node of ALV compoenent

and control the visiblity of the viewcontainer .

data nd type ref to if_wd_Context_node.
nd = wd_cotnext->get_child_node(  ' <Node name>' ).

data count type i.
count = nd->get_element_count(  ).

if count eq 0.

"hide the viewcontainer.

else 

"make it visible.

endif.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi

thanks both of you.

sarbjeet singh ... just to be clear

to hide the UIcontainer ...

which method should I call

??

nd->set_attribute_property

??

Thanks

Madhu2004
Active Contributor
0 Kudos

Hi Martin,

To put it simple, Create a attribute in context and bind it to the visible property of the Viewcontainer UI element holding the ALV.

Put the default value as X.

If the data and node is initial, Set this attribute to abap_false using the set_attribute method.

Hope it helps.

Regards,

Madhu

Former Member
0 Kudos

Hi ,

Bind the visibility property of the viewContainer to a context attribute of type WDUI_VISIBILITY.

Set this attribute with values as per your requirement as told in the above post.

CL_WD_UIELEMENT=>E_VISIBLE-NONE ---for hiding

CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE---for displaying.

Thanks,

Aditya.

Former Member
0 Kudos

One of the way that i am thinking is to embed the ALV_table interface view in your view using a ViewContainerUIElement.

and set the visibility of the ViewContainerUIElement based on your requirement to visible or none.