Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Applies to:
SAP BI Consultants with ABAP Knowledge. For more information, visit the EDW HomePage .
Summary
Copy existing DTP to a new one in not possible in SAP BI 7.0, to make it workable created a CLASS (ABAP) to copy DTP to a new one. Author: Suraj Tigga
Author Bio
Suraj Tigga is a Senior SAP BI / ABAP consultant at Capgemini Consulting. Suraj joined Capgemini Consulting in 2008 and has worked on multiple SAP BI implementation and support projects.
Table of Contents
Scenario .............................................................................................................................................................. 3 Step-by-Step Solution ..................................................................................................................................... 3
Class (ABAP) ............................................................................................................................................................... 3 Method (COPY_DTP) .................................................................................................................................................. 5 ABAP - Z_COPY_DTP_ABAP ..................................................................................................................................... 6 Execute Class (ABAP) ................................................................................................................................................. 7
Scenario
Copying existing DTP is not possible in SAP BI 7.0, so every time we want to copy a existing DTP, we have to create a new one. Here in this article developed Class (ABAP), which would help us copy the existing DTP for different data targets (Infocubes, DSO, Infoobject Attributes, Infoobject Text and Infoobject Hierarchies) Step-by-Step Solution Below are the steps mentioned to copy the DTP based on existing DTP (Built on DSO): Class (ABAP): ABAP class would be created with required Definition and Implementation. Method: ABAP code which copies the existing DTP definition to a new one. Execute Class (ABAP): Executes the Class (ABAP) to copy the DTP in M version and then activate it. Class (ABAP) Copy the existing DTP (Full Update) on DSO (ZQMNTST):
Method (COPY_DTP) Write the ABAP Code to copy the existing DTP
ABAP - Z_COPY_DTP_ABAP Step1: ABAP Code Z_COPY_DTP_ABAP to call the Class Z_DTP_COPY:
REPORT z_copy_dtp_abap.
******* DATA DECLARATION *********** DATA : BEGIN OF p_tab OCCURS 0, dtp(30) TYPE c, END OF p_tab , lt_return TYPE STANDARD TABLE OF ddshretval, wl_return TYPE ddshretval , e_dtp_copy TYPE rsbkdtpnm , zc_dtp_copy TYPE REF TO z_dtp_copy. DATA: valu_flds TYPE dfies OCCURS 0 , valu_flds_wa TYPE dfies , w_dtp TYPE rsbkdtpnm. ******* SELECTION SCREEN ***************** * DTP entered PARAMETERS : p_dtp TYPE rsbkdtpnm . ******* AT SELECTION SCREEN ON VALUE ****** AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dtp. * Retreive the values from DB table RSBKDTP SELECT dtp FROM rsbkdtp INTO TABLE p_tab WHERE objvers EQ 'A'. IF sy-subrc EQ 0. * Sort the internal table with DTP SORT p_tab BY dtp. * Pass the Field definition of DTP valu_flds_wa-tabname = 'RSBKDTP'. valu_flds_wa-fieldname = 'DTP'. APPEND valu_flds_wa TO valu_flds. * Call the FM to retrieve the values in F4 help CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING retfield = 'DTP' dynpprog = sy-repid dynpnr = sy-dynnr dynprofield = 'P_DTP' window_title = 'DTP Selection' TABLES value_tab = p_tab field_tab = valu_flds return_tab = lt_return . IF sy-subrc EQ 0. READ TABLE lt_return INTO wl_return INDEX 1. IF sy-subrc EQ 0. w_dtp = wl_return-fieldval. ENDIF. ENDIF. ENDIF.
***** START -OF-SELECTION ************* START-OF-SELECTION. * Call method to copy DTP CALL METHOD z_dtp_copy=>copy_dtp EXPORTING i_dtp = w_dtp i_dtp_txt = 'Test' i_dtp_prefix = ' ' IMPORTING e_dtp_copy = e_dtp_copy. IF sy-subrc EQ 0. WRITE : 'DTP Copied ' , e_dtp_copy. ENDIF.
Execute Class (ABAP) This is an example of a code sample: Step1: Execute (F8) the ABAP Code Z_COPY_DTP_ABAP and enter the DTP which has to be copied:
Step2: Execute the ABAP code which copied the DTP to a new one:
Related Content
For more information, visit the EDW HomePage .