How to write to SAP R/3 Table using SAS/ACCESS or Data Surveyor?
I'm using data surveyor, and I was able to access SAP R/3 tables, import the metadata, and create SAS datasets to host the SAS tables.
Now, I need to write back to SAP, any ideas how to perform so?
BTW, using simple table loader transformer giving errors like:
ERROR: SQL Passthru is not supported
ERROR: Update access is not supported for file ECCLIB.MSEG.DATA.
Ahmed,
Writing data back to r/3 is not the same as writing to a database because r/3 is an ERP system. I recommend working with your SAP team to determine if the table you want to write to can be updated. If the table can be updated do you have permission to write to that table? Based on the table you will also have to find an appropriate BAPI that will allow you to write to the table you want to update. Once you have this information you can create a job in SAS Data Integration Studio (part of SAS Data Surveyor for SAP) using the SAP Transformation to call the BAPI and pass the updated data to the desired table. In the properties of the of the SAP Transformation you will name the appropriate BAPI. The transformation can have inputs and outputs based on the BAPI named in the SAP Transformation. For example, the BAPI "BAPI_PBSRVAPS_CHANGEKEYFIGVAL2 " can be used to update planning data in a planning book in SAP.
Using the SAP Tranformation uses the PROC CALLRFC in code. Here are some details about PROC CALLRFC https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=accr3&docsetTarget=n0x...
I hope this helps you.
Regards,
Lou Galway
Ahmed,
Writing data back to r/3 is not the same as writing to a database because r/3 is an ERP system. I recommend working with your SAP team to determine if the table you want to write to can be updated. If the table can be updated do you have permission to write to that table? Based on the table you will also have to find an appropriate BAPI that will allow you to write to the table you want to update. Once you have this information you can create a job in SAS Data Integration Studio (part of SAS Data Surveyor for SAP) using the SAP Transformation to call the BAPI and pass the updated data to the desired table. In the properties of the of the SAP Transformation you will name the appropriate BAPI. The transformation can have inputs and outputs based on the BAPI named in the SAP Transformation. For example, the BAPI "BAPI_PBSRVAPS_CHANGEKEYFIGVAL2 " can be used to update planning data in a planning book in SAP.
Using the SAP Tranformation uses the PROC CALLRFC in code. Here are some details about PROC CALLRFC https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=accr3&docsetTarget=n0x...
I hope this helps you.
Regards,
Lou Galway
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.