<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get data with rfc-sdk language c in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991929#M1342756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after solving the problem I will not keep the solution secret &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I used instead of strlen sizeof for the tablename and so it threw an field exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help an readings.&lt;/P&gt;&lt;P&gt;If you have further questions about the same problem ask me, maybe I can help you now &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HFischer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2009 12:51:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-17T12:51:18Z</dc:date>
    <item>
      <title>Get data with rfc-sdk language c</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991925#M1342752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Me was given a task to develop a simple data read between C and SAP.  To foreshadow my prerequisites: I did not work with SAP and only have the possibilities of the NW7.01 Trial with a MaxDB database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will use the RFC_READ_TABLE and the RfcCallReceive function. The error handling and opening the rfchandle runs.&lt;/P&gt;&lt;P&gt;Using the RFC_READ_TABLE requires to fill the export parameters and handle the 3 tables, FIELDS, OPTIONS and DATA.&lt;/P&gt;&lt;P&gt;Handling the tables throws the error: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RFC Call/Exception: SYSTEM_FAILURE&lt;/P&gt;&lt;P&gt;Group       Error group 104&lt;/P&gt;&lt;P&gt;Key         RFC_ERROR_SYSTEM_FAILURE&lt;/P&gt;&lt;P&gt;Message     Incorrect field length for 'Remote Function Call'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After searching here this problem I place 3 structs  to define the maximum length, which is returnd by the rfc:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
typedef struct tDATA
{	SAP_CHAR	WA[512];
}tDATA;

typedef struct tFIELDS
{	SAP_CHAR	Fieldname[30];
	SAP_CHAR	Offset[6];
	SAP_CHAR	Length[6];
	SAP_CHAR	Type;
	SAP_CHAR	Fiedltext[60];
}tFIELDS;

typedef struct tOPTIONS
{	SAP_CHAR	WA[72];
}tOPTIONS;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now using the size of these structs the error still stays the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how do I initialise the tables and export parameters, to receive a useable data returned in the DATA table?&lt;/P&gt;&lt;P&gt;The declaration of the export and table structs is left out for now, I will post them immediatly if necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H.Fischer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: HFischer on Aug 12, 2009 4:09 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 10:02:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991925#M1342752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T10:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get data with rfc-sdk language c</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991926#M1342753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I'm not familar with C, but I noticed that some of the field names you use are different than the ones in the RFC interface definition.&lt;/P&gt;&lt;P&gt;Table OPTIONS has a field called TEXT, not WA... and table FIELDS has a field called FIELDTEXT, not Fiedltext. May be a typo only.&lt;/P&gt;&lt;P&gt;Again, not sure if this is relevant, just thought it may be related to the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 14:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991926#M1342753</guid>
      <dc:creator>Tamas_Hoznek</dc:creator>
      <dc:date>2009-08-12T14:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get data with rfc-sdk language c</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991927#M1342754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your answer. I changed it but the error is still thrown. During some searches in a C header of the SDK I wondered, if i had to change the datatype because of the unicode implementation I use. But I don't have any idea in which way it could be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H.Fischer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2009 15:57:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991927#M1342754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-12T15:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get data with rfc-sdk language c</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991928#M1342755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I returned to my mind that there was a function embedded in the SDK which generates a  headerfile which could be implemented easily. Now I have the structs necessary for the tables but the problem is still the same. I tried some configurations on the termination of the parameter list and I observe that the rfc does not handle with 5 export parameter tables. Here is the parameter declaration I try to use. &lt;/P&gt;&lt;P&gt;At last the tables are terminated with NULL, here I placed it at index 5 but with this the RFC throws an error about the RFC length mentioned in the first post. If I terminate at index 3 the "rfccallreceive" runs without error but returns two empty tables.&lt;/P&gt;&lt;P&gt;Or is it a problem in the declaration of ROWSKIPS and ROWCOUNT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
exporting[0].name = cU("QUERY_TABLE");
exporting[0].nlen = strlen(cU("QUERY_TABLE"));
exporting[0].addr = cU("SPFLI");
exporting[0].leng = strlen(cU("SPFLI"));
exporting[0].type = RFCTYPE_CHAR;
exporting[1].name = cU("DELIMITER");
exporting[1].nlen = strlen(cU("DELIMITER"));
exporting[1].addr = cU(" ");
exporting[1].leng = strlen(cU(" "));
exporting[1].type = RFCTYPE_CHAR;
exporting[2].name = cU("NO_DATA");
exporting[2].nlen = strlen(cU("NO_DATA"));
exporting[2].addr = cU(" ");
exporting[2].leng = strlen(cU(" "));
exporting[2].type = RFCTYPE_CHAR;
exporting[3].name = cU("ROWSKIPS");
exporting[3].nlen = strlen(cU("ROWSKIPS"));
exporting[3].addr = cU("0");
exporting[3].leng = strlen(cU("0"));
exporting[3].type = RFCTYPE_CHAR;
exporting[4].name = cU("ROWCOUNT");
exporting[4].nlen = strlen(cU("ROWCOUNT"));
exporting[4].addr = cU("0");
exporting[4].leng = strlen(cU("0"));
exporting[4].type = RFCTYPE_CHAR;
exporting[5].name = NULL; /*position I mean*/
importing[0].name = NULL;
tables[3].name = NULL;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 08:08:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991928#M1342755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-13T08:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get data with rfc-sdk language c</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991929#M1342756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after solving the problem I will not keep the solution secret &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I used instead of strlen sizeof for the tablename and so it threw an field exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help an readings.&lt;/P&gt;&lt;P&gt;If you have further questions about the same problem ask me, maybe I can help you now &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HFischer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 12:51:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-rfc-sdk-language-c/m-p/5991929#M1342756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-17T12:51:18Z</dc:date>
    </item>
  </channel>
</rss>

