05-21-2015 11:35 AM
Hi experts,
I have a requirement Interface b/w SAP to NON SAP(MS SQL DB) interface......
plzzzzzz share me if how to work with it and let me know is there any standard BAPI's or RFC
what to use and how to use in this scenario
Thanks in advance
Thirup
05-21-2015 11:43 AM
hi thirup,
Interface between SAP and NON-SAP is possible through IDOCs.
You will get plenty of information about IDOC on the internet.
Further if you specify particular requirement then we will try to give comments on it.
thanks.
05-21-2015 11:43 AM
hi thirup,
Interface between SAP and NON-SAP is possible through IDOCs.
You will get plenty of information about IDOC on the internet.
Further if you specify particular requirement then we will try to give comments on it.
thanks.
05-22-2015 2:45 AM
Hi Abdul,
Thanks for your response....
in my case we are not going with idocs as my client don't want xi like middle-wares....
sooo in this case need solutions with out middle-wares. like xi, pi.......
tell bapis or rfc or can we go with zprogram.... interface
with the below code am able to get data from SQL db but not able to transfer soo plzz help with some solution
*&---------------------------------------------------------------------*
*& Report ZSQL_CONNECTION
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSQL_CONNECTION.
PARAMETERS dbs TYPE dbcon-con_name.
DATA carrid_wa TYPE scarr-carrid.
DATA dbtype TYPE dbcon_dbms.
TYPES: BEGIN OF TY_SQLDT,
name TYPE CHAR10,
PERS_NO TYPE CHAR8,
END OF TY_SQLDT.
DATA: it_SQLDT TYPE STANDARD TABLE OF TY_SQLDT,
WA_SQLDT TYPE TY_SQLDT,
IT_ZANKUR TYPE TABLE OF ZANKUR,
WA_ZANKUR TYPE ZANKUR,
exc_ref TYPE REF TO cx_sy_native_sql_error,
error_text TYPE string.
TRY.
EXEC SQL .
connect to :DBS
ENDEXEC.
CATCH cx_sy_native_sql_error INTO exc_ref.
error_text = exc_ref->get_text( ).
MESSAGE error_text TYPE 'E'.
ENDTRY.
TRY.
EXEC SQL PERFORMING append_wa.
SELECT
NAME,
PERS_NO
FROM PERS_INFO
INTO :wa_SQLDT
ENDEXEC.
CATCH cx_sy_native_sql_error INTO exc_ref.
error_text = exc_ref->get_text( ).
MESSAGE error_text TYPE 'E'.
ENDTRY.
LOOP AT it_SQLDT INTO wa_SQLDT.
write 😕 wa_SQLDT-name,':',wa_SQLDT-PERS_NO.
ENDLOOP.
PERFORM UPDATE_ZANKUR.
PERFORM UPDATE_SQL.
EXEC SQL.
DISCONNECT :DBS
ENDEXEC.
FORM APPEND_WA.
append wa_SQLDT to it_SQLDT.
endform.
*&---------------------------------------------------------------------*
*& Form UPDATE_ZANKUR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM UPDATE_ZANKUR .
LOOP AT IT_SQLDT INTO WA_SQLDT.
WA_ZANKUR-NAME = WA_SQLDT-NAME.
WA_ZANKUR-PNO = WA_SQLDT-PERS_NO.
APPEND WA_ZANKUR TO IT_ZANKUR.
ENDLOOP.
LOOP AT IT_ZANKUR INTO WA_ZANKUR.
INSERT INTO ZANKUR VALUES WA_ZANKUR.
ENDLOOP.
ENDFORM. " UPDATE_ZANKUR
*&---------------------------------------------------------------------*
*& Form UPDATE_SQL
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM UPDATE_SQL .
TRY.
EXEC SQL .
connect to :DBS
ENDEXEC.
CATCH cx_sy_native_sql_error INTO exc_ref.
error_text = exc_ref->get_text( ).
MESSAGE error_text TYPE 'E'.
ENDTRY.
CLEAR : IT_ZANKUR.
SELECT PNO
NAME
INTO CORRESPONDING FIELDS OF TABLE IT_ZANKUR
FROM ZANKUR.
TRY.
LOOP AT IT_ZANKUR INTO WA_ZANKUR.
EXEC SQL .
INSERT INTO PERS_INFO VALUES ('BHASKAR' , '00001024' )
ENDEXEC.
ENDLOOP.
CATCH cx_sy_native_sql_error INTO exc_ref.
error_text = exc_ref->get_text( ).
MESSAGE error_text TYPE 'E'.
ENDTRY.
ENDFORM. " UPDATE_SQL
05-22-2015 6:29 PM
Hi Thirup,
It seems you are missing commit statement after insert.
try to place commit like below after insert............
EXEC SQL.
COMMIT
ENDEXEC.
05-23-2015 11:48 AM