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

Instead of BAPI

Former Member
0 Likes
729

Dear all,

Actually i m using bapi to access .net table.

Means through bapi i send data from sap to .net table & also take data from .net to SAP.

now i want to take data from oracle or send data to oracle.

means, plz give source/solution to access oracle server to get data or send data.

Thanx in advance

Edited by: Shalini Singh on Jun 5, 2009 11:04 AM

Edited by: Rob Burbank on Jun 5, 2009 4:00 PM

5 REPLIES 5
Read only

Former Member
0 Likes
695

Hi

The BAPI is a rfc function module, so u can create an your own Z-rfc, or (if SAP database is Oracle too) u can create a DB-link beetween SAP oracle and not SAP oracle database.

Max

Read only

0 Likes
695

If you dont mind then can u elobrate me in detail.

Read only

0 Likes
695

Hi

Detail? For DBlink?

DBlink is bridge allows to write a query in a databse in order to read the other database.

But u need to ask your basis in order to create a DBlink beetween two oracle database, it should be an easy operation, but I suppose only your basis has the authorizations to do it: it's a typical BASIS operation.

After creating the DBlink you can write a native sql in not SAP Oracle database in order to read SAP table, and/or create an abap program in native sql in order to read not SAP Oracle database.

U can update the tables by a DBlink, so it can be very dangerous if the SAP tables are standard one, and I suppose so because you're speaking about BAPIs.

See the SAP help for sql native

Max

Read only

0 Likes
695

REPORT ZTEST_SUBMIT.

*REPORT Z_TEST_DBCON.

PARAMETERS DBS TYPE DBCON-CON_NAME.

DATA: ABC(20) TYPE C.

DATA:W_FLG TYPE I VALUE '9'.

DATA DBTYPE TYPE DBCON_DBMS.

*SELECT SINGLE DBMS FROM DBCON INTO DBTYPE WHERE CON_NAME = DBS.

DATA:WA TYPE STRING,

EMP TYPE STRING.

*data:begin of itab OCCURS 0,

  • a like pa0001-pernr,

  • b(2) TYPE n,

  • c type sy-datum,

  • END OF itab.

*DATA:ITAB LIKE

TRY.

EXEC SQL.

CONNECT TO :DBS

ENDEXEC.

*UPDATE LPR_LEAVEPLAN_TRN SET FLOWLEVEL = W_FLG WHERE EMP_ID = '11200010'

*itab-a = '11200010'.

*itab-b = 36.

**itab-c = sy-datum.

*APPEND itab.

EXEC SQL.

OPEN DBCUR FOR

UPDATE LPR_LEAVEPLAN_TRN SET FLOWLEVEL = 9 WHERE EMP_ID = '11200010'

  • COMMIT WORK ;

ENDEXEC.

*

*IF SY-SUBRC = 0.

  • WRITE 'S'.

  • WRITE:/ SY-DBCNT.

*ENDIF.

EXEC SQL.

COMMIT

ENDEXEC.

EXEC SQL.

CLOSE DBCUR

ENDEXEC.

*----


EXEC SQL.

OPEN DBCUR FOR

*SELECT a FROM test1 WHERE b = 36

SELECT EMP_ID FLOWLEVEL FROM LPR_LEAVEPLAN_TRN WHERE EMP_ID = '11200010'

  • UPDATE LPR_LEAVEPLAN_TRN SET OVERALL_STATUS = 'Y' WHERE EMPID = '11200010'.

*COMMIT WORK.

ENDEXEC.

*

DO.

EXEC SQL.

FETCH NEXT DBCUR INTO :EMP

ENDEXEC.

IF SY-SUBRC <> 0.

EXIT.

ELSE.

WRITE:/10 EMP.

ENDIF.

ENDDO.

EXEC SQL.

CLOSE DBCUR

ENDEXEC.

*----


EXEC SQL.

DISCONNECT :DBS

ENDEXEC.

CATCH cx_sy_native_sql_error.

MESSAGE `Error in Native SQL.` TYPE 'I'.

ENDTRY.

My Code is above.

Here data is not Updated.

Plz help me

Read only

Former Member
0 Likes
695

BAPI's support Web service methodology by default. So, I guess you can directly call the BAPI/ Web service from oracle, and tweak accord to your requirement.