Application Development and Automation 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: 
Read only

make select to another mandt

Former Member
0 Likes
1,500

i in dev(DVP) and i want to make select to d.b table in prod(PRD)

i know in oracle i can doit, how i can make select from dev to prod.

like

select * from mrara@PROD.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,362

Hi,

It is not possible in SAP. Because any one can damage the production data.

Still if you want to fetch those data, I guess search for RFC function modules, using which providing all the Production server details etc.. it may fetch the data. I am not sure about which RFC or BAPI is responsible for the same.

Regards,

Nangunoori.

i in dev(DVP) and i want to make select to d.b table in prod(PRD)

i know in oracle i can doit, how i can make select from dev to prod.

like

select * from mrara@PROD.

5 REPLIES 5
Read only

Former Member
0 Likes
1,363

Hi,

It is not possible in SAP. Because any one can damage the production data.

Still if you want to fetch those data, I guess search for RFC function modules, using which providing all the Production server details etc.. it may fetch the data. I am not sure about which RFC or BAPI is responsible for the same.

Regards,

Nangunoori.

Read only

Former Member
0 Likes
1,362

Hello

One option would be to try FM RFC_READ_TABLE using destination PRD.

A search of the forum will find some more info re this FM.

Regards

Greg Kern

Read only

Former Member
0 Likes
1,362

Hi,

U have to use RFC only.Mention destination of production server.

Read only

Former Member
0 Likes
1,362

Hi,

The only way u could do such thing is if both your dev and prod were in the same system (u can usually identify the system by those 3 letters - DVP, PRD, etc.) and different clients - then u could write "select * from mara client specified where mandt = XXX(prod client No.) and.... ", but almost always the prod system is on a different system than the dev system (as in your case also - different systems: DVP and PRD) and usually it is also on a different server, so this is not an option.

Now u have some options: u can write native sql and mention the destination db server - that would be more like Oracle that u mentioned, or u can stay completely in ABAP by using RFC function. For that i think it would be best if u use RFC_READ_TABLE that someone already mentioned, but u must use "call function RFC_READ_TABLE destination #####" - find out what is the logical system defined in your landscape for the prod system and check if it has a configured RFC connection (tr. SM59, or consult your basis), and than u can get table lines from tables in prod system.

All the best

Igal

Read only

former_member189420
Active Participant
0 Likes
1,362

Hi,

If the database in backend is oracle then you know how to query in oracle. So you can go for writing native sql in ABAP.

REPORT demo_native_sql.

DATA: BEGIN OF wa,
        connid   TYPE spfli-connid,
        cityfrom TYPE spfli-cityfrom,
        cityto   TYPE spfli-cityto,
      END OF wa.

DATA c1 TYPE spfli-carrid VALUE 'LH'.

EXEC SQL PERFORMING loop_output.
  SELECT connid, cityfrom, cityto
  INTO   :wa
  FROM   spfli
  WHERE  carrid = :c1
ENDEXEC.

FORM loop_output.
  WRITE: / wa-connid, wa-cityfrom, wa-cityto.
ENDFORM.

Hope this helps. But, take care of what you are doing.

Thanks & Regards,

Anand Patil