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

problem in background job

Former Member
0 Likes
861

Hi,

I have a problem in (I think this and others that uses CL_GUI...)

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES

OBJECTS_OBJREF_NOT_ASSIGNED

But I need to use this method in background?

How can I handle this problem?

Thanks.

deniz.

Hi,

I have a problem in (I think this and others that uses CL_GUI...)

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES

OBJECTS_OBJREF_NOT_ASSIGNED

But I need to use this method in background?

How can I handle this problem?

Thanks.

deniz.

5 REPLIES 5
Read only

abdul_hakim
Active Contributor
0 Likes
833

Hi,

This cannot be used in background mode.

Cheers,

Hakim

Read only

0 Likes
833

Hello,

Frontend services that perform calls to your SAP Gui can only be performed in foreground, they will never run in background.

I always protect these calls and check if the program runs in foreground.

if sy-batch is initial.

call the frontend services

else.

  • error handling

endif.

Wim

Read only

0 Likes
833

Hi,

Is there any other way to get the files under a directory in background?

Thanks.

deniz.

Read only

0 Likes
833

put the file in application sever and try to get from there

using this syntex...

OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.

OPEN DATASET dsn FOR INPUT IN BINARY MODE.

Regards

Anbu B

Read only

GauthamV
Active Contributor
0 Likes
833

hi,

you cannot use any gui function modules or classes in background.

check these.

[https://forums.sdn.sap.com/click.jspa?searchID=19041445&messageID=6426789 ]

[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2]