03-15-2007 9:32 AM
hi.
how to retreive data from tables from other client to my client with the same table name
with regards
vinayaka
03-15-2007 9:35 AM
U need to use Client Specified option,....
then u can use mandt field in where clause..
When u use it , in select staement u can use mandt field in where clause..
DELETE [FROM] (<name>) [CLIENT SPECIFIED] <lines>.
where the field <name> contains the name of a database table defined in the ABAP Dictionary.
You can use the CLIENT SPECIFIED addition to disable automatic client handling.
It enables us to process data form other than the current client also ..
Normally in database for spfli table the data will be stored for all the clients..
But when u want to select data from database for spfli generally onli the data under the current client will be retrieved... But table in database contains data for all the cllients.
Try executing these codes u will come to know & compare the results..
800 is my current client...
*******************************************
data t_spfli type standard table of spfli with header line.
select *
from spfli <b>client specified</b>
into table t_spfli
where mandt = '100'.
loop at t_spfli.
write : / t_spfli-carrid, t_spfli-connid.
endloop.
*******************************************
data t_spfli type standard table of spfli with header line.
select *
from spfli client specified
into table t_spfli
where mandt ne '800'.
loop at t_spfli.
write : / t_spfli-carrid, t_spfli-connid.
endloop.
reward if it helps u,,,
sai ramesh
Message was edited by:
Sai ramesh
03-15-2007 9:35 AM
U need to use Client Specified option,....
then u can use mandt field in where clause..
When u use it , in select staement u can use mandt field in where clause..
DELETE [FROM] (<name>) [CLIENT SPECIFIED] <lines>.
where the field <name> contains the name of a database table defined in the ABAP Dictionary.
You can use the CLIENT SPECIFIED addition to disable automatic client handling.
It enables us to process data form other than the current client also ..
Normally in database for spfli table the data will be stored for all the clients..
But when u want to select data from database for spfli generally onli the data under the current client will be retrieved... But table in database contains data for all the cllients.
Try executing these codes u will come to know & compare the results..
800 is my current client...
*******************************************
data t_spfli type standard table of spfli with header line.
select *
from spfli <b>client specified</b>
into table t_spfli
where mandt = '100'.
loop at t_spfli.
write : / t_spfli-carrid, t_spfli-connid.
endloop.
*******************************************
data t_spfli type standard table of spfli with header line.
select *
from spfli client specified
into table t_spfli
where mandt ne '800'.
loop at t_spfli.
write : / t_spfli-carrid, t_spfli-connid.
endloop.
reward if it helps u,,,
sai ramesh
Message was edited by:
Sai ramesh
03-15-2007 9:37 AM
03-15-2007 9:40 AM
data t_spfli type standard table of spfli with header line.
select *
from spfli client specified
into table t_spfli
where mandt = '100'.
loop at t_spfli.
write : / t_spfli-carrid, t_spfli-connid.
endloop.
*******************************************
data t_spfli type standard table of spfli with header line.
select *
from spfli client specified
into table t_spfli
where mandt ne '800'.
loop at t_spfli.
write : / t_spfli-carrid, t_spfli-connid.
endloop.
reward if it helps u...
sai ramesh
03-15-2007 9:37 AM
Hi,
If you want to retrive the data then you can use <b>client specified</b>.
Regards,
Sandhya
03-15-2007 9:41 AM
Hi,
Look at the following example
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.
Reward if helpful.
Regards,
Sandhya
03-15-2007 9:48 AM
Hi.....
DATA T_SFLIGHT TYPE SFLIGHT OCCURS 0 WITH HEADER LINE.
SELECT *
INTO TABLE T_SFLIGHT
FROM SFLIGHT CLIENT SPECIFIED
WHERE MANDT = '000'.
LOOP AT T_SFLIGHT.
WRITE:/ T_SFLIGHT-CARRID,
T_SFLIGHT-CONNID,
T_SFLIGHT-FLDATE.
ENDLOOP.
Reward points if useful......
Suresh......