04-05-2017 4:37 AM
HI all,
I have to develop an ABAP that should be delivered to several customers.
This ABAP should only run on the development and testsystem. Not on the productive system. So I need during runtime of the ABAP an indicator if the users is trying to run the ABAP on a productive system.
As the sy-host-name divers from customer to customer I can not write a statement like
if sy-host = 'PROD'.exit.endif.
I need an indicator for the runtime to figure out if the system is the productive system.
Is there any system-variable or something similar which I can use?
04-05-2017 6:44 AM
Read table T000 for the client the program is running in and check field CCCATEGORY, if the value is 'P' then it's a production client, provided basis set it all up correctly.
04-05-2017 6:35 AM
Hi Mario,
you can try with the system variable SY-SYSID.
Regard's,
Samir
04-05-2017 12:11 PM
Since he's already said it must work regardless of customer, and the sysid of production systems varies from customer to customer, that's not going to work, is it?
04-05-2017 6:44 AM
Read table T000 for the client the program is running in and check field CCCATEGORY, if the value is 'P' then it's a production client, provided basis set it all up correctly.
04-05-2017 6:59 AM
04-05-2017 7:14 AM
Sample implementation is in:
cl_abap_demo_services=>is_production_system( )
🙂
04-05-2017 7:20 AM
04-05-2017 10:54 AM
Hi all,
thanks for the replies. T000 ist the correct anser.
BUT > Unfortunatelly I am at the moment on a Q-System; but in T000 the CCCATEGORY value is 'P' 😞
So I can use T000 only restricted.
Many Thanks,
Regards
Mario
04-05-2017 12:40 PM
BUT > Unfortunatelly I am at the moment on a Q-System; but in T000 the CCCATEGORY value is 'P' 😞
Our Q system settings also had CCCATEGORY = 'P' because they are supposed to be production-like.
I asked our Basis team to set it to 'T'
BR, Suhas
04-05-2017 1:58 PM
Perhaps the best way is to have a table hardcoded with the sysid of the productive system - it seems you can't rely on anything!
04-05-2017 2:24 PM
I think the T000, CCCATEGORY check for P might find false positives (as Q systems, I experience that too) but does not miss real production systems. Therefore not bad, if you can live with the false positives.