Create Validation from Load File (ZCL_RSPLF_FILE_UPLOAD) in BW-IP

Prerequisite
Also check SAP Notes:   SAP Note 2053696
URL Upload
<Host:Port>/sap/bc/webdynpro/sap/zrsplf_file_upload_v3?planning_sequence=<Planning Sequence>&sap-client=<Client>&sap-language=EN
Implement BAdI
ZRSPLF_FILE_UPLOAD
Class – Method that trigger BAdI
ZCL_RSPLF_FILE_UPLOAD – IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE
Step #6 trigger  l_r_badi->transform_file
Step #8 trigger  l_r_badi->transform_record
Step #9 trigger  l_r_badi->transform_data
My Case
Need to implement validation when uploading file before data goes into infocube.
What I’ve Done
Put validation logic inside method transform_file from BAdI implementation.
20170426-1107
Result
20170426-1111

 

Debugging ABAP BPC Standard 10.0 VS BPC Embedded 10.1

In BPC Standard 10.0 after we connect the Logic Script – BAdI – EPM Package we put the external breakpoint on object below,

Object
Detail
Class
CL_UJXD_PACKAGES_RES
Method
DO_POST
Line
179
Snippet
20170416-1200

 

In BPC Embedded 10.1 we are not using BAdI anymore to put logic programmaticaly BPC uses Fox Script, it’s extend version of logic script in BPC Standard, by extend I mean more powerful because it has more syntax to handle complex logic.

To execute ‘package’ in BPC Embedded we use Planning Sequence or Planning Function inside Analysis Office instead of running package on EPM Excel.

After all Datasource & Planning Function / Planning Sequence set up, put internal breakpoint inside below object, then execute Planning Sequence from Tcode RSPLAN

 

Class –  Method
CL_RSPLFR_CONTROLLER – EXECUTE_SERVICE
(put it in first line executable syntax)
20170419-1015
Script
RSPLFC_DEBUGGING_SCRIPT_FOX
1. Execute planning sequence with execute step with trace then debug runtime appear.
2. Go to tab script then load script name ‘RSPLFC_DEBUGGING_SCRIPT_FOX’
then execute directly.
20170419-1022 20170419-1023

Voila! debugger for fox script appear.

20170419-1024
to get the value of local variable inside Fox Script put some hardcode break-point.

 

[Solved] ODP Datasource Couldn’t Replicate into BW System

Background

We used to do replication datasource using RSA5 and RSA6 in ECC System.  Then replicate the active datasource in BW System using RSDS.

But since SAP introduce ODP (Operational Data Provisioning) as Data Exchange Framework between Source and Target , it allows us to make use of the ODP source system to use the same technology for a data mart scenario between BW systems as you would for providing other SAP source data for the BW system.

To understand more about ODP here is the link for FAQ

The Case

After activating datasource in RSA5 & RSA6 ECC System the datasource is not appearing in BW RSDS Tcode.

Solution

First, understand the Color Legend in RSA5 transaction ( Utilities > Color Key ).

After activating datasource system asking for Package & TR for object. But the status still in red. In old replication this is common and we still can replicate it in our BW System. But it turns out the green check icon represent the Release Datasource for ODP.

20170415-1100

 

then I’ve found out that not all Data extractor of Datasources is supported by ODP from here .  I check on table ROOSATTR in ECC System, but my failed replicated datasource already there.

“The ODP API does not show all Extractors, it only shows the released ones. The idea is that over the time multiple Extractors have been developed by SAP, some became obsolete, some might not work with this API. So along with the ODP API a new table is created in the dictionary called ROOSATTR containing all the Extractors the API and hence DataServices 4.0 supports.”

after reading the notes on  https://launchpad.support.sap.com/#/notes/2232584 ,

it saying,

SAP extractors: Most of the delivered SAP extractors are already released for ODP replication. You can release the corresponding DataSources in your SAP source system by implementing this SAP Note in your source system and then executing the program BS_ANLY_DS_RELEASE_ODP in the relevant source system. Pay attention to the restrictions that apply to the ODP release described in SAP Note 1932459 and KBA 2407906.

So i run the program BS_ANLY_DS_RELEASE_ODP in Development & Testing Client for Source System in BW. Voila! The status in RSA5 & RSA6 my active datasource already turn into green, which is activated for ODP.

If your datasources still not activated for ODP, in notes also saying that,

 For other SAP extractors that are not currently released for ODP replication but that you require, please open an incident in the application component BW-BCT-GEN.

Then Replicate in BW System

RSA1  > Source System > Choose Client under ODP – SAP > right-click > Replicate Datasource

You will find your activate datasources. Don’t forget to activate in RSDS Tcode to activating datasources in BW system.

Override External Debugging Authorization – User is not authorized for debugging

We as ABAP developer want to do some debugging with specific user. For instance there is an bug related to Standard Fiori Timesheet application, the user cannot input the timesheet for one or two day in periode of time. That’s why we need to login as specific user from fiori then we can debug from backend-side of SAP.

Usually we put some external debug point then after the action triggered from Fiori apps, the debug show up in screen.

But sometimes the Authorization team are not allowing us to do that. Normally the debugging role only allowed in development client. Not on Assurance or even on Production client.

  • Whenever we put external debugging point with user that have no debugging role the message error will be,

“User xxx is not authorized for debugging”

The idea is we need to intercept the standard external debugging point right before the message error appears.

  • Go to function module: SUSR_CHECK_DEBUG_ABILITY

set internal debugging point at line 120

  • Now set external debugger as user we want. The debug screen will appears. Then change the sy-subrc value from ‘3’ into ‘0’

Now the external debug point are set to the user.

 

 

 

[SAP NetWeaver Gateway] oData in Practice – Part 2

Objective: Retrieving Association Data from an OData service

Create Association Between EntitySet

  • Create New Entity Type with Detail Item Data
  • Create New Association

on folder icon named Association, right click > create

then following the wizard,

Principal Entity -> Header

Where table contain Header Records (ZET_USER_PROFILE)

Dependent Entity -> Detail Item

Where table contain Detail Item (ZET_USER_SKILL)

Cardinality means relation between table, here we set the relation between header->item are one to many.

So we set cardinality header with 1 then cardinality for item 1..n

The key we set into pernr.

  • Generate Runtime Object
  • Redefine Method ZETXXX_GET_ENTITYSET with below source code

  METHOD zet_user_skillse_get_entityset.

“Declaration of Local Navigation
DATAlt_nav_path TYPE /iwbep/t_mgw_tech_navi,
ls_nav_path TYPE /iwbep/s_mgw_tech_navi.

“Declaration of Input Parameter Structure
DATAlx_key_tab   LIKE LINE OF it_key_tab,
lx_entityset LIKE LINE OF et_entityset.

“Declaration of Internal Table
DATAlx_user_skill TYPE zta_fio_skill,
lt_user_skill TYPE TABLE OF zta_fio_skill.

“Local Variable
DATAlv_pernr        TYPE char5,
lv_where_clause TYPE string.

lt_nav_path io_tech_request_context->get_navigation_path).

READ TABLE lt_nav_path INTO ls_nav_path WITH KEY nav_prop ‘TOSKILLS’.
IF sysubrc 0.

“1) Request URI using Association
“/sap/opu/odata/sap/ZUSER_PROFILE_SRV/ZET_USER_PROFILESet(‘xxxxx’)/ToSkills

READ TABLE it_key_tab INTO lx_key_tab WITH KEY name ‘Pernr’.
IF sysubrc 0.
lv_pernr lx_key_tabvalue.
ENDIF.

REFRESHlt_user_skill[].
SELECT INTO CORRESPONDING FIELDS OF TABLE lt_user_skill
FROM zta_fio_skill
WHERE pernr lv_pernr.
IF lt_user_skill[] IS NOT INITIAL.

LOOP AT lt_user_skill INTO lx_user_skill.

MOVE-CORRESPONDING lx_user_skill
TO lx_entityset.
APPEND lx_entityset TO et_entityset.

ENDLOOP.

ENDIF.

ELSE.

“2) Request URI using Filter 

“/sap/opu/odata/sap/ZUSER_PROFILE_SRV/ZET_USER_SKILLSet?$filter=Pernr eq ‘xxxxx’
lv_where_clause io_tech_request_context->get_osql_where_clause_convert).
SELECT INTO CORRESPONDING FIELDS OF TABLE lt_user_skill
FROM zta_fio_skill
WHERE (lv_where_clause).

IF lt_user_skill[] IS NOT INITIAL.

LOOP AT lt_user_skill INTO lx_user_skill.

MOVE-CORRESPONDING lx_user_skill
TO lx_entityset.
APPEND lx_entityset TO et_entityset.

ENDLOOP.

ENDIF.

ENDIF.

ENDMETHOD.

  • Testing go to /n/IWFND/MAINT_SERVICE > your_service_srv > SAP Gateway Service

>Request URI using Association

IMPORTANT: make sure the navigation property is set correctly.

Navigation Property is used for Relation between Entity Types that used as Request URI using Association. To check that open SEGW, check under Entity Types > Header Entity Types (ZET_USER_PROFILE) > Navigation Properties

/sap/opu/odata/sap/ZUSER_PROFILE_SRV/ZET_USER_PROFILESet(‘00001’)/ToSkills

Result:

>Request URI using Filter

/sap/opu/odata/sap/ZUSER_PROFILE_SRV/ZET_USER_SKILLSet?$filter=Pernr eq ‘00001’

Result:

[Ubuntu] How to Set Up Hot Spot in Ubuntu

I’ve found this simple solution works like a charm at first attempt . This solution I found at http://askubuntu.com/a/609199

Simple steps: Create wifi hotspot in ubuntu

  1. Disable Wifi (Uncheck Enable Wi-Fi)
  2. Go to network connection (Edit Connections…)
  3. Click “Add”
  4. Choose “Wi-Fi” and click “Create”
  5. Type in Connection name like “wifi-hotspot”
  6. Type in SSID as you wish
  7. Choose Device MAC Address from the dropdown (wlan0)
  8. Wifi Security select “WPA & WPA2 Personal” and set a password.
  9. Go to IPv4 Settings tab, from Method drop-down box select Shared to other computers.
  10. Then save and close.
  11. Open Terminal (Ctrl+Alt+T) and type in the following command with your connection name used in step 5.
    sudo gedit /etc/NetworkManager/system-connections/wifi-hotspot
    
  12. Find mode=infrastructure and change it to mode=ap
  13. Now check the network section where wi-fi will be connected to the created hotspot automatically. If you can not find it, go to Connect to Hidden Network… Find the connection and connect to it.

“Ideas are easy.

Execution is everything.”

John Doerr

BPC – Running Package from ABAP Code

The core of this program is running the method RUN_PACKAGE from class CL_UJD_PACKAGE.
And to run that method we need the ‘selection’ alike on EPM Package Script, or on script named ‘prompt’.
The essential of the input method is on ITH_ANSWER_PROMPT.  We need to fill up those with correct prompt format.

So here some of my snippet to run that method.

 

“This program running on uj_custom_logic
DATA: LD_PROMPT       TYPE STRING,
          LD_PROMPT_FINAL TYPE STRING.
DATA: LX_CV LIKE LINE OF IT_CV.
DATA: LT_MEMBER    TYPE UJA_T_DIM_MEMBER,
          LX_MEMBER    TYPE UJ_DIM_MEMBER.
DATA:       LT_TH_VALUE TYPE UJD_TH_VALUE,
                LX_TH_VALUE TYPE UJD_S_VALUE.
DATA: LD_UNAME             LIKE SY-UNAME,
          LD_CYCLE(32),
          LD_CYCLE_MIN_ONE(32).
DATALR_DATA TYPE REF TO CL_UJD_PACKAGE.
CREATE OBJECT LR_DATA.

    “get base parameter
    LOOP AT IT_CV INTO LX_CV
      WHERE DIMENSION NE ‘TIME’
        AND USER_SPECIFIED EQ ‘X’.

      LT_MEMBER = LX_CV-MEMBER.
     “set-up prompt for each member
      LOOP AT LT_MEMBER INTO LX_MEMBER.
        CONCATENATE LD_PROMPT_FINAL ‘DIMENSION:’ LX_CV-DIMENSION ‘|’ LX_MEMBER ‘|’
      INTO LD_PROMPT_FINAL.
        CONDENSE LD_PROMPT_FINAL NO-GAPS.

      ENDLOOP.

    ENDLOOP.
“set-up header for prompt format
CONCATENATE ‘/BPC_PIHC/Production_Rate/PRIVATEPUBLICATIONS/’ LD_UNAME
    ‘/TempFiles/FROM.TMP@@@SAVE@@@@@@EXPAND@@@|’ LD_PROMPT_FINAL
    INTO LD_PROMPT_FINAL.
    CONDENSE LD_PROMPT_FINAL NO-GAPS.
“Running Package for each Time
LOOP AT LT_TIME ASSIGNING <LS_TIME>.

      CONCATENATE LD_PROMPT_FINAL ‘DIMENSION:TIME|’ <LS_TIME>-ID
     INTO LD_PROMPT.
      CONDENSE LD_PROMPT NO-GAPS.
      LX_TH_VALUE-FIELDNAME = ‘%SELECTION%’.
      LX_TH_VALUE-VALUE = LD_PROMPT.
      INSERT LX_TH_VALUE INTO TABLE LT_TH_VALUE.

      “event trigger for run package
      CALL METHOD LR_DATA->RUN_PACKAGE
        EXPORTING
          I_APPSET_ID       = I_APPSET_ID
          I_APPL_ID         = I_APPL_ID
          I_TEAM_ID         = ”
          I_GROUP_ID        = ‘PIHC’
          I_PACKAGE_ID      = ‘CALC_PROD_REQ_QTY_BACKGROUND’ “Name of Package
          ITH_ANSWER_PROMPT = LT_TH_VALUE
*         IS_SCHEDULE_INFO  =
*         I_CHAIN           =
          IF_SCHEDULE       = ”
          IF_DEBUG          = ”.
*     CATCH CX_UJD_DATAMGR_ERROR .
*     CATCH CX_UJ_DB_ERROR .
*     CATCH CX_UJ_STATIC_CHECK .
*    ENDTRY.

      DELETE LT_TH_VALUE WHERE FIELDNAME EQ ‘%SELECTION%’.

    ENDLOOP.

 

Gmail Error – Server Returned Error “Line Length Exceeded Limit: Line too Long”

I set up my office mail with gmail account for work. But one day my gmail stop fetching email from my office mail. The Gmail showing error Server Returned Error “Line Length Exceeded Limit: Line too Long”

 

According to https://productforums.google.com/forum/#!topic/gmail/nJ7tJD9GuFU, there are big size of email that will be fetched. In my case there is one email with size of 30mb.

The solution to this is simply move the big size email on source domain into folder, in my case i use default ms outlook owa to move the email into one of the folder i create.

Then in our setup gmail account (target email) go to Settings > Accounts & Import > Check Mail Now.

Voila! error message gone and your emails fetched seamlessly.

“Where performance is measured, performance improves. Where performance is measured and reported, the rate of improvement accelerates.”

– Thomas S. Monson

 

© 2018 Rijdz

Theme by Anders NorenUp ↑