<?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: Fixing a stupid problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007349#M957308</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;After open dataset, just check for sy-subrc.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0 , now check the contents and please give proper information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jun 2008 09:29:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-13T09:29:42Z</dc:date>
    <item>
      <title>Fixing a stupid problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007348#M957307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok so this is my code.&lt;/P&gt;&lt;P&gt;REPORT  ZISTANZS_TRNG_EX9A_CUST.&lt;/P&gt;&lt;P&gt;TABLES: KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF FS,&lt;/P&gt;&lt;P&gt;               CusNum       LIKE KNA1-KUNNR,&lt;/P&gt;&lt;P&gt;               Name         LIKE KNA1-NAME1,&lt;/P&gt;&lt;P&gt;               SrchTerm     LIKE KNA1-SORTL,&lt;/P&gt;&lt;P&gt;               City         LIKE KNA1-ORT01,&lt;/P&gt;&lt;P&gt;               Postal       LIKE KNA1-PSTLZ,&lt;/P&gt;&lt;P&gt;               Country      LIKE KNA1-LAND1,&lt;/P&gt;&lt;P&gt;               Language     LIKE KNA1-SPRAS,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     END OF FS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:    Filename(30) TYPE C OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;               CusNum       LIKE KNA1-KUNNR OBLIGATORY,&lt;/P&gt;&lt;P&gt;               Name         LIKE KNA1-NAME1 OBLIGATORY,&lt;/P&gt;&lt;P&gt;               SrchTerm     LIKE KNA1-SORTL OBLIGATORY,&lt;/P&gt;&lt;P&gt;               City         LIKE KNA1-ORT01 OBLIGATORY,&lt;/P&gt;&lt;P&gt;               Postal       LIKE KNA1-PSTLZ OBLIGATORY,&lt;/P&gt;&lt;P&gt;               Country      LIKE KNA1-LAND1 OBLIGATORY,&lt;/P&gt;&lt;P&gt;               Language     LIKE KNA1-SPRAS OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:    Create       RADIOBUTTON GROUP G1,&lt;/P&gt;&lt;P&gt;               Append       RADIOBUTTON GROUP G1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Create = 'X'.&lt;/P&gt;&lt;P&gt;OPEN DATASET Filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;    FS-CusNum   = CusNum.&lt;/P&gt;&lt;P&gt;    FS-Name     = Name.&lt;/P&gt;&lt;P&gt;    FS-SrchTerm = SrchTerm.&lt;/P&gt;&lt;P&gt;    FS-City     = City.&lt;/P&gt;&lt;P&gt;    FS-Postal   = Postal.&lt;/P&gt;&lt;P&gt;    FS-Country  = Country.&lt;/P&gt;&lt;P&gt;    FS-Language = Language.&lt;/P&gt;&lt;P&gt;    TRANSFER FS to Filename.&lt;/P&gt;&lt;P&gt;CLOSE DATASET Filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSEIF Append = 'X'.&lt;/P&gt;&lt;P&gt;OPEN DATASET Filename FOR APPENDING IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;    FS-CusNum   = CusNum.&lt;/P&gt;&lt;P&gt;    FS-Name     = Name.&lt;/P&gt;&lt;P&gt;    FS-SrchTerm = SrchTerm.&lt;/P&gt;&lt;P&gt;    FS-City     = City.&lt;/P&gt;&lt;P&gt;    FS-Postal   = Postal.&lt;/P&gt;&lt;P&gt;    FS-Country  = Country.&lt;/P&gt;&lt;P&gt;    FS-Language = Language.&lt;/P&gt;&lt;P&gt;    TRANSFER FS to Filename.&lt;/P&gt;&lt;P&gt;CLOSE DATASET Filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;My problem is whenever I open the file in which it was 'created' or 'appended' to. It's in telnet btw. the fields are so messy, I got 0000 first then my custoemr number, then after a few spaces I see the name and after about 10 spaces the search term and all that. Everything's one big pile of mess. Is there something wrong witht he way I transfer data to the file? And what's with that 0000 at the start of the file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 09:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007348#M957307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T09:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Fixing a stupid problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007349#M957308</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;After open dataset, just check for sy-subrc.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0 , now check the contents and please give proper information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 09:29:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007349#M957308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T09:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fixing a stupid problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007350#M957309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi zsa tan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;except from unnecessary code redundancy and confusing field names everything looks fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you do not know that the KUNNR's internal representation is with leading zeros. In debugger you can see it. Here's you code just a little bit abbreviated (don't forget to enclose code sequences in \&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; ... \&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know what you mean by 'big pile of mess'. Count the characters and see what deviations you get. I suppose it works as desired.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZISTANZS_TRNG_EX9A_CUST.
TABLES: KNA1.

DATA: BEGIN OF FS,
CusNum                                    LIKE KNA1-KUNNR,
Name                                      LIKE KNA1-NAME1,
SrchTerm                                  LIKE KNA1-SORTL,
City                                      LIKE KNA1-ORT01,
Postal                                    LIKE KNA1-PSTLZ,
Country                                   LIKE KNA1-LAND1,
Language                                  LIKE KNA1-SPRAS,

END OF FS.

PARAMETERS: Filename(30)                  TYPE C OBLIGATORY LOWER CASE,
CusNum                                    LIKE KNA1-KUNNR OBLIGATORY,
Name                                      LIKE KNA1-NAME1 OBLIGATORY,
SrchTerm                                  LIKE KNA1-SORTL OBLIGATORY,
City                                      LIKE KNA1-ORT01 OBLIGATORY,
Postal                                    LIKE KNA1-PSTLZ OBLIGATORY,
Country                                   LIKE KNA1-LAND1 OBLIGATORY,
Language                                  LIKE KNA1-SPRAS OBLIGATORY.

PARAMETERS: Create RADIOBUTTON GROUP G1,
Append RADIOBUTTON GROUP G1.

IF Create                                 = 'X'.
  OPEN DATASET Filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
ELSE.
  OPEN DATASET Filename FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
endif.
FS-CusNum                                 = CusNum.
FS-Name                                   = Name.
FS-SrchTerm                               = SrchTerm.
FS-City                                   = City.
FS-Postal                                 = Postal.
FS-Country                                = Country.
FS-Language                               = Language.
TRANSFER FS to Filename.
CLOSE DATASET Filename.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 09:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fixing-a-stupid-problem/m-p/4007350#M957309</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2008-06-13T09:52:41Z</dc:date>
    </item>
  </channel>
</rss>

