Sunday, December 29, 2013

Creating a BSP component

1. Tcode BSP_WD_CMPWB
2. Add a model, if you do not know the component set you can use ALL, but make sure you add the right component set because the right one can only give you your desired BO entity.
3. To get config page, in the details page add
<chtmlb:overviewFormConfig/>
4. An overview page does not have .htm
5. You create all the views you need, and all those views/assignment blocks are to be added into the over view page. You don't add any fields in the over view page as such. All the over view page has multiple assignment blocks. So as the over view page is a combination of many views, it can be called a view set.
6. .htm page
This page takes care of configuring your config tab or any buttons you have etc.
chtmlb is the name space for configuration
thtmlb is the name space for toolbar
Ex: You want to add a button in a particular view -
First add a button in the IMPL class of the view,
Add properties for the button in the DO_PREPARE_OUTPUT method.
Once the button is ready, you need to give a position where you need the button to be displayed that can be done in the toolbar.
< thtmlb toolbar is the bsp extension for toolbar that SAP has provided now pass the parameters it needs to put your button in the toolbar of your view.
like
<thtmlb toolbar id                    = "HeaderToolbar"
                        buttons            = <%= controller->gt_button %>
                        maxButtonNumber  = "3"
                        foreignUse = "TRUE" />

For data to flow between 2 views what we need is plugs and navigation link to connect these plugs.
To navigate between 2 views, create outbound plug, inbound plug and navigational link.
To add a button to navigate back from the toolbar, we can follow the same procedure as mentioned above for the edit button. But for this we got to make sure that there is a BSP extension for the toolbar call back. Otherwise, include the necessary interface in your IMPL class and implement the necessary methods.

Custom controller needs to be created to pass data between 2 views. And after creating it has to be bound with the view so that the view data can be accessible to other views.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.