cancel
Showing results for 
Search instead for 
Did you mean: 

RFC invoke => error after 250 lines recovered...

Former Member
0 Kudos

Hello everybody,

I use SAP .Net connector 3 to create an application that makes a remote function call (RFC). This function takes a table in parameter and I expect another table in return which should as many or less lines as the one in parameter.

The problem is that I didn't manage to retrieve more than 250 values. I tried to split by package of 250 lines but the problem is still there. I just manage to retrieve 250 values and then got an error.

The only info I got from Visual Studio is "RfcAbapException". no message, no detail...

Please help me. I don't know how to do...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello everybody,

I talk to the SAP team in charge of all stuff related to SAP in my company. You will find the ABAP message further down. After many tries, they can't figure out what is the problem. For them, RFC function works well even with 300 or 400 lines.

So maybe the problem comes from my code??? I paste here my code. Please help !!!

/// <summary>
        /// Call SAP and check the credit status of each order
        /// </summary>
        /// <param name="p_lstDNToCheck">The sub list of order to check</param>
        static void makeSAPCreditCheck(List<DN> p_lstDNToCheck)
        {            
            //Connection to SAP = destination
            RfcDestination l_destination = RfcDestinationManager.GetDestination(Global.get_sapSystemName());

            //Retrieve schema of the function we want to call
            RfcFunctionMetadata l_funcMD = l_destination.Repository.GetFunctionMetadata("MY_FUNCTION");

            try
            {
                //Create the function
                IRfcFunction l_func = l_funcMD.CreateFunction();

                //Retrieve Parameters
                l_func.SetValue("IF_PROCTYPE", "F");
                IRfcTable l_param = l_func.GetTable("IT_VBELN");
                l_param.Append(p_lstDNToCheck.Count());

                for (int li_i = 0; li_i < p_lstDNToCheck.Count(); li_i++)
                {
                    DN l_dn = p_lstDNToCheck[li_i];

                    l_param[li_i].SetValue("SIGN", "I");
                    l_param[li_i].SetValue("OPTION", "EQ");
                    l_param[li_i].SetValue("LOW", l_dn.ORDER_NUMBER.ToString().PadLeft(10, '0'));
                }

                //Return values
                IRfcTable l_res = l_func.GetTable("CT_POSTAB");

                //Call remote function
                l_func.Invoke(l_destination);


               
            }
            catch (RfcAbapException e)
            {
                Console.WriteLine("Error RfcAbapException : " + e.Message);
                Console.WriteLine("Press key");
                Console.ReadKey();
            }
        }

and here the ABAP message given when we try to retrieve more than 250 values ( for example 1call with 300 values => error, or 2 call with 150 values => 1st call ok, second one throw an error)

Runtime Error          SAPSQL_IN_ITAB_ILLEGAL_OPTION
 

Error analysis
     The current ABAP/4 program attempted to execute an ABAP/4 Open SQL
     statement in which the WHERE condition contains an IN itab operator.
 
     The IN itab operator is used with internal tables which
     have the following structure:
 
        SIGN(1)   OPTION(2)   LOW LIKE db_field   HIGH LIKE db_field
 
     The OPTION column should contain only one of the following values:
         "EQ LE GE CP BT NE LT GT NP NB"
     The value "I " is not allowed here.
 

How to correct the error
     Use only one of the permitted values in the OPTION column.
     You may able to find an interim solution to the problem
     in the SAP note system. If you have access to the note system yourself,
     use the following search criteria:
     ------------------------------------------------------------------------
     "SAPSQL_IN_ITAB_ILLEGAL_OPTION" C
     "SAPLV50Q" or "LV50QU07"
     "WS_LM_DATA_SELECTION_FREE"
     ------------------------------------------------------------------------

Information on where terminated
    The termination occurred in the ABAP program "SAPLV50Q" in
     "WS_LM_DATA_SELECTION_FREE".
    The main program was "SAPMSSY1 ".

    The termination occurred in line 628 of the source code of the (Include)
     program "LV50QU07"
    of the source code of program "LV50QU07" (when calling the editor 6280).

>>>>>         SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_likpuk
  629                  FROM likp AS l INNER JOIN vbuk AS v
  630                  ON l~vbeln = v~vbeln
  631                  WHERE ( l~vbtyp EQ 'J' OR l~vbtyp EQ 'T' )
  632                  AND   l~vbeln IN lt_vbeln
  633                  AND   l~vstel IN lt_vstel
  634                  AND   l~ernam IN lt_ernam
  635                  AND   l~erdat IN it_erdat
  636                  AND   l~kunnr IN lt_kunwe
  637                  AND   l~kunag IN lt_kunag                  "50A
  638                  AND   l~vkorg IN lt_vkorg
  639                  AND   l~lfart IN lt_lfart
  640                  AND   l~wadat IN lt_wadat
  641                  AND   l~wadat_ist IN it_wadat_ist
  642                  AND   l~lddat IN lt_lddat
  643                  AND   l~tddat IN lt_tddat
  644                  AND   l~lfdat IN lt_lfdat
  645                  AND   l~kodat IN lt_kodat
  646                  AND   l~route IN lt_route
  647                  AND   l~lprio IN it_lprio

Former Member
0 Kudos

Thank you for trying to help me, here is the content of the file:

        • Trace file opened at 2011-05-19 17:38:35+02:00 (Paris, Madrid)

SAP .NET Connector: 3, 0, 1, 0, Working directory: D:Mes DocumentsVisual Studio 2008ProjectsCreditCheckCreditCheck inDebug, Program: D:Mes DocumentsVisual Studio 2008ProjectsCreditCheckCreditCheck inDebugCreditCheck.exe

Hardware: PC with Windows NT, Processor: 4x Intel 80686 (Mod 37 Step 5), Operating system: Microsoft Windows NT 5.1.2600 Service Pack 3, .NET CLR version: 2.0.50727.3615

SAP release: 720, Kernel release: 720, Kernel patch level: 78

Hostname:XXXXXX , IP address: XXXXX, IP_v6 address:

Default trace level: None

>> Error entry 2011-05-19 17:38:35.853

SAP.Middleware.Connector.RfcAbapException

à SAP.Middleware.Connector.RfcConnection.ThrowRfcErrorMsg()

à SAP.Middleware.Connector.RfcConnection.RfcReceive(RfcFunction function)

à SAP.Middleware.Connector.RfcFunction.RfcDeserialize(RfcConnection conn, IRfcIOStream stream)

à SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn, IRfcIOStream stream, RFCID rid)

à SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn)

à SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination)

        • Trace file opened at 2011-05-19 17:49:08+02:00 (Paris, Madrid)

SAP .NET Connector: 3, 0, 1, 0, Working directory: D:Mes DocumentsVisual Studio 2008ProjectsCreditCheckCreditCheck inDebug, Program: D:Mes DocumentsVisual Studio 2008ProjectsCreditCheckCreditCheck inDebugCreditCheck.vshost.exe

Hardware: PC with Windows NT, Processor: 4x Intel 80686 (Mod 37 Step 5), Operating system: Microsoft Windows NT 5.1.2600 Service Pack 3, .NET CLR version: 2.0.50727.3615

SAP release: 720, Kernel release: 720, Kernel patch level: 78

Hostname: XXXXXX, IP address: XXXXXXXX, IP_v6 address:

Default trace level: None

>> Error entry 2011-05-19 17:49:08.537

SAP.Middleware.Connector.RfcAbapException

à SAP.Middleware.Connector.RfcConnection.ThrowRfcErrorMsg()

à SAP.Middleware.Connector.RfcConnection.RfcReceive(RfcFunction function)

à SAP.Middleware.Connector.RfcFunction.RfcDeserialize(RfcConnection conn, IRfcIOStream stream)

à SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn, IRfcIOStream stream, RFCID rid)

à SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn)

à SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination)

Former Member
0 Kudos

Hi,

Check your project directory and see if you have this file: dev_nco_rfc.log.

Open the file and you should see more details of the error.

Regards