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

Need to start a program in Oracle System (External) from sap program

Former Member
0 Likes
965

Hi guys,

I need to start a program in another oracle based system from sap program by writing native sql statements.

Does anyone have idea how to do this.

Rgds,

Ram

Hi guys,

I need to start a program in another oracle based system from sap program by writing native sql statements.

Does anyone have idea how to do this.

Rgds,

Ram

8 REPLIES 8
Read only

Former Member
0 Likes
935

Hi,

Call to oracle in SAP can be done using

EXEC QQL

ENDEXEC

Try below link.

mk:@SAPHTML://Gz1efb3J0Wi20000dYCIRG/HTML000001.htm

Regards

Amole

Read only

Former Member
0 Likes
935
Read only

Former Member
0 Likes
935

Hi amol,

Thanks for your reply. The link cannot be opened??

mk:@SAPHTML://Gz1efb3J0Wi20000dYCIRG/HTML000001.htm

Read only

Former Member
0 Likes
935

Hi Ram,

1. DB Link

with the help of basis team,

if some db link is created in R/3 database,

then something can be done.

using @dblinkname.

2. eg.

report abc.

exec sql.

BEGIN

MYPROC@mydblink('2102');

COMMIT;

END;

endexec.

regards,

amit m.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
935

Hi,

Kindly reward points by clicking the star on the left of reply,if it helps.

Code Sample for creating table and inserting values

REPORT zzz_jaytest.

  • Creating a table. No need of giving semicolon or colon for each statement.

exec sql.

create table stu_det ( regno char(10) primary key,

name char(20) not null,

total number(3) )

endexec.

  • Inserting first record

exec sql.

insert into stu_det values ('R1000', 'Ganesh', 500)

endexec.

  • Inserting Second record

exec sql.

insert into stu_det values ('R1001', 'Murugan', 480)

endexec.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
935

Hi,

Here is another sample for procedures.Kindly reward points by clicking the star on the left of reply,if it is useful.

Code Sample for writing a procedure with input and output parameters
REPORT zzz_jaytest.

* Getting the regno and total as input parameters
PARAMETERS : p_regno(10) TYPE c DEFAULT 'R1000',
                           p_total     TYPE i.

data : v_total type i.

* In this procedure, we are updating the total of a regno given as input.
* Here two parameters used in the procedure are input parameters.
* We are updating the record of regno entered in selection screen and
* adding the total entered to the already existing total. We have to give semicolon 
* for the statement inside procedure.


exec sql.
CREATE or replace PROCEDURE PROC1 ( p_regno in char, p_total in number )
IS
    BEGIN
      UPDATE stu_det SET total = total + p_total where regno = p_regno;
    END;
endexec.

* This is the code to execute the procedure for update.
* While executing the procedure, the parameter variable should be
* preceded with colon  :

EXEC SQL.
  EXECUTE PROCEDURE PROC1 ( in :p_regno, in :p_total )
ENDEXEC.

* In this procedure, we are selecting the details for the regno entered
* as input. Here p_regno is input parameter and v_total is used as output
* parameter. So that we can use the retrieved value of v_total in our
* ABAP program

exec sql.
CREATE or replace PROCEDURE PROC2 (p_regno in char, v_total out char)
IS
    BEGIN
      select total into v_total from stu_det
                         where regno = p_regno;
    END;
endexec.

* This is the code to execute second procedure.
EXEC SQL.
  EXECUTE PROCEDURE PROC2 ( in :p_regno, out :v_total )
ENDEXEC.

write : / 'Total of ', p_regno, ' is ', v_total.

Read only

Former Member
0 Likes
935

Thanks for all your replies. I will definitely reward the points.

Can you pls help me out to get from SAP to external oracle system.

I have followed the following steps.

1. In DBCO transaction i have entered the logical name of db, userid and password on oracle system and connect info.

Is this enough to get connected to external Oracle system??

I have port number and host name of external Oracle system. Where should i give these values to get connection.

Thanks in advance.

Rgds

Ram

Read only

0 Likes
935

Hi again,

1. Basis Team

Their help is a must.

They will do something on the server

(for this extra connection)

(apart from table entry)

2. They will make the connection string

on the server so that

the SERVER can connect to the external oracle system.

(in that they will specify the port number and host name)

regards,

amit m.