OO-Transaction - Dynpro or MainClass as Controller?
Hello,
I've got a question about programming style concerning Object Oriented Transactions:
There are two possibilities for me, here is a small example. I hope you understand what my question is about:
1. Class as Controller
Creating a Class "MainProgram" which calls FunctionModule "Screen1" to show a dynpro "InputScreen". Dynpro "InputScreen" does all the things to ensure, that the Userinput ist consistent and all right. FunctionModule "Screen1" Returns all the UserData to the Class "Mainprogramm". The Class "Mainprogramm" now does some DataBase stuff and Calculating things.
After that it calls FunctionModule "Screen2" to show a Dynpro "CommittingScreen". This Dynpro asks the User whether the Calculated Data is allright. The User also can change some Fields and then push a Button "Save", "Back" or "Cancel". The FunctionModule "Screen2" returns the answer and the changed data back to the class "Mainprogramm" which performs the appropriate action (which is saving data or Calling FunctionModule "Screen1" again or "Leaving Program").
If the required user action is "save Data on Database" the last call of Class "Mainprogram" ist FunctionModule "Screen3", which calls Dynpro "Resultscreen". Here the user can end the program by clicking "end program" after he saw the results. FunctionModule "Screen3" now tells Class "MainProgram" the action ("end program") and the Class ends the Program.
Of course in this Example all FunctionModules are in the same FunctionGroup.
2. FunctionGroup as Controller
The 2nd Example starts also with Class "Mainprogramm" which only Calls FunctionModule "AllScreens". "AllScreens" Calls Dynpro "InputScreen" and after the User did his Input an PAI Module Calls a Local Class to do all the Database and Calculating stuff. After that the Dynpro Module Leaves to Screen "CommittingScreen". Now the User does his changes. The PAI-Module of the "CommittingScreen" again uses a local class to do all the things and sets the next screen according to the UserInput (Leaves to Screen "Input Screen", . Ans so on.
You see: In the First Example all the Controlling-Stuff is done by the Class "MainProgram" whereas in the 2nd Example the Controlling is Programmed in the PAI and PBO Modules of the Dynpro.
If now there should be a new UserInterface, in example 1 i just have to change the function modules and tell those who build the new Interface: "In screen1 i expect the following user data: X Y Z" "In screen2 i give table A to the interface and expect an answer and a corrected table back" and so on. In example 2 i had to copy the local classes which do all the database and calculating stuff from the old dynpro to the new user interface.
So i think example 1 is better - but it doesnt use the advantages of dynpros (Leave to Screen....) because this is done by the "MainProgram" Class....
Can you tell me what is recommended by SAP ? In the ABAB OBJECTS book, i saw an example which was designed like the 2nd example. What is your style and what do you think is better according to Maintanence.
Thanks for your ideas!
Regards!!!!
Christopher
Hello Christopher,
at least, you should consider using some architectural princilpes: Loose coupling and separation of concerns.
E.g. try to encapsulate every object in our scope with small classes and link them together by using interfaces.
For SAP dynpro development, I would at least try to encapsulate everything in classes and hold only the dynpro within a function group, due to the technical limits, that dynpros can only exists for function groups and reports.
Next: build a central application class and a generic controller class for the dynpro processing. Every dynpro should encapsulated via a class and every sy-ucomm should be a simple and small class which deals with your data. The generic controller has to bring the views, events and the model together. The model will be delivered by the central application class.
Before you are starting to build your own framework, just look at this http://wiki.sdn.sap.com/wiki/display/ABAP/SAPmvc.
The SAP mvc-Framework delivers the functionality, which should fulfill your needs.
The introduction has been made with this blog: http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/10732. [original link is broken] [original link is broken]
Hope this helps you.
Kind regards,
Hendrik
Similar Messages
-
In web dynpro i want explanation/definition for the following things
Hi dudes,
I want explanation *** definition for the following
(1) web dynpro
(2) Cardinality
(3) methods
(4) Nodes
(5) Attributes
(6) Interface
(7) Views
(8) Windows
(9) Mapping
(10)Binding
(11)Model
(12)ControllerHi,
Here are the defintions for the terms you hav requested-
Web Dynpro Architecture
Definition
Web Dynpro is the SAP NetWeaver programming model for user interfaces (UIs).
The Web Dynpro model is based on the Model View Controller paradigm, and has the
following features that build on the classic dynpro model:
Clear separation of business logic and display logic
Uniform metamodel for all types of user interfaces
Execution on a number of client platforms
Extensive platform independence of interfaces
Web Dynpro provides support for developing Web representation of a business application.
You use specific tools to describe the properties of a Web Dynpro application in the form of
Web Dynpro metadata. The necessary source code is then generated automatically and
executed at runtime. In addition to the events offered by the framework, you can also define
your own events for a Web Dynpro application. However, the event handling must always be
programmed in separate source code areas which are executed automatically when the event
is triggered at runtime.
In Web Dynpro, each user interface is always made up of the same basic elements. These
elements of the metamodel can be statically declared using Web Dynpro tools.
It is also possible to implement elements of the metamodel at runtime and to change them or
reintegrate them at runtime. Using these implementations, you can make any changes or
enhancements to a user interface that has been created by declarative methods by
generating new interface structures at runtime.
This means that you can combine declarative processes and the implementation of source
code.
A Web Dynpro component is a reusable entity. It summarizes all components that are
required as part of this programming unit for an executable Web Dynpro application.
The Web Dynpro component concept offers a number of advantages:
Structuring of the programming
Creation of easily manageable application blocks
Reusability of whole components
Decoupling of software projects in both time and space
The Web Dynpro component contains any number of windows and views and their
corresponding controllers. Additional Web Dynpro components can also be referenced.
View
A view describes the layout and behavior of a rectangular area of a user interface.
Every Web Dynpro application has at least one view. The layout of a view is made up of
different user interface elements, which can be nested in each other. The positioning of
interface elements in one view is supported by the supplied layout variants.
In addition to the visible part, the layout, a view also contains a controller and a context. The
data to which the elements of the view can be bound are stored and managed in the view
context, enabling them to be represented or used on the screen. The view controller can
contain methods for data retrieval or for processing user input.
Window
A window is used to combine several Views and View Sets (the concept of view sets is only
offered in Web Dynpro for Java). A view can only be displayed by the browser if it has been
embedded in a window. A window always contains one or more views, which are connected
by navigation links. One of these views, or a view set, is specified as the start view and is
displayed the first time the window is called.
Windows have inbound and outbound plugs.
Inbound Plugs and Outbound Plugs
A window has one or several inbound or outbound plugs. Using these plugs, a window can be
included into a navigation chain. The concept of these plugs corresponds to the concept of
the plug for a view. Each plug of a window is visible within the entire window and can be used
for navigating within this window. In addition, one or several plugs can be made accessible to
the component interface so that they are visible even beyond the limits of the component in
question. They thus belong to the interface view of the relevant window.
They are used to navogate from one view to other and pass the data between the views. Which view to be called next from current view - the flow of views is descriebd here using Plugs.
Controller
Controllers are the active parts of a Web Dynpro application. They define how the user can
interact with the Web Dynpro application. The data that a controller can access is defined in
the corresponding context. Different instances of controllers and contexts exist within a Web
Dynpro application.
View Controller
Each view has exactly one view controller, which processes the actions performed by the user in the view.
A view also has exactly one view context, which contains the data required for the view.
Interface Controller
Each Web Dynpro component contains exactly one component controller. This controller is a
global controller that is visible also outside the component. It is thus part of the interface of a
Web Dynpro component.
Context
Definition
The data used in the component or in the view are stored in the context. Read-write access to
this data is available using the controllers as a starting point.
Structure
The data from the contexts is managed in a hierarchical structure. Each context has a root
node, underneath which the individual data fields (attributes) are stored in a tree structure.
You create this tree structure according to the structure of your application.
CONTEXT is generally called as a ROOT Node.
Each context has nodes and attributes also.
Cardinatlity
Each node contains data fields that represent one of the following:
u2022
An individual instance of an object type
u2022
A table of instances.
This property of a node is known as its cardinality. The following table summarizes the
possible cardinalities for a node:
Cardinality Description
1:1 The node contains only one element instance, which is instantiated automatically.
0:1 The node contains only one element instance, which must not be instantiated.
1:n The node can contain multiple element instances, of which at least one must always be
instantiated (and is instantiated automatically).
0:n The node can contain multiple element instances, of which none have to be instantiated.
Further information about this and other properties of context nodes is available in the section
Context-Nodes: Properties.
Recursion Nodes
Dynamic node nesting is possible within a context, creating what is called a recursion node.
The node that is used for recursion is always a predecessor of the new node. The newly
created recursion node is a reference to a predecessor node and therefore cannot be
processed separately. Instead it takes on the structure of the node to be repeated.
Data Binding and Mapping
Within the Web Dynpro architecture, the contexts of the different controllers can be linked in
different ways:
u2022
A UI element of the user interface of the view can be linked with an element of the view
context.
u2022
A mapping can be defined between two global controller contexts, or from a view
context to a global controller context.
The context of a global controller can be linked to a Web Dynpro Model.
Defining Mapping Between Two Contexts
The elements of a view context can be locally defined. In this case (represented in the graphic
below as a "Local Node"), all the contained attributes are only visible within the relevant view.
When the view disappears, the attribute values are deleted.
Event
The component controller allows you to create events.
Events are used to communicate between controllers and enable one controller to trigger
event handlers in a different controller.
Cross-component communication can be implemented using the interface controlleru2019s events.
Events that were created in the component controller are visible within the component only.
Inbound Plugs
Inbound plugs in a view also react like an event. Therefore, when a view is called using an
inbound plug, the event handler that is optionally available for the inbound plug is always
called first. In this case event handling takes place within the current view controller.
UI Element Events
Some UI elements, such as the Button element have special events that are linked with user
actions. These events are predefined and have to be linked with an action at design time.
Actions for UI Element Events
Some UI elements such as the button element can react to a useru2019s interaction: clicking on
the corresponding pushbutton can trigger a handling method to be called within the view
controller. Such UI elements are equipped with one or several general events, which can be
linked with a specific action at design time (switching to a subsequent view, for example). If
such an action is created, an event handler method for this action is created automatically. In
this way, you can equip a UI element event (which has been inserted several times into a
view) with different actions as necessary. The event is then processed by the corresponding
event handler depending on the action that is linked.
Interfaces of Web Dynpro Components
Each component has an interface in order to enable communication between Web Dynpro
components and to enable a component to be called up by a user. This interface consists of
two parts:
Interface View of a Window Contained in a Component
The interface view of a Web Dynpro window is used to link a window with a Web Dynpro
application that can be called by the user.
Reward if helpful.
Best Wishes,
Chandralekha -
How to call a transaction from ABAP code
Hi everybody,
How do I run a transaction from my ABAP code?
For example, through my ABAP code, I want to call the ME24 transaction (Maintain Purchase Order).
Thanks for the help,
RoyCALL TRANSACTION
Syntax
CALL TRANSACTION ta { [AND SKIP FIRST SCREEN]
| [USING bdc_tab [bdc_options]] }.
Extras:
1. ... AND SKIP FIRST SCREEN
2. ... USING bdc_tab [bdc_options]
Effect
The statement CALL TRANSACTION calls the transaction whose transaction code is contained in data object ta. The data object ta must be of character type and must contain the transaction code in uppercase letters. If the transaction specified in ta cannot be found, an untreatable exception is triggered. The additions suppress the display of the initial screen and allow you to execute the transaction using a batch input session.
At CALL TRANSACTION the calling program and its data is kept, and after exiting the called transaction, processing is resumed in the calling program after the call.
When the transaction is called, the ABAP program linked with the transaction code is loaded in a new internal session. The session of the calling program is kept. The called program runs in an SAP LUW of its own.
If the called transaction is a dialog transaction, after loading the ABAP program the event LOAD-OF-PROGRAM is triggered and the dynpro defined as initial dynpro of the transaction is called. The initial dynpro is the first dynpro of a dynpro sequence. The transaction is finished when the dynpro sequence is ended by encountering the next dynpro with dynpro number 0 or when the program is exited with the LEAVE PROGRAM statement.
If the called transaction is an OO transaction (as of release 6.10), when loading all programs except class pools the event LOAD-OF-PROGRAM is triggered and then the method linked with the transaction code is called. If the method is an instance method, implicitly an object of the corresponding class is generated and referenced by the runtime environment. The transaction is finished when the method is finished or when the program is exited using the LEAVE PROGRAM statement.
After the end of the transaction call, program execution of the calling program resumes after the CALL TRANSACTION statement.
Note
At the statement CALL TRANSACTION, the authorization of the current user to execute the called transaction is not checked automatically. If the calling program does not execute a check, the called program must check the authorization. To do this, the called program must call function module AUTHORITY_CHECK_TCODE.
Addition 1
... AND SKIP FIRST SCREEN
Effect
This addition suppresses the display of a screen of the initial dynpro of a called dialog transaction. The addition AND SKIP FIRST SCREEN suppresses the first screen under these prerequisites:
For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number.
All mandatory input fields of the initial dynpro must be filled completely and with the correct values by the SPA/GPA parameters
If these prerequisites are met, that screen of the dynpro is displayed that is specified in the Screen Painter as the next dynpro of the initial dynpro.
Example
If the static next dynpro of the initial dynpro of the called dialog transaction FLIGHT_TA is not the initial dynpro itself, its screen is suppressed, because its input fields are filled using the SPA/GPA parameters CAR and CON.
DATA: carrid TYPE spfli-carrid,
connid TYPE spfli-connid.
SET PARAMETER ID: 'CAR' FIELD carrid,
'CON' FIELD connid.
CALL TRANSACTION 'FLIGHT_TA' AND SKIP FIRST SCREEN.
Addition 2
... USING bdc_tab [bdc_options]
Effect
Use this addition to pass an internal table bdc_tab of row type BDCDATA from the ABAP Dictionary to a dialog transaction. The additions bdc_options control the batch input processing. When a transaction with addition USING is called, the system field sy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.
The internal table bdc_tab is the program-internal representation of a batch input session and must be filled accordingly. The structure BDCDATA has the components shown in the table below.
Component Description
PROGRAM Name of the program of the called transaction
DYNPRO Number of the dynpro to be processed
DYNBEGIN Flag for the beginning of a new dynpro (possible values are "X" and " ")
FNAM Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor
FVAL Value to be passed to the dynpro field or to the control statement
Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
System Fields
sy-subrc Description
0 The batch input processing of the called transaction was successful.
< 1000 Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES.
1001 Error in batch input processing.
Note
Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN and USING together. However, this does not make sense, because the addition AND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields using SPA/GPA parameters, while the batch input table specified with USING controls the entire transaction flow including the display of the screens.
Example
Call of the Class Builder (transaction SE24) and display of class CL_SPFLI_PERSISTENT. The internal table bdcdata_tab contains the input for the batch input processing of the first dynpro (1000) of the transaction. Using structure opt, the batch input processing is set to suppress the first screen and to display the next screen in the standard size.
DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'.
DATA: bdcdata_wa TYPE bdcdata,
bdcdata_tab TYPE TABLE OF bdcdata.
DATA opt TYPE ctu_params.
CLEAR bdcdata_wa.
bdcdata_wa-program = 'SAPLSEOD'.
bdcdata_wa-dynpro = '1000'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
bdcdata_wa-fval = class_name.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=CIDI'.
APPEND bdcdata_wa TO bdcdata_tab.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt. -
Sharing transaction between regions and creating new records
Hi all,
To simplify my scenario, I will use HR scema.
I have a fragment department.jsff. This one is showing records from a Departments table in a panelFormLayout. In here I have a button NEW that is bound to the CreateInsert operation from Deparment collection from HRDataControl. (so the ActionListener for the button is "#{bindings.CreateInsert.execute}".
This department.jsff has a task flow as a region (customer-tf) with input parameter. So in departmentPageDef, customer-tf is an executable with Refresh:ifNeeded and a parameter value: #{bindings.DepartmentId.inputValue}. The customer-tf, has as a default activity method call - which based on the input parameter value executes a query (viewcritwria) for Customer table, and than shows in a table Customer collection from HRDataControl.
So far so good. When I run the page, first record from Departnent collection is displayed in the form, the right value #{bindings.DepartmentId.inputValue} is passed as a input value to customer-tf, proper query is done for Customer collection and proper customer records are displayed in the customer region.
The problem I have is when the New button is pressed.
If on customer-tf for Transaction behavior I set: <No Controller Transaction> and "Share data controls with calling task flow" unchecked (so isolated), than when New button is pressed, new department record is created, and customer table shows no records. The customer-tf was restarted with a input parameter value of -10 (since DepartmentId is of type oracle.jbo.domain.DBSequence in Department table.) That is excellant.
But I want to share transaction. So if on customer-tf for Transaction behavior I set: <Use existing Transaction if possible> and "Share data controls with calling task flow" checked (so shared), I am tracing that new record is created in Department entity, but customer-tf is restarted with the old value of DeparmentId #{bindings.DepartmentId.inputValue}. New record is never shown on the page.
I want to be able to share transaction and data control. Somehow is second scenario, like a sharing prevents bindings value (#{bindings.DepartmentId.inputValue}) to get new value of -10.
Am I doing anything wrong??I have figured it out.
The transaction management and sharing data controls.
It is different when the task-flow:
a) is a region inside a page or fragment (in here you are controlling only sharing data controls declaratively)
b) is called with a task low call activity from another flow and has a task flow return point (in here you are controlling transaction declaratively + sharing data controls)
I figured out this by carefully rereading from Fusion Developers Guide: chapter 18.3 (Managing transactions) , and chapter 16.4 (Sharing data control instances)
Regards -
Hi all,
What is the use of component controller,custom controller and interface controller.In wht senarios we use them.Also please explain about its visibility with other components..
Regards,
Alex.hi
What is the use of component controller,custom controller and interface controller.In wht senarios we use them
Component controller
There is only one component controller per Web Dynpro component. This is a global controller, visible to all other controllers. The component controller drives the functionality of the entire component. This controller has no visual interface. The lifetime of the component controller equals the lifetime of the component. When starting a Web Dynpro application, the component controller is instantiated by the Web Dynpro runtime
Custom controllers
Custom controllers are optional. They have to be defined at design time and can be used to encapsulate sub-functions of the component controller. Multiple custom controllers can be defined in a component. Custom controllers are instantiated automatically by the Web Dynpro framework and the instantiation order is undefined; therefore, the coding in a custom controller should make no assumptions about the existence of any other custom controller. The instantiation of a custom controller is delayed until the first method of the controller is called. Custom controller instances cannot be deleted explicitly.
Interface Controller
The interface controller is used for cross-component communication. It defines the controller part of the interface of a Web Dynpro component. The interface controller itself does not contain any implementation.
For the interface controller of a Web Dynpro controller, the methods are implemented in the related component controller.
For the interface controller of a component interface definition, the implementation is performed in the component controller of the embedding component.
go through this WIKI :
Introduction to controllers
http://wiki.sdn.sap.com/wiki/display/WDABAP/Introductiontocontrollers
and SAP online help :
http://help.sap.com/saphelp_nw70/helpdata/en/b9/b82c4142aef623e10000000a155106/content.htm
regards,
amit -
hi experts,
I want to call a transaction and to invoke a function code in the called transaction without any user interaction. Is it possible to use <b>call transaction "Tcode" </b>statement and pass a fuction code along with it. else suggest me how to over come this problem.
with regards,
James....
valuable answers will be rewarded..........this is one more addtion of the CALL TRANSACTION statement
... <b>USING bdc_tab [bdc_options]</b>
Effect
Use this addition to pass an internal table bdc_tab of row type BDCDATA from the ABAP Dictionary to a dialog transaction. The additions bdc_options control the batch input processing. When a transaction with addition USING is called, the system field sy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.
The internal table bdc_tab is the program-internal representation of a batch input session and must be filled accordingly. The structure BDCDATA has the components shown in the table below.
Component Description
PROGRAM Name of the program of the called transaction
DYNPRO Number of the dynpro to be processed
DYNBEGIN Flag for the beginning of a new dynpro (possible values are "X" and " ")
FNAM Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor
FVAL Value to be passed to the dynpro field or to the control statement
Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
System Fields
sy-subrc Description
0 The batch input processing of the called transaction was successful.
< 1000 Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES.
1001 Error in batch input processing.
Note
Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN and USING together. However, this does not make sense, because the addition AND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields using SPA/GPA parameters, while the batch input table specified with USING controls the entire transaction flow including the display of the screens.
Example
Call of the Class Builder (transaction SE24) and display of class CL_SPFLI_PERSISTENT. The internal table bdcdata_tab contains the input for the batch input processing of the first dynpro (1000) of the transaction. Using structure opt, the batch input processing is set to suppress the first screen and to display the next screen in the standard size.
DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'.
DATA: bdcdata_wa TYPE bdcdata,
bdcdata_tab TYPE TABLE OF bdcdata.
DATA opt TYPE ctu_params.
CLEAR bdcdata_wa.
bdcdata_wa-program = 'SAPLSEOD'.
bdcdata_wa-dynpro = '1000'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
bdcdata_wa-fval = class_name.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=CIDI'.
APPEND bdcdata_wa TO bdcdata_tab.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt. -
Hi All,
Why a web dyn pro component can have only one component controller?
thanks & regards,
Manoj.Hi Manoj..
<b><u>Component Controllers</u></b>
The component controller is the master controller for a Web Dynpro Component. As soon as you declare the existence of a Web Dynpro Component, the component controller is automatically created. You cannot have a Web Dynpro Component without a component controller.
This controller can be thought of as being hierarchically superior to all other controllers in the component. Consequently, the lifespan of the component is always equal to the lifespan of the component controller.
For each component of yours there will be a component controller, were in you can define context variables and methods, events etc.. This usefull while using models.
Simple example where we can see this is, when you create global context variable in this controller and map this variable to the view controller context variable of different view, which enables you to pass the value of the variable from one view to another.
<b><u>Custom Controllers</u></b>
They also have the same the function but as the name suggest there function can be customised. That is <b>we can have more than one custom controller for a component</b>. This is usefull when we need to create seperate execute methods for inputs from model import( Both webservice and rfc call).So you can seperate each other.
<u><b>Creating Custom Controller</b></u>
1.In the Web Dynpro Explorer, place the cursor on the node Custom Controllers (a subnode of the Web Dynpro component) and choose Create Custom Controller in the context menu.
2.In the wizard, enter a name for the custom controller and close the wizard by choosing Finish.
Hop this will help you..
Regards,
GS
Message was edited by:
Sathishkumar GS -
Batch-Input Dynpro sequence changed
Hello,
a customer uses a report since today (1 1/2 years) that creates new materials by CALL TRANSACTION 'MMZ1'.
Hoever, the once recorded dynpro sequence changed and the report fails to create new materials. (already changed and material creation with BAPI_MATERIAL_SAVEDATA)
There were no changes to the customizing of that system and no patches etc. were installed. Even no user knew this transaction MMZ1, so that its sequence was not changed manually.
Now my question:
Which events do infuence transactions, transaction dynpro sequences?
Regards
Frank ZoorHi Frank,
If it is a BDC program, then the Sequence in which the dynpors were coded is almost harcoded and it needs to be changed according to the new sequence. There is no other alternative to this.
If it calls some BAPIs that creates the Material, then check the sequence in which the BAPI calls the screens and compare whether it is calling in the correct sequence. Else modify that.
Cheers,
Sam -
Hi All
I am new in Web-Dynpro and please give me some document releted to these words
WdThis
IWDController
IWDViewController,IWDWindowController,IWDmessagemanager,IWDWindowmanager
and please tell me how and when we access these.
Regards
SatishHi
1) Controller Shortcut Variables
private final IPrivate wdThis;
private final IPrivate.IContextNode wdContext;
private final IWDViewController wdControllerAPI;
private final IWDComponent wdComponentAPI;
public (IPrivate wdThis) {
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
2) Within any Web Dynpro controller, three shortcut variables are always present, whose values are all derived from the member variable wdThis.wdThis is the Web Dynpro specific self reference and should be used in preference to the standard Java self reference of this.
3) The member variable wdThis is populated from a parameter of the same name, passed in by the Web Dynpro framework when the controller is instantiated.
IWDController
https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDController.html
IWDViewController
https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDViewController.html
IWDMessageManager
https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDMessageManager.html
IWDWindow
https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/session/api/IWDWindow.html
IWDWindowManager
https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/session/api/IWDWindowManager.html
Thanks and Regards,
Arun -
Unable to call the RFC from the WD java Program
Hi All,
I have a table and three buttons Create, Edit, Save in the layout.
If no record available in the R3 the the end user will click on create and then he will click on save so that the insert RFC will be called accordingly and the record will be inserted.My table is limited to 5 records only. If i enter all the 5 records and Click on submit the record is inserting in the backend , but if i enter less than 5 records im unable to call the RFC what might be the issue.
My insert RFC takes one Table node and 4 import parameters i'm passing all of the all the mentioned import parameters.
Code:-
View Controller code
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.gmr.ess;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateAPPView).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.math.BigDecimal;
import java.util.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Iterator;
import com.gmr.ess.wdp.IPrivateAPPView;
import com.gmr.pck.Zst_Hr_Nominee;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
//@@end
//@@begin documentation
//@@end
public class APPView
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(APPView.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.gmr.ess.wdp.IPrivateAPPView for more details
private final IPrivateAPPView wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.gmr.ess.wdp.IPrivateAPPView.IContextNode for more details.
private final IPrivateAPPView.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public APPView(IPrivateAPPView wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
try{
IWDMessageManager manager1 = wdComponentAPI.getMessageManager();
IWDClientUser user = WDClientUser.getLoggedInClientUser();
String logUser= user.getSAPUser().getUniqueName();
wdContext.currentContextElement().setUserid(logUser);
wdThis.wdGetAPPController().executeBapi_Employee_Getdata_Input();//Returns the user id for the employee
Collection nomineeList = new ArrayList();
wdThis.wdGetAPPController(). executeZ_Hrfm_Nominee_Disp_Input( );
int nomineeTableSize = wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().size();
for(int i=0;i< nomineeTableSize;i++){
IPrivateAPPView.IDisplay_table_nodeElement ele = wdContext.nodeDisplay_table_node().createDisplay_table_nodeElement();
ele.setAddr(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getAddr());
ele.setDob(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getDob());
ele.setGuard(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getGuard());
ele.setName(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getName());
ele.setPerc(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getPerc());
ele.setRelat(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getRelat());
nomineeList.add(ele);
wdContext.nodeDisplay_table_node().bind(nomineeList);
wdContext.currentContextElement().setEdit_val_attr(true);
if(nomineeTableSize<=0){
wdContext.currentContextElement().setCreateButtonEnable(true);
wdContext.currentContextElement().setEditButtonEnable(false);
else{
wdContext.currentContextElement().setCreateButtonEnable(false);
wdContext.currentContextElement().setEditButtonEnable(true);
catch(Exception e){
wdComponentAPI.getMessageManager().reportException("",true);
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoModifyView
Hook method called to modify a view just before rendering.
This method conceptually belongs to the view itself, not to the
controller (cf. MVC pattern).
It is made static to discourage a way of programming that
routinely stores references to UI elements in instance fields
for access by the view controller's event handlers, and so on.
The Web Dynpro programming model recommends that UI elements can
only be accessed by code executed within the call to this hook method.
@param wdThis Generated private interface of the view's controller, as
provided by Web Dynpro. Provides access to the view controller's
outgoing controller usages, etc.
@param wdContext Generated interface of the view's context, as provided
by Web Dynpro. Provides access to the view's data.
@param view The view's generic API, as provided by Web Dynpro.
Provides access to UI elements.
@param firstTime Indicates whether the hook is called for the first time
during the lifetime of the view.
//@@end
public static void wdDoModifyView(IPrivateAPPView wdThis, IPrivateAPPView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
//@@end
//@@begin javadoc:onActionGetData(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionGetData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionGetData(ServerEvent)
//$$begin ActionButton(-535519310)
//wdThis.wdGetAPPController().executeZ_Hrfm_Nominee_Disp_Input();
//$$end
//@@end
//@@begin javadoc:onActionEdit(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionEdit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionEdit(ServerEvent)
//$$begin ActionButton(-535519310)
displayTablesize=wdContext.nodeDisplay_table_node().size();
if(displayTablesize<5){
for(int i=0;i<size-displayTablesize;i++){
IPrivateAPPView.IDisplay_table_nodeElement ele = wdContext.nodeDisplay_table_node().createDisplay_table_nodeElement();
wdContext. nodeDisplay_table_node().addElement(ele);
operation="MOD";
wdContext.currentContextElement().setTableReadOnly(true);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setOperation(operation);
//$$end
//@@end
//@@begin javadoc:onActionCreate(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionCreate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionCreate(ServerEvent)
int month=0,year=0,day=0;
String month1,day1,year1;
try{
displayTablesize=wdContext.nodeDisplay_table_node().size();
wdContext.currentContextElement().setEdit_val_attr(false);
if(wdContext.nodeDisplay_table_node().isEmpty()){
if(displayTablesize<5){
Calendar cal=Calendar.getInstance();
month=cal.get(Calendar.MONTH)+1;
if(month==1||month==2||month==3||month==4||month==5||month==6||month==7||month==8||month==9){
month1="0"+month;
else{
month1=""+month;
day = cal.get(Calendar.DAY_OF_MONTH);
if(day==1||day==2||day==3||day==4||day==5||day==6||day==7||day==8||day==9){
day1= "0"+day;
else{
day1=""+day;
year = cal.get(Calendar.YEAR);
year1=""+year;
String strFormat=day1"."month1"."year1;
wdContext.currentOutput_NomineeElement().setBegda(strFormat);
wdContext.currentOutput_NomineeElement().setEndda("31.12.9999");
for(int i=0;i<size-displayTablesize;i++){
IPrivateAPPView.IDisplay_table_nodeElement ele = wdContext.nodeDisplay_table_node().createDisplay_table_nodeElement();
wdContext. nodeDisplay_table_node().addElement(ele);
operation="INS";
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setOperation(operation);
wdContext.currentContextElement().setTableReadOnly(true);
catch(NullPointerException npe){
wdComponentAPI.getMessageManager().reportException("No Data Available",true);
//@@end
//@@begin javadoc:onActionSaveData(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionSaveData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionSaveData(ServerEvent)
float percentage=0;
float dupePercentage=0;
boolean isTest = false;
Collection DispTList = new ArrayList();
IWDMessageManager manager1 = wdComponentAPI.getMessageManager();
try{
displayTablesize = wdContext.nodeDisplay_table_node().size();
//for(int i=1;i<=displayTablesize;i++){
for(int i=0;i<displayTablesize;i++){
BigDecimal share = wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getPerc();
String name = wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getName();
percentage = share.floatValue();
dupePercentage = dupePercentage + percentage;
if(name!=null && share!=null){
Zst_Hr_Nominee nominee = new Zst_Hr_Nominee();
nominee.setAddr(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getAddr());
manager1.reportSuccess(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getAddr());
nominee.setDob(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getDob());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getDob());
nominee.setGuard(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getGuard());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getGuard());
nominee.setName(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getName());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getName());
nominee.setPerc(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getPerc());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getPerc());
nominee.setRelat(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getRelat());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getRelat());
DispTList.add(nominee);
wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().nodeNominee_ins().bind(DispTList);
if((dupePercentage)!=100)
wdComponentAPI.getMessageManager().reportException(
"The sum of the share Percentages is not 100. Modify the percentages accordingly",true);
wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().nodeNominee_ins().bind(DispTList);
IWDMessageManager manager = wdComponentAPI.getMessageManager();
String beginDate = wdContext.currentOutput_NomineeElement().getBegda();
manager.reportSuccess(wdContext.currentOutput_NomineeElement().getBegda());
String endDate=wdContext.currentOutput_NomineeElement().getEndda();
manager.reportSuccess(wdContext.currentOutput_NomineeElement().getEndda());
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setBegda(beginDate);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setEndda(endDate);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setOperation(operation);
wdComponentAPI.getMessageManager().reportSuccess(operation);
wdThis.wdGetAPPController().executeBapi_Employee_Getdata_Input();
wdThis.wdGetAPPController().executeZ_Hrfm_Nominee_Ins_Mod_Input();
//wdContext.currentContextElement().setTableReadOnly(false);
catch(Exception e){
e.getMessage();
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
int nomineeTableSize = 0;
int displayTablesize = 0;
String operation= null;
int size=5;
// float dupePercentage=0;
//String mod_op="MOD";
//@@end
content of obsolete user coding area(s) -
//@@begin obsolete:javadoc:onActionSave(ServerEvent)
// /** Declared validating even
Component controller code
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.gmr.ess;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateAPP).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.util.Iterator;
import com.gmr.ess.wdp.IPrivateAPP;
import com.gmr.pck.Bapi_Employee_Getdata_Input;
import com.gmr.pck.Bapip0002B;
import com.gmr.pck.Z_Hrfm_Nominee_Disp_Input;
import com.gmr.pck.Z_Hrfm_Nominee_Ins_Mod_Input;
import com.gmr.pck.Zst_Hr_Nominee;
import com.sap.lcr.api.util.SetProfileConnect;
import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
//@@end
//@@begin documentation
//@@end
public class APP
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(APP.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.gmr.ess.wdp.IPrivateAPP for more details
private final IPrivateAPP wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.gmr.ess.wdp.IPrivateAPP.IContextNode for more details.
private final IPrivateAPP.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public APP(IPrivateAPP wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
//$$begin Service Controller(1490375209)
// wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().bind(new Z_Hrfm_Nominee_Ins_Mod_Input());
Z_Hrfm_Nominee_Ins_Mod_Input input = new Z_Hrfm_Nominee_Ins_Mod_Input();
input.addNominee(new Zst_Hr_Nominee());
wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().bind(input);
//$$end
//$$begin Service Controller(-932523997)
wdContext.nodeZ_Hrfm_Nominee_Disp_Input().bind(new Z_Hrfm_Nominee_Disp_Input());
//$$end
//$$begin Service Controller(-368783613)
wdContext.nodeBapi_Employee_Getdata_Input().bind(new Bapi_Employee_Getdata_Input());
//$$end
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoPostProcessing()
Hook called to handle data retrieval errors before rendering.
After doModifyView(), the Web Dynpro Framework gets all context data needed
for rendering by validating the contexts (which in turn calls the supply
functions and supplying relation roles). In this hook, the application
should handle the errors which occurred during validation of the contexts.
Using preorder depth-first traversal, this hook is called for all component
controllers starting with the current root component.
Permitted operations:
- Flushing model queue
- Creating messages
- Reading context and model data
Forbidden operations:
- Invalidating model data
- Manipulating the context
- Firing outbound plugs
- Creating components
@param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoPostProcessing(boolean isCurrentRoot)
//@@begin wdDoPostProcessing()
//@@end
//@@begin javadoc:wdDoBeforeNavigation()
Hook before the navigation phase starts.
This hook allows you to flush the model queue and handle any
errors that occur. Firing outbound plugs is allowed in this hook.
Using preorder depth-first traversal, this hook is called for all component
controllers starting with the current root component.
@param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoBeforeNavigation(boolean isCurrentRoot)
//@@begin wdDoBeforeNavigation()
//@@end
//@@begin javadoc:wdDoApplicationStateChange()
Hook that informs the application about a state change.
<p>
This hook is called e.g. to tell the application that will be
<ul>
<li>left via a suspend plug and therefore should go into a suspend/sleep
mode with minimal need of resources. errors that occur. Firing
outbound plugs is allowed in this hook.
<li>left due to a timeout and could write it's state to a data base if the
user comes back later on
</ul>
The concrete reason is available via IWDApplicationStateChangeInfo
<p>
<b>Important</b>: This hook is called for the top level component only!
@param stateChangeInfo contains the information about the nature of the state change
@param stateChangeReturn allows the application to ask for a different state change.
The framework is allowed to ignore it considering i.e. the current resources situation.
//@@end
public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn)
//@@begin wdDoApplicationStateChange()
//@@end
//@@begin javadoc:executeBapi_Employee_Getdata_Input()
/** Declared method. */
//@@end
public void executeBapi_Employee_Getdata_Input( )
//@@begin executeBapi_Employee_Getdata_Input()
//$$begin Service Controller(1705750894)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
Iterator itrGetData = null;
Bapip0002B out = null;
try
wdContext.currentBapi_Employee_Getdata_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
itrGetData = wdContext.currentOutputElement().modelObject().getPersonal_Data().iterator();
while (itrGetData.hasNext()) {
out = (Bapip0002B) itrGetData.next();
empNo = out.getPerno();
wdContext.currentZ_Hrfm_Nominee_Disp_InputElement().setPernr(empNo);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setPernr(empNo);
// manager.reportSuccess(empNo);
//wdThis.executeZ_Hrfm_Nominee_Disp_Input();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//$$end
//@@end
//@@begin javadoc:executeZ_Hrfm_Nominee_Disp_Input()
/** Declared method. */
//@@end
public void executeZ_Hrfm_Nominee_Disp_Input( )
//@@begin executeZ_Hrfm_Nominee_Disp_Input()
//$$begin Service Controller(-366407911)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
wdContext.currentZ_Hrfm_Nominee_Disp_InputElement().modelObject().execute();
wdContext.nodeOutput_Nominee().invalidate();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//$$end
//@@end
//@@begin javadoc:executeZ_Hrfm_Nominee_Ins_Mod_Input()
/** Declared method. */
//@@end
public void executeZ_Hrfm_Nominee_Ins_Mod_Input( )
//@@begin executeZ_Hrfm_Nominee_Ins_Mod_Input()
//$$begin Service Controller(1524028406)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().modelObject().execute();
wdContext.nodeOutput_nominee_ins_mod().invalidate();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//$$end
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
String empNo = null;
//@@end
Suman
Edited by: sumankumar kurimilla on Dec 23, 2008 9:26 AMHi,
I have checked from RFC side that is working fine only java app its not working can you tell any thing needs to be changed from my application end.
Please check in Savedata action.
Regards,
Suman
Edited by: sumankumar kurimilla on Dec 23, 2008 11:01 AM -
Unable to send emails through adobe offline project.
Hi Experts!!!
I am trying to send an email through Adobe Offline Form. I am quoting the code. Plz check what's the problem with the code.
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.lifecyclelettersapplication;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateFormView).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.util.Properties;
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.SendFailedException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import com.lifecyclelettersapplication.wdp.IPrivateFormView;
//@@end
//@@begin documentation
//@@end
public class FormView
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(FormView.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.lifecyclelettersapplication.wdp.IPrivateFormView for more details
private final IPrivateFormView wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.lifecyclelettersapplication.wdp.IPrivateFormView.IContextNode for more details.
private final IPrivateFormView.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public FormView(IPrivateFormView wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
/* The following lines initialize the context elements;
Enter your e-mail id in the set From-method
//wdContext.currentContextElement().setTeststatus(" do in it");
try{
wdContext.currentEmailElement().setFrom("[email protected]");
wdContext.currentEmailElement().setTo("[email protected]");
wdContext.currentEmailElement().setCc("[email protected]");
wdContext.currentEmailElement().setBcc("[email protected]");
// wdContext.currentEmailElement().setCc(" ");
// wdContext.currentEmailElement().setBcc(" ");
wdContext.currentEmailElement().setSubject("Test Mail By Umang");
wdContext.currentEmailElement().setBody("You will find the address proof letter in the attachment of this e mail. Please sign this form and send it.");
catch(Exception e)
wdContext.currentContextElement().setTeststatus("do in it"+e.getMessage());
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoModifyView
Hook method called to modify a view just before rendering.
This method conceptually belongs to the view itself, not to the
controller (cf. MVC pattern).
It is made static to discourage a way of programming that
routinely stores references to UI elements in instance fields
for access by the view controller's event handlers, and so on.
The Web Dynpro programming model recommends that UI elements can
only be accessed by code executed within the call to this hook method.
@param wdThis Generated private interface of the view's controller, as
provided by Web Dynpro. Provides access to the view controller's
outgoing controller usages, etc.
@param wdContext Generated interface of the view's context, as provided
by Web Dynpro. Provides access to the view's data.
@param view The view's generic API, as provided by Web Dynpro.
Provides access to UI elements.
@param firstTime Indicates whether the hook is called for the first time
during the lifetime of the view.
//@@end
public static void wdDoModifyView(IPrivateFormView wdThis, IPrivateFormView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
//@@end
//@@begin javadoc:onPlugFromFirstview(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onPlugFromFirstview(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onPlugFromFirstview(ServerEvent)
wdContext.currentContextElement().setTeststatus("from first view");
//wdDoInit();
//@@end
//@@begin javadoc:onActionBack(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionBack(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionBack(ServerEvent)
wdThis.wdFirePlugToFirstView();
//@@end
//@@begin javadoc:onActionSend(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionSend(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionSend(ServerEvent)
Properties props = new Properties();
String host = "rmail070.zmail.ril.com";
props.put("rmail070.zmail.ril.com", host);
Session session = Session.getInstance(props, null);
MimeMessage message = new MimeMessage(session);
Address toAddress = new InternetAddress();
Address fromAddress = new InternetAddress();
Address ccAddress = new InternetAddress();
Address bccAddress = new InternetAddress();
wdContext.currentContextElement().setTeststatus("1");
try
MimeMultipart multipart = new MimeMultipart();
wdContext.currentContextElement().setTeststatus("2");
BodyPart messageBodyPart = new MimeBodyPart();
if (! wdContext.currentEmailElement().getFrom().equals(""))
fromAddress = new InternetAddress(wdContext.currentEmailElement().getFrom());
message.setFrom(fromAddress);
wdContext.currentContextElement().setTeststatus("3");
if (! wdContext.currentEmailElement().getTo().equals(""))
toAddress = new InternetAddress(wdContext.currentEmailElement().getTo());
message.setRecipient(Message.RecipientType.TO, toAddress);
wdContext.currentContextElement().setTeststatus("4");
if (! wdContext.currentEmailElement().getCc().equals(""))
ccAddress = new InternetAddress(wdContext.currentEmailElement().getCc());
message.setRecipient(Message.RecipientType.CC, ccAddress);
wdContext.currentContextElement().setTeststatus("5");
if (! wdContext.currentEmailElement().getBcc().equals(""))
bccAddress = new InternetAddress(wdContext.currentEmailElement().getBcc());
message.setRecipient(Message.RecipientType.BCC, bccAddress);
wdContext.currentContextElement().setTeststatus("6");
if (! wdContext.currentEmailElement().getSubject().equals(""))
message.setSubject(wdContext.currentEmailElement().getSubject());
wdContext.currentContextElement().setTeststatus("7");
if (! wdContext.currentEmailElement().getBody().equals(""))
messageBodyPart.setText(wdContext.currentEmailElement().getBody());
wdContext.currentContextElement().setTeststatus("8");
multipart.addBodyPart(messageBodyPart);
wdContext.currentContextElement().setTeststatus("10");
//// A new part will be added this will be the attachment
messageBodyPart = new MimeBodyPart();
// String filename = "temp
webdynpro
web
local
LifeCycleLetters
Components
com.lifecyclelettersapplication.LifeCycleLettersApplication
LifeCycle.pdf";
// DataSource source = new FileDataSource(filename);
// messageBodyPart.setDataHandler(new DataHandler(source));
// messageBodyPart.setFileName(source.getName());
// messageBodyPart.setHeader("Content-Type","application/pdf");
// multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport.send(message);
wdContext.currentContextElement().setTeststatus("11");
catch (AddressException e)
wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
e.printStackTrace();
catch (SendFailedException e)
wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
e.printStackTrace();
catch (MessagingException e)
wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
e.printStackTrace();
catch(Exception e)
wdContext.currentContextElement().setTeststatus("action send"+e.getMessage());
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
//@@endHi,
I think u need to set up the SMTP So that u can send the email.
Regards
Mustafa. -
Hi All,
Kindly help me in solving this issue.
Portals report layouts can be customized. When the user chooses to export
the customized reports to Excel, only the standard layout (hard coded
layout for each report) is exported to Excel and all the customized columns
are not exported.
C&RM is planning to use the portals aging report for performance metrics,
collection and identifying the over 90 items for collection rep. The
standard layout for the portals aging report is missing the BP# and
Collection rep name.
Choosing right click, select all and copying to Excel, the format of the
report is lost.
Herewith I am attaching the code which needs modification.
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.zurich.fscd;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED // BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN // AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateExportexView).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY // A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS // OF IMPORT STATEMENTS.
//@@begin imports
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.StringTokenizer;
import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;
import com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfo;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
import com.sap.tc.webdynpro.progmodel.api.IWDNode;
import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
import com.sap.tc.webdynpro.services.sal.adapter.api.WDWebContextAdapter;
import com.sap.tc.webdynpro.services.sal.url.api.IWDCachedWebResource;
import com.sap.tc.webdynpro.services.sal.url.api.WDURLException;
import com.sap.tc.webdynpro.services.sal.url.api.WDWebResource;
import com.sap.tc.webdynpro.services.sal.url.api.WDWebResourceType;
import com.zurich.fscd.wdp.IPrivateExportexView;
//@@end
//@@begin documentation
//@@end
public class ExportexView
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(ExportexView.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.zurich.fscd.wdp.IPrivateExportexView for more details
private final IPrivateExportexView wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.zurich.fscd.wdp.IPrivateExportexView.IContextNode for more details.
private final IPrivateExportexView.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public ExportexView(IPrivateExportexView wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
IWDCachedWebResource cachedExcelResource = null;
String fileName = "Items.xls";
byte[] bytes ;
IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("ExcelDownload");
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
String reporttype = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("reporttype" ) ;
if (reporttype == null) {
reporttype = GC_REPORTTYPE_BPACCTSTAT_CARM;
Object level = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("level" ) ;
if (level == null){
level = "";
Object paramname = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("app.paramname" ) ;
Object paramvalue = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("app.paramvalue" ) ;
if (paramname == null){
paramname = "";
if (paramvalue == null){
paramvalue = "";
if (reporttype.equals(GC_REPORTTYPE_OPENITEMS_SUMM)) {
wdContext.currentZ_Rm_Get_Open_Items_ResultsElement().setI_Reporttype("S");
wdContext.currentZ_Rm_Get_Open_Items_ResultsElement().modelObject().execute();
wdContext.nodeOutputOI().invalidate();
bytes = toExcel(wdContext.nodeEt_Mas(),getColumnInfosAOISUMM()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equals(GC_REPORTTYPE_OPENITEMS_DET)) {
wdContext.currentZ_Rm_Get_Open_Items_ResultsElement().setI_Reporttype("A");
wdContext.currentZ_Rm_Get_Open_Items_ResultsElement().modelObject().execute();
wdContext.nodeOutputOI().invalidate();
bytes = toExcel(wdContext.nodeEt_Detail(),getColumnInfosAOIDet()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equals(GC_REPORTTYPE_BPACCTSTAT_BU)) {
wdContext.currentZ_Rm_Bpacctstat_Bu_Get_ResultsElement().setI_Level(level.toString());
wdContext.currentZ_Rm_Bpacctstat_Bu_Get_ResultsElement().setI_Paramname(paramname.toString());
wdContext.currentZ_Rm_Bpacctstat_Bu_Get_ResultsElement().setI_Paramvalue(paramvalue.toString());
wdContext.currentZ_Rm_Bpacctstat_Bu_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
bytes = toExcel(wdContext.nodeEt_Bu1(),getColumnInfosBU()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equals(GC_REPORTTYPE_BPACCTSTAT_CARM)) {
wdContext.currentZ_Rm_Bpaccstat_Ca_Get_ResultsElement().setI_Level(level.toString());
wdContext.currentZ_Rm_Bpaccstat_Ca_Get_ResultsElement().setI_Paramname(paramname.toString());
wdContext.currentZ_Rm_Bpaccstat_Ca_Get_ResultsElement().setI_Paramvalue(paramvalue.toString());
wdContext.currentZ_Rm_Bpaccstat_Ca_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputCRM().invalidate();
bytes = toExcel(wdContext.nodeEt_Carm1(),getColumnInfosCARM()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equalsIgnoreCase(GC_REPORTTYPE_RMETRICS_EFDBID)) {
//wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reportlevel("1");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reporttype("1");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputRmetr().invalidate();
bytes = toExcel(wdContext.nodeEt_Efdbid(),getColumnInfosRMETRICS1()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equalsIgnoreCase(GC_REPORTTYPE_RMETRICS_EFDBOD)) {
//wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reportlevel("1");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reporttype("2");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputRmetr().invalidate();
bytes = toExcel(wdContext.nodeEt_Efdbod(),getColumnInfosRMETRICS2()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equalsIgnoreCase(GC_REPORTTYPE_RMETRICS_PADDUD)) {
//wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reportlevel("1");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reporttype("3");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputRmetr().invalidate();
bytes = toExcel(wdContext.nodeEt_Paddud(),getColumnInfosRMETRICS3()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equalsIgnoreCase(GC_REPORTTYPE_RMETRICS_BIDBOD)) {
//wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reportlevel("1");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reporttype("4");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputRmetr().invalidate();
bytes = toExcel(wdContext.nodeEt_Bidbod(),getColumnInfosRMETRICS4()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equalsIgnoreCase(GC_REPORTTYPE_RMETRICS_DETAIL)) {
//wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reportlevel("2");
//wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().setI_Reporttype("1");
wdContext.currentZ_Rm_Rmetrics_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputRmetr().invalidate();
bytes = toExcel(wdContext.nodeEt_Metdet(),getColumnInfosRMETRICSD()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
} else if (reporttype.equalsIgnoreCase(GC_REPORTTYPE_WRITEOFF)) {
wdContext.currentZ_Rm_Writeoff_Get_ResultsElement().setI_Reportlevel("1");
wdContext.currentZ_Rm_Writeoff_Get_ResultsElement().setI_Reporttype("4");
wdContext.currentZ_Rm_Writeoff_Get_ResultsElement().modelObject().execute();
wdContext.nodeOutputWoff().invalidate();
bytes = toExcel(wdContext.nodeEt_Writeoff1(),getColumnInfosWRITEOFF()).getBytes();
cachedExcelResource = this.getCachedWebResource(bytes, fileName, WDWebResourceType.XLS);
if (cachedExcelResource != null) {
wdContext.currentContextElement().setExcelDownload(cachedExcelResource.getURL());
} catch(WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
} catch (WDURLException ce) {
manager.reportException(ce.getMessage(), false);
} catch (Exception ce) {
manager.reportException(ce.getMessage(), false);
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoModifyView
Hook method called to modify a view just before rendering.
This method conceptually belongs to the view itself, not to the
controller (cf. MVC pattern).
It is made static to discourage a way of programming that
routinely stores references to UI elements in instance fields
for access by the view controller's event handlers, and so on.
The Web Dynpro programming model recommends that UI elements can
only be accessed by code executed within the call to this hook method.
@param wdThis Generated private interface of the view's controller, as
provided by Web Dynpro. Provides access to the view controller's
outgoing controller usages, etc.
@param wdContext Generated interface of the view's context, as provided
by Web Dynpro. Provides access to the view's data.
@param view The view's generic API, as provided by Web Dynpro.
Provides access to UI elements.
@param firstTime Indicates whether the hook is called for the first time
during the lifetime of the view.
//@@end
public static void wdDoModifyView(IPrivateExportexView wdThis, IPrivateExportexView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
private String trimHeaderText(String headerText) {
StringBuffer newHeaderText = new StringBuffer();
String token;
StringTokenizer tokenizer = new StringTokenizer(headerText.trim());
while (tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
newHeaderText.append(token.substring(0, 1).toUpperCase());
newHeaderText.append(token.substring(1).toLowerCase());
return newHeaderText.toString();
private void trimHeaderTexts(Map columnInfos) {
String attributeName, trimmedHeaderText;
for (Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();) {
attributeName = (String) iter.next();
String attributeValue = (String) columnInfos.get(attributeName);
attributeValue.replace('&','-');
attributeValue.replace('/','-');
trimmedHeaderText = trimHeaderText(attributeValue);
columnInfos.put(attributeName, trimmedHeaderText);
private String toExcel(IWDNode dataNode, Map columnInfos) {
StringBuffer x = new StringBuffer();
String attributeName, headerName;
String entriesName = "I"; //dataNode.getNodeInfo().getName();
String entryName = entriesName + "";
// trim given header texts, so that XML element names adhere to the rule 'no spaces contained'.
trimHeaderTexts(columnInfos);
x.append("<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n");
x.append("<").append(entriesName).append(">\n");
for (int i = 0; i < dataNode.size(); ++i) {
IWDNodeElement dataNodeElement = dataNode.getElementAt(i);
x.append("<").append(entryName).append(">\n");
for (Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();) {
attributeName = (String) iter.next();
headerName = (String) columnInfos.get(attributeName);
String colVal = (String)dataNodeElement.getAttributeAsText(attributeName);
//colVal = colVal.replace(' ','');
colVal = colVal.replace('&','-');
colVal = colVal.replace('<','L');
colVal = colVal.replace('>','G');
colVal = colVal.replace('/','-');
x
.append("<")
.append(headerName)
.append(">")
.append(""+colVal)
.append("</")
.append(headerName)
.append(">\n");
x.append("</").append(entryName).append(">\n");
x.append("</").append(entriesName).append(">\n");
return x.toString();
private String replaceSpecialChars(String inputString){
String outputString = inputString;
outputString.replace('A','B');
inputString.replace('A','B');
return outputString;
private Map getColumnInfosAOISUMM() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZBUS__UNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZPRODCATEG__D, "ProfitCenter");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZ1_TO30__FKKOPRU, "One Month OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZ31_TO60__FKKOPRU, "Two Months OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZ61_TO90__FKKOPRU, "Three Months OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZ91_TO18__FKKOPRU, "Three to Six Months OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZGT180__FKKOPRU, "Greater Than Six Months");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZCURREN__FKKOPRU,"Current");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.ZZFUTURE__FKKOPRU, "Future");
columnInfosMap.put(IPrivateExportexView.IEt_MasElement.TOTAL, "Total");
return columnInfosMap;
private Map getColumnInfosBU() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.ZZPRCTR__D, "ProfitCenter");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.ZZUWRITER__D, "Underwriter");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.ZZBROKER__D, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.GPART__D, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.VTREF, "Policy");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.AMNT__ADJ, "Adjustment");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.AMNT__COMM, "Commission");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.AMNT__DUE, "Due");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.AMNT__GROSS, "Gross");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.AMNT__PAID, "Paid");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.AMNT__NET, "Net");
columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.FAEDN, "DueDate");
//columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.HVORG__D, "Main");
//columnInfosMap.put(IPrivateExportexView.IEt_Bu1Element.TVORG__D, "Sub");
return columnInfosMap;
private Map getColumnInfosCARM() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZPRCTR__D, "ProfitCenter");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZMANAGER__D, "TeamManager");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZACCREP__D, "AccountRepresentative");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.ZZBROKER__D, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.GPART__D, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.VKONT, "Contract");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.VTREF, "Policy");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.AMNT__ADJ, "Adjustment");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.AMNT__COMM, "Commission");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.AMNT__DUE, "Due");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.AMNT__GROSS, "Gross");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.AMNT__PAID, "Paid");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.AMNT__NET, "Net");
columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.FAEDN, "DueDate");
//columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.HVORG__D, "Main");
//columnInfosMap.put(IPrivateExportexView.IEt_Carm1Element.TVORG__D, "Sub");
return columnInfosMap;
private Map getColumnInfosAOIDet() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZBUS__UNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZPRODCATEG__D , "ProfitCenter");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZNAME1__FKKOPRU, "BusinessPartner");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZNAME__B__FKKOPRU, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.BUKRS, "Company Code");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.VTREF, "Policy");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZHVORGT, "Main");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZTVORGT, "Sub");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZ1_TO30__FKKOPRU, "One Month OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZ31_TO60__FKKOPRU, "Two Months OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZ61_TO90__FKKOPRU, "Three Months OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZ91_TO18__FKKOPRU, "Three to Six Months OverDue");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZGT180__FKKOPRU, "Greater Than Six Months");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.TOTAL, "Total");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.ZZCURREN__FKKOPRU,"Current");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.OPBEL, "Document No");
//columnInfosMap.put(IPrivateExportexView.IEt_Detail1Element.VKONT, "Contract Account");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.BUDAT, "Posting Date");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.FAEDN, "Due Date");
columnInfosMap.put(IPrivateExportexView.IEt_DetailElement.WAERS, "Currency");
return columnInfosMap;
private Map getColumnInfosRMETRICS1() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZZPRODCATEG__D, "Profit Center");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZZOFFICE__D, "Office");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.NAME__AR, "Collection Rep");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.NAME__IN, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z0_TO3__AMT, "ZeroToThreeDaysBilledAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z0_TO3__POL, "ZeroToThreeDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z4_TO5__AMT, "FourToFiveDaysBilledAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z4_TO5__POL, "FourToFiveDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z6_TO10__AMT, "SixToTenDaysBilledAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z6_TO10__POL, "SixToTenDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z11_TO15__AMT, "ElevenToFifteenDaysBilledAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z11_TO15__POL, "ElevenToFifteenDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z16_TO30__AMT, "SixteenToThirtyDaysBilledAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.Z16_TO30__POL, "SixteenToThirtyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZOVER30__AMT, "OverThirtyDaysBilledAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbidElement.ZOVER30__AMT, "OverThirtyNoOfPol");
return columnInfosMap;
private Map getColumnInfosRMETRICS2() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZZPRODCATEG__D, "Profit Center");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZZOFFICE__D, "Office");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.NAME__AR, "Collection Rep");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.NAME__IN, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.Z0_TO30__AMT, "ZeroToThirtyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.Z0_TO30__POL, "ZeroToThirtyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.Z31_TO90__AMT, "ThirtytoNinetyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.Z31_TO90__POL, "ThirtytoNinetyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.Z91_TO120__AMT, "NinetytoOneTwentyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.Z91_TO120__POL, "NinetytoOneTwentyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZOVER120__AMT, "OVEROneTwentyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_EfdbodElement.ZOVER120__POL, "OVEROneTwentyDaysNoOfPol");
return columnInfosMap;
private Map getColumnInfosWRITEOFF() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.ZZPRCTR__D, "ProfitCenter");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.ZZOFFICE__D, "Office");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.INSU__NAME, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.INSOBJECT, "InsuranceObject");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.TVORG__TXT, "SubTransaction");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.HVORG__TXT, "MainTransaction");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.ABGRD__D, "WriteOffReason");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.ZZCOLLREP__D, "CollectionRepresentative");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.AUTH__NAME, "AuthName");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.AUTH__DATE, "AuthDate");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.WRITE__AMT, "WriteOffAmount");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.COMM, "Commission");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.GROSS, "Gross");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.NET, "Net");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.REVERSED, "Reversed");
columnInfosMap.put(IPrivateExportexView.IEt_Writeoff1Element.ABDAT, "WriteOffDate");
return columnInfosMap;
private Map getColumnInfosRMETRICS3() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZZPRODCATEG__D, "Profit Center");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZZOFFICE__D, "Office");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.NAME__AR, "CollectionRep");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.NAME__IN, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.Z0_TO30__AMT__I, "ZeroToThirtyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.Z0_TO30__AMT__P, "ZeroToThirtyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.Z31_TO90__AMT__I, "ThirtytoNinetyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.Z31_TO90__AMT__P, "ThirtytoNinetyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.Z91_TO120__AMT__I, "NinetytoOneTwentyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.Z91_TO120__AMT__P, "NinetytoOneTwentyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZOVER120__AMT__I, "OVEROneTwentyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_PaddudElement.ZOVER120__AMT__P, "OVEROneTwentyDaysNoOfPol");
return columnInfosMap;
private Map getColumnInfosRMETRICS4() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZZPRODCATEG__D, "Profit Center");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZZOFFICE__D, "Office");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.NAME__AR, "CollectionRep");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.NAME__IN, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.Z0_TO30__AMT__I, "ZeroToThirtyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.Z0_TO30__AMT__P, "ZeroToThirtyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.Z31_TO90__AMT__I, "ThirtytoNinetyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.Z31_TO90__AMT__P, "ThirtytoNinetyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.Z91_TO120__AMT__I, "NinetytoOneTwentyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.Z91_TO120__AMT__P, "NinetytoOneTwentyDaysNoOfPol");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZOVER120__AMT__I, "OVEROneTwentyDaysBookedAmt");
columnInfosMap.put(IPrivateExportexView.IEt_BidbodElement.ZOVER120__AMT__P, "OVEROneTwentyDaysNoOfPol");
return columnInfosMap;
private Map getColumnInfosRMETRICSD() {
LinkedHashMap columnInfosMap = new LinkedHashMap();
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.ZZBUSUNIT__D, "BusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.ZZSUBBUSUNIT__D, "SubBusinessUnit");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.ZZPRODCATEG__D, "Profit Center");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.ZZREGION__D, "Region");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.ZZOFFICE__D, "Office");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.NAME__AR, "CollectionRep");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.NAME__IN, "Insured");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.NAME__BR, "Broker");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.BILL__DT, "BillDate");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.BOOK__DT, "BookDate");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.CREATE__DT, "CreateDate");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.FANR, "InvoiceNumber");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.HVORG__D, "Main");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.TVORG__D, "Sub");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.GROSS, "GrossInvoiced");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.NET, "NetInvoiced");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.COMM, "CommissionInvoiced");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.TAX, "TaxInvoiced");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.GROSS__PAID, "GrossPaid");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.TAX__PAID, "TaxPaid");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.NET__PAID, "NetPaid");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.COMM__PAID, "CommissionPaid");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.AUGDT, "ClearingDate");
columnInfosMap.put(IPrivateExportexView.IEt_MetdetElement.AUGBT, "ClearingAmount");
return columnInfosMap;
private IWDCachedWebResource getCachedWebResource(byte[] file, String name, WDWebResourceType type) {
IWDCachedWebResource cachedWebResource = null;
if (file != null) {
cachedWebResource = WDWebResource.getWebResource(file, type);
cachedWebResource.setResourceName(name);
return cachedWebResource;
private static String GC_REPORTTYPE_OPENITEMS_SUMM = "AOISUMM";
private static String GC_REPORTTYPE_OPENITEMS_DET = "AOIDET";
private static String GC_REPORTTYPE_BPACCTSTAT_BU = "BPBU";
private static String GC_REPORTTYPE_BPACCTSTAT_CARM = "BPCARM";
private static String GC_REPORTTYPE_RMETRICS_EFDBID = "RMETRICS1";
private static String GC_REPORTTYPE_RMETRICS_EFDBOD = "RMETRICS2";
private static String GC_REPORTTYPE_RMETRICS_PADDUD = "RMETRICS3";
private static String GC_REPORTTYPE_RMETRICS_BIDBOD = "RMETRICS4";
private static String GC_REPORTTYPE_RMETRICS_DETAIL = "RMETRICSDETAIL";
private static String GC_REPORTTYPE_WRITEOFF = "WRITEOFF";
//@@end
Marks will be rewarded for sure.
Regards,
Pranathi.Hi, I finally found the issue which was causing the numbers stored in text format issue. While exporting data to Excel programatically if any of the cells precede with a special character like -. = etc.. the data which is exported after that starts behaving in a peculiar way. So removal of any such special characters resolves the issue.
Hope this helps..
Regards,
Macho -
Getting Exception of MessagingException
Hi All,
I am developing Email Application which retrieve the emails from the Gmail Account.
But I am getting the Exception:
1)
javax.mail.MessagingException: Connect failed; nested exception is: java.io.IOException: Couldn't connect using "javax.net.ssl.SSLSocketFactory" socket factory to host, port: pop.gmail.com, 995; Exception: java.lang.reflect.InvocationTargetException
2)
javax.mail.MessagingException: Not connected
Following is my program.
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.sap.training;
// IMPORTANT NOTE:
// _ALL_ IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateAccessGmailComp).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.io.IOException;
import java.util.Properties;
import javax.mail.Folder;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Part;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.URLName;
import com.sap.training.wdp.IPrivateAccessGmailComp;
import com.sap.training.wdp.IPublicAccessGmailComp;
//@@end
//@@begin documentation
//@@end
public class AccessGmailComp
* Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(AccessGmailComp.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
* Private access to the generated Web Dynpro counterpart
* for this controller class. </p>
* Use <code>wdThis</code> to gain typed access to the context,
* to trigger navigation via outbound plugs, to get and enable/disable
* actions, fire declared events, and access used controllers and/or
* component usages.
* @see com.sap.training.wdp.IPrivateAccessGmailComp for more details
private final IPrivateAccessGmailComp wdThis;
* Root node of this controller's context. </p>
* Provides typed access not only to the elements of the root node
* but also to all nodes in the context (methods node<i>XYZ</i>())
* and their currently selected element (methods current<i>XYZ</i>Element()).
* It also facilitates the creation of new elements for all nodes
* (methods create<i>XYZ</i>Element()). </p>
* @see com.sap.training.wdp.IPrivateAccessGmailComp.IContextNode for more details.
private final IPrivateAccessGmailComp.IContextNode wdContext;
* A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
* Represents the generic API of the generic Web Dynpro counterpart
* for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI;
* A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
* Represents the generic API of the Web Dynpro component this controller
* belongs to. Can be used to access the message manager, the window manager,
* to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public AccessGmailComp(IPrivateAccessGmailComp wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoPostProcessing()
* Hook called to handle data retrieval errors before rendering.
* After doModifyView(), the Web Dynpro Framework gets all context data needed
* for rendering by validating the contexts (which in turn calls the supply
* functions and supplying relation roles). In this hook, the application
* should handle the errors which occurred during validation of the contexts.
* Using preorder depth-first traversal, this hook is called for all component
* controllers starting with the current root component.
* Permitted operations:
* - Flushing model queue
* - Creating messages
* - Reading context and model data
* Forbidden operations:
* - Invalidating model data
* - Manipulating the context
* - Firing outbound plugs
* - Creating components
* @param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoPostProcessing(boolean isCurrentRoot)
//@@begin wdDoPostProcessing()
//@@end
//@@begin javadoc:wdDoBeforeNavigation()
* Hook before the navigation phase starts.
* This hook allows you to flush the model queue and handle any
* errors that occur. Firing outbound plugs is allowed in this hook.
* Using preorder depth-first traversal, this hook is called for all component
* controllers starting with the current root component.
* @param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoBeforeNavigation(boolean isCurrentRoot)
//@@begin wdDoBeforeNavigation()
//@@end
//@@begin javadoc:wdDoApplicationStateChange()
* Hook that informs the application about a state change.
* <p>
* This hook is called e.g. to tell the application that will be
* <ul>
* <li>left via a suspend plug and therefore should go into a suspend/sleep
* mode with minimal need of resources. errors that occur. Firing
* outbound plugs is allowed in this hook.
* <li>left due to a timeout and could write it's state to a data base if the
* user comes back later on
* </ul>
* The concrete reason is available via IWDApplicationStateChangeInfo
* <p>
* <b>Important</b>: This hook is called for the top level component only!
* @param stateChangeInfo contains the information about the nature of the state change
* @param stateChangeReturn allows the application to ask for a different state change.
* The framework is allowed to ignore it considering i.e. the current resources situation.
//@@end
public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn)
//@@begin wdDoApplicationStateChange()
//@@end
//@@begin javadoc:Login()
/** Declared method. */
//@@end
public void Login( )
//@@begin Login()
try
Properties props = System.getProperties();
//props.setProperty("mail.pop3.socketFactory.class", SSL_FACTORY);
props.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.pop3.socketFactory.fallback", "false");
props.setProperty("mail.pop3.port", "995");
props.setProperty("mail.pop3.socketFactory.port", "995");
Session session = Session.getDefaultInstance(props,null);
URLName urln = new URLName("pop3","pop.gmail.com",995,null,
wdContext.nodeVnLogin().currentVnLoginElement().getVaUsername(),
wdContext.nodeVnLogin().currentVnLoginElement().getVaPassword());
store = session.getStore(urln);
store.connect();
wdComponentAPI.getMessageManager().reportSuccess("Suceesfully login");
catch(MessagingException e)
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
//@@end
//@@begin javadoc:getInboxMsg()
/** Declared method. */
//@@end
public void getInboxMsg( )
//@@begin getInboxMsg()
try
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
message = folder.getMessages();
IPublicAccessGmailComp.IVnInboxElement inBoxElement;
for(int i=0;i<message.length;i++)
inBoxElement=wdContext.nodeVnInbox().createVnInboxElement();
inBoxElement.setVaFrom(message<i>.getFrom()[0].toString());
inBoxElement.setVaSubject(message<i>.getSubject());
// inBoxElement.setVaIndex(i);
wdContext.nodeVnInbox().addElement(inBoxElement);
wdComponentAPI.getMessageManager().reportSuccess("You have"+wdContext.nodeVnInbox().size()+"message");
wdContext.nodeVnInbox().setLeadSelection(-1);
catch(MessagingException e)
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
//@@end
//@@begin javadoc:getTextContent()
/** Declared method. */
//@@end
public void getTextContent( )
//@@begin getTextContent()
try
String temp;
for(int j=0;j<wdContext.nodeVnInbox().size();j++)
if(j<0)
temp = "false";
else
temp = "true";
if(wdContext.nodeVnInbox().currentVnInboxElement().getVaIndex() == temp )
Object content = message[j].getContent();
Multipart multipart=(Multipart)content;
Part part=multipart.getBodyPart(0);
wdContext.currentContextElement().setCaBodyText(part.getContent().toString());
catch(MessagingException e)
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
catch(IOException e)
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
//@@end
//@@begin javadoc:Logout()
/** Declared method. */
//@@end
public void Logout( )
//@@begin Logout()
try
store.close();
catch(MessagingException e)
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
//@@end
* The following code section can be used for any Java code that is
* not to be visible to other controllers/views or that contains constructs
* currently not supported directly by Web Dynpro (such as inner classes or
* member variables etc.). </p>
* Note: The content of this section is in no way managed/controlled
* by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
//final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
Store store;
javax.mail.Message message[];
//@@end
Pls help me out asap
Thanks & Regards,
Dhruv Shah
Edited by: DS on Feb 20, 2008 3:06 PMHi Dhruv,
Are you sure you can connect to port 995 from the server?
Jeschael -
WebDynpro : 500 Internal Server Error
Hi All,
We are devloping WebDynpro Project with RFC Model, in that project we created two application's we are deploying that applicaton's into devlopment server, it was excuted successfully, now that same webdynpro project we are deploying to production, that first application was excuted successfully, but when are excuting second application we are getting below error.....
500 Internal Server Error
SAP NetWeaver Application Server 7.00/Java AS 7.00
Failed to process request. Please contact your system administrator.
[Hide]
Error Summary
While processing the current request, an exception occured which could not be handled by the application or the framework.
If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
Root Cause
The initial exception that caused the request to fail, was:
java.lang.NullPointerException
at com.stepan.app.DetailsView.getProcessOrderVisibilityProcessOrderVisibility(DetailsView.java:574)
at com.stepan.app.wdp.InternalDetailsView.getProcessOrderVisibilityProcessOrderVisibility(InternalDetailsView.java:340)
at com.stepan.app.wdp.IPrivateDetailsView$IProcessOrderVisibilityElement.wdGetObject(IPrivateDetailsView.java:3521)
at com.sap.tc.webdynpro.progmodel.context.AttributePointer.getObject(AttributePointer.java:158)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.getObject(DataContainer.java:881)
... 61 more
See full exception chain for details.
System Environment
Client
Web Dynpro Client Type HTML Client
User agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Version null
DOM version null
Client Type msie7
Client Type Profile ie6
ActiveX enabled
Cookies enabled
Frames enabled
Java Applets enabled
JavaScript enabled
Tables enabled
VB Script enabled
Server
Web Dynpro Runtime Vendor: SAP, build ID: 7.0011.20070125102926.0000 (release=645_VAL_REL, buildtime=2007-01-31:20:18:32[UTC], changelist=434634, host=pwdfm101), build date: Thu Jul 12 10:54:43 CDT 2007
J2EE Engine No information available
Java VM Java HotSpot(TM) Server VM, version:1.4.2_12-b03, vendor: Sun Microsystems Inc.
Operating system Windows 2003, version: 5.2, architecture: x86
Session & Other
Session Locale en_US
Time of Failure Tue Sep 11 09:13:06 CDT 2007 (Java Time: 1189519986156)
Web Dynpro Code Generation Infos
local/CalenderDashBoard
SapDictionaryGenerationCore 7.0009.20060802115015.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:24:21[UTC], changelist=413123, host=PWDFM101.wdf.sap.corp)
SapDictionaryGenerationTemplates (unknown)
SapGenerationFrameworkCore 7.0009.20060719095755.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:12:57[UTC], changelist=411255, host=PWDFM101.wdf.sap.corp)
SapIdeWebDynproCheckLayer 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:00[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)
SapMetamodelCommon 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:46[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)
SapMetamodelCore 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:38[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)
SapMetamodelDictionary 7.0009.20060719095619.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:21:59[UTC], changelist=411251, host=PWDFM101.wdf.sap.corp)
SapMetamodelWebDynpro 7.0009.20060428190938.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:26:52[UTC], changelist=400815, host=PWDFM101.wdf.sap.corp)
SapWebDynproGenerationCTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)
SapWebDynproGenerationCore 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:11[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)
SapWebDynproGenerationTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)
sap.com/tcwddispwda
No information available null
sap.com/tcwdcorecomp
No information available null
Detailed Error Information
Detailed Exception Chain
java.lang.NullPointerException
at com.stepan.app.DetailsView.getProcessOrderVisibilityProcessOrderVisibility(DetailsView.java:574)
at com.stepan.app.wdp.InternalDetailsView.getProcessOrderVisibilityProcessOrderVisibility(InternalDetailsView.java:340)
at com.stepan.app.wdp.IPrivateDetailsView$IProcessOrderVisibilityElement.wdGetObject(IPrivateDetailsView.java:3521)
at com.sap.tc.webdynpro.progmodel.context.AttributePointer.getObject(AttributePointer.java:158)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.getObject(DataContainer.java:881)
at com.sap.tc.webdynpro.progmodel.view.UIElement.getVisible(UIElement.java:620)
at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter.setViewAndNodeElement(FlowLayoutAdapter.java:94)
at com.sap.tc.webdynpro.clientserver.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:285)
at com.sap.tc.webdynpro.clientserver.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:93)
at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.getAdapterFor(AbstractAdapter.java:495)
at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.GroupAdapter.getContent(GroupAdapter.java:334)
at com.sap.tc.ur.renderer.ie6.GroupRenderer.render(GroupRenderer.java:74)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutItemFragment(FlowLayoutRenderer.java:288)
at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutFragment(FlowLayoutRenderer.java:244)
at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.render(FlowLayoutRenderer.java:49)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:619)
at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:74)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutItemFragment(FlowLayoutRenderer.java:288)
at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutFragment(FlowLayoutRenderer.java:244)
at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.render(FlowLayoutRenderer.java:49)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:619)
at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:74)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:52)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:1052)
at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.fillDynamicTemplateContext(HtmlClient.java:455)
at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:1236)
at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.retrieveData(HtmlClient.java:252)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRetrieveData(WindowPhaseModel.java:595)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:156)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
if any body facing same problem please tell me how to resolve that error.
really i appreciate that person help.
Thanks and Regards,
Abhi.Hi Sumit,
The below is my code, pls find this one and please let me know is there any bugs in code.
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.stepan.app;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateDetailsView).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import com.sap.security.api.IUser;
import com.sap.security.api.IUserAccount;
import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable;
import com.sap.tc.webdynpro.progmodel.api.IWDNode;
import com.sap.tc.webdynpro.progmodel.api.WDVisibility;
import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
import com.sap.tc.webdynpro.tests.utils.TableSorter;
import com.stepan.app.wdp.IPrivateDetailsView;
//@@end
//@@begin documentation
//@@end
public class DetailsView
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(DetailsView.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.stepan.app.wdp.IPrivateDetailsView for more details
private final IPrivateDetailsView wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.stepan.app.wdp.IPrivateDetailsView.IContextNode for more details.
private final IPrivateDetailsView.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public DetailsView(IPrivateDetailsView wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
wdThis.wdGetDetailsCompController().CalRFC();
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
} catch (Exception e) {
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoModifyView
Hook method called to modify a view just before rendering.
This method conceptually belongs to the view itself, not to the
controller (cf. MVC pattern).
It is made static to discourage a way of programming that
routinely stores references to UI elements in instance fields
for access by the view controller's event handlers, and so on.
The Web Dynpro programming model recommends that UI elements can
only be accessed by code executed within the call to this hook method.
@param wdThis Generated private interface of the view's controller, as
provided by Web Dynpro. Provides access to the view controller's
outgoing controller usages, etc.
@param wdContext Generated interface of the view's context, as provided
by Web Dynpro. Provides access to the view's data.
@param view The view's generic API, as provided by Web Dynpro.
Provides access to UI elements.
@param firstTime Indicates whether the hook is called for the first time
during the lifetime of the view.
//@@end
public static void wdDoModifyView(IPrivateDetailsView wdThis, IPrivateDetailsView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
if(firstTime)
IWDNode node = wdContext.nodeZdetail();
// getting ZDetail Node information
IPrivateDetailsView.IShipmentTableNode ShipmentTableNode =
wdContext.nodeShipmentTable();
IPrivateDetailsView.IProcessOrderTableNode ProcessOrderTableNode =
wdContext.nodeProcessOrderTable();
IPrivateDetailsView.IReceiptTableNode ReceiptTableNode =
wdContext.nodeReceiptTable();
IPrivateDetailsView.ITankTransferTableNode TankTransferTableNode =
wdContext.nodeTankTransferTable();
//Getting Popupwindow information
for (int i = 0; i < node.size(); i++) { //Loop for populating table
IPrivateDetailsView.IZdetailElement ele =
wdContext.nodeZdetail().getZdetailElementAt(i);
//Checking whether Clicked button is Shipping
if (wdContext.currentContextElement().getType().equals("SH")) {
String country=null;
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
country = user.getCountry();
} catch (Exception e) {
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
int ZslotNo = Integer.parseInt(ele.getZslotno());
int SelectedSlotNo =
Integer.parseInt(
wdContext.currentContextElement().getSlotNo());
if (ZslotNo == SelectedSlotNo
&& ele.getZdoctype().equals("SH"))
IPrivateDetailsView.IShipmentTableElement ele1 =
wdContext.createShipmentTableElement();
ele1.setCustomerName(ele.getName());
ele1.setDestinationCity(ele.getCity());
ele1.setMaterialName(ele.getMattext());
try{
if(country.equals("FR"))
ele1.setQuantity(ele.getQuantity());
else{
Locale locale = Locale.GERMAN;
String s1=ele.getQuantity().trim();
Number number = NumberFormat.getNumberInstance(locale).parse(s1);
NumberFormat formatter = new DecimalFormat("#,###,###.##" );
String s= (formatter.format(number.doubleValue()));
ele1.setQuantity(s);
catch(Exception e)
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
ele1.setShipmentNumber(ele.getZdocnumber());
ele1.setUnit(ele.getSales_Unit());
String ChangedDateFormat=wdThis.DisplayingDateFormat(ele.getSched_Date());
ele1.setShipmentDate(ChangedDateFormat);
ele1.setShipmentTime(ele.getSched_Time());
ShipmentTableNode.addElement(ele1);
//Checking whether Clicked button is PO
//Getting Process Order node information
if (wdContext.currentContextElement().getType().equals("PP")) {
String country=null;
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
country = user.getCountry();
} catch (Exception e) {
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
int ZslotNo = Integer.parseInt(ele.getZslotno());
int SelectedSlotNo =
Integer.parseInt(
wdContext.currentContextElement().getSlotNo());
if (ZslotNo == SelectedSlotNo
&& ele.getZdoctype().equals("PP"))
IPrivateDetailsView.IProcessOrderTableElement ele2 =
wdContext.createProcessOrderTableElement();
ele2.setResourceName(ele.getWorkcenter());
ele2.setMaterialNumber(ele.getMattext());
try{
if(country.equals("FR"))
ele2.setQuantity(ele.getQuantity());
else{
Locale locale = Locale.GERMAN;
String s1=ele.getQuantity().trim();
Number number = NumberFormat.getNumberInstance(locale).parse(s1);
NumberFormat formatter = new DecimalFormat("#,###,###.##" );
String s= (formatter.format(number.doubleValue()));
ele2.setQuantity(s);
catch(Exception e)
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
ele2.setUnit(ele.getSales_Unit());
String ChangedDateFormat=wdThis.DisplayingDateFormat(ele.getSched_Start_Date());
ele2.setProcessOrderStartDate(ChangedDateFormat);
ele2.setProcessOrderStartTime(ele.getSched_Start_Time());
String ChangedDateFormat1=wdThis.DisplayingDateFormat(ele.getSched_Date());
ele2.setProcessOrderTEnddate(ChangedDateFormat1);
ele2.setProcessOrderTEndTime(ele.getSched_Time());
ele2.setProcessOrderNo(ele.getZdocnumber());
ProcessOrderTableNode.addElement(ele2);
//Checking whether Clicked button is Receipt Image
//Populating Receipt Table with current context elements
if (wdContext.currentContextElement().getType().equals("PO")) {
String country=null;
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
country = user.getCountry();
} catch (Exception e) {
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
int ZslotNo = Integer.parseInt(ele.getZslotno());
int SelectedSlotNo =
Integer.parseInt(
wdContext.currentContextElement().getSlotNo());
if (ZslotNo == SelectedSlotNo
&& ele.getZdoctype().equals("PO")) {
IPrivateDetailsView.IReceiptTableElement ele3 =
wdContext.createReceiptTableElement();
ele3.setMaterialName(ele.getMattext());
try{
if(country.equals("FR"))
ele3.setReceiptQuantity(ele.getQuantity());
else{
Locale locale = Locale.GERMAN;
String s1=ele.getQuantity().trim();
Number number = NumberFormat.getNumberInstance(locale).parse(s1);
NumberFormat formatter = new DecimalFormat("#,###,###.##" );
String s= (formatter.format(number.doubleValue()));
ele3.setReceiptQuantity(s);
catch(Exception e)
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
String ChangedDateFormat=wdThis.DisplayingDateFormat(ele.getSched_Date());
ele3.setPlannedReceiptsDate(ChangedDateFormat);
ele3.setPlannedReceiptsTime(ele.getSched_Time());
ele3.setVenderName(ele.getName());
ele3.setUnit(ele.getSales_Unit());
ele3.setPurchaseOrderNo(ele.getZdocnumber());
ReceiptTableNode.addElement(ele3);
// Checking whether Clicked button is TankTransfer Image
//Populating Tank Transfer Table with current context elements
if (wdContext.currentContextElement().getType().equals("PI")) {
String country=null;
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
country = user.getCountry();
} catch (Exception e) {
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
int ZslotNo = Integer.parseInt(ele.getZslotno());
int SelectedSlotNo =
Integer.parseInt(
wdContext.currentContextElement().getSlotNo());
if (ZslotNo == SelectedSlotNo
&& ele.getZdoctype().equals("PI")) {
IPrivateDetailsView.ITankTransferTableElement ele4 =
wdContext.createTankTransferTableElement();
ele4.setResourceName(ele.getWorkcenter());
ele4.setMaterialName(ele.getMattext());
try{
if(country.equals("FR"))
ele4.setQuantity(ele.getQuantity());
else{
Locale locale = Locale.GERMAN;
String s1=ele.getQuantity().trim();
Number number = NumberFormat.getNumberInstance(locale).parse(s1);
NumberFormat formatter = new DecimalFormat("#,###,###.##");
String s= (formatter.format(number.doubleValue()));
ele4.setQuantity(s);
catch(Exception e)
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
ele4.setPIEndDate(ele.getSched_Start_Time());
ele4.setPlannedEndTime(ele.getSched_Time());
ele4.setUnit(ele.getSales_Unit());
ele4.setProcessOrderNo(ele.getZdocnumber());
String ChangedDateFormat=wdThis.DisplayingDateFormat(ele.getSched_Start_Date());
ele4.setPIStartDate(ChangedDateFormat);
String ChangedDateFormat1=wdThis.DisplayingDateFormat(ele.getSched_Date());
ele4.setPlannedEndDate(ChangedDateFormat1);
ele4.setPIEndDate(ele.getSched_Start_Time());
TankTransferTableNode.addElement(ele4);
// Table sorting
// Sorting Shipment Table
IWDTable SortShipmentTable = (IWDTable) view.getElement("ShipmentTable");
wdContext.currentContextElement().setShipmentTableSorter(
new TableSorter(SortShipmentTable, wdThis.wdGetSortAction(), null));
// Sorting Receipt Table
IWDTable SortReceiptTable = (IWDTable) view.getElement("ReceiptTable");
wdContext.currentContextElement().setReceiptTableSorter(
new TableSorter(SortReceiptTable, wdThis.wdGetReceiptTableSortAction(), null));
// Sorting TankTransfer Table
IWDTable SortTankTransferTable = (IWDTable) view.getElement("TankTransferTable");
wdContext.currentContextElement().setTankTransferTableSorter(
new TableSorter(SortTankTransferTable, wdThis.wdGetTankTransferTableSortAction(), null));
// Sorting ProcessOrder Table
IWDTable SortProcessOrderTable = (IWDTable) view.getElement("ProcessOrderTable");
wdContext.currentContextElement().setProcessOrderTableSorter(
new TableSorter(SortProcessOrderTable, wdThis.wdGetProcessOrderTableSortAction(), null));
//@@end
//@@begin javadoc:DisplayingDateFormat()
/** Declared method. */
//@@end
public java.lang.String DisplayingDateFormat( java.lang.String date )
//@@begin DisplayingDateFormat()
//SimpleDateFormat sdf = new SimpleDateFormat("MM.dd.yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
String ChangedDateFormat=null;
try{
//Parsing String to Date
Date sqlDate =sdf.parse(date);
// Getting User Locale
Locale userLocale=WDClientUser.getCurrentUser().getLocale();
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.DEFAULT, userLocale);
//Converting Date to String
String newDateString = dateFormat.format(sqlDate);
//binding to Table UI element
ChangedDateFormat=newDateString;
catch(Exception e)
wdThis
.wdGetAPI()
.getComponent()
.getMessageManager()
.reportException(
e.toString(),
false);
return ChangedDateFormat;
//@@end
//@@begin javadoc:getShipmentVisibilityShipmentVisibility(IPrivateDetailsView.IShipmentVisibilityElement)
Declared getter method for attribute ShipmentVisibility of node ShipmentVisibility
@param element the element requested for the value
@return the calculated value for attribute ShipmentVisibility
//@@end
public com.sap.tc.webdynpro.progmodel.api.WDVisibility getShipmentVisibilityShipmentVisibility(IPrivateDetailsView.IShipmentVisibilityElement element)
//@@begin getShipmentVisibilityShipmentVisibility(IPrivateDetailsView.IShipmentVisibilityElement)
if (wdContext.currentContextElement().getType().equals("SH"))
return WDVisibility.VISIBLE;
else
return WDVisibility.NONE;
//return null;
//@@end
//@@begin javadoc:setShipmentVisibilityShipmentVisibility(IPrivateDetailsView.IShipmentVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
Declared setter method for attribute ShipmentVisibility of node ShipmentVisibility
@param element the element to change the value
@param value the new value for attribute ShipmentVisibility
//@@end
public void setShipmentVisibilityShipmentVisibility(IPrivateDetailsView.IShipmentVisibilityElement element, com.sap.tc.webdynpro.progmodel.api.WDVisibility value)
//@@begin setShipmentVisibilityShipmentVisibility(IPrivateDetailsView.IShipmentVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
//@@end
//@@begin javadoc:getReceiptVisibilityReceiptVisibility(IPrivateDetailsView.IReceiptVisibilityElement)
Declared getter method for attribute ReceiptVisibility of node ReceiptVisibility
@param element the element requested for the value
@return the calculated value for attribute ReceiptVisibility
//@@end
public com.sap.tc.webdynpro.progmodel.api.WDVisibility getReceiptVisibilityReceiptVisibility(IPrivateDetailsView.IReceiptVisibilityElement element)
//@@begin getReceiptVisibilityReceiptVisibility(IPrivateDetailsView.IReceiptVisibilityElement)
if (wdContext.currentContextElement().getType().equals("PO"))
return WDVisibility.VISIBLE;
else
return WDVisibility.NONE;
//return null;
//@@end
//@@begin javadoc:setReceiptVisibilityReceiptVisibility(IPrivateDetailsView.IReceiptVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
Declared setter method for attribute ReceiptVisibility of node ReceiptVisibility
@param element the element to change the value
@param value the new value for attribute ReceiptVisibility
//@@end
public void setReceiptVisibilityReceiptVisibility(IPrivateDetailsView.IReceiptVisibilityElement element, com.sap.tc.webdynpro.progmodel.api.WDVisibility value)
//@@begin setReceiptVisibilityReceiptVisibility(IPrivateDetailsView.IReceiptVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
//@@end
//@@begin javadoc:getProcessOrderVisibilityProcessOrderVisibility(IPrivateDetailsView.IProcessOrderVisibilityElement)
Declared getter method for attribute ProcessOrderVisibility of node ProcessOrderVisibility
@param element the element requested for the value
@return the calculated value for attribute ProcessOrderVisibility
//@@end
public com.sap.tc.webdynpro.progmodel.api.WDVisibility getProcessOrderVisibilityProcessOrderVisibility(IPrivateDetailsView.IProcessOrderVisibilityElement element)
//@@begin getProcessOrderVisibilityProcessOrderVisibility(IPrivateDetailsView.IProcessOrderVisibilityElement)
if (wdContext.currentContextElement().getType().equals("PP"))
return WDVisibility.VISIBLE;
else
return WDVisibility.NONE;
//return null;
//@@end
//@@begin javadoc:setProcessOrderVisibilityProcessOrderVisibility(IPrivateDetailsView.IProcessOrderVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
Declared setter method for attribute ProcessOrderVisibility of node ProcessOrderVisibility
@param element the element to change the value
@param value the new value for attribute ProcessOrderVisibility
//@@end
public void setProcessOrderVisibilityProcessOrderVisibility(IPrivateDetailsView.IProcessOrderVisibilityElement element, com.sap.tc.webdynpro.progmodel.api.WDVisibility value)
//@@begin setProcessOrderVisibilityProcessOrderVisibility(IPrivateDetailsView.IProcessOrderVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
//@@end
//@@begin javadoc:getTankTransferVisibilityTankTransferVisbility(IPrivateDetailsView.ITankTransferVisibilityElement)
Declared getter method for attribute TankTransferVisbility of node TankTransferVisibility
@param element the element requested for the value
@return the calculated value for attribute TankTransferVisbility
//@@end
public com.sap.tc.webdynpro.progmodel.api.WDVisibility getTankTransferVisibilityTankTransferVisbility(IPrivateDetailsView.ITankTransferVisibilityElement element)
//@@begin getTankTransferVisibilityTankTransferVisbility(IPrivateDetailsView.ITankTransferVisibilityElement)
if (wdContext.currentContextElement().getType().equals("PI"))
return WDVisibility.VISIBLE;
else
return WDVisibility.NONE;
//return null;
//@@end
//@@begin javadoc:setTankTransferVisibilityTankTransferVisbility(IPrivateDetailsView.ITankTransferVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
Declared setter method for attribute TankTransferVisbility of node TankTransferVisibility
@param element the element to change the value
@param value the new value for attribute TankTransferVisbility
//@@end
public void setTankTransferVisibilityTankTransferVisbility(IPrivateDetailsView.ITankTransferVisibilityElement element, com.sap.tc.webdynpro.progmodel.api.WDVisibility value)
//@@begin setTankTransferVisibilityTankTransferVisbility(IPrivateDetailsView.ITankTransferVisibilityElement, com.sap.tc.webdynpro.progmodel.api.WDVisibility)
//@@end
//@@begin javadoc:onActionSort(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionSort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionSort(ServerEvent)
wdContext.currentContextElement().getShipmentTableSorter().sort(wdEvent,wdContext.nodeShipmentTable());
//@@end
//@@begin javadoc:onActionReceiptTableSort(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionReceiptTableSort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionReceiptTableSort(ServerEvent)
wdContext.currentContextElement().getReceiptTableSorter().sort(wdEvent,wdContext.nodeReceiptTable());
//@@end
//@@begin javadoc:onActionProcessOrderTableSort(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionProcessOrderTableSort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionProcessOrderTableSort(ServerEvent)
wdContext.currentContextElement().getProcessOrderTableSorter().sort(wdEvent,wdContext.nodeProcessOrderTable());
//@@end
//@@begin javadoc:onActionTankTransferTableSort(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionTankTransferTableSort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionTankTransferTableSort(ServerEvent)
wdContext.currentContextElement().getTankTransferTableSorter().sort(wdEvent,wdContext.nodeTankTransferTable());
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
//@@end
content of obsolete user coding area(s) -
//@@begin obsolete:javadoc:onActionSubmit(ServerEvent)
// /** Declared validating event handler. */
//@@end
//@@begin obsolete:onActionClose(ServerEvent)
//@@end
//@@begin obsolete:javadoc:DisplayingNumberFormat()
// /** Declared method. */
//@@end
//@@begin obsolete:javadoc:onActionClose(ServerEvent)
// /** Declared validating event handler. */
//@@end
i will be waiting for your reply.
Thanks and Regards,
Abhi. -
Hi experts
when I run Network UI Element
to presnt org Chart
I get in IE->Tools->Java Console
the follow error:
<<<--- Applet.destroy(): AppWin0/JNET --->>>
<<<--- EXIT for AppWin0/JNET --->>>
java.lang.NullPointerException
at sun.plugin.javascript.ocx.JSObject.eval(Unknown Source)
at com.sap.tc.webdynpro.ace.Acf2JavaScriptClient$1.run(Acf2JavaScriptClient.java:55)
at java.lang.Thread.run(Unknown Source)
ACF 7.1000.0.71
<<< frog.jar: version 5.4.6 02/01/06 sap.theme: null >>>this is the file:
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package co.il.bnhp;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateOrgTree).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Entity;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import org.xml.sax.SAXException;
import co.i.bnhp.model.Zhr_Rfc_Disp_Manger_Employees2_Input;
import co.il.bnhp.wdp.IPrivateOrgTree;
import co.il.bnhp.wdp.IPublicOrgTree;
import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;
import com.sap.tc.webdynpro.progmodel.api.WDResourceFactory;
import com.sap.tc.webdynpro.services.sal.deployment.api.WDAliasResolvingException;
import com.sap.tc.webdynpro.services.sal.url.api.WDURLGenerator;
import com.sap.tc.webdynpro.services.sal.url.api.WDWebResource;
import com.sap.tc.webdynpro.services.sal.url.api.WDWebResourceType;
//@@end
//@@begin documentation
//@@end
public class OrgTree
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(OrgTree.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see co.il.bnhp.wdp.IPrivateOrgTree for more details
private final IPrivateOrgTree wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see co.il.bnhp.wdp.IPrivateOrgTree.IContextNode for more details.
private final IPrivateOrgTree.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public OrgTree(IPrivateOrgTree wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
buildDOM();
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoPostProcessing()
Hook called to handle data retrieval errors before rendering.
After doModifyView(), the Web Dynpro Framework gets all context data needed
for rendering by validating the contexts (which in turn calls the supply
functions and supplying relation roles). In this hook, the application
should handle the errors which occurred during validation of the contexts.
Using preorder depth-first traversal, this hook is called for all component
controllers starting with the current root component.
Permitted operations:
- Flushing model queue
- Creating messages
- Reading context and model data
Forbidden operations:
- Invalidating model data
- Manipulating the context
- Firing outbound plugs
- Creating components
@param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoPostProcessing(boolean isCurrentRoot)
//@@begin wdDoPostProcessing()
//@@end
//@@begin javadoc:wdDoBeforeNavigation()
Hook before the navigation phase starts.
This hook allows you to flush the model queue and handle any
errors that occur. Firing outbound plugs is allowed in this hook.
Using preorder depth-first traversal, this hook is called for all component
controllers starting with the current root component.
@param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoBeforeNavigation(boolean isCurrentRoot)
//@@begin wdDoBeforeNavigation()
//@@end
//@@begin javadoc:wdDoApplicationStateChange()
Hook that informs the application about a state change.
<p>
This hook is called e.g. to tell the application that will be
<ul>
<li>left via a suspend plug and therefore should go into a suspend/sleep
mode with minimal need of resources. errors that occur. Firing
outbound plugs is allowed in this hook.
<li>left due to a timeout and could write it's state to a data base if the
user comes back later on
</ul>
The concrete reason is available via IWDApplicationStateChangeInfo
<p>
<b>Important</b>: This hook is called for the top level component only!
@param stateChangeInfo contains the information about the nature of the state change
@param stateChangeReturn allows the application to ask for a different state change.
The framework is allowed to ignore it considering i.e. the current resources situation.
//@@end
public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn)
//@@begin wdDoApplicationStateChange()
//@@end
//@@begin javadoc:buildDOM()
/** Declared method. */
//@@end
public void buildDOM( )
//@@begin buildDOM()
// File fileName = new File ("orgchart.xml");
wdThis.wdGetEmpUserIdInterface().getemp();
wdContext.currentContextElement().setPernrRet(wdContext.currentContextElement().getPernrRet());
Zhr_Rfc_Disp_Manger_Employees2_Input input = new co.i.bnhp.model.Zhr_Rfc_Disp_Manger_Employees2_Input();
wdContext.nodeZhr_Rfc_Disp_Manger_Employees2_Input().bind(input);
input.setP_Pernr("1511");
//input.setP_Pernr(wdContext.currentContextElement().getPernrRet());
try{
String xmlFile =WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "//tmp//tipex.xml");
File file = new File(xmlFile);
//Creating an empty XML Document
//We need a Document
input.execute();
wdContext.nodeSource().invalidate();
DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
// DOMImplementation impl = docBuilder.getDOMImplementation();
Document doc = docBuilder.newDocument();
//Creating the XML tree
Element SapJNETData = doc.createElement("SAPJNetData");
SapJNETData.setAttribute("version","1.0");
doc.appendChild(SapJNETData);
// Element typeRepository = doc.createElement("TypeRepository");
// typeRepository.setAttribute("href","
tmp
TypeRepository.xml");
// SapJNETData.appendChild(typeRepository);
Element typeRepository = doc.createElement("TypeRepository");
typeRepository.setAttribute("id","orgchart");
typeRepository.setAttribute("version","1.0");
SapJNETData.appendChild(typeRepository);
Element color = doc.createElement("COLOR");
typeRepository.appendChild(color);
Element type1 = doc.createElement("type");
type1.setAttribute("name","OCBlue");
Element rgb1 = doc.createElement("rgb");
Text textRGB1 = doc.createTextNode("0,0,128");
color.appendChild(type1);
rgb1.appendChild(textRGB1);
type1.appendChild(rgb1);
Element type2 = doc.createElement("type");
type2.setAttribute("name","OCGray");
Element rgb2 = doc.createElement("rgb");
Text textRGB2 = doc.createTextNode("215,220,216");
color.appendChild(type2);
rgb2.appendChild(textRGB2);
type2.appendChild(rgb2);
Element type3 = doc.createElement("type");
type3.setAttribute("name","OCGrayer");
Element rgb3 = doc.createElement("rgb");
Text textRGB3 = doc.createTextNode("195,200,196");
color.appendChild(type3);
rgb3.appendChild(textRGB3);
type3.appendChild(rgb3);
Element type4 = doc.createElement("type");
type4.setAttribute("name","OCLighter");
Element rgb4 = doc.createElement("rgb");
Text textRGB4 = doc.createTextNode("235,240,236");
color.appendChild(type4);
rgb4.appendChild(textRGB4);
type4.appendChild(rgb4);
Element layout = doc.createElement("LAYOUT");
typeRepository.appendChild(layout);
Element typeLayout = doc.createElement("type");
typeLayout.setAttribute("name","OCLayout");
Element style = doc.createElement("style");
Text textStyle = doc.createTextNode("VERTICAL_FLOW");
layout.appendChild(typeLayout);
typeLayout.appendChild(style);
style.appendChild(textStyle);
Element label = doc.createElement("LABEL");
typeRepository.appendChild(label);
Element typeLabel1 = doc.createElement("type");
typeLabel1.setAttribute("name","OCLabelBase");
Element colorLabel = doc.createElement("color");
colorLabel.setAttribute("type","Black");
Element font1 = doc.createElement("font");
Element size1 = doc.createElement("size");
Text textSize1 = doc.createTextNode("12");
Element multiLine =doc.createElement("multiLine");
Text textMultiLine=doc.createTextNode("TRUE");
Element hAlign = doc.createElement("halign");
Text textHalign = doc.createTextNode("CENTER");
Element hAlignText = doc.createElement("halignText");
Text textHalignText = doc.createTextNode("CENTER");
Element border1 = doc.createElement("border");
Element insets1 = doc.createElement("insets");
insets1.setAttribute("top","3");
Element typeLabel2 = doc.createElement("type");
typeLabel2.setAttribute("name","OCLabelOrgUnit");
typeLabel2.setAttribute("inherits","OCLabelBase");
Element colorLabel2 = doc.createElement("color");
colorLabel2.setAttribute("type","OCBlue");
Element fillColorLabel2 = doc.createElement("fillColor");
fillColorLabel2.setAttribute("type","OCGrayer");
Element font2 = doc.createElement("font");
Element style2 = doc.createElement("style");
Text textStyle2 = doc.createTextNode("BOLD");
Element border2 = doc.createElement("border");
Element thickness = doc.createElement("thickness");
Text textThickness = doc.createTextNode("1");
Element Side = doc.createElement("sides");
Text textSide = doc.createTextNode("SOUTH");
Element typeLabel3 = doc.createElement("type");
typeLabel3.setAttribute("name","OCLabelNumber");
typeLabel3.setAttribute("inherits","OCLabelBase");
Element colorLabel3 = doc.createElement("color");
colorLabel3.setAttribute("type","OCBlue");
Element size3 = doc.createElement("size");
Text textSize3 = doc.createTextNode("40,0");
Element halign3 = doc.createElement("halign");
Text textHalign3 = doc.createTextNode("RIGHT");
Element multiLine3 = doc.createElement("multiline");
Text textMultiLine3 = doc.createTextNode("FALSE");
Element border3 = doc.createElement("border");
Element Thickness3 = doc.createElement("thickness");
Text textThickness3 = doc.createTextNode("1");
Element insets3 = doc.createElement("insets");
insets3.setAttribute("top","0");
Element Sides3 = doc.createElement("sides");
Text textSides3 = doc.createTextNode("NORTH,WEST");
Element typeLabel4 = doc.createElement("type");
typeLabel4.setAttribute("name","OCLabelChief");
typeLabel4.setAttribute("inherits","OCLabelBase");
Element font4 = doc.createElement("font");
Element style4 = doc.createElement("style");
Element border4 = doc.createElement("border");
Element insets4 = doc.createElement("insets");
insets4.setAttribute("top","6");
Element edgeT = doc.createElement("EDGE");
Element typeEdge= doc.createElement("type");
typeEdge.setAttribute("name","OCLink");
Element Shape = doc.createElement("shape");
Element ThickNess =doc.createElement("thickness");
Element targetDeco = doc.createElement("targetdeco");
targetDeco.setAttribute("shape","NONE");
Element nodeT = doc.createElement("NODE");
Element typeNode = doc.createElement("type");
typeNode.setAttribute("name","OCNodeBase");
Element shape = doc.createElement("shape");
shape.setAttribute("type","Box");
Element fillColor = doc.createElement("fillColor");
fillColor.setAttribute("type","OCGray");
Element borderNode = doc.createElement("border");
Element styleNode = doc.createElement("style");
Element plugs = doc.createElement("plugs");
plugs.setAttribute("min","0");
plugs.setAttribute("position","SOUTH");
plugs.setAttribute("positionMode","CENTRIC");
Element socket = doc.createElement("sockets");
socket.setAttribute("min","0");
socket.setAttribute("position","NORTH");
socket.setAttribute("positionMode","CENTRIC");
Element OCNode = doc.createElement("type");
OCNode.setAttribute("name","OCNode");
OCNode.setAttribute("inherits","OCNodeBase");
Element OCNodeShape = doc.createElement("shape");
Element OCNodeSize = doc.createElement("size");
OCNodeSize.setAttribute("pack","true");
Element OClayout = doc.createElement("layout");
OClayout.setAttribute("type","OCLayout");
Element OCNodeArrowUp = doc.createElement("type");
OCNodeArrowUp.setAttribute("name","OCNodeArrowUp");
OCNodeArrowUp.setAttribute("inherits","OCNodeBase");
Element OCNodeArrowShape = doc.createElement("shape");
Element OcNodeArrowSize = doc.createElement("size");
Element OcNodeArrowLabel = doc.createElement("label");
Element OcNodeArrowicon = doc.createElement("icon");
Element OcNodeArrowHalign = doc.createElement("halign");
Element OCNodeArrowDown = doc.createElement("type");
OCNodeArrowDown.setAttribute("name","OCNodeArrowDown");
OCNodeArrowDown.setAttribute("inherits","OCNodeArrowUp");
Element OCNodeArrowDownLabel = doc.createElement("label");
Element OcNodeArrowDownIcon = doc.createElement("icon");
Element NodeGraph = doc.createElement("Graph");
Element OCGraph = doc.createElement("type");
OCGraph.setAttribute("name","OCGraph");
Element direction = doc.createElement("direction");
Element components = doc.createElement("components");
Element OCGraphLayouts = doc.createElement("layouts");
Element types = doc.createElement("types");
Element OCGraphlayout = doc.createElement("layout");
OCGraphlayout.setAttribute("type","TREE");
Element property1 = doc.createElement("property");
property1.setAttribute("name","STYLE");
property1.setAttribute("value","VARIABLE_SIZE");
Element property2 = doc.createElement("property");
property2.setAttribute("name","OFFS_X");
property2.setAttribute("value","50");
Element property3 = doc.createElement("property");
property3.setAttribute("name","OFFS_Y");
property3.setAttribute("value","30");
Element Graph = doc.createElement("Graph");
Graph.setAttribute("type","OCGraph");
Graph.setAttribute("version","1.0");
Element layouts = doc.createElement("layouts");
layouts.setAttribute("onLoad","TREE");
Element view = doc.createElement("view");
Element grid = doc.createElement("grid");
Text TextGrid = doc.createTextNode("80,80");
Element UserInterface = doc.createElement("userInterface");
UserInterface.setAttribute("version","1.0");
Element mode = doc.createElement("mode");
label.appendChild(typeLabel1);
typeLabel1.appendChild(colorLabel);
typeLabel1.appendChild(font1);
font1.appendChild(size1);
size1.appendChild(textSize1);
typeLabel1.appendChild(multiLine);
multiLine.appendChild(textMultiLine);
typeLabel1.appendChild(hAlign);
hAlign.appendChild(textHalign);
typeLabel1.appendChild(hAlignText);
hAlignText.appendChild(textHalignText);
typeLabel1.appendChild(border1);
border1.appendChild(insets1);
label.appendChild(typeLabel2);
typeLabel2.appendChild(colorLabel2);
typeLabel2.appendChild(fillColorLabel2);
typeLabel2.appendChild(font2);
font2.appendChild(style2);
style2.appendChild(textStyle2);
typeLabel2.appendChild(border2);
border2.appendChild(thickness);
thickness.appendChild(textThickness);
border2.appendChild(Side);
Side.appendChild(textSide);
label.appendChild(typeLabel4);
typeLabel4.appendChild(font4);
font4.appendChild(style4);
style4.appendChild(doc.createTextNode("BOLD"));
typeLabel4.appendChild(border4);
border4.appendChild(insets4);
label.appendChild(typeLabel3);
typeLabel3.appendChild(colorLabel3);
typeLabel3.appendChild(size3);
size3.appendChild(textSize3);
typeLabel3.appendChild(halign3);
halign3.appendChild(textHalign3);
typeLabel3.appendChild(multiLine3);
multiLine3.appendChild(textMultiLine3);
typeLabel3.appendChild(border3);
border3.appendChild(Thickness3);
Thickness3.appendChild(textThickness3);
border3.appendChild(insets3);
insets3.setAttribute("top","0");
border3.appendChild(Sides3);
Sides3.appendChild(textSides3);
typeRepository.appendChild(edgeT);
edgeT.appendChild(typeEdge);
typeEdge.appendChild(Shape);
Shape.appendChild(doc.createTextNode("BENT"));
typeEdge.appendChild(ThickNess);
ThickNess.appendChild(doc.createTextNode("1"));
typeEdge.appendChild(targetDeco);
typeRepository.appendChild(nodeT);
nodeT.appendChild(typeNode);
typeNode.appendChild(shape);
shape.appendChild(fillColor);
shape.appendChild(borderNode);
borderNode.appendChild(styleNode);
styleNode.appendChild(doc.createTextNode("RAISED"));
typeNode.appendChild(plugs);
typeNode.appendChild(socket);
nodeT.appendChild(OCNode);
OCNode.appendChild(OCNodeShape);
OCNodeShape.appendChild(OCNodeSize);
OCNodeSize.appendChild(doc.createTextNode("150,0"));
OCNode.appendChild(OClayout);
nodeT.appendChild(OCNodeArrowUp);
OCNodeArrowUp.appendChild(OCNodeArrowShape);
OCNodeArrowShape.appendChild(OcNodeArrowSize);
OcNodeArrowSize.appendChild(doc.createTextNode("22,21"));
OCNodeArrowUp.appendChild(OcNodeArrowLabel);
OcNodeArrowLabel.appendChild(OcNodeArrowicon);
OcNodeArrowicon.appendChild(doc.createTextNode("apps/orgchart/arrow-up.gif"));
OcNodeArrowLabel.appendChild(OcNodeArrowHalign);
OcNodeArrowHalign.appendChild(doc.createTextNode("CENTER"));
nodeT.appendChild(OCNodeArrowDown);
OCNodeArrowDown.appendChild(OCNodeArrowDownLabel);
OCNodeArrowDownLabel.appendChild(OcNodeArrowDownIcon);
OcNodeArrowDownIcon.appendChild(doc.createTextNode("apps/orgchart/arrow-down.gif"));
typeRepository.appendChild(NodeGraph);
NodeGraph.appendChild(OCGraph);
OCGraph.appendChild(direction);
direction.appendChild(doc.createTextNode("TOP_BOTTOM"));
OCGraph.appendChild(components);
components.appendChild(doc.createTextNode("OCNode"));
OCGraph.appendChild(OCGraphLayouts);
OCGraphLayouts.appendChild(types);
types.appendChild(doc.createTextNode("TREE"));
OCGraphLayouts.appendChild(OCGraphlayout);
OCGraphlayout.appendChild(property1);
OCGraphlayout.appendChild(property2);
OCGraphlayout.appendChild(property3);
SapJNETData.appendChild(UserInterface);
UserInterface.appendChild(mode);
mode.appendChild(doc.createTextNode("SELECTONLY"));
SapJNETData.appendChild(Graph);
Graph.appendChild(layouts);
Graph.appendChild(view);
view.appendChild(grid);
grid.appendChild(TextGrid);
for (int i=0; i<wdContext.nodeZhr_Rfc_Employees2().size(); i++) {
IPublicOrgTree.IEmpElement Emp = wdContext.nodeEmp().createEmpElement();
IPublicOrgTree.IZhr_Rfc_Employees2Element curEmp = wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(i);
Element node = doc.createElement("node");
node.setAttribute("id",curEmp.getEmp_Pernr());
node.setAttribute("type","OCNode");
Element label1 = doc.createElement("label");
label1.setAttribute("type","OCLabelOrgUnit");
Text TextLabel1 = doc.createTextNode(curEmp.getEmp_Name());
Element label2 = doc.createElement("label");
label2.setAttribute("type","OCLabelChief");
Text TextLabel2 = doc.createTextNode(curEmp.getEmp_Pernr());
Graph.appendChild(node);
node.appendChild(label1);
label1.appendChild(TextLabel1);
node.appendChild(label2);
label2.appendChild(TextLabel2);
wdContext.nodeEmp().addElement(Emp);
for (int i=0; i<wdContext.nodeZhr_Rfc_Employees2().size()-1; i++) {
IPublicOrgTree.IEmpElement Emp = wdContext.nodeEmp().createEmpElement();
IPublicOrgTree.IZhr_Rfc_Employees2Element curEmp = wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(i);
for (int j=i1; j<wdContext.nodeZhr_Rfc_Employees2().size(); j+)
if (wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(i).getEmp_Pernr().equals(wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(j).getEmp_Manager()))
Element edge = doc.createElement("edge");
edge.setAttribute("type","OCLink");
Element from = doc.createElement("from");
from.setAttribute("node",curEmp.getEmp_Pernr());
Element to = doc.createElement("to");
to.setAttribute("node",wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(j).getEmp_Pernr());
Graph.appendChild(edge);
edge.appendChild(from);
edge.appendChild(to);
// typeLabel3.appendChild()
// Element font = doc.createElement("font");
// .appendChild(color);
// type1.appendChild(rgb1);
//create a comment and put it in the root element
// Comment comment = doc.createComment("Just a thought");
// type1.appendChild(comment);
//create child element, add an attribute, and add to root
// Element child = doc.createElement("child");
//child.setAttribute("name", "value");
//type.appendChild(child);
//add a text element to the child
//Output the XML
//set up a transformer
TransformerFactory transfac = TransformerFactory.newInstance();
Transformer trans = transfac.newTransformer();
trans.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-8");
trans.setOutputProperty(OutputKeys.INDENT, "yes");
//create string from xml tree
StringWriter sw = new StringWriter();
StreamResult result = new StreamResult(file);
DOMSource source = new DOMSource(doc);
trans.transform(source, result);
wdContext.currentContextElement().setXmlString(sw.toString());
} catch (DOMException e) {
wdComponentAPI.getMessageManager().reportException("2-"+e.getMessage(),true);
} catch (TransformerConfigurationException e) {
Maybe you are looking for
-
Hi Everybody! I just bought an Iphone 5, and I've added my email accounts on Mail for iPhone. As soon as I did it, mail on MacBook Pro started crashing, and I can't fix it... Can anyone, PLEASE, help me? Thanks in advance! This is the code I get: Pro
-
"Sent Items" folder can not be synced up in time for Outlook 2013 cache mode
Hi, I found a strange problem in Outlook 2013 cache mode. Hope anyone can help me find out if it is the new design of outlook 2013 or outlook 2013 issue. I am using Exchange 2013 and Outlook 2013 client. I created two outlook profiles in two machines
-
Physical Query in OBIEE 10g vs OBIEE 11g
Hi Everyone, We're in the middle of an OBIEE 10g to an OBIEE 11.1.1.6.4 upgrade and as part of our assembly testing we were planning on comparing the physical query generated for a report generated in obiee 10g vs the physical query for a report in o
-
Is there a way to search contacts by both last name and first name in one go (like N series or all Windows phones)? As of now, I need to remember which name was entered in which order. Anyone can help here? I will have to change my phone because of t
-
TimeZone exception in java webdynpro
Hi All, Can anybody help me to resolve below exception: com.sap.i18n.SAPTimeZoneInfo.SAPTimeZoneException i am getting above exception in PI nwa while trying to load current time/timezone in webdynpro input field. Thanks in advance!!! Regards, gaurav