The company I work for converted AP, AR and Payroll last year to SAP we still have the bulk of are data in the ISeries. We do all of our ordering from the ISeries but all Vendor maintence is done in SAP. So we have a cross reference file located in the ISeries but AP no longer uses the ISeries so sometimes the cross reference file gets out of sync with SAP. So I have been doing manual entry as needed the ISeries but have been wanting AP to take over this work. So I started looking around for away of allowing SAP to update a table on another system. In my research I came across some OSS notes which kind of pointed the way so I thought I would share what I found with anyone who might want to do this same thing.
First let me give you some OSS Notes to read 146624, 323151 there are others but these will point the way.
Next I need to tell you that currently were running SAP on an ISeries if your not running on an ISeries you will need to load some additional software on your system. See the above mentioned OSS notes for further details.
OK enough prelim let's get down to work.
First you have to tell SAP what system you want to intergrate with this is done thru transaction DBCO.
Create a new entry and you should see something like the following screen.
DB Connection this is where you will give it a name can be whatever you want.
DBMS I'm connecting to an ISeries so the value is DB4.
User Name give it a user name whose password does not change all of the time plus has access to the data library.
DB password key in the password twice.
Conn. info You must enter AS4_HOST= then enter system name of your ISeries that your attempting to access this is where I ran into a bit of a problem I had to ask my Basis guy for help to get the correct name you must seperate the two parameters with a ";" the second parameter is AS4_DB_LIBRARY= this is the data library where the file/files are located that you want to pull into your ABAP program. After you enter the data and save it you will need to start a listener job on the target ISeries. Enter the following command
"STRTCPSVR SERVER(*EDRSQL)". Now if you want to test this configuration run the following ABAP program adbc_test_connection. If everything works then were ready to move forward if not go and review the OSS notes I listed above.
The following is some code to read an external database file.
First I am creating an internal table to hold the results.
data: begin of global_svvndxp_tab occurs 0, company(3) type c, hs_vendor_number(10) type c, sap_account_number(10) type c, end of global_svvndxp_tab.This is a routine I copied from the notes.
* Test if connection 'con_name' has already been opened data: con_name like dbcon-con_name. con_name = 'ISERIES'. EXEC SQL. SET CONNECTION :con_name ENDEXEC. if sy-subrc <> 0. * Connection not yet opened. EXEC SQL. CONNECT TO :con_name ENDEXEC. if sy-subrc <> 0. * error handling endif. endif. * Execute a SQL statement on remote ISeries. EXEC SQL performing loop_output. select COMPANY, HS_VENDOR_NUMBER, SAP_ACCOUNT_NUMBER from svvndxp into :global_svvndxp_tab where SAP_CLIENT = '400' ENDEXEC. EXEC SQL. DISCONNECT :con_name ENDEXEC. * Reset to "default connection" EXEC SQL. SET CONNECTION DEFAULT ENDEXEC. endform. form loop_output. write: / global_svvndxp_tab-company, global_svvndxp_tab-hs_vendor_number, global_svvndxp_tab. endform.Well that's as far as I have gone with this so far I will be loading the data into an ALV Grid allowing the users to edit delete and add records.
I hope this gives you some ideas and some help in setting it up drop me a message if you need any help.
I found this on the web seems like it could be of use.