2019 Sep 05 11:46 AM
Hi All,
I want to copy records of table T000 to custom table. I am using below code:
DATA : it_t000 TYPE TABLE OF t000,
wa_t000 TYPE t000.
SELECT * FROM t000 INTO TABLE it_t000.
LOOP AT it_t000 INTO wa_t000.
MODIFY zt000 FROM wa_t000. ( here ZT000 is custom table copied from T000)
CLEAR wa_t000.
ENDLOOP.
The problem is T000 have MANDT field as primary key, which is copying only one record to my custom table which belongs to my current client.
I tried to change my custom table where i added 2 extra fields (char3) to my custom table to keep value of MANDT and kept serial no as primary key but now the custom table is facing issue while activating custom table with below error.
"Field MANDT of foreign key ZT000-MWAER not found :
"Data exists and the client-dependency has changed."
Please help.
Thanks,
Naren
2019 Sep 05 11:56 AM
Hello,
if you want to select cross Client you have to add the commands CLIENT SPECIFIED to the SQL Statements and then you have to add MANDT to the condition clause "MANDT GT 0" ... then u should get all records
Your target table should have one real and Logical Client field ... the real one to address the Client where the recordsets are stored and a Logical one (not DATATYP CLNT) to store the Client numbers.
Regards
holger
2019 Sep 05 11:56 AM
Hello,
if you want to select cross Client you have to add the commands CLIENT SPECIFIED to the SQL Statements and then you have to add MANDT to the condition clause "MANDT GT 0" ... then u should get all records
Your target table should have one real and Logical Client field ... the real one to address the Client where the recordsets are stored and a Logical one (not DATATYP CLNT) to store the Client numbers.
Regards
holger
2019 Sep 05 12:30 PM
Thanks Holger, for quick reply and solution .
can you answer one more question? do we have any BAPI to update T000?
2019 Sep 05 1:07 PM
No there is no Bapi this would not make sense T000 is very important table wrong updates or deletion will remove a client logically from the system. And you are not able to login anymo