Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ITS Issue

Former Member
0 Likes
579

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...

5 REPLIES 5
Read only

Former Member
0 Likes
551

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

Read only

0 Likes
551

Thanks for u reply...

Where exactly i need to call this method..

any specific place..

.

Read only

athavanraja
Active Contributor
0 Likes
551

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

Read only

0 Likes
551

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...

Read only

Former Member
0 Likes
551

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