<?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: Concatenate BSEG fields. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340478#M515733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this example program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: ibseg type table of bseg.
data: xbseg like line of ibseg.

data: istr type table of string,
      xstr type string.
data: xtmp type string.
field-symbols: &amp;lt;fs&amp;gt;.


select * into table ibseg from bseg
           up to 100 rows.

loop at ibseg into xbseg.

  do.
    assign component sy-index of structure xbseg to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    xtmp = &amp;lt;fs&amp;gt;.
    if sy-index = 1.
      xstr = xtmp.
    else.
      concatenate xstr xtmp into xstr separated by '|'.
    endif.
  enddo.
  append xstr to istr.

endloop.

call method cl_gui_frontend_services=&amp;gt;gui_download
  exporting
    filename                = 'c:test.txt'
  changing
    data_tab                = istr.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jun 2007 16:50:00 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-06-12T16:50:00Z</dc:date>
    <item>
      <title>Concatenate BSEG fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340475#M515730</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
  &lt;P&gt; I ahve to download data in a text file from SAP.The format must be ' | ' or pipe delimiter. So i am using SAP_to_convert_tex_format.But this is not working for BSEG table. So i am using concatenate for all the fields and seperated by ' | '.while conatenating i am getting syntax error for the result it_bseg1.That declare it_bseg1 as character type .i declared it_bseg1 as &lt;/P&gt;
  &lt;P&gt; data : it_bseg1(4096) type c occurs 0.&lt;/P&gt;
  &lt;P&gt; can any body tell me how to solve this one.&lt;/P&gt;
  &lt;P&gt; i wrote concatenate all fields................into it_bseg1 seperated by '|'.&lt;/P&gt;
  &lt;P&gt;Thanks,&lt;/P&gt;
  &lt;P&gt;Gopi.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2007 16:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340475#M515730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-12T16:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate BSEG fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340476#M515731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gopi anne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define like this,&lt;/P&gt;&lt;P&gt;data: it_bseg1 type string.&lt;/P&gt;&lt;P&gt;try to avoid this.&lt;/P&gt;&lt;P&gt;data : it_bseg1(4096) type c occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;seshu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2007 16:49:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340476#M515731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-12T16:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate BSEG fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340477#M515732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll probably want to convert you currency fields to character first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2007 16:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340477#M515732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-12T16:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate BSEG fields.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340478#M515733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this example program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: ibseg type table of bseg.
data: xbseg like line of ibseg.

data: istr type table of string,
      xstr type string.
data: xtmp type string.
field-symbols: &amp;lt;fs&amp;gt;.


select * into table ibseg from bseg
           up to 100 rows.

loop at ibseg into xbseg.

  do.
    assign component sy-index of structure xbseg to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    xtmp = &amp;lt;fs&amp;gt;.
    if sy-index = 1.
      xstr = xtmp.
    else.
      concatenate xstr xtmp into xstr separated by '|'.
    endif.
  enddo.
  append xstr to istr.

endloop.

call method cl_gui_frontend_services=&amp;gt;gui_download
  exporting
    filename                = 'c:test.txt'
  changing
    data_tab                = istr.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2007 16:50:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-bseg-fields/m-p/2340478#M515733</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-12T16:50:00Z</dc:date>
    </item>
  </channel>
</rss>

