cancel
Showing results for 
Search instead for 
Did you mean: 

RFC status : Access not possible using 'NULL' object reference ?

Former Member
0 Kudos

Hello,

i have a workflow that works well when the method in the task is dialog, if it is dialog, then once an event takes place, a new workitem is placed in the inbox and once the user double click on it , then this will trigger the workflow.

Now i want the workflow to be triggered by itself, once the document status changes, so in SWO1 for the method i unchecked dialog and in the task properties in the workflow builder i check background processing.

in event linkage table SWE2 i have an entry for DRAW, CHANGED triggering workflow ws90000019 and the receiver FM is SWW_WI_CREATE_VIA_EVENT_IBF

so the problem is that once the method is non dialog, it does not work, nothing happens, there is no workitem in the inbox and the workflow is not executed.

so i checked in SWEL and i saw the following error :

RFC status : Access not possible using 'NULL' object reference ?

now this method is instance dependent and it works well when it is dialog but when it is non dialog it gives error , any ideas as to why this is happening ?

regards

points are awarded

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello experts and thanks for you great suggestions.

I noticed one thing, when my method is a dialog one, everything works fine, i get an entry in the workitem and when i click on it it executes.

when i change it to non dialog method and put the task as background then i am getting the following error:

-if the method if instance dependent, then i get cannot access null reference

-if method if not instance dependent i do not get any errors and in SWEL the event log says receiver started correctly but nothing happens, my task is not executed, i even put a break point inside the method and the system is not stopping there , this means that the method is not being executed.

-Here is a step by step of what i did

1- i want to trigger a workflow which opens a web broswer if the status of a document changes

2- I created in SWO1 an object called YMYDRAW and i delegated it to DRAW

3- I added a new method called M1 and i attached it to a function module FM1

4- i created a workflow and it has a triggering event : object tyepe : DRAW ,event: changed

5- i did the binding from the event container to the workflow container and i also send the instance of the object of event creator

6- created a task and i transfered the elements from the workflow container to the task container

7- in the task i assigned the object type as DRAW and the method as M1

8- i did the binding from the task to the method container.

then in SWE2 i added an entry:

object type : DRAW

event: changed

reciver task : ws90000099

receiver FM : sww_wi_create_via eventibf

So here is what is happening:

1- if the method is dialog => works perfectly and the browser window opens

2- if the method is non dialog + instance dependent => i check in SWEL and i find the error : access not possible using null reference

3- if methid is non dialog + non instance dependent => in SWEL there is no error, SWEL says receiver started correctly, but there is no workitem and the browser does not start, and the break point in the code is not reached => the code is not being executed.

So basically i followed all the steps but it is not working :S

Any suggestions ?

regards

0 Kudos

That is the problem!

A background task can have no screens! Not event the IE. It is executed by the WF-BATCH user and if he encounters a FM to communicate to the IE of the local system where should he display the webpage?

Hope this helps,

Sudhi

0 Kudos

And I guess you receive the Null object reference in the Function Module that you use to display the browser window. It may not find the required container to display.

Former Member
0 Kudos

Hello sudhindra,

thanks for your prompt response

here is what i am getting in the SWEL :

event data:

event instance ID : 336170

object type : draw

object key : kpraaa.dwg 00000

event : changed

event creator: me

creation time : current time

receiver data:

receiver type: ws90000099

object key :

notice that object key is empty

receiver FM: sww_wi_create_via_event_ibf

rfc destination: workflow_local_000

check fm :

receiver type fm:

Trace data:

action: receiver started correctly

rfc status : access not possible using null object reference

-


the setting were as follow:

-method is non dialog

-method is instance dependent.

-task is set as background

so why is this happening ?

regards

0 Kudos

Go to transaction ST22 to see the dump analysis. I am pretty sure there is a dump.

It surprises me that the object key is blank! Have you changed the receiver function module or everything is as in standard?

Sudhi

Former Member
0 Kudos

Hello,

thanks for you continuous help here is the dump, sorry i am asking alot of questions but i am really new in SAP.

runtime error: objects_objref_not_assigned

except : cx_sy_ref_is_initial

what happened:

abap program had to terminate : CL_GUI_FRONTEND_SERVICES======cp

error analysis:

exception not caught nor passed along in the RAISE clasue in the prcedure "EXECUTE" method

the reason for this exception: attempt to access component using null object reference.

variable cl_gui_frontend_services=>handle

-


-i have checked the binding 100 times, i am binding the object instance that raised the event "changed" from the event container to the workflow container to the task container

- when the method is instance independent, no error is there but the workflow is not executed .

any suggestions ?

regards

0 Kudos

This is not a problem with the workflow binding but your method. When you say that you are trying to show a webpage once the event changes I guess you must be using one of the function modules like "CALL_INTERNET_ADRESS" which internally makes use of the class CL_GUI_FRONTEND_SERVICES. This class is an API which communicates with the GUI which later communicates with the OS instructing of what is to be done. Just comment out the code where you call the webpage and just execute and it should work. Baiscally you can have a blank method and call that in the background to see it it works and later add the code.

Hope this helps and do award points for answers which have helped you! It is just the motivation for everyone!

Sudhi

Former Member
0 Kudos

Hello, Sudhindra,

Thanks a lot for your help, actually i used the function that you suggested for opening the web browser, and i no longer get any null pointer exceptions, so in SWEL it says that receiver started correctly, in ST22 there are no errors

But but, the browser is not opening, there are no exceptions but the browser window does not open. This is a background task, shouldn't it open the browser directly when the changed event is raised ?

once again thanks a lot

regards

0 Kudos

No the background task is executed by the user WF-BATCH and once the function module is called the user transfers the control to the SAP GUI and then the SAP GUI communicates with the OS. In this case if the task is background then how will the OS know where to call the web browser? It will not know the user to whom this request must be dispatched.

So the bottom line is that you cannot use this functionality in a background task.

There is one workaround that comes to my mind. What you can do to inform a user that the "Changed" event has triggered is as follows:

1. Create a workflow which will trigger off from the Changed event of "DRAW"

2. Create a send mail step and check the checkbox that says "Send Express" and include the URL you want to open in the Mail body and then send it to an outlook user.

If you use the Send Express flag then the user will be intimated once the event has occured if and only if he uses the SAP GUI. If the user does not use the SAP GUI then you can remove the check but just send the mail to the outlook so that the user receives the email in outlook once the event has triggered!

Apart from this nothing comes to my mind!

All the best!

Sudhi

Answers (2)

Answers (2)

0 Kudos

Your understanding of how the workflow is triggered is wrong. Be it Dialog or non-Dialog the workflow gets instantiated immediately once the event is raised.

Your statement:

**"if it is dialog, then once an event takes place, a new workitem is placed in the inbox and once the user double click on it , then this will trigger the workflow.**

is wrong. Before it event comes to the user the workflow has already started and the container elements are filled.

In your case there might be a problem.

Does the method have any screens involved?

A null object reference is an error that happens if the code is trying to access a object that has not been instantiated.

Hope this helps,

Sudhi

Former Member
0 Kudos

hello Sudhindra,

Thanks for your reply,

ok so you are saying that once the event is raised then all the container elements are filled.

in my binding, i am binding the the object that raised the event from the even container -> workflow container -> task container.

and the method that i have is an instance dependent method. So basically the task container should have a reference to the object that instantiated the event , right ?

The same code is working correctly when it is a dialog method, but once i out it as background is stops working.

Another thing, no the method does not have any screens.

One thing i am not sure of. In SWO1 once i create a method, i am unchecking dialog and i am checking synchronous checkboxes,

in the task definition, i am checking synchronous and i am unchecking and i am checking background processing.

is this correct setting.

So why is it that the dialog does not get a null object reference and the background processing has a null object reference although it is the same code ?

regards

Points are awarded.

Former Member
0 Kudos

Just a thought. Once you change the properties of the Method in the Business Object and regenerate the Business Object the Background option in the task should change automatically. You needn't have to manually uncheck the option. So may be the activation of your method didn't go through successfully.

0 Kudos

Hi Hassan,

Is your method Synchronous or Asynchronous. If it is asynch then you will have to specify a terminating event.

Once you make this as a background task execute it and go to the workflow log what does it tell?

Best regards,

Sudhi

Former Member
0 Kudos

Hi Hassan,

Since the method is not a dialog method you will not get a workitem in your Business Workplace when the event is triggered.

Also there might be an issue with the workflow getting triggered. Hence you might not be reaching the point where the method is being executed.

You will be able to check all the values that get passed to the workflow and the values of the workflow container elements/ Task elements in the workflow log. Transaction SWUS.

Regards

Bhooma