cancel
Showing results for 
Search instead for 
Did you mean: 

rfc fails

Former Member
0 Kudos

Hi All

I tried executing one rfc with remote destination 'sapcms' in a few ways but all of them failed.

First I tried :

CALL FUNCTION 'SCMS_CLTFC_FILE_GET'

EXPORTING

USAGE = 'AL'

KEY = lv_key

FILENAME = lv_filename

EXCEPTIONS

FAILED = 1

OTHERS = 2

This function calls a function inside with destination, but it failed on pinging the destination.

Second I tried Service Call:

wd_this->execute_scms_cltfc_file_get(

filename = lv_filename

key = lv_key

usage = 'AL'

).

The method looks like:

DATA CMS_DESTINATION TYPE RFCDES-RFCDEST

VALUE 'SAPCMS'.

  • the invocation - errors are always fatal !!!

CALL FUNCTION 'SCMS_CLTFC_FILE_GET'

DESTINATION CMS_DESTINATION

EXPORTING

usage = usage

key = key

filename = filename

EXCEPTIONS

failed = 1.

  • error handling

CASE sy-subrc.

WHEN 1.

RAISE EXCEPTION TYPE cx_wd_no_handler

EXPORTING

textid = cx_wd_no_handler=>kind_old

old_exception = `FAILED`.

ENDCASE.

But I get the exception.

Third I tried writing a program and submit it with parameters:

SUBMIT zcms_copy AND RETURN WITH p_key = lv_key WITH p_file = lv_filename.

But then I get an error : The RFC destination SAPCMS can no longer be contacted:

If I run this program from se80 it works fine.

Any Idea ???

Thanks

Nitsan

.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Thomas

Thank u for your answer.

I will try to solve the problem in other directions.

Nitsan

Former Member
0 Kudos

Hi Thomas

Thanks for your helpful answer.

Do u think that if I will call an rfc with another destination that will call this rfc it will work ?

Do u know of any workaround that will enable me to run this rfc although it is using sapgui ?

Thanks

Nitsan

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Do u think that if I will call an rfc with another destination that will call this rfc it will work ?

No. You still won't have any connection to the SAPGUI.

>Do u know of any workaround that will enable me to run this rfc although it is using sapgui ?

I dont' know this function module specifically, so what I can suggest is limited. There is nothing you can do to get around the SAPGUI connection. Some of the DMS function modules offer an alternative RFC Destination that uses the application server instead of the presentation server (SAPGUI) for file access. This can be used from Web Dynpro.

Former Member
0 Kudos

Hi Thomas/Nitsun,

We are using FM 'ALINK_DOCUMENTS_GET_CLIENT' to download the PDF to user directory. The FM fails when a call is made to SCMS_CLTFC_FILE_GET which is a RFC to system SAPCMS.

The error message is 'GetStream failed (1)'.

I see that there is no exception being raised.

I searched the forum and found that there were posts mentioning ADS and Java Startup Failure (J2EE Engine) but I could not make the relevance.

Do you have any idea on this?

Thank you.

-Niranchan.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I give you the same answer which I already posted earlier in this same thread: from web dynpro you can't use RFC connections which would attempt to contact the client machine. This mechanism uses the SAPGUI and of course in Web Dynpro you have no connection to the SAPGUI. You can only download files to the client via browser mechanism - fileDownload UI element, ACFUpDownload (on 7.01 and higher) and class CL_WD_RUNTIME_SERVICES method ATTACH_FILE_TO_RESPONSE.

Former Member
0 Kudos

Thomas,

Thank you very much for your time.

The FM is being called in a report program and is working in a machine that has document viewer. Could you pls. help me understand if there is any note that needs to be installed and why there is another FM with the same name but different functionality in SAPCMS.

Thanks again.

-Niranchan

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No. No note to be implemented. Web dynpro runs in a browser and can't use client side SAPGUI RFC Destintations.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm guessing that your RFC Destination points to the Frontend (client machine with connection via SAPGUI). Because you have no connection to the SAPGUI in background or in Web Dynpro, the RFC fails. However it works fine from SE80 becuase you are running in the SAPGUI.