cancel
Showing results for 
Search instead for 
Did you mean: 

Job Monitor Widget: TypeError: jobTableList.item(0) has no properties

kmoore007
Active Contributor
0 Kudos

I have tried to implement the Job Monitor widget. I followed the blog instructions and also I changed the main.js with the RFC name ZBP_JOB_SELECT_SM37B.

I am getting the following error:

TypeError: jobTableList.item(0) has no properties (Global/onLoad:Logics/main.js: Line 157)

Accepted Solutions (1)

Accepted Solutions (1)

frank_ruggaber
Explorer
0 Kudos

Hi Kenneth!

Check the lines in the main.js with "...getElementsByTagName(...)" if they match

the web service response (case-sensitive !). In my case I had to change it to -

var jobTableList = root.getElementsByTagName("JOBSELECT_JOBLIST_B");....

=> and all the other ones into upper case. Then it worked.

Greetings

Frank

kmoore007
Active Contributor
0 Kudos

I changed these and it is still giving me the same error. Can you send me your widget file and maybe it will work for me? If so, send it to kmoore@charlottepipe.com.

Thanks!

kmoore007
Active Contributor
0 Kudos

Thanks Frank. I tried your version of the widget (and changed the main.js with my RFC name from WRAP... to ZBP...), but it is still not working. I must have something wrong outside the widget. I still get the error:

TypeError: jobTableList.item(0) has no properties (Global/onLoad:Logics/main.js: Line 357)

athavanraja
Active Contributor
0 Kudos

i have emailed the working version of mine. check it out and let me know. and also do let us know whats the difference between yours and the one i have sent.

Regards

Raja

kmoore007
Active Contributor
0 Kudos

Yes. Thanks. I changed the RFC name to all CAPS as mine is. But I am still getting the same error. I can see the error when I turn on debug:

TypeError: jobTableList.item(0) has no properties (Global/onLoad:Logics/main.js: Line 157)

I gues something is wrong on the SAP side.

athavanraja
Active Contributor
0 Kudos

the name next to ns1: is it same as operation name in wsdl - case sensitive.

kmoore007
Active Contributor
0 Kudos

Yes. I changed it to be like in the wsdl. Mine is all CAPS in the wsdl.

Raja, I tried your version without changing anything:

Same error:

TypeError: jobTableList.item(0) has no properties (Global/onLoad:Logics/main.js: Line 157)

PS: I am on SAP 4.7, I don’t think I have a web service wizard option. I just classify my function as remote and it shows up automatically as a web service.

athavanraja
Active Contributor
0 Kudos

oh 4.7, the way wsdl is generated is slightly different from was6.40 and you need do to a lot of change in the main js (mainly the soap envelope) to get it working.

athavanraja
Active Contributor
0 Kudos

the soap message has to be in this format.

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <ZBP_JOB_SELECT_SM37B xmlns="urn:sap-com:document:sap:rfc:functions">
      <ENDDATE />
      <ENDTIME />
      <JOBSELECT_DIALOG />
      <JOBSELECT_JOBLIST>
        <item>
          <JOBNAME />
          <JOBCOUNT />
          <JOBGROUP />
          <INTREPORT />
          <SDLSTRTDT />
          <SDLSTRTTM />
          <BTCSYSTEM />
          <SDLDATE />
          <SDLTIME />
          <SDLUNAME />
          <LASTCHDATE />
          <LASTCHTIME />
          <LASTCHNAME />
          <RELDATE />
          <RELTIME />
          <RELUNAME />
          <STRTDATE />
          <STRTTIME />
          <ENDDATE />
          <ENDTIME />
          <PRDMINS />
          <PRDHOURS />
          <PRDDAYS />
          <PRDWEEKS />
          <PRDMONTHS />
          <PERIODIC />
          <DELANFREP />
          <EMERGMODE />
          <STATUS />
          <NEWFLAG />
          <AUTHCKNAM />
          <AUTHCKMAN />
          <JOBLOG />
          <LASTSTRTDT />
          <LASTSTRTTM />
          <EVENTID />
          <EVENTPARM />
          <BTCSYSREAX />
          <JOBCLASS />
          <EVENTCOUNT />
          <CHECKSTAT />
          <CALENDARID />
          <PRDBEHAV />
          <EXECSERVER />
          <REAXSERVER />
          <RECLOGSYS />
          <RECOBJTYPE />
          <RECOBJKEY />
          <RECDESCRIB />
          <TGTSRVGRP />
        </item>
      </JOBSELECT_JOBLIST>
      <JOBSELECT_JOBLIST_B>
        <item>
          <JOBNAME />
          <JOBCOUNT />
          <JOBGROUP />
          <INTREPORT />
          <SDLSTRTDT />
          <SDLSTRTTM />
          <BTCSYSTEM />
          <SDLDATE />
          <SDLTIME />
          <SDLUNAME />
          <LASTCHDATE />
          <LASTCHTIME />
          <LASTCHNAME />
          <RELDATE />
          <RELTIME />
          <RELUNAME />
          <STRTDATE />
          <STRTTIME />
          <ENDDATE />
          <ENDTIME />
          <PRDMINS />
          <PRDHOURS />
          <PRDDAYS />
          <PRDWEEKS />
          <PRDMONTHS />
          <PERIODIC />
          <DELANFREP />
          <EMERGMODE />
          <STATUS />
          <NEWFLAG />
          <AUTHCKNAM />
          <AUTHCKMAN />
          <JOBLOG />
          <LASTSTRTDT />
          <LASTSTRTTM />
          <EVENTID />
          <EVENTPARM />
          <BTCSYSREAX />
          <JOBCLASS />
          <EVENTCOUNT />
          <CHECKSTAT />
          <CALENDARID />
          <PRDBEHAV />
          <EXECSERVER />
          <REAXSERVER />
          <RECLOGSYS />
          <RECOBJTYPE />
          <RECOBJKEY />
          <RECDESCRIB />
          <TGTSRVGRP />
          <PROGNAME />
          <XPGPROG />
          <EXTCMD />
        </item>
      </JOBSELECT_JOBLIST_B>
      <JOBSEL_PARAM_IN>
        <JOBNAME />
        <JOBCOUNT />
        <JOBGROUP />
        <USERNAME />
        <FROM_DATE />
        <FROM_TIME />
        <TO_DATE />
        <TO_TIME />
        <NO_DATE />
        <WITH_PRED />
        <EVENTID />
        <EVENTPARM />
        <pre><code>
        <SCHEDUL />
        <READY />
        <RUNNING />
        <FINISHED />
        <ABORTED />
        <ABAPNAME />
      </JOBSEL_PARAM_IN>
    </ZBP_JOB_SELECT_SM37B>
  </soap:Body>
</soap:Envelope>

Regards

Raja

kmoore007
Active Contributor
0 Kudos

Ok. That is probably my problem in that this widget example is not for a 4.7 SAP system. I tried Raja's 4.7 soap code example, but I couldn't get it to work (I'm not a Java developer).

So, if anyone has a 4.7 working example of this widget, please send me a copy to kmoore@charlottepipe.com. Otherwise...I give up!

Thanks everyone!

athavanraja
Active Contributor
0 Kudos

the easiest approach would be to create a bsp application to return required data in xml form and build widget based on that.

check out the following weblog which uses that approach

/people/durairaj.athavanraja/blog/2006/10/10/sap-logged-on-users-list-widget

raja

Answers (3)

Answers (3)

kmoore007
Active Contributor
0 Kudos

We have since upgraded to ECC 6.0, so I am closing this thread.

athavanraja
Active Contributor
0 Kudos

<i> I changed the main.js with the RFC name ZBP_JOB_SELECT_SM37B.</i>

what did you change. all that you need to change is.

fo to the wsdl of your webservice and copy the operation name. (in my case its ZbpJobSelectSm37b) and then go the main.js file and find the occurrences of <b>ns1:</b> next to the colon , it should have the operation name. it has to be same as what you saw in the wsdl file. (case sensitive) if not replace with what is there in wsdl. thats all you need.

if it doesnt help, let us know.

Regards

Raja

kmoore007
Active Contributor
0 Kudos

Hey Raja - I tried that already and it didn't work for me.

kmoore007
Active Contributor
0 Kudos

Any ideas?