Publishing Objects in Container and offering toolbox directly
I have a container for showing list of published object for a material.
I have two cases:
Case 1. when the material has publihed objects, I list all attachments in my container. This case works OK. I am using this code:
call method go_myobject->start_service_direct EXPORTING ip_service = 'VIEW_ATTA' is_object = my_object io_container = my_container EXCEPTIONS NO_OBJECT = 1 OBJECT_INVALID = 2 EXECUTION_FAILED = 3.
( For reference see: http://help.sap.com/saphelp_47x200/helpdata/EN/ee/f36a41a33111d389c80000e8216438/frameset.htm )
Case 2.- When object has no attachments, The previous method return exception 3, So, then I wish show the toolbox inside the container for allowing insert new attachments, notes, etc.
In this case I am using the code:
call method go_myobject->display_toolbox EXPORTING io_container = my_container is_object = my_object.
( For reference see:
This works ok, the toolbar appears in container and works OK,
The problem is that after appeareance of Toolbar, next time I am trying show attachments for another object, like in case 1, the container keeps filled with last toolbox and I cant remove it.
I need to remove that toolbox, and fill the container again with data like in case 1. Or another solution for empty the container always before show any object inside.
The container is referenced TYPE REF TO cl_gui_custom_container. I cant see any method for refresh, clear, empty it.
Any idea how to do this?
best regards and thank you for help.