BW Tips and Tricks

How to add new line character in text variable ? If you want to add a new line character in text variable of customer exit type, just use standard class cl_abap_char_utilities=>newline: e_t_range = VALUE #( ( sign = 'I' opt = 'EQ' low = | LINE 1 { cl_abap_char_utilities=>newline } LINE2 | ) ).

May 29, 2023 · 1 min

BW Fiori cheat sheet

Important transactions in the context of BW Fiori Apps: Tile Maitenance - category,group /ui2/flpd_cust Transaltion SE63, Short Text, TABL, WDY_CONF_USERT2 Cache /UI2/INVALIDATE_CLIENT_CACHES /UI2/INVALIDATE_GLOBAL_CACHES /UI5/APP_INDEX_CALCULATE /UI2/DELETE_CACHE

August 8, 2022 · 1 min

How to trace BW BPC Authorization

Process of building authorization in BW with, and without BPC, is different. Reason is user authorization are enhanced by roles assigned to them in BPC administration panel. For more information about this process you can search for Data Access Profiles (DAPs). Common ways Common ways to check the BW auth is: Execute query on the affected user in rsudo - But it may not be enough, please check more Check authorization log using SU53 Trace authorization using ST01, STAUTHTRACE or similar BPC Most important difference is that user is sometimes able to execute the query in rsrt, but in the same time is not able to execute the BPC Planing workbook laing on the same object. After opening the workbook, before the prompts user will see issue like: ...

June 4, 2022 · 1 min

Manual deployment from ABAP to SAP HANA

Normally BW objects are transported to HANA using a transportation system, but what can be done when transport fails? When you have authorization to repat the import - it is still ok. You can go to Sap Transport Management system (transaction: STMS) and reimport. Thinks get much more complicated when you do not have the necessary rights. Let me share with you my notes about this process. Authorization To manually deploy ABAP objects to SAP Hana databse you need a following authorization: ...

February 11, 2022 · 2 min

Useful modern ABAP statements for BW transformations

ABAP 7.4 SAP introduced a lot of inline declarations. Nevertheless in BW world many developments are still written in very old syntax, where some of them are even not supported by the cloud version of ABAP (Steampunk). If you want to check out a modern ABAP statement that can be used in BW then this article is definitely for you. Every example contains a previous and a new version to compare. You can treat this post as a ABAP handbook/guide for BW developers. If you want to check more information how to write a clean ABAP code, check out check this website where is an official guide from SAP. ...

January 11, 2022 · 3 min

Create ADSO from ABAP

Creating ADSO from ABAP can be easily achieved by cl_rso_adso_api=>create DATA(ls_flags) = VALUE cl_rso_adso_api=>tn_s_adsoflags( direct_update = abap_true ). TRY. cl_rso_adso_api=>create( EXPORTING i_adsonm = "Name of the ADSO i_infoarea = "Infoarea name i_s_adsoflags = ls_flags i_t_object = "Table with all fields i_t_dimension = "Dimension i_t_key = "String table with key IMPORTING e_t_msg = DATA(lt_msg) ). CATCH cx_rs_all_msg INTO DATA(lr_msg). cl_demo_output=>display( EXPORTING data = lr_msg->get_longtext( ) name = 'Error' ). ENDTRY. Full usage examples can be found here

January 6, 2022 · 1 min

Remove invalid characters in your BW transformation

If you have in your BW regular flat-file data load in your BW system, you probably afflict issues with the wrong data provided by the user. The scenario of this issue can be very simple. It’s enough that the user provides an invalid unsupported charter and during activation, you will get a similar issue: Or other issues like: Value ‘#’ (hex. ‘2300′) of characteristic contains invalid characters Error when assigning SID: Action VAL_SID_CONVERT InfoObject (hex. ‘500072007A0065006C006500770020006E0061002000720061′) of characteristic contains inva This issue also affects me in the last time, and during my research, and found several options for removal. Most of them were based on a simple check like is your charter on the list: ...

January 2, 2022 · 2 min

BW formula parameters

BW contains many standard formulas which can be used in TRFN’s and RSPC’s. The main issue is that sometimes you need to know default values/data types. All available formulas can be checked in class CL_RSAR_FUNCTION. Bellow, you can find a table with explained importing and returning parameters. Formula / Method Name Description Importing Types (Example) Returning Types (Example result) ABORT_PACKAGE Returns exception cx_rfso_abort_package to stop processing N/A N/A ADD_TO_DATE Add days to the specified date DATS,INT (20201201,1) DATS 20201202 ALPHA Add leading zeros base on the provided length STRING,INT (123,5) STRING 00123 CALMONTH_FISCPER Convert calendar month to the fiscal period CONDENSE Trim text (left site) STRING ( 43) STRING ‘43’ CONDENSE_NO_GAPS Trim text + remove spaces inside STRING ( 43 55 33) STRING ‘435533’ DATECONV Change date format to internal CHAR10,CHAR10,CHAR1 (12/07/1992, MM/DD/YYYY,/) DATS 19921207 DATE_DIFF Calculate differences between dates DATS,DATS (20211212,20211215) INT 3 DATE_FISCPER DATE_FISCPER3 DATE_FISCYEAR DATE_HALFYEAR Check if the date is in the first or second part of the year DATS (20210212) NUMC 1 DATE_MONTH Get the calendar month from the given date DATS (20201201) NUMC 202012 DATE_MONTH2 Get the month number from the given date DATS (20201201) NUMC 12 DATE_QUATER Get the quarter from the given date DATS (20210909) NUMC 20213 DATE_QUATER1 Get the quarter number from the given date DATS (20210909) NUMC 3 DATE_WEEK Get the week from the given date DATS (20210731) NUMC 202130 DATE_WEEKDAY Get the day from the given date DATS (20211220) STRING Monday DATE_WEEKDAY1 Get the day number from given date DATS (20211220) NUMC 1 more DATE_YEAR Get the year from the given date DATS (20210101) NUMC 4 FIRST_WORKINGDAY_MONTH Get the first working day from the given date and calendar DATS,CHAR (20210425,01) DATS 20210401 FIRST_WORKINGDAY_YEAR Get the first working day of the year and calendar DATS,CHAR (20210525,01) DATS 20210104 FISCPER_CALMONTH FISCPER_FISCPER3 FISCPER_FISCYEAR IF Check condition - If I_Arg1 = X then Arg2 else Arg3 BOOLEAN,ANY,ANY (X,1,10) ANY 1 IS_INITIAL Check if the string is initial ANY (’') BOOLEAN X IS_INTEGER Check if the string contains only integers STRING (9) BOOLEAN X LAST_WORKINGDAY_MONTH Get the last working day from the given date DATS,CHAR (20210101,01) DATS 20210129 LAST_WORKINGDAY_YEAR Get the last working day of the year from the date given DATS,CHAR (20210101,01) DATS 20211231 LEFT Get the first X characters from the string INT,STRING (4,123456) STRING 1234 LTRIM Trim text (left site), by given regexp STRING,STRING ( ABCD,\s) STRING ‘ABCD’ L_TRIM Trim text (left site) STRING ( ABCD) STRING ‘ABCD’ MAPPING Looks like deprecated - almost all code inside commented out Result = Arg4 MONTH2_HALFYEAR Check if the month is in the first or second half of the year ANY (202112) or (11) NUMC 2 MONTH2_QUARTER1 Check the quarter of the month ANY (202208) or (08) NUMC 3 MONTH_HALFYEAR Check if the month is in the first or second half of the year. ANY (202112) NUMC 2 MONTH2_QUARTER1 Get the quarter based on the given date ANY (202106) or (06) NUMC 2 MONTH_HALFYEAR Check is given month in first or second half of the year ANY (20211) NUMC 2 MONTH_QUARTER Check the quarter of the given month ANY (202208) NUMC 202003 MONTH_QUARTER1 Check the quarter of the given month ANY (202208) NUMC 3 MONTH_YEAR Check the month of the given date ANY (202111) or (20211125) NUMC 2021 NEGATIVE Return number with negative sing F (1) F -1 QUARTER1_HALFYEAR Check if given quarter is in first or second half of the year ANY (202101) NUMC 1 QUARTER_HALFYEAR Check if given quarter is in first or second half of the year ANY (20214) NUMC 2 QUARTER_QUARTER1 Get the quarter from the given quarter ANY (20214) NUMC 4 QUARTER_YEAR Get the year from the given quarter ANY (20211) NUMC 2021 REPLACE_ALL Replace selected charter to different one C,C,STRING (4,9,A4B4C4) STRING A9B9C9 REPLACE_FIRST Replace first occurrences of the charters to different one C,C,STRING (4,9,A4B4C4) STRING A9B4C4 RIGHT Get first few numbers from right I,STRING (4,123456) STRING 3456 RTRIM Trim white charters from right based on provided regexp STRING,STRING (ABC,\s) STRING ‘ABC’ R_TRIM ? C (D) STRING D SHIFT_LEFT Remove first few charters from the left site of the string more I,STRING (2,abcdef) STRING cdef SHIFT_RIGHT Add few charters from the left site of the string more I,STRING (2,abcdef) STRING ’ abcdef' SKIP_RECORD Raise CX_RSFO_SKIP_RECORD exception to skip processing of current record N/A N/A SKIP_RECORD_AS_ERROR Raise CX_RSFO_SKIP_RECORD _AS_ERROR exception to skip current record processing with error N/A N/A STR_LEN Returns the length of the string STRING abcdef INT 6 UNIT_CONVERSION Convert units UNIT,UNIT,ANY (TO,KG,100) F 100000 UTC_LONG_TO_ LOCAL_DATE Convert timestamp based on selected timezone to get the date DEC,CHAR (20161030053000,EST) DATS 20161030 UTC_LONG_TO_ LOCAL_TIME Convert timestamp based on selected timezone to get the hour DEC,CHAR (20161030053000,EST) F 5.40 UTC_SHORT_TO_ LOCAL_DATE Convert timestamp based on selected timezone to get the date (same code like for long version) DEC,CHAR (20161030053000,EST) DATS 20161030 UTC_SHORT_TO_ LOCAL_TIME Convert timestamp based on selected timezone to get the hour DEC,CHAR (20161030053000,EST) TIMS 013000 WEEK_FIRST_DAY Get the first day of the week NUMC (202104) DATS 20210125 WORKINGDAY_MONTH Get the number of working days based on month DATS,CHAR,CHAR (20211220,01,+) INT 14 WORKINGDAY_YEAR Get the number of working day base on year DATS,CHAR,CHAR (20211220,01,+) INT 243 Explanations: DATE_WEEKDAY1(): 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday 7 - Sunday ...

December 20, 2021 · 5 min

BW important programs / Function modules / Tables

Almost all of these programs are included in my GitHub development “bw_toolbox”. If you want, you can just implement this in an easy way to your system. Please check by clicking here. Activate: Name Category Type Description RSDG_TRFN_ACTIVATE TRFN PROG Activate transformations on the system. If you are missing fields in source or target - then it will not work correctly. RSDS_DATASOURCE_ACTIVATE_ALL RSDS PROG Activate data source RSBKDTPREPAIR DTP PROG Activate data transfer process RSDG_HCPR_ACTIVATE HCPR PROG Activate composite provider RSDG_CUBE_ACTIVATE CUBE PROG Activate cube RSDG_ADSO_ACTIVATE ADSO PROG Activate Advanced DataStore Object RSDG_IOBJ_ACTIVATE IOBJ PROG Activate InfoObject Maintenance: Name Category Type Description RSDG_AFTER_IMPORT_FOR_CORR N/A PROG Reimport transport RSBM_GUI_CHANGE_USTATE DTP FM Change DTP request status RSPM_PROCESS_MONITOR DTP PROG Change DTP request status ADSO RSPC_VARIANT_DELETE RSPC FM Delete process chain variant RSPC_API_CHAIN_START RSPC FM Start process chain immediately ( even scheduled ) DB_DROP_TABLE DEST PROG Drop tables under the OpenHub RSDG_IOBJ_REORG IOBJ PROG Repair Infoobject RSPC_PROCESS_FINISH RSPC PROG Process chain variant status change BAPI_USER_UNLOCK N/A FM Unlock user BW4 GUI Versions Description Name Type DTP View rsbk0001 PROG TRFN View rstran_gui_start PROG DataSource View rsds Transaction Infoprovider View (display data) rsoadso Transaction Manage Request rsmng Transaction Tables Description Name Check iobj assigned to extractor field RSTSFIELD RSOFIELSMAP Keyfigures basic info RSDKYF Characteristics basic info RSDCHABAS Extractor metadata including custom (fields) RSDSSEGFD Query Repo (UUID from name) RSZCOMPDIR Authorization Tables Description Name Role Defnition AGR_DEFINE Role user asigment ( S_RS_AUTH for BW RSECADMIN) AGR_1251 Maintenance View transport: SE54 > Utilities > Total Transport ...

November 4, 2021 · 2 min

About me

Nice to meet you 👋 My name is Pawel Wiejkut and I am an SAP Consultant since 2016. Since the beginning, my career is related to big data. In this blog, I share my knowledge about SAP & Databases. Besides, I am the author of saponit.pl platform where I teach people programming in ABAP in Polish. In my free time, I co-create projects on GitHub. Feel free to contact me via social media. ...

November 4, 2021 · 1 min