‎2007 May 02 8:49 AM
Hi all,
I have created a report..this report when executed will give the o/p in a PDF format of PO details ...this report will take PO number as input ..this is working fine in GUI mode...when i placed this report in the ITS whenever i give a PO number to it it is going to dump...In dump i didnt find how to solve it...please help..
Dump shows as ::
<b>ShrtText
Access not possible using 'NULL' object reference.
What happened?
Error in ABAP application program.
The current ABAP program "CL_GUI_FRONTEND_SERVICES======CP" had to be
terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL', was
neither
caught nor passed along using a RAISING clause, in the procedure
"GET_SAPGUI_WORKDIR" "(METHOD)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
Attempt to access a component using 'NULL' object reference (points
to nothing).
An object reference must point to an object (an instance of a class)
before you can use it to access components (variable:
"CL_GUI_FRONTEND_SERVICES=>HANDLE").
Either the reference has not yet been set, or it has been reset to
'NULL' by a CLEAR statement.</b>
I am unable to find a solution please help...
‎2007 May 02 8:57 AM
Hi
In the program you are accessing the method/event straight with the class like
CL_GUI_FRONTEND_SERVICES=>HANDLE.
it is wrong
you have to create an object like
data: O_OBJ TYPE REF TO CL_GUI_FRONTEND_SERVICES
then you have to call the method/event with that object
O_OBJ=>HANDLE
Reward points if useful
Regards
Anji
‎2007 May 02 9:09 AM
Thanks for u reply...
Where exactly i need to call this method..
any specific place..
.
‎2007 May 02 10:02 AM
the issue is your code is trying to access user SAP work dir (GET_SAPGUI_WORKDIR)
ITS is a webapplication which can be called from a machine which may ot may not have sapgui (which is responsilbe for creating sap work directory). thus when called from web cl_gui_front.... wont be able to execute that code.
(are you putting the file in a temp directory and read it from there?)
the more appropriate forum for this question is ITS forum at
Regards
Raja
‎2007 May 02 10:17 AM
Hi Durairaj Athavan Raja ,
Yes! My report will take input as PO Number and when executed it will open the PO Details in PDF format...
The logic i have written is creating the PDF file in the SAP Work dir and opening the created PDF file from the SAP Work Dir...will this effect any where????
As my report is working fine in GUI and NOT ITS what exactly do i need to chnage..
Please help...
‎2007 May 02 10:12 AM
you might be passing cl_gui_frontend_services=>handle to some varible instead pass the object reference directly with out using this attribte.
there is no problem with you call as this is static attirbute you can call it as you are calling it but its empty so its showing an errro message
just in place of cl_gui_frontend_services=>handle replace with the object reference of the object which displays the pdf or what ever.
Thanks
raju N