Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10548

Calling READ_TEXT

$
0
0

Hello,

 

I'm trying to call the function "READ_TEXT", since i need the long text for a BOM line. I'm doing this by rpc

 

I want to retrieve the following data:

     SELECT *

     FROM STXL

     WHERE TDNAME = '100M000024700000000500000010'


MANDT  RLIDTDOBJECTTDNAMETDID    TDSPRAS SRTF2   CLUSTR  CLUSTD 
100    TX     BOM      100M000024700000000500000010    MPO     N 0288     ÿ €

 

I try to call the function "READ_TEXT" with the following parameters:

            CLIENT = 100

            ARCHIVE_HANDLE= 0

            OBJECT = "BOM"

            ID = "MPO"

            NAME = "100M000024700000000500000010"

            LANGUAGE = "N"

 

But i keep getting the error: "Missing parameter with PERFORM.", what am i doing wrong?


Code:

            secept.RfcConnector.RfcSession rfcsession = new secept.RfcConnector.RfcSession();

            // connection settings

            rfcsession.RfcSystemData.ConnectString = "ASHOST=" + server + " SYSNR=" + instance;

            rfcsession.LogonData.User = user;

            rfcsession.LogonData.Password = password;

            rfcsession.LogonData.Language = "EN";

            // connect

            rfcsession.Connect();

            if (rfcsession.Error) throw new Exception(rfcsession.ErrorInfo.Message);                       

            // get the functionhandle

            secept.RfcConnector.FunctionCall fc = rfcsession.ImportCall("READ_TEXT");

            System.Diagnostics.Debug.Assert(!rfcsession.Error);           

            // set the parameters

            fc.Importing["CLIENT"].value = 100;

            fc.Importing["ARCHIVE_HANDLE"].value = 0;

            fc.Importing["OBJECT"].value = "BOM";

            fc.Importing["ID"].value = "MPO";

            fc.Importing["NAME"].value = "100M000024700000000500000010";

            fc.Importing["LANGUAGE"].value = "N";

            // call the function

            rfcsession.CallFunction(fc);

 

            if (rfcsession.Error)

            {

                //  ^^^ FAILS HERE!!!!!

                //  with message: "Missing parameter with PERFORM."

                rfcsession.Disconnect();

                throw new Exception(rfcsession.ErrorInfo.Message);

            }           

            rfcsession.Disconnect();


Viewing all articles
Browse latest Browse all 10548

Trending Articles