Skip to Content
avatar image
Former Member

ABAP: Figure out productive system

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 05, 2017 at 05: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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • 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

    Add comment
    10|10000 characters needed characters exceeded