DIY: HANA Resources

I’ve been having fun creating my HANA DB  with SAP’s trial SAP Cloud Platform and playing around with it.

Creating your trial SAP Cloud Platform:


I found a tutorial on getting started, but problem is its a little dated which has different screenshots but if your willing to power through it and make educated conclusions as to what they are referring to, this tutorial works.

Tutorial link:

Link to SAP’s PDF

In case the PDF is taken down, here is the file from my site: HANA Trial – Getting Started


Unlock users in SAP

Quick Solution:

Table: USR02

Field: UFLAG

Value: 0 (zero)

Continue reading →

Find BW InfoCube from Web Report bookmark

Background: I had to find a way to go and find the InfoCube that provided a BEx Web Report with data by only having its bookmark available.

Technical Solution: Here are the technical tables and relationships used in order to find the InfoCube name. Copy and paste friendly names of the tables used: RSZWBOOKMARK , RSZWOBJXREF, RSZWVIEW.

Table Relationship( Displayed are table technical names and relevant fields)

Continue reading →

get BSP URL parameters – page redirector

Background: I had to write these BSP’s a few times. Once was for a plain vanilla redirector that got its values pushed from another application and a different time is when I needed to create a RESTful web service.

What: BSP application ZBSP_REDIR (SAPlink nugget)

How to use:

Under the Event Handler tab within your BSP. Select the “OnRequest” method.

"For this example, we will be pushing in appname
 "  then we will use our make believe business logic
 "  and generate a redirection URL based off the
 "  appname.

 "     Name value pair's

 "Get the URL variables and save them into the table.
 runtime->server->request->GET_FORM_FIELDS( CHANGING FIELDS = lt_HTTPNVP ).

 "Get the variable from the table

 "Save to the Page Attribute which will hold the redirection URL
   WHEN 'redirect_example'.
      redirection_url = ''.
     redirection_url = ''.

The URL I used to test the was    http://***/sap/bc/bsp/sap/zbsp_redir/index.htm?appname=redirect_example

CSV utility class

*Note* This page links to SAPlink compliant code. If you are unfamiliar with SAPlink, please visit this page.

Background: From time to time, I have had requests to work with custom data in excel and import it in an ABAP program or was asked to export some processed data back into excel, that I decided to write a CSV (Comma Separated Values) utility class that would make my life a little bit easier.

What: My custom SAP class ZCL_CSV (SAPlink nugget)


ZCL_CSV methods list.

How to use: Pass in two parameters and one changing parameter. The two parameters are the CSV file and its defined structure, and the changing parameter is the table you want your data to be put into.

CSV_TO_TABLE parameters

Code Sample:

     IV_CSV = "CSV File as a string.
     IS_CSV = "The structure of the CSV file
     ET_CONVERTED_TABLE = "The table to store the data  ).

Full Code Sample:

 DATA: lv_data type string.

 TYPES: begin of ty_struct,
   comp_foo type string,
   comp_bar type string,
   comp_baz type string,
   end of ty_struct.

 TYPES: begin of ty_struct2,

   comp_bar type string,
   comp_baz type string,
   comp_qux type string,
   end of ty_struct2.

 DATA: ls_struct TYPE ty_struct. "CSV structure
 DATA: lt_struct TYPE TABLE OF ty_struct2. "My table structure

 DATA: lv_filename TYPE string.
 DATA: lv_file_data_string TYPE STRING.

 DATA: lv_file_save TYPE STRING.

 CONCATENATE 'foo,bar,baz' cl_abap_char_utilities=>cr_lf 'foo2,bar2,baz2' INTO lv_data.

 ZCL_CSV=>SHOW_OPEN_DIALOG( CHANGING iv_filename = lv_filename ).

 lv_file_data_string = ZCL_CSV=>GET_FILE( lv_filename ) .

     IV_CSV =  lv_file_data_string
     IS_CSV = ls_struct
     ET_CONVERTED_TABLE = lt_struct   ).

 lt_csv_table = ZCL_CSV=>TABLE_TO_CSV( lt_struct ) .
 lv_file_save = ZCL_CSV=>SHOW_SAVE_DIALOG( ).
 ZCL_CSV=>SAVE_FILE( IV_FILENAME = lv_file_save IV_CSV_TABLE = lt_csv_table ).

“Super ABAPer” achievement unlocked.

Thank you Aziz for this picture. Aziz was my intern and at the end of his time here at the company, he has surprised me with this gift. I always liked the title “code ninja” but that’s not fitting for this picture. I think i’ll call this picture “Super ABAPer” and hence, “Super ABAPer” achievement unlocked.

Picture my intern made me after his internship was over. Thank you Aziz.

LinkedIn sign in.

You can now sign in and leave a comment via LinkedIn. I didnt have it set up properly before, but now it should be up and working.

First steps.

I have been meaning to start my site where I could share some code and post some reference material for myself and others to use, and here it is. Whenever I have something to share, i’ll create a page for it and under what category it lies under. For now, I finally posted one thing under the SAP category and i’ll be adding more soon later.