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

ALV Layout

Former Member
0 Likes
1,068

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
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,024

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
Read only

rachit_gupta1
Participant
0 Likes
1,024

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.

Read only

0 Likes
1,024

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.

Read only

0 Likes
1,024

Hi Marco,

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,025

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

Read only

0 Likes
1,024

Thanks, it worked with an implicit enhancement