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

rfc

Former Member
0 Likes
681

I have a source file of about 10 fields,i was able to fetch 9 ,but the rest one field info ,i need to use rfc .The resp FM is on another server.i've come up with code like

CALL FUNCTION 'ZCIC_QOS_DATA' DESTINATION 'CRM_DEV'

EXPORTING

ASCNO = KNA1VV-KUNNR

IMPORTING

QOSYTD = GV_QOSYTD

TABLES

QOSDATA = IT_QOSDATA.

but its givin dump.

ascno is input for the rfc and qosytd is output.

pls help me.wats wrong in it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
653

Hi,

What is the short dump you are getting?

First of all, handle exception in your code. There no exception handling in your code, that might be the cause of short dump.

See this code. Also, for handling exception you have to define these exception on the "Exceptions" tab in function module.

CALL FUNCTION 'ZCIC_QOS_DATA' DESTINATION 'CRM_DEV'
    EXPORTING
      ascno = kna1vv-kunnr
    IMPORTING
      qosytd = gv_qosytd
    TABLES
      qosdata = it_qosdata
    EXCEPTIONS
      communication_failure   = 01
      system_error            = 02.

CASE sy-subrc.
  WHEN 0.
    WRITE:/ 'Success'.
  WHEN 1.
    WRITE:/ 'Communication error'.
  WHEN 2.
    WRITE:/ 'System error'.
  WHEN OTHERS.
    WRITE:/ 'Unknown errors'.
ENDCASE

Secondly, debug your code and see why and where this error is happening. Give the error message from short dump (Tcode ST22) so we can give solution.

Regards,

RS

6 REPLIES 6
Read only

Former Member
0 Likes
653

Hi,

Go through the following link:

http://www.sapbrain.com

See the example and do it.

Regards,

Bhaskar

Read only

Former Member
0 Likes
653

Did you check if the RFC destination, CRM_DEV, is defined in SM59. For any RFC to work, the destination has to be defined in SM59. Also try adding exceptions to your function module

DATA : l_msgtext(100) type c.

CALL FUNCTION 'ZCIC_QOS_DATA' DESTINATION 'CRM_DEV'

EXPORTING

ASCNO = KNA1VV-KUNNR

IMPORTING

QOSYTD = GV_QOSYTD

TABLES

QOSDATA = IT_QOSDATA

EXCEPTIONS

communication_failure = 1 MESSAGE l_msgtext

system_failure = 2 MESSAGE l_msgtext.

You will know what exactly the error is in the l_msgtext. Also check ST22 to see why the program dumped, that might throw more light.

hith

Sunil Achyut

Read only

Former Member
0 Likes
654

Hi,

What is the short dump you are getting?

First of all, handle exception in your code. There no exception handling in your code, that might be the cause of short dump.

See this code. Also, for handling exception you have to define these exception on the "Exceptions" tab in function module.

CALL FUNCTION 'ZCIC_QOS_DATA' DESTINATION 'CRM_DEV'
    EXPORTING
      ascno = kna1vv-kunnr
    IMPORTING
      qosytd = gv_qosytd
    TABLES
      qosdata = it_qosdata
    EXCEPTIONS
      communication_failure   = 01
      system_error            = 02.

CASE sy-subrc.
  WHEN 0.
    WRITE:/ 'Success'.
  WHEN 1.
    WRITE:/ 'Communication error'.
  WHEN 2.
    WRITE:/ 'System error'.
  WHEN OTHERS.
    WRITE:/ 'Unknown errors'.
ENDCASE

Secondly, debug your code and see why and where this error is happening. Give the error message from short dump (Tcode ST22) so we can give solution.

Regards,

RS

Read only

0 Likes
653

thank u .My prob with the prog is solved.rfc was workin gud with just table and no input/output parameters...however exception handling is a helpful topic and so rewarded.

Read only

Former Member
0 Likes
653

FUNCTION ZLETRARFWBI001.

*"----


""Interfase local

*" IMPORTING

*" VALUE(LINEAS) TYPE IW_NOLINES

*" TABLES

*" TI_FECHAS STRUCTURE ZLETRADATES OPTIONAL

*" TI_TRANS_PLAN_PT STRUCTURE ZLETRATPLST

*" TI_LOADS STRUCTURE ZLETRATKNUM OPTIONAL

*"----


ENDFUNCTION.

And this is the CORRECT code of my call to the RFC

CALL FUNCTION 'ZLETRARFWBI001' destination VL_DEST

EXPORTING

LINEAS = VL_LINEAS

TABLES

TI_FECHAS = TI_FECHAS

TI_TPLST = TI_TPLST

TI_LOADS = TI_LOADS

EXCEPTIONS

system_failure = 1 MESSAGE VL_MESS

communication_failure = 2 MESSAGE VL_MESS.

Read only

0 Likes
653

Check if your RFC destination is active - go to SM59 to select your RFC dest and test it.

How did you declare variable VL_DEST?