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: 

FM to know if you are in Dev, QA or prod

dany_charbonneau
Explorer
0 Kudos

Hi all,

I'm looking for a FM to know if the running system is dev, qa or Prod ??

Thanks

1 ACCEPTED SOLUTION

Former Member

Check the table T000 field CCCATEGORY to see if the system is PROD etc.

  • run program in test system only

  SELECT SINGLE cccategory FROM t000
                INTO t000-cccategory
                WHERE mandt EQ sy-mandt.
  IF t000-cccategory EQ 'P'.
    MESSAGE e637.
  ENDIF.

Hope this helps.

Cheers

A

8 REPLIES 8

Former Member
0 Kudos

CASE sy-sysid.

WHEN 'DEV'.

-


WHEN 'QAS'.

-


WHEN 'PRD'.

-


ENDCASE.

Former Member
0 Kudos

Use FM TWP_GET_SYSTEM_INFORMATION

Lokesh

Pls. reward helpful posts

dany_charbonneau
Explorer
0 Kudos

Hi,

thanks for the answers but both this methods check SY-SYSID which is the system name. If my system name is "AAA" i cannot know if this is a prd or a dev system... I cannot rely on the fact that the system names are hardcoded...

0 Kudos

Hi Dany,

Check with your basis person. They must have created a framework for the different servers and their clients. Generally a bespoke table is maintained to store such details.

If they have not maintained any such table, in that case there is no other option apart from hardcoding.

Lokesh

Pls. reward if it helps.

Former Member
0 Kudos

what is so hard to remember if the system with the name "AAA" is a dev, test or prod system? system names dont change a lot, so you really can try to learn those 3 abbreviations.

0 Kudos

Hi Florian,

this is because I want to be able to execute my program within different installations, not only at one SAP customer. "AAA" could be dev for 1 installation and prod for another customer.

Thanks.

Former Member

Check the table T000 field CCCATEGORY to see if the system is PROD etc.

  • run program in test system only

  SELECT SINGLE cccategory FROM t000
                INTO t000-cccategory
                WHERE mandt EQ sy-mandt.
  IF t000-cccategory EQ 'P'.
    MESSAGE e637.
  ENDIF.

Hope this helps.

Cheers

A

dany_charbonneau
Explorer
0 Kudos

Exactly what I was looking for !! Thanks !!