Skip to Content
avatar image
Former Member

sy-subrc = 4 for table selection when in rfc call

Hi SAP Gurus,

I am working on an optimization ticket and got stucked with my parallel processing method. I tried to place my database selection in a remote fm that I am calling in my program as new task however I am not getting any data (sy-subrc = 4) when I have placed the selection in the remote rfc compared to the 51882 number of records I am getting when the selection is placed just within my program.

Here is the SQL statement:

SELECT head~mblnr






FROM ( mkpf AS head JOIN mseg AS item

ON headmblnr = itemmblnr AND

headmjahr = itemmjahr ) JOIN mara AS mat

ON itemmatnr = matmatnr

INTO TABLE t_goods_issue

WHERE head~budat IN r_date AND

item~werks IN lr_werks AND

item~bwart IN r_bwart AND

item~matnr IN r_matnr AND

mat~mtart IN r_mtart.

Your ideas will be greatly appreciated. Thanks in advance.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 04, 2008 at 06:46 PM

    Hello Allex,

    You should add the MANDT-field in the WHERE clause.

    I wish you no further stuck,


    Add comment
    10|10000 characters needed characters exceeded