Application Development 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: 

RFC Issue

Former Member
0 Kudos

Hi Gurus,

I am facing an issue where I need to upload images in SE78 through a Function Module.

I made a custom function module and its working fine.

Now the problem is, when this FM is accessed remotely through RFC, it throws the following exception

Exception Condition "NOT_SUPPORTED_BY_GUI" raised.

Has anyone did this before?

Please respond soon.

Regards,

Ibrar

Moderator message: please choose more descriptive subject lines for your posts.

Edited by: Thomas Zloch on May 26, 2011 9:49 AM

1 ACCEPTED SOLUTION

former_member195402
Active Contributor
0 Kudos

Hi Ibrar,

your fm works fine in dialog mode with a GUI connection to a frontend server. But in batch or rfc mode you don't have this GUI frontend connection.

I can't believe, that this should workin rfc mode. But your local fm shouldn't work in batch mode, too, if I'm right!

Regards,

Klaus

14 REPLIES 14

former_member195402
Active Contributor
0 Kudos

Hi Ibrar,

your fm works fine in dialog mode with a GUI connection to a frontend server. But in batch or rfc mode you don't have this GUI frontend connection.

I can't believe, that this should workin rfc mode. But your local fm shouldn't work in batch mode, too, if I'm right!

Regards,

Klaus

0 Kudos

Thanks Klaus for the quick reply.

This FM is working fine on the Development Server but the RFC connection established from Dot NET gets this exception raised.

The way I see it, the Import Parameters where I am passing the location of the Image file is not considered a local file by the RFC.

But again, its just an assumption.

0 Kudos

Hi,

When you are calling function module from DOT net. That function module must be type of RFC enable. Don't not pass value by reference.

Release the function module before used it in dot net.

Kind Rgds

Ravi Lanjewar

0 Kudos

Hello Ravi,

Thanks for the reply

My FM is Remote enabled and released as well.

If pass value by reference should not be used then what to use?

Can you please clarify this a bit?

0 Kudos

I think pass by reference not allow when you have to create RFC enable function module.

Only pass by value parameter you have to used.

0 Kudos

Already using Pass Value for my parameters

0 Kudos

Please Keep in mind that when you create RFC.

1) parameter Pass by value only.

2) Don't used the exception in to the RFC enable function module.

3) error message can pass only using return table.

Kind Rgds

Ravi Lanjewar

brad_bohn
Active Contributor
0 Kudos

Klaus' answer was correct but you haven't been very clear about how you are accessing and/or loading the image file data. If the upload is by GUI_UPLOAD, you can't do that in batch or RFC mode as Klaus indicated. It has nothing to do with the parameters or the suggestions by Ravi...

You can either have the external app access and send the data via the function interface in XSTRING format or you can upload it using OPEN DATASET. From there, you use the CL_BDS_DOCUMENT_SET methods to convert and format the data for load into STXBITMAPS.

0 Kudos

I think he has to describe problem more details. Due to incomplete information we are assumption on issue.

matt
Active Contributor
0 Kudos

It's very simple, and already stated. And has come up in one form or another many times.

When you use RFC the context with the presentation server doesn't exist. If you are using any functionality that relies on SAPGui being present/accesses the presentation server, then it won't work in RFC.

brad_bohn
Active Contributor
0 Kudos

I think he has to describe problem more details. Due to incomplete information we are assumption on issue.

Not at all - this issue was obvious as Matt said and it certainly has nothing to do with the interface...

Former Member
0 Kudos

Thanks Matt for the very helpful answer.

My problem seems to be the same as you mentioned.

I am using the following code in my FM

perform import_bitmap_bds

in program saplstxbitmaps

using filename

name

'GRAPHICS' "Object

'BMAP' "ID

  • 'BMON' " Black and White

'BCOL' " Color

'BMP' "Extension

title

space

'X'

''

changing l_docid

l_resolution.

If the RFC is not able to access the presentation server in this case then, what should be done?

matt
Active Contributor
0 Kudos

As I understand it, your aim is to upload an image from the presentation server to the app server, for use with SAPScripts, via some kind of .net application.

You should carefully examine the form import_bitmap_bds and find the part where the image data has made it into SAP memory - the file has been read - and what happens to it afterwards. Then, your .net application should transmit the image data as a parameter to an RFC enabled function module that does this second part. You might even find that it's a callable FM.

Sandra_Rossi
Active Contributor
0 Kudos

Hi all,

I'd like to correct one thing about what is said about RFC and dialog. If we use RFC in a special context, i.e. from a presentation server via the SAPGUI APIs and logging with the dialog mode active, then uploading a file from the presentation server, or even displaying a dynpro, will work. Here, I don't know if Ibrar runs his code from the presentation server or from the application server...

BR

Sandra