You are on page 1of 9

Reading Component Controllers Context from View with Out Mapping to View Context Node

Applies to:
SAP Net Weaver 2004s. Web Dynpro for ABAP. For more information, visit the Web Dynpro ABAP homepage.

Summary
How to read/get component controllers context node from view with out creating mapping between view context and Controllers context? Author: Suman Kumar Chinnam

Company: YASH Technologies Created on: 13 July 2009

Author Bio
Suman Kumar is a Consultant for YASH Technologies, Pvt., and Ltd. Based in India. He has more than 2 and half years of IT experience. He has good knowledge in ABAP, BSP and Web Dynpro for ABAP.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

Reading Component Controllers Context from View with Out Mapping to View Context Node

Table of Contents
How to read Component controllers context node from view with out mapping................................................ 3 Create Web Dynpro component ..................................................................................................................... 3 Create Controller context node ....................................................................................................................... 3 Get the Controller context node from View ..................................................................................................... 5 Related Content .................................................................................................................................................. 8 Disclaimer and Liability Notice ............................................................................................................................ 9

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2

Reading Component Controllers Context from View with Out Mapping to View Context Node

How to read Component controllers context node from view with out mapping
We usually create mapping between the view context and Controller context for data flow. Some times we may require getting controller context node with out mapping to the view especially when we create a dynamic controller context node. Create Web Dynpro component Create Web Dynpro component and named it as Z_READ_CONTROLLER_CONTEXT and also create component usage for ALV. Create Controller context node First create a controller context node with attributes and fill the node with data as shown below.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 3

Reading Component Controllers Context from View with Out Mapping to View Context Node

Now fill the node with data from table.

Go to layout of view and insert view container element and named it as VCU_ALV.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 4

Reading Component Controllers Context from View with Out Mapping to View Context Node

Get the Controller context node from View Here I am not creating view context node as well as mapping the controller context node. Write the below logic in the View to read the controller context node.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 5

Reading Component Controllers Context from View with Out Mapping to View Context Node

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 6

Reading Component Controllers Context from View with Out Mapping to View Context Node

Create application to test the component. Output:

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 7

Reading Component Controllers Context from View with Out Mapping to View Context Node

Related Content
For more information, visit the Web Dynpro ABAP homepage.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 8

Reading Component Controllers Context from View with Out Mapping to View Context Node

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 9

You might also like