Vous êtes sur la page 1sur 17

Open Hub Extraction Enhancement: Using Literal Filename & Path

Applies To:
SAP BW Open Hub Extraction

Article Summary
With the help of Open Hub, data can be extracted from BW and saved onto the application server or local drive. Currently, standard functionality does not allow you to specify the filename or path. This article provides a step by step solution to enhance current BW Open Hub functionality to use custom filename & path specified by the user. By: Catherine Fan Title: Technical Consultant Date: 08 Mar 2005

Table of Content
Open Hub Extraction Enhancement: Using Literal Filename & Path...............................................1 Applies To: ....................................................................................................................................1 Article Summary.............................................................................................................................1 Table of Content.............................................................................................................................1 Overview: How It Works..................................................................................................................2 Step By Step Instruction.................................................................................................................2 Disclaimer & Liability Notice..........................................................................................................17

Overview: How It Works


When a user initiates open hub extraction by creating an InfoSpoke, behind-the-scenes activity involves OO ABAP which is calling classes to determine each of the different components involved in making the open hub extraction possible. In particular, this enhancement will focus on 2 standard classes: one used to determine file destination name and path and the other to control the user interface of the InfoSpoke which will ultimately allow the user to enter his/her own filename and path. To make this enhancement, we will perform 3 tasks: Task 1: create a custom class to handle the file management: naming and location (all code supplied; please unzip zcl_rsb_file_literal_methods.zip & store for upload) Task 2: modify methods of a standard class being used to point to our newly created class to manage the files how weve specified Task 3: enhance the user interface to allow for user customization.

Step By Step Instruction


Task 1: Steps for Creating a File Management Custom Class 1. 2. 3. 4. 5. Go to transaction SE24 Create Object Type: ZCL_RSB_FILE_LITERAL Click the Create Button Enter a description & accept the creation screen defaults Click Save

6. 7. 8. 9.

Enter Package & Transport information Click the Superclass Button Enter CL_RSB_FILE_GENERAL Enter the following properties:

Message Class: RSBO Type group/Object type: RS RSBO RSUDT 10. Accept the remaining defaults 11. Click the Methods tab

12. Place the cursor on Method: IF_RSB_OPEN_HUB_TARGET~RECEIVE_DATA 13. Click the Redefine button

14. Highlight the existing commented code & follow the menu path: Utilities More Utilities Upload/Download Upload

15. Navigate to the previously unzipped folder and select the corresponding file name with the same Method name 16. Save and Activate the method

17. Return to the Methods tab by using the green arrow back button and repeat steps 12 through 16 for the remaining methods IF_RSB_OPEN_HUB_TARGET~RECEIVE_DATA IF_RSB_OPEN_HUB_TARGET~BEFORE_EXTRACTION IF_RSB_OPEN_HUB_TARGET~AFTER_EXTRACTION IF_RSB_OPEN_HUB_TARGET~REQUEST_ROLLBACK CHANGE_PARMS CONVERT_INT_TO_EXT GET_INFO SAVE CHECK GENERATE_CONTROL_FILE_CSV GENERATE_CONTROL_FILE_ASC DETERMINE_FILENAME 18. 19. 20. 21. Return to the Methods tab to customize the last method in your custom class Click the create Constructor button Save the changes and click the Code button Repeat steps 14 through 16

Task 2: Steps for Modifying Methods of a Standard Class to Use the Newly Created File Management Class (a) Method: CHANGE_PARMS 1. Go to transaction SE24 2. Display Object Type: CL_RSB_DEST 3. Click the Display button 4. Double click on the method: CHANGE_PARMS

5. Click the Change Button Access key required to make changes

6. Place the cursor on line 17 and Click the Insert button 7. Insert the following code in the allocated space: * clear filepath when change between server vs. local file clear l_s_vdest-path. 8. Place the cursor on line 27 and Click the Replace button 9. Insert the following code in the allocated space: * replaced for open hub extraction literal filename/path data: l_r_file_applsrv type ref to zcl_rsb_file_literal. 10. Save and activate the changes

Sample Code: CL_RSB_DEST

(b) Method: GET_OBJECT_REF_INT 1. Double click on the method: GET_OBJECT_REF_INT

2. Click the Change Button 3. Place the cursor on line 19 and click the Replace button 4. Insert the following code in the allocated space: * replaced for open hub extraction logical filename/path data: l_r_file_applsrv type ref to zcl_rsb_file_literal. 5. Save and activate the changes

Sample Code: GET_OBJECT_REF_INT

Task 3: Steps for Enhancing the User Interface Properties (a) Modifying a Method from a Standard Class to Control the User Interface 1. Go to transaction SE24 2. Display Object Type: CL_RSB_SPOK_VIEW

3. Double click on the method SET_SCREEN_2001

4. Click the Change button 5. Place the cursor on line 101 and highlight the 4 lines of code below. 6. Click the Delete button

7. Follow the same steps to delete the corresponding endif statement 8. Place the cursor at the following example and click the Replace button

9. Insert the following code in the allocated space: * replaced for open hub extraction literal filename/path e_input = rsboh_c_on.

10. Save and activate the changes Sample code: SET_SCREEN_2001

(b)

Modifying Screen Attributes 1 Create a Domain 1.1 Go to Transaction SE11 1.2 Select the Domain radio button 1.3 Enter RSPATH 1.4 Click the copy button 1.5 Enter the Copy To field

1.6 1.7 1.8

Select the Definition tab Set the Lowercase option by clicking the Lowercase checkbox Save and activate

2 Create a Data type 2.1 Go to Transaction SE11 2.2 Select the Data type radio button 2.3 Enter RSBPATH 2.4 Click the copy button 2.5 Enter the Copy To field

2.6 2.7 2.8

Select the Data Type tab Enter the newly created domain Save and activate

3 Assign the custom Component type 3.1 Go to Transaction SE11 3.2 Select the Data type radio button 3.3 Enter RSBODYN2001 3.4 Click the change button Access key required to make changes

3.5 3.6

Enter the newly created data element in the component type for component: PATH Save and activate

3.7 Confirm screen properties changes 3.7.1 Go to transaction SE80 3.7.2 Enter RSBO_GUI under function group 3.7.3 Expand screens and double click on screen 2001 3.7.4 Click the Element list tab 3.7.5 Click the Special attr. Tab 3.7.6 Scroll down to RSBODYN2001-PATH type I/O 3.7.7 Confirm that Upper/Lower case entry is checked (If setting not applied, screen properties may need to be re-activated - access key would be needed for R3TR FUGR RSBO_GUI)

3.8

Turn off upper case formatting on file path when using search help

3.8.1

While still in screen 2001, Go to the Flow Logic tab

3.8.2 3.8.3

Double click on module f4_path_2001 Double click on method f4_path

3.8.4

Double click on method dynp_values_read_2001

3.8.5

Use the replace button to replace the exporting parameter rs_c_true with rs_c_false in the call function DYNP_VALUES_READ in order to turn off the upper case option

Disclaimer & Liability Notice


This document may discuss sample coding, which does not include official interfaces and therefore is not supported. 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 of the code and methods suggested here, and anyone using these methods, is doing it under his/her own responsibility. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of the technical article, including any liability resulting from incompatibility between the content of the technical article and the materials and services offered by SAP. You agree that you will not hold SAP responsible or liable with respect to the content of the Technical Article or seek to do so.
Copyright 2004 SAP AG, Inc. All Rights Reserved. SAP, mySAP, mySAP.com, xApps, xApp, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product, service names, trademarks and registered trademarks mentioned are the trademarks of their respective owners.

Vous aimerez peut-être aussi