Friday, 18 May 2018

RRI: Jump from ABAP CDS Analytical query to Fiori Application

In this post I would like to share step-by-step description of creation RRI from ABAP CDS Analytical query to Fiori Application with parameter transfering.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

In this scenario Analytical query is opened in Analysis for Excel and user is able to jump to Fiori Application due to analyse or edit data based on specific documents.

Note that:

In simple cases it is enough to use standard RRI target with URL type.
In more difficult cases BADI RS_BBS_BADI is useful solution.

Step-by-step:


1.Go to SE19 and create implementation for BADI RS_BBS_BADI.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

2. Write in method IF_EX_RS_BBS_BADI~GET_TYPES following code. Specify name of ABAP class where logic will be realized.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

3. Create ABAP class and specify the interface IF_RS_BBS_BADI_HANDLER.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

4. Create method CLASS_CONSTRUCTOR.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

We need to call only URL that’s why setting are following.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

In RSBBS there are new target:

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

5. Fill method GET_TARGETS.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

Note that objnm is visible in RSBBS and txtlg in Analysis for Excel.

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

By the way there were all setting in RSBBS t-code. All logic and mapping should be defined in method CALL_URL.

6. Fill method CALL_URL:

SAP ABAP CDS, SAP ABAP Development, SAP ABAP Tutorials and Materials, SAP ABAP Guides

Specific logic is not really important, just understand:
  • Use table i_thx_mapping to get values of needed query fields.
  • Use RSRT with technical names option to get correct query field names.
  • Realize logic and fill r_url returning parameter, this is target link.
  • Use i_onam to split logic (if needed) for different Receiver Objects (previous point 5 in the post).
  • In our case Frond-end Fiori Server link was saved in table in Back-end system TVARVC. It is useful thing for DEV-QA-PROD landscape reasons.
  • In our case RRI is working if DOC_GUID “Document GUID” field or SYS_NUM “Document number” field  is in drill-down of Analytical Query. If not – another URL link was used.
7. Open ABAP CDS query in Analysis for Excel and check result.

Needed Fiori Application was opened by URL and Document GUID parameter was transferred correctly.

1 comment: