ZLISTCUBE - an Alternate to LISTCUBE.PDF

18
ZLISTCUBE: an Alternate to LISTCUBE Applies to: SAP BW 3.0b, SAP BW 3.5, Will also work on SAP BI 7 For more information, visit the Business Intelligence homepage . Summary Standard ‘LISTCUBE’ Transaction in SAP BW has got some limitations like a mandatory Pre-Selection screen for all the infoprovider with many infoObjects and we do not have an option to skip this Pre-Selection or to save the Pre-Selection condition as a Variant to use it for next time. This Journal is to demonstrate a code ‘ZLISTCUBE’ which is a modified version of standard ‘LISTCUBEcode and will give the user with an option to skip the Pre-Selection screen. Author: Anil Raparthi Company: IBM India Pvt Ltd (Hyderabad/INDIA) Created on: 18 September 2008 Author Bio Anil Raparthi is a SAP BI consultant currently working with IBM India Pvt Ltd (Hyderabad/INDIA). He has over 5+ years of experience in various BW/BI implementation projects around the globe. SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1

description

ZLISTCUBE - an Alternate to LISTCUBE.PDF

Transcript of ZLISTCUBE - an Alternate to LISTCUBE.PDF

Page 1: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Applies to: SAP BW 3.0b, SAP BW 3.5, Will also work on SAP BI 7 For more information, visit the Business Intelligence homepage.

Summary Standard ‘LISTCUBE’ Transaction in SAP BW has got some limitations like a mandatory Pre-Selection screen for all the infoprovider with many infoObjects and we do not have an option to skip this Pre-Selection or to save the Pre-Selection condition as a Variant to use it for next time.

This Journal is to demonstrate a code ‘ZLISTCUBE’ which is a modified version of standard ‘LISTCUBE’ code and will give the user with an option to skip the Pre-Selection screen.

Author: Anil Raparthi

Company: IBM India Pvt Ltd (Hyderabad/INDIA)

Created on: 18 September 2008

Author Bio Anil Raparthi is a SAP BI consultant currently working with IBM India Pvt Ltd (Hyderabad/INDIA). He has over 5+ years of experience in various BW/BI implementation projects around the globe.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1

Page 2: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Table of Contents Scope of the ‘ZLISTCUBE’ Program: .................................................................................................................3

Why and Where to use ‘ZLISTCUBE’ instead of Standard ‘LISTCUBE’ ........................................................3 Scope 1: To Bypass the Pre-Selection Screen ............................................................................................................3 Scope 2......................................................................................................................................................................15

Related Content................................................................................................................................................17 Disclaimer and Liability Notice..........................................................................................................................18

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 2

Page 3: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Scope of the ‘ZLISTCUBE’ Program: 1. To Bypass the Pre-Selection Screen

2. To maintain a SAVE and USE VARIENT option at the Pre-Selection screen* (*Under development)

Why and Where to use ‘ZLISTCUBE’ instead of Standard ‘LISTCUBE’

Standard ‘LISTCUBE’ Transaction in SAP BW has got some limitations like a mandatory Pre-Selection screen for all the infoprovider with many infoObjects and we do not have an option to skip this Pre-Selection or to save the Pre-Selection condition as a Variant to use it for next time.

This Journal is to demonstrate a code ‘ZLISTCUBE’ which is a modified version of standard ‘LISTCUBE’ code and will give the user with an option to skip the Pre-Selection screen for those Infoproviders that contains many InfoObjects.

Note: This Documentation only provides the first scope i.e. To Bypass the Pre-Selection Screen. The Scope 2 is still in progress and will update you in my next upgraded documentation/Journal.

Scope 1: To Bypass the Pre-Selection Screen

Step (1)

Go to Tcode SE38 and past the below ZLISTCUBE code.

****************************************************************************************** *&---------------------------------------------------------------------* *& Report ZLISTCUBE * *&---------------------------------------------------------------------* *& *******************Anil Raparthi//\\15/09/2008*********************** *& This Prog is a Clone of LISTCUBE prog and Scope (1) is to skip * *& the Perselection screen for the InfoProvider where * *& it contains too many infoObjects * *& Scope (2) is to have a 'Save and Use Varient' in the Pre-Selection * *&---------------------------------------------------------------------* REPORT ZLISTCUBE . TYPE-POOLS: rsd, rsdq. *tables ZIOINF. Data ZVAR(1) Type c. DATA: g_r_dta TYPE REF TO cl_rsd_dta, g_obj_overflow TYPE rs_bool, g_okcode(4) TYPE c, g_tlogo TYPE rs_tlogo, g_t_tlogo TYPE rs_t_tlogo, g_s_dta TYPE rsd_s_dta, g_t_ioinf TYPE rsdq_t_iobj_info, g_t_dta_dime TYPE rsd_t_dta_dime, g_t_tabl_cntl TYPE rsdq_t_tabl_cntl WITH HEADER LINE, g_t_dynp LIKE dynpread OCCURS 0 WITH HEADER LINE. CONTROLS: table_cntl TYPE TABLEVIEW USING SCREEN 2000.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 3

Page 4: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

PARAMETER: p_tlogo TYPE rs_tlogo NO-DISPLAY MEMORY ID /bic/rsdq/cubetype, p_dta TYPE rsddatatarget OBLIGATORY MEMORY ID /bic/rsdq/datatarget. PARAMETER: p_ssids TYPE dbman_show_sid AS CHECKBOX MEMORY ID /bic/rsdq/showsids, p_sdims TYPE dbman_show_dim "AS CHECKBOX "MEMORY ID /bic/rsdq/showdims NO-DISPLAY, p_dbagg TYPE dbman_db_aggregation AS CHECKBOX MEMORY ID /bic/rsdq/db_aggr, p_tchnm TYPE dbman_technm AS CHECKBOX MEMORY ID /bic/rsdq/tech_nms. SET PARAMETER ID '/BIC/RSDQ/DATATARGET' FIELD p_dta. SET PARAMETER ID '/BIC/RSDQ/SHOWSIDS' FIELD p_ssids. SET PARAMETER ID '/BIC/RSDQ/SHOWDIMS' FIELD p_sdims. SET PARAMETER ID '/BIC/RSDQ/DB_AGGR' FIELD p_dbagg. SET PARAMETER ID '/BIC/RSDQ/TECH_NMS' FIELD p_tchnm. p_sdims = rs_c_false. CALL FUNCTION 'RSDQ_GET_DTA_INFO' EXPORTING i_datatarget = p_dta i_show_sids = p_ssids IMPORTING e_s_dta = g_s_dta e_t_ioinf = g_t_ioinf e_t_dta_dime = g_t_dta_dime EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. MESSAGE e203(dbman) WITH p_dta. ENDIF. SET PARAMETER ID '/BIC/RSDQ/CUBETYPE' FIELD g_s_dta-tlogo. *ANiL***////****** Change in code started ******\\\\******** CALL FUNCTION 'RSDQ_TABLCNTL_FROM_IOINF' EXPORTING i_t_ioinf = g_t_ioinf i_called_from = 'L' " Aufruf von LISTCUBE aus IMPORTING * e_t_tabl_cntl = g_t_tabl_cntl[] e_obj_overflow = g_obj_overflow. IF g_obj_overflow EQ rs_c_true. CALL FUNCTION 'POPUP_TO_CONFIRM'

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 4

Page 5: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

EXPORTING TITLEBAR = 'Skip Pre-Selection' * DIAGNOSE_OBJECT = ' ' TEXT_QUESTION = 'Too Many InfoObjects, Do you Want to Skip Preselection Screen ?' TEXT_BUTTON_1 = 'YES'(001) ICON_BUTTON_1 = 'ICON_CHECKED' TEXT_BUTTON_2 = 'NO'(002) ICON_BUTTON_2 = 'ICON_INCOMPLETE' DEFAULT_BUTTON = '2' DISPLAY_CANCEL_BUTTON = ' ' * USERDEFINED_F1_HELP = ' ' START_COLUMN = 25 START_ROW = 6 * POPUP_TYPE = * IV_QUICKINFO_BUTTON_1 = ' ' * IV_QUICKINFO_BUTTON_2 = ' ' IMPORTING ANSWER = ZVAR * TABLES * PARAMETER = * EXCEPTIONS * TEXT_NOT_FOUND = 1 * OTHERS = 2 . * IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. IF ZVAR = '2' . ***************** Pop-up prog **START********************* DO. CALL FUNCTION 'RSDQ_TABLCNTL_FROM_IOINF' EXPORTING i_t_ioinf = g_t_ioinf i_called_from = 'L' " Aufruf von LISTCUBE aus IMPORTING e_t_tabl_cntl = g_t_tabl_cntl[] e_obj_overflow = g_obj_overflow. . IF g_obj_overflow EQ rs_c_true. MESSAGE i201(rsdd). ***This Pops up a Iobj Per-Selection Windiow** CALL SCREEN 2000 STARTING AT 10 40. ***This FM will check and iobj sel pop-up and ***pass the values in to g_t_ioinf which is ***further passed to FM 'RSDQ_VIEW_DATATARGET' CALL FUNCTION 'RSDQ_IOINF_FROM_TABLCNTL' EXPORTING i_t_tabl_cntl = g_t_tabl_cntl[] CHANGING c_t_ioinf = g_t_ioinf. ELSE.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 5

Page 6: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

EXIT. ENDIF. ENDDO. ENDIF. ENDIF. ***************** Pop-up prog **END** ********************* *ANiL****////****** Change in code End ******\\\\*********** CALL FUNCTION 'RSDQ_VIEW_DATATARGET' EXPORTING i_datatarget = p_dta i_s_dta = g_s_dta i_t_dta_dime = g_t_dta_dime i_show_sids = p_ssids i_show_dimids = p_sdims i_tech_nms = p_tchnm i_use_db_aggregation = p_dbagg CHANGING c_t_ioinf = g_t_ioinf EXCEPTIONS dta_not_found = 1 illegal_input = 2 OTHERS = 4. IF sy-subrc EQ 1. MESSAGE i151(brain) WITH p_dta. ELSEIF sy-subrc > 1. MESSAGE i299(brain) WITH 'LISTCUBE' 'RSDQ_VIEW_DATATARGET'. ENDIF. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dta. * g_t_dynp-fieldname = 'P_TLOGO'. APPEND g_t_dynp. "UK 998954 g_t_dynp-fieldname = 'P_DTA'. APPEND g_t_dynp. CALL FUNCTION 'DYNP_VALUES_READ' EXPORTING dyname = 'RSDD_SHOW_ICUBE' dynumb = '1000' translate_to_upper = 'X' TABLES dynpfields = g_t_dynp EXCEPTIONS invalid_abapworkarea = 1 invalid_dynprofield = 2 invalid_dynproname = 3 invalid_dynpronummer = 4 invalid_request = 5 no_fielddescription = 6 invalid_parameter = 7 undefind_error = 8 OTHERS = 9. * CHECK sy-subrc = 0. READ TABLE g_t_dynp

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 6

Page 7: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

WITH KEY fieldname = 'P_DTA'. p_dta = g_t_dynp-fieldvalue. CLEAR g_t_tlogo. READ TABLE g_t_dynp WITH KEY fieldname = 'P_TLOGO'. p_tlogo = g_t_dynp-fieldvalue. IF p_tlogo IS INITIAL OR ( p_tlogo <> rs_c_tlogo-infocube AND p_tlogo <> rs_c_tlogo-aggregate AND p_tlogo <> rs_c_tlogo-multiprovider AND p_tlogo <> rs_c_tlogo-ods_object AND p_tlogo <> rs_c_tlogo-infoobject AND p_tlogo <> rs_c_tlogo-infoset ). CLEAR p_tlogo. CLEAR g_t_tlogo. APPEND rs_c_tlogo-infocube TO g_t_tlogo. APPEND rs_c_tlogo-aggregate TO g_t_tlogo. APPEND rs_c_tlogo-multiprovider TO g_t_tlogo. APPEND rs_c_tlogo-ods_object TO g_t_tlogo. APPEND rs_c_tlogo-infoobject TO g_t_tlogo. APPEND rs_c_tlogo-infoset TO g_t_tlogo. ENDIF. CALL METHOD cl_rsd_dta=>f4 EXPORTING i_tlogo = p_tlogo i_t_tlogo = g_t_tlogo CHANGING c_infoprov = p_dta. *&---------------------------------------------------------------------* *& Module PROCESS_SELECTION INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE process_selection INPUT. MODIFY g_t_tabl_cntl INDEX table_cntl-current_line. ENDMODULE. " PROCESS_SELECTION INPUT *&---------------------------------------------------------------------* *& Module STATUS_2000 OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE status_2000 OUTPUT. SET PF-STATUS '2000'. SET TITLEBAR '200'. CLEAR g_okcode. ENDMODULE. " STATUS_2000 OUTPUT *&---------------------------------------------------------------------* *& Module EXIT INPUT

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 7

Page 8: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

*&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE exit INPUT. IF g_okcode EQ 'CNCL'. LEAVE PROGRAM. ENDIF. ENDMODULE. " EXIT INPUT *&---------------------------------------------------------------------* *& Module MARK INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE mark INPUT. FIELD-SYMBOLS: <l_s_tabl_cntl> TYPE rsdq_s_tabl_cntl. CASE g_okcode. WHEN 'MALL'. LOOP AT g_t_tabl_cntl ASSIGNING <l_s_tabl_cntl>. <l_s_tabl_cntl>-mark = 'X'. ENDLOOP. WHEN 'DALL'. LOOP AT g_t_tabl_cntl ASSIGNING <l_s_tabl_cntl>. <l_s_tabl_cntl>-mark = ' '. ENDLOOP. WHEN 'MCHA'. LOOP AT g_t_tabl_cntl ASSIGNING <l_s_tabl_cntl>. IF <l_s_tabl_cntl>-sid EQ ' '. <l_s_tabl_cntl>-mark = 'X'. ELSE. <l_s_tabl_cntl>-mark = ' '. ENDIF. ENDLOOP. WHEN 'MSID'. LOOP AT g_t_tabl_cntl ASSIGNING <l_s_tabl_cntl>. IF <l_s_tabl_cntl>-sid EQ ' '. <l_s_tabl_cntl>-mark = ' '. ELSE. <l_s_tabl_cntl>-mark = 'X'. ENDIF. ENDLOOP. WHEN 'CNCL'. LEAVE PROGRAM. WHEN 'SAVE'. **** Write the SAVE Code here *** ANiL *** WHEN OTHERS.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 8

Page 9: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

ENDCASE. ENDMODULE. " MARK INPUT *&---------------------------------------------------------------------* *& Module USER_COMMAND_2000 INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE user_command_2000 INPUT. IF g_okcode EQ 'OK'. * Remove the check marks on the headings * ... no brain (JP) dump prevention ... LOOP AT g_t_tabl_cntl ASSIGNING <l_s_tabl_cntl>. IF <l_s_tabl_cntl>-name CP '#*#*#**'. <l_s_tabl_cntl>-mark = ' '. ENDIF. ENDLOOP. READ TABLE g_t_tabl_cntl WITH KEY mark = rs_c_true TRANSPORTING NO FIELDS. IF sy-subrc <> 0. MESSAGE i203(rsdd). RETURN. ENDIF. SET SCREEN 0. LEAVE SCREEN. ENDIF. ENDMODULE. " USER_COMMAND_2000 INPUT ******************************************************************************************

Step (2)

Go To Tcode SE51 (Screen Painter) and call screen program ‘RSDD_SHOW_ICUBE’ and screen ‘2000’ and press copy to screen Program ‘ZLISTCUBE’ Screen ‘2000’

Step (3)

Go To Tcode SE41 (Menu Painter) and call Menu ‘RSDD_SHOW_ICUBE’ and Status ‘PF_2000’

Copy the status as “ZLISTCUBE” and Status ‘2000’

Once done, please open “ZLISTCUBE” and Status ‘2000’ in change mode and open Application toolbar and add an item ‘SAVE’ along with icon ‘ICON_SYSTEM_SAVE’

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 9

Page 10: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 10

Page 11: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Step (4)

Go to Tcode SE93 (Maintain Transaction code) and create a T-Code for program ‘ZLISTCUBE’

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 11

Page 12: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Working with ‘ZLISTCUBE’ program

Run Tcode -> “ZLISTCUBE”

System prompts for your choice:

Choose your option whether you want to Skip the Pre-Selection screen where you do not want to do any pre-selection.

If your choice is then the program bypasses the pre-selection screen and will show you all the InfoObjects listed in the infoprovider and here you can choose the infoObject selection on which you want to view the data.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 12

Page 13: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 13

Page 14: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Here you will obviously have an option to come back and choose your desired infoObjects when ever you want during execution, where as in the standard ‘LISTCUBE’ program you have to totally come out of the “LISTCUBE” transaction and you need to choose the infoObjects at Pre-selection screen and also at normal selection screen.

Note: If you are using / trying to view all the infoObjects at this level after you have skipped the Pre-selection screen, then the system raises and message saying ‘Too many objects for the list output’ So we have to minimize the no of objects/columns as this is a system limitation.

So you can come back and trim the infoObject as needed Here you can also come back to the selection screen at any time to add the InfoObjects that you have missed to

view with out going back to pre-selection screen.

If your choice is then the system will take you to pre-selection screen with out bypassing it.

System prompts standard message just as in Standard “LISTCUBE” program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 14

Page 15: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Pre-Selection screen in ZLISTCUBE:

Scope 2

Note: Documentation only provides the first scope (1) i.e. To Bypass the Pre-Selection Screen. The Scope (2) is still in progress and will update you in my next upgraded documentation/Journal.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 15

Page 16: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Scope 2 is under development and it provides us with a flexibility of saving the Pre-selection as a variant and uses it any time.

*** Under development and will be provided in my next article.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 16

Page 17: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

Related Content • Custom Process Types "Remote Trigger" and "End Time"

• Tracking Real-Time Loads with a Bex Query

• How to Track the status of all the Historical Requests in a Data Target

• How to Send a Data Load Status Mail from SAP BI Using "Quick Stats"

• For more information, visit the Business Intelligence homepage.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 17

Page 18: ZLISTCUBE - an Alternate to LISTCUBE.PDF

ZLISTCUBE: an Alternate to LISTCUBE

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 18

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.