Application Development 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: 

ALV Layout

former_member249109
Active Participant
0 Kudos

Hi,

Does anyone know if it's possible to restrict the naming of ALV layouts to a certain pattern?  For instance we've done this with programs by implementing BAdI CTS_CURRENT_PROJECT and comparing the program name against certain patterns which are stored in a Z table. However, we are not able to find a way to do this whi ALV layouts.

Any ideas?

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Try to put a break-point to FM as LT_FC_SAVE (or similar FM/Class) to identify an implict enhancement option to use, you could raise WRONG_INPUT error with a message when IS_VARIANT doesnt comply with your rules (and if I_TOOL = 'LT') at start of form, you could also yadd some AUTHORITY CHECK to drive your checks (*)

NB: You can find this and similar spots, thru where-used of EXPORT TO DATABASE LTDX(LT)

Regards,

Raymond

(*)  you must, as you don't really want to raise error when system as user DDIC or SAPxxx imports some SP, Add-on or note

5 REPLIES 5

rachit_gupta
Participant
0 Kudos

Hi,

You can add a logic to get the desired name to a variable. Then try this 

'REUSE_ALV_GRID_LAYOUT_INFO_GET'

DATA: ls_var TYPE disvariant.

       CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'

         IMPORTING

           es_variant    = ls_var

         EXCEPTIONS

           no_infos      = 1

           program_error = 2

           OTHERS        = 3.

0 Kudos

Hi Rachit,

Thanks for your anwser but I want to restrict this in any ALV layout in the system, not just to a specific program.

0 Kudos

Hi Marco,

You can try table LTDX. A small program to manipulate the values stored in it may help.

raymond_giuseppi
Active Contributor
0 Kudos

Try to put a break-point to FM as LT_FC_SAVE (or similar FM/Class) to identify an implict enhancement option to use, you could raise WRONG_INPUT error with a message when IS_VARIANT doesnt comply with your rules (and if I_TOOL = 'LT') at start of form, you could also yadd some AUTHORITY CHECK to drive your checks (*)

NB: You can find this and similar spots, thru where-used of EXPORT TO DATABASE LTDX(LT)

Regards,

Raymond

(*)  you must, as you don't really want to raise error when system as user DDIC or SAPxxx imports some SP, Add-on or note

0 Kudos

Thanks, it worked with an implicit enhancement