Skip to Content
author's profile photo Former Member
Former Member

onActionShow gives no result

Hi Experts,

I am creating an application similat to web dynpro example : Accessing ABAP Functions in Web Dynpro. found here [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#6 [original link is broken]].

I created an RFM which has import parameters as Date of Type CATSDB-WORKDATE. It has 'Employee_atab' as tables parameters. This is a custom fm, so if the date is given as input, it gives employee's attendence and absences in table 'Employee_atab' . It is working perfectly fine in R/3 system.

I am trying to create a web dynpro UI for this fm: So 'date' will be supplied through Web Dynpro and Table "Employee_atab" output will be seen in Web Dynpro.

I am struck here. when I give the 'date' and press show button, i do not see any thing in the table UI element.

I have a curiosity if the logic here below in wdInit Method of the controller is fine:I am guessing it is the problem with Date conversion.

Z_Hr_Time_Report_2Weeks_Input readInput = new Z_Hr_Time_Report_2Weeks_Input();

wdContext.nodeTimeDataRead().bind(readInput);

Calendar c1 = Calendar.getInstance();

// Date sDate = new Date();

Date d = new Date(c1.getTimeInMillis());

readInput.setStartdate(new Date (c1.getTime().getTime()));

This is the code in Search View controller:

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

{

//@@begin onActionShow(ServerEvent)

wdContext.currentContextElement().setStartdate(wdContext.currentContextElement().getWorkDate());

wdThis.wdGetTimeReport_CustController().executeReadTimeData();

//@@end

}

I can not locate the problem. I am not sure how the RFM is responding to the Date input on web dynpro. I am on ERP2004, I can not create a external break point in my RFC.

Could any body throw some light on the problem. I would really appreicate your help.

Thanks!

Edited by: minisap g on Apr 6, 2008 1:41 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Apr 07, 2008 at 04:44 AM

    readInput.setStartdate(new Date (c1.getTime().getTime()));

    // new Date(c1.getTime()) will give you Date instance

    you can set current date by

    new Date(System.currentTimeMillis());

    try:

    1. in onActionShow()

    set current date as wdContext.currentContextElement().setStartdate(new Date(System.currentTimeMillis());

    2. If still not shows the result, you need to invalidate the node to reflect the new values in the output node of RFC.

    - Go to CustController().executeReadTimeData()

    - wdContext.node<RFC_OUTPUT>.invalidate();

    //make sure that you are invalidating the exact node that gets filled when the RFC is executed.

    regards,

    nikhil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 07, 2008 at 04:55 AM

    Hi,

    First, check with a simple BAPI if you are able to execute successfully and get the output.

    Once you get, then go to the RFC you are facing problem. Execute from R3 screen itself by specifying the date.

    Once the output comes there, check the date format.

    Then follow the same format from webdynpro and check the output. Y

    ou can put many print statements to check the node attribute values here and there.

    That may help you locate the problem.

    Regards,

    Harini S

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member snehal kendre

      Hi Experts,

      I have tried your suggestions, I have not had any luck with executing the RFC from Web Dynpro Input Date.

      please advice on how to debug in ERP2004. I can not set an external break point in ERP2004 system.

      I have done bebugging in NWDS by using external break point in ERP2005 system, though. I just would like to see in which format the date is coming into the RFC from Web Dynpro.

      I know this web dynpro application is not very complex. I am only supplying date to the RFC through web dynpro and am trying to see the output.

      Thanks!

  • author's profile photo Former Member
    Former Member
    Posted on Apr 07, 2008 at 04:45 AM

    Hello,

    I think problem arise at your value binding at your input node element.

    Do this way

    
    wdContext.currentZ_Hr_Time_Report_2Weeks_InputElementz().setStartdate( wdContext.currentContextElement().getWorkDate());
    wdThis.wdGetTimeReport_CustController().executeReadTimeData();
    

    You have to bind your input value to currentZ_Hr_Time_Report_2Weeks_InputElementz() not with

    wdContext.currentContextElement().setStartdate().

    You can hardcode a date as the input parameter to check.

    Regards

    - Vinod

    *

    Edited by: Vinod V on Apr 7, 2008 10:16 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 07, 2008 at 07:35 AM

    Hi minisap,

    I think there is some problem with the format of date.

    Hope the following code will work

    You can take your date into strDate,

    SimpleDateFormat objDateFormat = null;

    Date dtDate = null;

    String strDate = "31/12/9999";

    try

    {

    objDateFormat = new SimpleDateFormat("dd/MM/yyyy");

    dtDate = new Date(objDateFormat.parse(strDate).getTime());

    }

    catch(Excetion e)

    {

    IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();

    String strMessage = e.getLocalizedMessage();

    if((strMessage == null) ||(strMessage.length() == 0))

    {

    strMessage = e.getMessage();

    }

    if ((strMessage == null) || (strMessage.length() == 0))

    {

    strMessage = e.toString();

    }

    msgMgr.reportException(strMessage,true);

    }

    dtDate will contain the required format to be sent to backend.

    Thanks and Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.