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: 

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

Former Member
0 Kudos

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

head~budat

item~matnr

item~menge

item~kunnr

item~werks

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.

-allex

1 REPLY 1

Former Member
0 Kudos

Hello Allex,

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

I wish you no further stuck,

Heinz