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: 

retrieve data from tables of other client

Former Member
0 Kudos

hi.

how to retreive data from tables from other client to my client with the same table name

with regards

vinayaka

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

0 Kudos

can any one send me the code for that

0 Kudos

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

Former Member
0 Kudos

Hi,

If you want to retrive the data then you can use <b>client specified</b>.

Regards,

Sandhya

Former Member
0 Kudos

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

Former Member
0 Kudos

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......