Skip to Content
1

ABAP: Figure out productive system

Apr 05, 2017 at 03:37 AM

124

avatar image
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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Gerrit Beukema Apr 05, 2017 at 05:44 AM
5

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.

Show 7 Share
10 |10000 characters needed characters left characters exceeded

This is the correct answer.

0

Sample implementation is in:

cl_abap_demo_services=>is_production_system( )

:-)

2

Grrr, I deliberately didn't show it ;-)

4
Former Member

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

0

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

1

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!

0

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.

2
avatar image
Former Member Apr 05, 2017 at 05:35 AM
-3

Hi Mario,

you can try with the system variable SY-SYSID.

Regard's,

Samir

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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?

0