BSP/How-To: Navigation between BSP Applications: P...
Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Introduction:- This blog will narrate "Navigation between BSP Applications".
This blog is described into two parts for better understanding.
BSP Application using MVC Architecture
From MVC-BSP Application to MVC-BSP Application
From MVC-BSP Application to Flow Logic BSP Application
BSP Application using Flow Logic Methodology
From Flow Logic-BSP Application to MVC-BSP Application
From Flow Logic-BSP Application to Flow Logic BSP Application
Let's look at Part-I...
Scenario: The scenario which i took here to explain the Navigation process is: The main BSP Application will accept the Employee's personal Number as input from user & pass it to another BSP Application which shows the details of employee and comes back to main BSP Application when event is triggered.
To pass the data: I used two approaches to pass the data's between the BSP Application.
Via URL -You can use this approach just to pass one or two variables between applications.
Via cookies - Server/Client side cookies -
If you need to pass Structures or Internal tables you can use this approach.
1. Let's start how to navigate from MVC-BSP Application to MVC-BSP Application...
Highlights: - We're going to create the following objects:
Model Class of Source BSP Application- ZCL_MVC_PERNR.
Source BSP Application- YMVC_NAV
Controller class -YMVC_NAV_CTRL.
Model class of Target BSP Application-ZCL_MVC_PERNR_DETAIL.
Target BSP Application-YMVC_TARGET.
Controller calss-YMVC_TARGET_CTRL.
Let's see in detail: Steps involved to create the Source BSP Application:-YMVC_NAV
event handler for checking and processing user input and
for defining navigation
DATA EVENT TYPE REF TO CL_HTMLB_EVENT. DATA: V_TARGET_URL TYPE STRING, W_APP_NAME TYPE STRING. IF NOT EVENT_ID IS INITIAL. EVENT ?= CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ). IF NOT EVENT IS INITIAL. CASE EVENT->SERVER_EVENT. WHEN 'back'. CALL METHOD REQUEST->GET_FORM_FIELD EXPORTING NAME = 'source_bsp' RECEIVING VALUE = SOURCE_BSP. CONCATENATE '**/' SOURCE_BSP INTO SOURCE_BSP. CALL METHOD RUNTIME->CONSTRUCT_BSP_URL EXPORTING IN_PROTOCOL = 'http' IN_APPLICATION_NS = RUNTIME->APPLICATION_NAMESPACE IN_APPLICATION = RUNTIME->APPLICATION_NAME IN_PAGE = SOURCE_BSP IMPORTING OUT_ABS_URL = V_TARGET_URL. CONCATENATE RUNTIME->APPLICATION_NAME '/**/' INTO W_APP_NAME. REPLACE W_APP_NAME IN V_TARGET_URL WITH SPACE. NAVIGATION->GOTO_PAGE( V_TARGET_URL ). ENDCASE. ENDIF. ENDIF.