Reading Component Controller’s 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

.........................................................sap..................................................... 9  SAP COMMUNITY NETWORK © 2008 SAP AG SDN ..................................................................sap.....................................com 2 ................................................................................................com | BOC .Reading Component Controller’s Context from View with Out Mapping to View Context Node Table of Contents How to read Component controller’s context node from view with out mapping......sap........................................................................................sdn........................................ 3  Get the Controller context node from View ................................ 5  Related Content ...................com | BPX ...... 3  Create Controller context node .......................bpx......................boc........................ 8  Disclaimer and Liability Notice .. 3  Create Web Dynpro component .............................................................................................

boc. Create Controller context node First create a controller context node with attributes and fill the node with data as shown below.sap.bpx.sap. SAP COMMUNITY NETWORK © 2008 SAP AG SDN .sdn. Some times we may require getting controller context node with out mapping to the view especially when we create a dynamic controller context node.Reading Component Controller’s Context from View with Out Mapping to View Context Node How to read Component controller’s context node from view with out mapping We usually create mapping between the view context and Controller context for data flow.sap. Create Web Dynpro component Create Web Dynpro component and named it as Z_READ_CONTROLLER_CONTEXT and also create component usage for ALV.com | BPX .com 3 .com | BOC .

bpx.com 4 .sdn. SAP COMMUNITY NETWORK © 2008 SAP AG SDN .sap.sap. Go to layout of view and insert view container element and named it as VCU_ALV.boc.Reading Component Controller’s Context from View with Out Mapping to View Context Node Now fill the node with data from table.com | BPX .com | BOC .sap.

sap.boc. SAP COMMUNITY NETWORK © 2008 SAP AG SDN .sap.com | BPX .com 5 .sdn.Reading Component Controller’s 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.sap. Write the below logic in the View to read the controller context node.bpx.com | BOC .

sap.sap.bpx.Reading Component Controller’s Context from View with Out Mapping to View Context Node SAP COMMUNITY NETWORK © 2008 SAP AG SDN .boc.sap.com | BOC .sdn.com | BPX .com 6 .

sap.Reading Component Controller’s Context from View with Out Mapping to View Context Node Create application to test the component.bpx.com 7 .sdn.com | BPX .com | BOC .boc. Output: SAP COMMUNITY NETWORK © 2008 SAP AG SDN .sap.sap.

com | BOC .sap.sap.boc.com | BPX .sap. visit the Web Dynpro ABAP homepage.bpx.sdn. SAP COMMUNITY NETWORK © 2008 SAP AG SDN .Reading Component Controller’s Context from View with Out Mapping to View Context Node Related Content For more information.com 8 .

bpx. 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. or seek to hold.Reading Component Controller’s 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. including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP.com | BOC .com 9 .sdn. You agree that you will not hold.sap.com | BPX . SAP responsible or liable with respect to the content of this document. and anyone using these methods does so at his/her own risk.boc.sap. SAP COMMUNITY NETWORK © 2008 SAP AG SDN . Changes made based on this information are not supported and can be overwritten during an upgrade.sap. code or methods suggested in this document. SAP will not be held liable for any damages caused by using or misusing the information.

Sign up to vote on this title
UsefulNot useful