[BW] Refresh query in workbook via VBA
Sub t()
' run specific query
Run "SAPBEX.XLA!SAPBEXrefresh", False, ActiveWorkbook.Sheets("Sheet3").Cells(1, 1)
' run all queries
Run "SAPBEX.XLA!SAPBEXrefresh", true
End Sub
Sub t()
' run specific query
Run "SAPBEX.XLA!SAPBEXrefresh", False, ActiveWorkbook.Sheets("Sheet3").Cells(1, 1)
' run all queries
Run "SAPBEX.XLA!SAPBEXrefresh", true
End Sub
You might be able to use this fm to trigger other BPS function by BPS function exit.
Test for function group UPC_API
Function module API_SEMBPS_SEQUENCE_EXECUTE
Upper/lower case
RFC target sys:
Import parameters Value
I_AREA FLIA0001
I_PLEVEL FLIL0005
I_PACKAGE 0-ADHOC
I_SEQUENCE FLIF0003
Tables Value
ETK_RETURN 0 Entries
FUNCTION Y_BPS_USEREXIT_SYSTEM_LOG.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" VALUE(I_PLEVEL) TYPE UPC_Y_PLEVEL
*" VALUE(I_METHOD) TYPE UPC_Y_METHOD
*" VALUE(I_PARAM) TYPE UPC_Y_PARAM
*" VALUE(I_PACKAGE) TYPE UPC_Y_PACKAGE
*" VALUE(IT_EXITP) TYPE UPF_YT_EXITP OPTIONAL
*" VALUE(ITO_CHASEL) TYPE UPC_YTO_CHASEL OPTIONAL
*" VALUE(ITO_CHA) TYPE UPC_YTO_CHA OPTIONAL
*" VALUE(ITO_KYF) TYPE UPC_YTO_KYF OPTIONAL
*" EXPORTING
*" VALUE(ET_MESG) TYPE UPC_YT_MESG
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
*"----------------------------------------------------------------------
DATA:
SEL_AREA TYPE UPC_Y_AREA,
SEL_VAR TYPE UPC_Y_VARIABLE,
SEL_LOG1(60) TYPE C,
SEL_LOG2(60) TYPE C,
W_VAR(60) TYPE C.
data:
"ODS table name
RECORDS type i,
ls_data type /BIC/AODSBPS9000,
lt_data type table of /BIC/AODSBPS9000 with default key.
data: W_IT_EXITP TYPE UPF_YT_EXITP WITH HEADER LINE.
data: ITAB_2 TYPE upc_yto_charsel with header line.
DATA LS_CHARSEL TYPE UPC_YS_CHARSEL.
data i_line type i.
LOOP AT IT_EXITP INTO W_IT_EXITP.
CASE W_IT_EXITP-PARNM.
WHEN 'AREA'.
SEL_AREA = W_IT_EXITP-CHAVL.
WHEN 'VARIABLE'.
SEL_VAR = W_IT_EXITP-CHAVL.
WHEN 'TXT1'.
SEL_LOG1 = W_IT_EXITP-CHAVL.
WHEN 'TXT2'.
SEL_LOG2 = W_IT_EXITP-CHAVL.
ENDCASE.
ENDLOOP.
CALL FUNCTION 'Y_BPS_VAR_GET_DETAIL'
EXPORTING
I_AREA = SEL_AREA
I_VARIABLE = SEL_VAR
* I_BUFFER =
IMPORTING
E_SUBRC = L_SUBRC
ES_RETURN = L_RETURN
E_TYPE = L_TYPE
ETO_VARSEL_ALL = L_VARSEL_ALL " all select value
ETO_VARSEL = L_VARSEL " selected value
ETO_CHANM = L_CHANM.
DESCRIBE TABLE L_VARSEL LINES i_line.
if i_line = 1.
loop at L_VARSEL_ALL into itab_2.
W_VAR = ITAB_2-LOW.
clear ls_data.
ls_data-/BIC/BPSAREA = SEL_AREA.
ls_data-/BIC/BPSLOGD = sy-datum.
ls_data-/BIC/BPSLOGT = sy-uzeit.
ls_data-/BIC/BPSUSER = SY-UNAME.
ls_data-/BIC/BPSLOG1 = SEL_LOG1.
CONCATENATE SEL_LOG2 W_VAR INTO ls_data-/BIC/BPSLOG2.
collect ls_data into lt_data.
CALL FUNCTION 'RSDRI_ODSO_INSERT'
EXPORTING
I_ODSOBJECT = 'ODSBPS90'
I_T_INSERT = lt_data
IMPORTING
E_RECORDS = RECORDS.
endloop.
ENDIF.
* break bwabap01.
ENDFUNCTION.
Transactional ODS
1. Data store for external app like SAP SEM
2. Direct update via. API - no load processes
3. Data is available immediate
4. No change log- no delta update for connected targets....
5. Reporting only with Infoset
Example:
data:
"ODS table name
RECORDS type i,
ls_data type /BIC/AODSBPS9000,
lt_data type table of /BIC/AODSBPS9000 with default key.
clear ls_data.
ls_data-/BIC/BPSAREA = 'FBSA0001'.
ls_data-/BIC/BPSLOGD = sy-datum.
ls_data-/BIC/BPSLOGT = sy-uzeit.
ls_data-/BIC/BPSUSER = SY-UNAME.
ls_data-/BIC/BPSLOG1 = 'TEST'.
collect ls_data into lt_data.
CALL FUNCTION 'RSDRI_ODSO_INSERT'
EXPORTING
I_ODSOBJECT = 'ODSBPS90'
I_T_INSERT = lt_data
IMPORTING
E_RECORDS = RECORDS.
Just don't ues it. @.@
Use 0CALMONTH related objects instead. !!
The 'Restriction of Selection Required by User' check box.
If the box is checked, user must restricted the variable to
single entry. The data for processing will also be restricted
to only those data only.
If the box is not checked, it won't popup and window for selection.
But, you set the variable manully the data will be restricted to the selected value.
User need to reset the variable manully.