cancel
Showing results for 
Search instead for 
Did you mean: 

Overview Link of ESS Salary Stat application

Former Member
0 Kudos

Hello,

We are using few ESS applications in our environment. We were using the ESS applications without any customization so far. Now, we have some requirements for customizing a few things. I would really appreciate your help in the following requirement.

(We have the NWDI setup and track created I have imported the configuration into NWDS and created the appropriate project for ess/rem and ess/rep).

(We are on EP 7.0 using Webdynpro Java XSS 600 components)

Our requirement is:

In the ESS pay (Remuneration) statement application:

1. Display the Overview screen by default (This is hidden now and will only be displayed if you click on the link "Show Overview")

I really have very limited idea about this webdynpro application and am having difficulty finding the exact piece of code to be modified.

I will appreciate your help.

Thank You,

Kalyan B

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please find the application under the name.

ED1_ESSTrack_Dessrem~sap.com

Please add the following lines of code under the init method of view

if(wdContext.currentVCDATAElement().getLINK_ENABLED()){

try{

* wdContext.currentContextElement().setTable_visible(WDVisibility.VISIBLE);*

* wdContext.currentVCDATAElement().setOVERVIEW_SEL("99");*

* wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_LINK());*

* wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_DDSEL());*

* }catch(NullPointerException e){ *

* wdComponentAPI.getMessageManager().reportWarning("Salary Statement does not Exists in database for You : " + e.getMessage());*

* }*

}else{

* wdContext.currentContextElement().setTable_visible(WDVisibility.NONE);*

* wdComponentAPI.getMessageManager().reportWarning("Payroll data does not Exists, Check with HR Team");*

}

I have added the following lines of code and it is working fine.

Regards

Ponnusamy

Former Member
0 Kudos

Hello Ponnusamy and Delma,

Thanks for your valuable time and input.

A small clarification please.

1. Do I need to put the code in

wdDoInit() method of SelectionView (view controller)

(OR)

wdDoInit() method of VcRem2Selection (component contoller)

(OR)

onInit() method of VcRem2Selection (component contoller)

2. Is there any change that needs to be made in context/methods (other code changes) of the view and component contoller?

Thank You,

Kalyan

Former Member
0 Kudos

Hello Ponnusamy,

I have tried inserting your code in the wdDoInit() method of "SelectionView". I have the following error:

"The method setTable_Visible((WDVisibility) is undefined for the type IPrivateSelectionView".

It seems that the implementation/definition of method Table_Visible is needed.

I am using XSS 600 SP 12 webdynpro components.

The following is my code for your reference:

Please suggest.

Thank You,

Kalyan

// ---------------------------------------------------------------------------
// 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.xss.hr.rem2.selection;

// 
// 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 IPrivateSelectionView).
// 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 com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable;
import com.sap.tc.webdynpro.progmodel.api.WDVisibility;
import com.sap.xss.hr.rem2.selection.wdp.IPrivateSelectionView;
//@@end

//@@begin documentation
//@@end

public class SelectionView
{
  /**
   * Logging location.
   */
  private static final com.sap.tc.logging.Location logger = 
    com.sap.tc.logging.Location.getLocation(SelectionView.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.xss.hr.rem2.selection.wdp.IPrivateSelectionView for more details
   */
  private final IPrivateSelectionView 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.xss.hr.rem2.selection.wdp.IPrivateSelectionView.IContextNode for more details.
   */
  private final IPrivateSelectionView.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 SelectionView(IPrivateSelectionView 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: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 in order 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 etc.
   * The Web Dynpro programming model recommends to restrict access to
   * UI elements to 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(IPrivateSelectionView wdThis, IPrivateSelectionView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
  {
    //@@begin wdDoModifyView
	//wdContext.nodeVCTABLE().getNodeInfo().addAttributesFromDataNode();
    IWDTable viewTab = (IWDTable) view.getElement("OverViewTab");
    wdThis.wdGetVcRem2SelectionController().assignTable(view, viewTab, wdContext.nodeTABLE0(), firstTime);
    if (wdContext.currentVCDATAElement().getOVERVIEW_VISIBLE() == WDVisibility.VISIBLE) {
    	// overview is already shown - enable close
		    wdContext.nodeCONTENT_TABLE0().setLeadSelection(wdContext.currentVCDATAElement().getSELECTED_TABROW());
			wdContext.currentRemLocalElement().setLinkOverviewLabel(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("CloseOverviewLabel"));
			wdContext.currentRemLocalElement().setLinkOverviewTooltip(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("CloseOverviewLabel"));
		} else {
		    wdContext.nodeCONTENT_TABLE0().setLeadSelection(-1);
			wdContext.currentRemLocalElement().setLinkOverviewLabel(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("OpenOverviewLabel"));
			wdContext.currentRemLocalElement().setLinkOverviewTooltip(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("OpenOverviewLabel"));
		}
    //@@end
  }

  //@@begin javadoc:onActionOverViewRowSelection(ServerEvent)
  /** declared validating event handler */
  //@@end
  public void onActionOverViewRowSelection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionOverViewRowSelection(ServerEvent)
		wdContext.currentVCDATAElement().setSELECTED_TABROW(wdContext.nodeCONTENT_TABLE0().getLeadSelection());
    wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_TABSEL());
    //@@end
  }

  //@@begin javadoc:onActionToggleVisibility(ServerEvent)
  /** declared validating event handler */
  //@@end
  public void onActionToggleVisibility(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionToggleVisibility(ServerEvent)
    wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_LINK());
    //@@end
  }

  //@@begin javadoc:onActionSel_ListSelection(ServerEvent)
  /** declared validating event handler */
  //@@end
  public void onActionSel_ListSelection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionSel_ListSelection(ServerEvent)
    wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_DDSEL());
    //@@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
}

Former Member
0 Kudos

Dear Kalyan,

I have not done anything, try to check the table properties and redeploy it again.

Please find my coding

// -


// 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.xss.hr.rem2.selection;

//

// 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 IPrivateSelectionView).

// 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 com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable;

import com.sap.tc.webdynpro.progmodel.api.WDVisibility;

import com.sap.xss.hr.rem2.selection.wdp.IPrivateSelectionView;

//@@end

//@@begin documentation

//@@end

public class SelectionView

{

/**

  • Logging location.

*/

private static final com.sap.tc.logging.Location logger =

com.sap.tc.logging.Location.getLocation(SelectionView.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.xss.hr.rem2.selection.wdp.IPrivateSelectionView for more details

*/

private final IPrivateSelectionView 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.xss.hr.rem2.selection.wdp.IPrivateSelectionView.IContextNode for more details.

*/

private final IPrivateSelectionView.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 SelectionView(IPrivateSelectionView 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()

// Added here to Call methods When the Application is loaded.

if(wdContext.currentVCDATAElement().getLINK_ENABLED()){

try{

wdContext.currentContextElement().setTable_visible(WDVisibility.VISIBLE);

wdContext.currentVCDATAElement().setOVERVIEW_SEL("99");

wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_LINK());

wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_DDSEL());

}catch(NullPointerException e){

wdComponentAPI.getMessageManager().reportWarning("Salary Statement does not Exists in database for You : " + e.getMessage());

}

}else{

wdContext.currentContextElement().setTable_visible(WDVisibility.NONE);

wdComponentAPI.getMessageManager().reportWarning("Payroll data does not Exists, Check with HR Team");

}

//@@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 in order 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 etc.

  • The Web Dynpro programming model recommends to restrict access to

  • UI elements to 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(IPrivateSelectionView wdThis, IPrivateSelectionView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

//wdContext.nodeVCTABLE().getNodeInfo().addAttributesFromDataNode();

//wdComponentAPI.getMessageManager().reportWarning("Check Status : " + wdContext.currentVCDATAElement().getOVERVIEW_VISIBLE());

IWDTable viewTab = (IWDTable) view.getElement("OverViewTab");

wdThis.wdGetVcRem2SelectionController().assignTable(view, viewTab, wdContext.nodeTABLE0(), firstTime);

if (wdContext.currentVCDATAElement().getOVERVIEW_VISIBLE() == WDVisibility.VISIBLE) {

// overview is already shown - enable close

wdContext.nodeCONTENT_TABLE0().setLeadSelection(wdContext.currentVCDATAElement().getSELECTED_TABROW());

wdContext.currentRemLocalElement().setLinkOverviewLabel(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("CloseOverviewLabel"));

wdContext.currentRemLocalElement().setLinkOverviewTooltip(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("CloseOverviewLabel"));

} else {

wdContext.nodeCONTENT_TABLE0().setLeadSelection(-1);

wdContext.currentRemLocalElement().setLinkOverviewLabel(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("OpenOverviewLabel"));

wdContext.currentRemLocalElement().setLinkOverviewTooltip(wdThis.wdGetAPI().getComponent().getTextAccessor().getText("OpenOverviewLabel"));

}

//@@end

}

//@@begin javadoc:onActionOverViewRowSelection(ServerEvent)

/** declared validating event handler */

//@@end

public void onActionOverViewRowSelection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionOverViewRowSelection(ServerEvent)

wdContext.currentVCDATAElement().setSELECTED_TABROW(wdContext.nodeCONTENT_TABLE0().getLeadSelection());

wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_TABSEL());

//@@end

}

//@@begin javadoc:onActionToggleVisibility(ServerEvent)

/** declared validating event handler */

//@@end

public void onActionToggleVisibility(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionToggleVisibility(ServerEvent)

wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_LINK());

//@@end

}

//@@begin javadoc:onActionSel_ListSelection(ServerEvent)

/** declared validating event handler */

//@@end

public void onActionSel_ListSelection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSel_ListSelection(ServerEvent)

wdThis.wdGetVcRem2SelectionController().execAction(wdContext.currentVCDATAElement().getACTIONID_DDSEL());

//@@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

}

Regards

Ponnusamy

Former Member
0 Kudos

OK, got it working now.

In my case, the context attributes were different. I had to make a small change.

Thanks for your help. (full points awarded)

Regs,

Kalyan

Answers (1)

Answers (1)

Former Member
0 Kudos

hi

I didn't try this. But I guess you just put

wdThis.execAction(wdContext.currentVCDATAElement().getACTIONID_LINK());

in the end of the onInit() method of the VcRem2Selection controller.

Hope it helps.

Best Regards

delma