Skip to Content
0
Former Member
May 17, 2006 at 12:23 PM

data upload from sap to oracle

16 Views

hi friends,

we r uploading and downloading data from SAP to orcale table

we have used this code [down i am giving only sql statements ]

plz some one anlayse the code n tell me wat its exactly doing

1.EXEC SQL.

SELECT VBELN INTO :WA_VBELN FROM ZASCENT@ZASCENTLINK

WHERE VBELN = :ITAB_ASCENT-VBELN AND

MANDT = :SY-MANDT

ENDEXEC.

2. EXEC SQL.

INSERT INTO ZASCENT@ZASCENTLINK VALUES

( :WS_ZASCENT-MANDT,

:WS_ZASCENT-VBELN,

:WS_ZASCENT-NAME1,

:WS_ZASCENT-STRAS,

:WS_ZASCENT-STR_SUPPL1,

:WS_ZASCENT-STR_SUPPL2,

:WS_ZASCENT-CITY1,

:WS_ZASCENT-REGION,

:WS_ZASCENT-POST_CODE1,

:WS_ZASCENT-COUNTRY,

:WS_ZASCENT-TEL_NUMBER,

:WS_ZASCENT-CONTACT,

:WS_ZASCENT-STATUS,

:WS_ZASCENT-PRONO,

:WS_ZASCENT-ANZPK,

:WS_ZASCENT-BTGEW,

:WS_ZASCENT-DATE1,

:WS_ZASCENT-DATE2,

:WS_ZASCENT-DATE3 )

ENDEXEC.

EXEC SQL.

COMMIT

ENDEXEC.

IF sy-subrc = 0.

WRITE:/ itab_ascent-vbeln,'INSERTED SUCCESSFULLY INTO TABLE ZASCENT'.

ENDIF.

COMMIT WORK.

3.EXEC SQL.

OPEN c1 FOR

SELECT VBELN,

NAME1,

STRAS,

STR_SUPPL1,

STR_SUPPL2,

CITY1,

REGION,

POST_CODE1,

COUNTRY,

TEL_NUMBER,

CONTACT,

STATUS,

PRONO,

ANZPK,

BTGEW,

DATE1,

DATE2,

DATE3

FROM ZASCENT@ZASCENTLINK

WHERE MANDT = :SY-MANDT AND

STATUS = '1'

*WHERE VBELN = '0080036329'

ENDEXEC.

DO.

EXEC SQL.

FETCH NEXT c1 INTO

:ITAB_ASCENT-VBELN,

:ITAB_ASCENT-NAME1,

:ITAB_ASCENT-STREET,

:ITAB_ASCENT-STR_SUPPL1,

:ITAB_ASCENT-STR_SUPPL2,

:ITAB_ASCENT-CITY1,

:ITAB_ASCENT-REGION,

:ITAB_ASCENT-POST_CODE1,

:ITAB_ASCENT-COUNTRY,

:ITAB_ASCENT-TEL_NUMBER,

:ITAB_ASCENT-CONTACT,

:ITAB_ASCENT-STATUS,

:ITAB_ASCENT-PRONO,

:ITAB_ASCENT-ANZPK,

:ITAB_ASCENT-BTGEW,

:ITAB_ASCENT-DATE1,

:ITAB_ASCENT-DATE2,

:ITAB_ASCENT-DATE3

ENDEXEC.

IF sy-subrc = 0.

APPEND itab_ascent.

CLEAR itab_ascent.

ELSE.

EXIT.

ENDIF.

ENDDO.

thanks ,

soorya