‎2006 Oct 05 6:59 PM
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
‎2006 Oct 05 7:30 PM
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?