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

UPLOAD DATA FROM INT-TABLE TO ORACLE TABLE...

Former Member
0 Likes
374

Dear all,

I am working on uploading data from sap internal table to oracle table through DBCO conection. I have the code to read data from the oracle table but need some help to upload data..any sample codes would be helpful. let me share what i have right now.

This is getting data into SAP I want to get data out of SAP to ORACLE.

REPORT ZTEST2.

DATA: BEGIN OF IT_FLAT2 ,

MATERIAL(18),

ALTERNATIVE(2),

COMPONENT(18),

HM_ROLL_PRACTICE(3),

END OF IT_FLAT2.

DATA: COUNT TYPE i.

COUNT = 0.

EXEC SQL.

CONNECT TO 'RPDDBP02-MRP' AS 'V'

ENDEXEC.

EXEC SQL.

SET CONNECTION 'V'

ENDEXEC.

*- Get the data from MS-SQL Server

EXEC SQL.

open BOM_LINK1 for

select

material,

alternative,

component,

hm_roll_practice

from BOM_LINK

ENDEXEC.

DO.

EXEC SQL.

FETCH NEXT BOM_LINK1 into :IT_FLAT2-MATERIAL, :IT_FLAT2-ALTERNATIVE,

:IT_FLAT2-COMPONENT, :IT_FLAT2-HM_ROLL_PRACTICE

ENDEXEC.

IF sy-subrc = 0.

COUNT = COUNT + 1.

PERFORM loop_output.

ELSE.

EXIT.

ENDIF.

ENDDO.

WRITE: / COUNT.

EXEC SQL.

CLOSE BOM_LINK1

ENDEXEC.

&----


*& Form LOOP_OUTPUT

&----


  • Output

----


FORM loop_output .

WRITE: /1 IT_FLAT2-MATERIAL, 30 IT_FLAT2-ALTERNATIVE, 38

IT_FLAT2-COMPONENT, 80 IT_FLAT2-HM_ROLL_PRACTICE.

CLEAR IT_FLAT2.

ENDFORM. " LOOP_OUTPUT

1 REPLY 1
Read only

Former Member
0 Likes
332

VJ RJ,

Your req seems a bit unclear. Can try to explain more?

What DB system does your current SAP system use - MS SQL or Oracle?

You are simply trying to write this data to a flat file - it looks like - yes?