Dynamic creation of component usage in ABAP WebDynpro

By Reetika, IBM

Background: While working on one or other Webdynpro component, we all have come across the implementation of ALV. Interactive ALV is the type of ALV where after giving the input, user is first shown the primary list of ALV. A secondary list will be displayed on the click by user in one of the records of primary ALV. This secondary list will have more elaborated data of the selected record.  

For implementation of ALV in  ABAP Webdynpro, we have to create the component usage of one standard Webdynpro component named SALV_WD_TABLE. Further we have to do the external mapping of DATA node of SALV_WD_TABLE to our context node which is going to have the final value for display in ALV. We also have to embed the TABLE view of SALV_WD_TABLE into our ViewContainerUIElement of the respective view of our custom component, where we want to display the ALV.  

While working on one such ALV requirement, I came across one scenario where I need to implement the interactive ALV. As per the requirement both the ALVs must be displayed on the same screen (View).  

The usual approach to achieve this is to create as many separated usage of SALV_WD_TABLE as the number of ALVs you want to implement. In my case I could have to create 2 usages. The other approach is to implement the component usage dynamically. This approach can particularly be proved helpful when at design time you are not sure how many of component usage you need to create.  

So the component usage which we create at design time is called the static component usage, while the one created through program s called the dynamically created component usage  

Instead of following the static approach all the way, I created one component usage statically while other one I created through program (dynamic creation of component usage).  

Pre-requisite: Must have worked on normal Webdynpro application. Knowledge on static creation of component usage in own custom Webdynpro component.  

Creation of Static Component Usage:  

1.     Create one Webdynpro component with main view and a window.

2.     Now go to the webdynpro component -> Used component tab and create a static component usage of SALV_WD_TABLE.  

3.     Now go to component controller and create a new controller usage.  

4.     Now in context tab of component controller create 3 new node named sales_doc, sales_header_data, sales_item_data with the below mentioned attribute and properties.

 

 

 

5.     Go to Component Usage sub tree which is coming in left side panel and there click on INTERFACECONTROLLER_USAGE. There do the external binding of Sales_header_data context node to the DATA context node of SALV_WD_TABLE.  

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image