Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Container name validation

Former Member
0 Likes
1,387

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.

6 REPLIES 6
Read only

Former Member
0 Likes
948

Hi Ravi,

What do you mean by container name... is it the one which we supply in the screen painter for a control area?

Read only

0 Likes
948

yes it is that name only.I want to validate that name for correctness.is it possible.

Read only

0 Likes
948

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

Read only

Former Member
0 Likes
948

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

Read only

0 Likes
948

how can I validate whether the name 'ALV_CONTAINER' is correct or not.is there any table that stores this name.

Read only

0 Likes
948

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.