on 05-16-2017 10:10 AM
Hi Experts,
I would like to filter datasource before open workbook with VBA in AFO
Im trying yo filter a datasource with Workbook_SAP_Initialize()
CODE:
Public Sub Workbook_SAP_Initialize()
lresult = Application.Run("SAPSetFilter", "DS_1", "ACAUDIT", "CREP_TARJ", "INPUT_STRING")
End Sub
The same code execute with botton work but with the initialize of workbook not work.
Thank you all
Hi!
In the code of VBA you have to refresh before the code of the filter:
Public Sub Workbook_SAP_Initialize()
Application.Run("SAPExecuteCommand", "Refresh.ActualSheet")
lresult = Application.Run("SAPSetFilter", "DS_1", "ACAUDIT", "CREP_TARJ", "INPUT_STRING")
End Sub
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Javier,
I don't understand why you want to do this filtering using VBA. Without code you can use BW variables, so the end user can set the restriction. The variable may be based on authorization. Variables have the advantage that you have one implementation that works for all workbooks and queries that contain the variables. VBA code has to be replicated in all relevant workbooks.
Regards,
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
YES, its defined in this section.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just from help:
"Callback 'Workbook_SAP_Initialize' has to be defined in the 'ThisWorkbook' section of the VBA editor."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.