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: 

ABAP: Figure out productive system

Former Member

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?

1 ACCEPTED SOLUTION

former_member182466
Contributor

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.

10 REPLIES 10

Hi Mario,

you can try with the system variable SY-SYSID.

Regard's,

Samir

0 Kudos

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?

former_member182466
Contributor

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.

0 Kudos

This is the correct answer.

Sample implementation is in:

cl_abap_demo_services=>is_production_system( )

🙂

-- Tomas --

Grrr, I deliberately didn't show it 😉

0 Kudos

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

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

0 Kudos

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!

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.