<?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: Table data mis-aligned from non-unicode server to unicode client C program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072188#M1355693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sandra, this really put me on the good track to solve my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2009 12:36:20 GMT</pubDate>
    <dc:creator>former_member183984</dc:creator>
    <dc:date>2009-08-31T12:36:20Z</dc:date>
    <item>
      <title>Table data mis-aligned from non-unicode server to unicode client C program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072185#M1355690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have an ABAP function module that is RFC-enabled. It allows to retrieve a table of spool requests for a given user in a given output device (from TSP01 table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have created a Windows C++ Unicode program that is linked to the version 7.11 of SAP UNICODE RFC SDK (version of librfc32u.dll is 7110.0.46.6208). This program first connects to the SAP System then calls the ABAP function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The list of is returned in a RFC_TABLE like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		tables[0].name     = L"TA_SPOOLLIST";&lt;/P&gt;&lt;P&gt;		tables[0].nlen     = (int) wcslen(tables[0].name);&lt;/P&gt;&lt;P&gt;		tables[0].type     = TYPC;&lt;/P&gt;&lt;P&gt;		tables[0].leng     = 1000;&lt;/P&gt;&lt;P&gt;		tables[0].itmode   = RFC_ITMODE_BYREFERENCE;&lt;/P&gt;&lt;P&gt;		tables[0].newitab  = 0;&lt;/P&gt;&lt;P&gt;		tables[0].ithandle = ItCreate(L"TA_SPOOLLIST", 1000,  0, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each line is then transferred into a C structure mapping the fields of TSP01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have no problem retrieving the fields when we connect to a Unicode SAP system (ECC6 here). However when you we try to retrieve a TSP01 structure from a NON-UNICODE system (4.7 here) the alignment of the fields in the structure is screwed:&lt;/P&gt;&lt;P&gt;-          INT4 fields are coded on 8 bytes (4-bytes with a Unicode SAP system)&lt;/P&gt;&lt;P&gt;-          INT2 fields are coded on 4 bytes (2-bytes with a Unicode SAP system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover, it seems that "padding" bytes are added in the structure, especially before INT2 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it a known issue and is there a corrective, whether on SAP system or in RFC library?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is a normal behavior, is there an explanation about the strange structure alignment and how to handle it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 15:30:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072185#M1355690</guid>
      <dc:creator>former_member183984</dc:creator>
      <dc:date>2009-08-26T15:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Table data mis-aligned from non-unicode server to unicode client C program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072186#M1355691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it's absolutely normal in ABAP : see [abap documentation - Alignment of data objects|http://help.sap.com/abapdocu_70/en/ABENALIGNMENT.htm] and [abap documentation - Alignment in Unicode Systems|http://help.sap.com/abapdocu_70/en/ABENUNICODE_ALIGNMENT.htm]. Couldn't find more information about how to handle alignment with RFC. If you do, please tell us &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 18:37:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072186#M1355691</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-08-26T18:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Table data mis-aligned from non-unicode server to unicode client C program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072187#M1355692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I saw in srfctest.h program supplied with RFC library, that alignment is hard coded for a test structure :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
static RFC_UNICODE_TYPE_ELEMENT typeOfRfcTest[] =
{
{ cU("Rfcfloat"),        RFCTEST_RFCFLOAT_TYP,  16,   8,   0,   8,   0,   8,   0 },
{ cU("Rfcchar1"),        RFCTEST_RFCCHAR1_TYP,   0,   1,   8,   2,   8,   4,   8 },
{ cU("Rfcint2"),         RFCTEST_RFCINT2_TYP,    0,   2,  10,   2,  10,   2,  12 },
{ cU("Rfcint1"),         RFCTEST_RFCINT1_TYP,    0,   1,  12,   1,  12,   1,  14 },
{ cU("Rfcchar4"),        RFCTEST_RFCCHAR4_TYP,   0,   4,  13,   8,  14,  16,  16 },
{ cU("Rfcint4"),         RFCTEST_RFCINT4_TYP,    0,   4,  20,   4,  24,   4,  32 },
{ cU("Rfchex3"),         RFCTEST_RFCHEX3_TYP,    0,   3,  24,   3,  28,   3,  36 },
{ cU("Rfcchar2"),        RFCTEST_RFCCHAR2_TYP,   0,   2,  27,   4,  32,   8,  40 },
{ cU("Rfctime"),         RFCTEST_RFCTIME_TYP,    0,   6,  29,  12,  36,  24,  48 },
{ cU("Rfcdate"),         RFCTEST_RFCDATE_TYP,    0,   8,  35,  16,  48,  32,  72 },
{ cU("Rfcdata1"),        RFCTEST_RFCDATA1_TYP,   0,  50,  43, 100,  64, 200, 104 },
{ cU("Rfcdata2"),        RFCTEST_RFCDATA2_TYP,   0,  50,  93, 100, 164, 200, 304 }
};
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which corresponds to what we find in SAP SE11 transaction for RFCTEST structure (you can see the alignment (OFFSET) by using menu Utilities | Runtime object | Display):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
Field	 OFFSET
RFCFLOAT    0
RFCCHAR1    8
RFCINT2    10   realigned from 9 to 10 (gap of 1 octet)
RFCINT1    12
RFCCHAR4   13
RFCINT4    20   realigned from 17 to 20 (gap of 3 octets)
RFCHEX3    24
RFCCHAR2   27
RFCTIME    29
RFCDATE    35
RFCDATA1   43
RFCDATA2   93
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With srfctest.h and srfctest.c, I guess you should have all the info you need. Good luck !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 19:40:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072187#M1355692</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-08-26T19:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Table data mis-aligned from non-unicode server to unicode client C program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072188#M1355693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sandra, this really put me on the good track to solve my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 12:36:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-data-mis-aligned-from-non-unicode-server-to-unicode-client-c-program/m-p/6072188#M1355693</guid>
      <dc:creator>former_member183984</dc:creator>
      <dc:date>2009-08-31T12:36:20Z</dc:date>
    </item>
  </channel>
</rss>

