‎2006 Nov 28 10:06 AM
Is it possible to validate the CONTAINER_NAME when we create a custom container on a screen.Is there any table where this name is stored.
‎2006 Nov 28 11:02 AM
Hi Ravi,
What do you mean by container name... is it the one which we supply in the screen painter for a control area?
‎2006 Nov 28 11:40 AM
yes it is that name only.I want to validate that name for correctness.is it possible.
‎2006 Nov 28 2:01 PM
Hi Ravi,
You can get the screen fields for a screen using FM RS_SCREEN_IMPORT.
then you can validate the container name from the export parameter F_G.
hope this helps.
Regards,
kinshuk
‎2006 Nov 28 11:50 AM
HI,
We create the Container in the Screen and we give the name to that container
Declare it as
go_custom_container TYPE REF TO cl_gui_custom_container.
Then you can write the code like ...
IF go_custom_container IS INITIAL.
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
Regards
Sudheer
‎2006 Nov 28 12:20 PM
how can I validate whether the name 'ALV_CONTAINER' is correct or not.is there any table that stores this name.
‎2006 Nov 28 2:06 PM
Hello Ravi,
This container name should not be validated. In general, the name of the screen element does not change. Therefore, it is usually hardcoded as shown in the example above.
And I believe this is the recommended practice. If you try to validate such screen elements, it will unnecessarily increase the runtime of your application.
However, for reasons of technical interest, Kinshuk's solution above will do the trick for you.
Regards,
Anand Mandalika.