01-15-2015 9:46 AM
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?
01-16-2015 7:30 AM
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
01-15-2015 10:05 AM
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.
01-15-2015 10:11 AM
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.
01-16-2015 3:52 AM
Hi Marco,
You can try table LTDX. A small program to manipulate the values stored in it may help.
01-16-2015 7:30 AM
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
02-04-2015 11:27 AM