Integrate SAP FPM and BOPF
By the end of this blog, you will be able to:
- Create an FPM Application on top of a BOPF business object
- Configure the Application initial screen
- Configure a main screen with header section, Item section, Text collection and Attachment section
- Configure the wire schema of the application
The application is based on the custom business object ZRZ_SALES_QUOTE. Refer the blog Custom BOPF Business Object
Launch FPM creation wizard using FPM_WB. The transaction FPM_WB provides the design time for creating FPM applications. To get an initial configuration of the underlying Web Dynpro application, it offers wizards for dedicated purposes. In this context, choose the Wizard for Creating Empty FPM Applications.
In the first step you have to provide the Web Dynpro Application name and description. Select a predefined floorplan. FPM provides three main floorplans:
- OIF – Object Instance Floorplan
- GAF – Guided Activity Floorplan
- OVP – Overview Page Floorplan.
We will use the Overview Page Floorplan. With the selection the names for the derived components are proposed.
In the final step, assign package and transport request.
Configure Initial Screen:
In this step we will create the initial screen of your application. The target of this screen is to select the sales quote to be displayed on the main screen.
Choose the Application configuration and click ‘Start Configurator’ button
Click ‘Continue in Change Mode’:
Click the Component Configuration link:
How to different page types in the component configuration:
On the Initial page, I have added two UIBB with form component [FPM_FORM_UIBB].
Component configuration “ZRZ_SQ_FORM_CONFIG_INIT_PAGE” was created to display the Sales Quote field from ROOT node of ZRZ_SALES_QUOTE business object
Feeder class /BOFU/CL_FBI_GUIBB_ALTKEY_FDR, is a feeder class for simplified form, that exposes only alternative keys.
Refer to blog Create Alternative Key/Validation (BOPF), I have created QUOTE_ID as alternative key on ROOT node of ZRZ_SALES_QUOTE business object
Add QUOTE_ID field on to the screen as shown below:
Assign event FPM_LEAVE_INITIAL_SCREEN() to field QUOTE_ID to allow the navigation from initial page to main page. (Remember, we don’t have any other buttons on screen)
Component configuration “ZRZ_SQ_FORM_BOOTSTRAP_CONFIG” is a bootstrap.
“Bootstrap is technical UIBB that is responsible to map the readable key entered in the initial screen to the technical key that is used by BOPF framework, and pass it to the UIBBs configured in the main screen”
/BOFU/CL_FBI_GUIBB_BOOTSTRAP is the feeder class for bootstrap
Business Object - ZRZ_SALES_QUOTE Node - ROOT URL Key Provider - /BOFU/CL_FBI_URL_KEYPROVIDER and Pre-selction Key Provider - /BOFU/CL_FBI_PRSEL_KEYPROVIDER
Return to the component configuration screen by selecting the OVP link in the breadcrumb navigation. Open the General Settings section, choose the Floorplan Settings menu and select Application Controller Settings.
In the Change Application-Specific Parameters dialogue, enter the class /BOFU/WDC_FBI_CONTROLLER as Web Dynpro Component/Class. Enter /BOFU/WDCC_FBI_CONTROLLER_NEW as configuration name. The application controller defined here enables FBI to react to FPM events in the application level, and not just in the individual UIBB level.
Test the initial screen now..
Configure Main Screen:
In this step I will configure the main screen and the target of this screen is to display header, item, long text and attachments of your selected sales quote.
- ZRZ_SQ_ROOT_FORM_CONFIG : Component configuration created to display the
header fields of our business object
- ZRZ_SQ_ITEM_FORM_CONFIG : Component configuration created to display the
item fields of our business object
- /BOFU/TEXT_COLLECTION_TAB and /BOFU/ATTACHMENT_FOLDER_TAB are reusable configurations. To know more about them, Click here..
We can make use of Create wire option or graphical option as highlighted below:
Start wiring from Form UIBB on initial screen to Bootstrap. Make use of standard connector class “/BOFU/CL_FBI_CONNECTOR” and port type as “Collection”.
Now, from bootstrap to Form UIBB (ROOT) on main screen to transfer the internal keys to business object.
With association relation between ROOT and ITEM, transfer the internal keys by establishing wiring between Form UIBB (ROOT) and Form UIBB (ITEM). Under connector parameters, you can see the source node association as ITEM
Also, create wiring between ROOT and other sub nodes Long text and Attachment.