Here is a simple method to check fot the System ID in a VBA Macro in a BEx Analyzer Workbook
1) Create Infoobject ZSYSID
=> CHAR 3
=> Master Data checked but no attributes
=> Texts – Short not language dept
=> Infoprovider => set any infoarea (this way reporting on the object is possible)
3) Extras => Object directory Entry => add to package and transport request
4) RSA1 => Infoproviders => Look for ZSYSID => Maintain Master Data
=> Create as many rows as there are BW systems ( ex BWD,BWQ, BWP) and set description as you wish ( You need to repeat step 4) in all systems after transporting the requests )
5) SE38 => ZXRSU01 => Add code to process a Customer Exit variable =>
if i_step = 2.
l_s_range-low = sy-sysid.
l_s_range-sign = ‘I’.
l_s_range-opt = ‘EQ’.
append l_s_range to e_t_range.
6) BEx Query Designer => Create New Query on Infoprovider ZSYSID
=> ZSYSID on rows (Always suppress results + Display Key)
=> Default Values => Restrict ZSYSID => Create Variable CE_SV_MA_ZSYSID (Char value / Customer Exit / Single Value / Mandatory, intial not allowed, Not Input Ready)
7) Add the query Query somewhere in the workbook
8) Collect Query and necessary objects in transport request.
9) Transport all. Maintain Master data fort ZSYSID in all systems.
You can now refer to the system ID as displayed by the query in your VBA Macros.