2010 Feb 08 1:40 PM
Hi there,
Is there a way to specify a MANDT globally for all SELECT statements in the report?
Cheers,
Bart
2010 Feb 08 2:28 PM
2010 Feb 08 2:28 PM
SYST-MANDT (aka sy-mandt) is set globally at log on, and is inserted into the Native SQL generated by your SAP ABAP SELECT..WHERE statements. Generally, then, we don't use the CLIENT SPECIFIED addition, at least not without including an explicit value for the MANDT/CLIENT table in our where clause.
What are you trying to do, actually?
2010 Feb 08 2:33 PM
If i understand correctly, you are looking to fetch the data from another clients also with the same select statements. If so you can try below: CLIENT SPECIFIED
Below code copied from SAP HELP: http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb39c4358411d1829f0000e829fbfe/content.htm
REPORT demo_select_dynamic_database.
DATA wa TYPE scarr.
DATA name(10) TYPE c VALUE 'SCARR'.
SELECT *
INTO wa
FROM (name) CLIENT SPECIFIED
WHERE mandt = '000'.
WRITE: / wa-carrid, wa-carrname.
ENDSELECT.
2010 Feb 08 2:51 PM
Hi,
I have test data on client 300 whereas I can write/edit reports only on client 200.
I know 2 things:
- I can use CLIENT SPECIFIED in SELECT to be able to put MANDT in WHERE clause
- I can be logged on two clients simultaneously and switch between windows
But I'm trying to make my life simpler. Instead of switching windows or adding MANDT=XXX to every SELECT clause I'd like to specify it globally for whole report and it would cause all selects to work on a specified client.
Edited by: Bartosz Bijak on Feb 8, 2010 3:56 PM
2010 Feb 08 3:37 PM
It may not possible since you already have MANDT field inthe table from where you are trying to fetch the data.