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

Error calling class methods CL_GUI_FRONTEND_SERVICES

Former Member
0 Likes
987

Hi all,

I have a requirement in BAPI (integrating solman to portal) to download file from app. server to local directory. I used the below FM to get temp directory of presntation server.

*

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
   CHANGING
     TEMP_DIR             =  LV_TEMP_DIR
   EXCEPTIONS
     CNTL_ERROR           = 1
     ERROR_NO_GUI         = 2
     NOT_SUPPORTED_BY_GUI = 3
     others               = 4.
   CALL METHOD cl_gui_cfw=>flush.

.

It works fine in R3, but when i called it from portal it shows Access not possible using 'NULL' object reference with a short dump .

st22 shows

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.

An exception occurred. This exception is dealt with in more detail belo
. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL',
 neither
caught nor passed along using a RAISING clause, in the procedure
 "GET_TEMP_DIRECTORY" "(METHOD)"
.
Since the caller of the procedure could not have expected this exceptio
 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.

When i put external break point and the dump comes during execution of CALL METHOD cl_gui_cfw=>flush.

Is it not possible to use CL_GUI_FRONTEND_SERVICES in RFC ??.

thanks and regards

Jijo

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
664

[CL_GUI_FRONTEND_SERVICES|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_frontend_services+portal&adv=false&sortby=cm_rnd_rankvalue] needs a SAPGUI, so it is not possible to use it in RFC, BSP or other portal.

Regards

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
665

[CL_GUI_FRONTEND_SERVICES|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_frontend_services+portal&adv=false&sortby=cm_rnd_rankvalue] needs a SAPGUI, so it is not possible to use it in RFC, BSP or other portal.

Regards

Read only

0 Likes
664

Hi Raymond,

Can you suggest any FM that can be used in RFC's for my requirement .

Thanks and regards

Jijo