Skip to content

Instantly share code, notes, and snippets.

@danieljarolim
Last active November 20, 2020 18:11
Show Gist options
  • Save danieljarolim/230f127c723f328bd63e to your computer and use it in GitHub Desktop.
Save danieljarolim/230f127c723f328bd63e to your computer and use it in GitHub Desktop.
SSIS SAP Integration

SSIS SAP Integration

This describes how to consume data from SAP without using a custom component. There are several prerequisites to get this working.

  1. SAP adapter packs from the MS Biztalk server.
  2. SAP client DLLs from SAP.
  3. Acess to BAPIs in SAP to call.

Step 1 Install ADO.NET SAP Adapter packs

Download the Biztalk server demo (BizTalk Server 2013 R2 Evaluation Edition) from http://www.microsoft.com/en-au/download/details.aspx?id=43381 Install only the adapter packs (32bit and 64bit).

Step 2 Add requisite SAP Client DLLs

Extract librfc32u.dll and librfc32.dll from SAP (64 bit into C:\Windows\system32 and 32 bit into C:\Windows\SysWOW64). Do the same for the unicode libraries icuuc40.dll icudt40.dll icuin40.dll. They can be obtained from http://icu-project.org/ and the version depends on the version required by librfc32u.dll (both 32bit and 64bit).

Note: 32 bit versions of dlls and adapters are required on 64 bit systems for Visual Studio development.

Step 3 Call the SAP BAPI to extract data

Add the ADO.NET source component to the SSIS workflow. Choose SAP ADO.NET as the source and configure connection details. Use the following syntax to call the BAPI

exec ZBAPI_FETCH_GLPCT  
    @YEAR=2012 , 
    @RECORDTYPE = '1' , 
    @RECORDVERSION = '000' 
    OPTION 'disabledatavalidation, firstresultset IT_OUTPUT_GLPCT'

Notes on the exec:

  • The ADO NET component can only return the first result set which by default is the RETURN table. This only returns the metadata on the resultsets returned.
  • Using OPTION 'firstresultset TABLENAME' changes the first result set to be the table or structure that should be returned first.
  • Using OPTION 'disabledatavalidation' passes most fields as string and conversion has to be done manually within the workflow. This is required for dealing with bad dates. Remove this option to quickly check the metadata of each field in the dataflow.

Note: The syntax shown on the Microsoft page for quoting OPTION settings is incorrect.

@derek-baker
Copy link

The link to the download in step one leads to a dead end. Is the download still available anywhere?

@danieljarolim
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment