<?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: Looping through a record in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125460#M1188496</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;for your first question, you can use&lt;/P&gt;&lt;P&gt;DO .. ENDO with VARYING addion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop .. Endloop will iterate vertically where as DO .. ENDO iterates horizontally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not understand your second question, can you clear a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mubeen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jan 2009 21:29:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-26T21:29:47Z</dc:date>
    <item>
      <title>Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125458#M1188494</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;My program produces an internal table with one row containing about 100 fields. Before I merge the contents of these fields, I would like to "loop" horizontall through the row to find negative values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. How can I loop horizontally trhough fields in a row.&lt;/P&gt;&lt;P&gt;2. How do I reposition the "-" (minus) sign so that it comes before the number before I merge the data to a word document. When I use "replace" and "concatenate" to change the position of the minus sign, the values are not merged properly to word. They appear in brackets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 21:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125458#M1188494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T21:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125459#M1188495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this for question # 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    data : i_details    type abap_compdescr_tab.
    data : i_ref_descr  type ref to cl_abap_structdescr.
    i_ref_descr ?= cl_abap_typedescr=&amp;gt;describe_by_data( i_temp ). 
    " Here i_temp is your internal table to verify horizontally
    i_details[] = i_ref_descr-&amp;gt;components[].
    " Here you will get i_details with (ie it contains all fields information)
    data : v_value(100) type c.
    loop at i_temp.
    loop at i_details.
      concatenate 'I_TEMP-' i_details-name into v_field.
      condense v_field no-gaps.
      write : ( v_field ) to v_value.
      " Here search for v_value in it have minus sign or not.
    endloop.
    endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; a®s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: a®s on Jan 26, 2009 4:41 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 21:28:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125459#M1188495</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-01-26T21:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125460#M1188496</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;for your first question, you can use&lt;/P&gt;&lt;P&gt;DO .. ENDO with VARYING addion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop .. Endloop will iterate vertically where as DO .. ENDO iterates horizontally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not understand your second question, can you clear a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mubeen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 21:29:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125460#M1188496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T21:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125461#M1188497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fs_itab&amp;gt; type itab. "your table...

field-symbols: &amp;lt;fs_comp&amp;gt; TYPE ANY.

loop at itab assigning &amp;lt;fs_itab&amp;gt;.

do.
ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;fs_itab&amp;gt; TO &amp;lt;fs_comp&amp;gt;.
IF sy-subrc &amp;lt;&amp;gt; 0.
          EXIT.
        ENDIF.

check if &amp;lt;fs_comp&amp;gt; LE 0.

enddo.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 21:32:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125461#M1188497</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-01-26T21:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125462#M1188498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your concise anwser. Unfortunately I am not connected to my ABAP compture but will try that tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my second question, in SAP the negative amounts are stored with the minus sign after the number for example, 3456.78-, 12345.90- ,...instead of -3456.78, -12345.90,... I would like to have the negative sign before the number and not after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used "REPLACE" to replace the sign  after the number with a blank and then "CONCATENATE"  to combine "-" and the number. The resulting number does not appear correctly in my word document. It is enclosed in brackets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 21:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125462#M1188498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T21:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125463#M1188499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us assume num1 = 7890.98-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if num1 ca '-'.&lt;/P&gt;&lt;P&gt;REPLACE '-' with space here and lets say num2 is the new variable without -sign&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate '-' num2&lt;/P&gt;&lt;P&gt;into num1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you can check syntax of WRITE statement with FORMAT addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mubeen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 22:06:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125463#M1188499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T22:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125464#M1188500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did try the REPLACE/CONCATENATE algorithm but my numbers appear in brackets in he resulting Word document. I did llok at WRITE but it seems it  is only useful if one is writing to a screen and not to a table to be used in a WORD mail merge.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 22:10:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125464#M1188500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T22:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125465#M1188501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello TJ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE statement is used to display on screen as well as to move data from variable to other.&lt;/P&gt;&lt;P&gt;WRITE source TO destination.&lt;/P&gt;&lt;P&gt;It has some additions like FORMAT.&lt;/P&gt;&lt;P&gt;I don't have access to SAP now, please check the syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mubeen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 22:16:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125465#M1188501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T22:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125466#M1188502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mubeen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try that first thing tomorrow morning. I do not have access to SAP now either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 22:21:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-through-a-record/m-p/5125466#M1188502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-26T22:21:33Z</dc:date>
    </item>
  </channel>
</rss>

