Distinguish ABAP between different SAP clients (Mandanten)


currently we have an SAP system with two different clients 002 and 004. My task is to write a program in ABAP to create a report on user assignments. The report will do basically the same thing on both clients. But I need to choose a different number of tables on different tables and on different clients. Depending on which client the user calling the report is registered with.
Question: Is there a way to distinguish ABAP code between different clients? For instance:

IF client = 002.
*dothis.
ELSE.
*dothatdifferentthing.
ENDIF.

Thanks in advance.

+3
source share
2 answers

The current client is available in the sy-mandt field .

For instance:

IF sy-mandt = '002'.
*dothis.
ELSE.
*dothatdifferentthing.
ENDIF.
+9

- - , , . , SY-MANDT, . ...

+5

Source: https://habr.com/ru/post/1774466/


All Articles