<?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: a question on string manipulation - a bit complicated one in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036858#M1350252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reetha,&lt;/P&gt;&lt;P&gt;               Try using SET SIGN LEFT.Hoping your query resolved.&lt;/P&gt;&lt;P&gt;Link:[SIGN|http://help.sap.com/saphelp_nw70/helpdata/en/d1/803445454211d189710000e8322d00/content.htm]&lt;/P&gt;&lt;P&gt;Have a best day ahead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Srivastava.G on Aug 6, 2009 6:11 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Srivastava.G on Aug 6, 2009 6:29 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2009 04:11:51 GMT</pubDate>
    <dc:creator>gaursri</dc:creator>
    <dc:date>2009-08-06T04:11:51Z</dc:date>
    <item>
      <title>a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036857#M1350251</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' m using the following FM to get data &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'LIST_TO_TXT'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LIST_INDEX               = -1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      listtxt                  = it_mess_att&lt;/P&gt;&lt;P&gt;      listobject               = i_abaplist&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;     empty_list               = 1&lt;/P&gt;&lt;P&gt;     list_index_invalid       = 2&lt;/P&gt;&lt;P&gt;     OTHERS                   = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in it_mess_att, the content looks like the following (all the content is in one column in the itab,The structure of the itab is SOLISTI1-line.). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May i know how to move those minus sign to the front. I have to do this in the it_mess_att, not before the data come in. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg. from 2,080.00-    to  -2,080.00     before i call this FM. thank you so much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;OX10M&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;94015789&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;01/25/2007&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;02/24/2007&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3000&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;60033430&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;sdfsdfsfsf&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2,080.00-&lt;/P&gt;&lt;/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&lt;TD&gt;&lt;P&gt;1100000068&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;| OX10M  |94015857 |         |03/13/2008|04/12/2008|3000  |60033545  |test                   |      117.32-|           277 |      117.32-|         |EWLETT ACKARD (OMAHA)        |2300000003&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Reetha Pitchee Maridas on Aug 6, 2009 6:02 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 04:01:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036857#M1350251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T04:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036858#M1350252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reetha,&lt;/P&gt;&lt;P&gt;               Try using SET SIGN LEFT.Hoping your query resolved.&lt;/P&gt;&lt;P&gt;Link:[SIGN|http://help.sap.com/saphelp_nw70/helpdata/en/d1/803445454211d189710000e8322d00/content.htm]&lt;/P&gt;&lt;P&gt;Have a best day ahead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Srivastava.G on Aug 6, 2009 6:11 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Srivastava.G on Aug 6, 2009 6:29 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 04:11:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036858#M1350252</guid>
      <dc:creator>gaursri</dc:creator>
      <dc:date>2009-08-06T04:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036859#M1350253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. Use function module..&lt;/P&gt;&lt;P&gt;CLOI_PUT_SIGN_IN_FRONT&lt;/P&gt;&lt;P&gt;this will move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.&lt;/P&gt;&lt;P&gt;chck this example..&lt;/P&gt;&lt;P&gt;data: a1 type i value 56 ,&lt;/P&gt;&lt;P&gt;a2 type i value 60,&lt;/P&gt;&lt;P&gt;res type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;res = a1 - a2.&lt;/P&gt;&lt;P&gt;data: res1(10).&lt;/P&gt;&lt;P&gt;res1 = res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;VALUE = res1&lt;/P&gt;&lt;P&gt;write res1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTANT:&lt;/P&gt;&lt;P&gt;You can use this FM CLOI_PUT_SIGN_IN_FRONT.&lt;/P&gt;&lt;P&gt;But you need to declare the amount field as char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can follow the below code as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data int type i.&lt;/P&gt;&lt;P&gt;data char(10).&lt;/P&gt;&lt;P&gt;int = -4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int = int * -1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write int to char.&lt;/P&gt;&lt;P&gt;concatenate '-' char into char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 04:19:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036859#M1350253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T04:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036860#M1350254</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;Actually my question is in this itab with one column only, how to locate the number with minus sign. Then only use the function suggested by you to put the sign in front. The number with minus sign can be coming at any place any row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking how to loop through the  it_mess_att, locate it , and convert it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 05:26:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036860#M1350254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T05:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036861#M1350255</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;You can try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Split the column of it_mess_att seperated by space  and '|' and assign the seperated fields in to a internal table&lt;/P&gt;&lt;P&gt;2) Loop at the internal table and perform 'SET SIGN LEFT' to each of the field, so where ever the sign is identified it will be left assigned&lt;/P&gt;&lt;P&gt;3) concatenate all the fields of this internal table and assign it back to it_mess_att.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 05:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036861#M1350255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T05:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036862#M1350256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the minus sign is always on the right of the number something like this should work. Kinda messy but would do the job?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT IT_MESS_ATT.
 SEARCH IT_MESS_ATT-FIELD FOR '-'.
 IF SY-SUBRC = 0.
  IT_MESS_ATT-FIELD+SY-FDPOS = SPACE.
  SHIFT IT_MESS_ATT-FIELD RIGHT BY 1 PLACES.
 V_FIELD(1) = '-'.
 ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 05:44:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036862#M1350256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T05:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036863#M1350257</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;Thanks for the very informative suggestion. For my case i think it is not possible due to some constraint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 06:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036863#M1350257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T06:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: a question on string manipulation - a bit complicated one</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036864#M1350258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reetha,&lt;/P&gt;&lt;P&gt;the following logic to move the sign to the left of a string in an internal table would help....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types:
begin of type_s_sign,
 col1 type string,
 col2 type string,
 col3 type string,
 col4 type string,
 col5 type string,
 col6 type string,
 col7 type string,
 col8 type string,
 col9 type string,
 col10 type string,
 col11 type string,
end of type_s_sign.

data:
t_sign type table of type_s_sign with header line.

data:
" itab is ur  it_mess_att table taken with a single record..
itab type table of SOLISTI1 with header line,
w_str type string value 'OX10M  94015789    01/25/2007 02/24/2007 3000  60033430  sdfsdfsfsf  2,080.00- 690  2,080.00-   EWLETT ACKARD (OMAHA)  2300000008 '.

itab = w_str.
append itab.
// instead of itab take  it_mess_att.
loop at itab.
  condense itab.
  split itab at space into t_sign-col1 t_sign-col2 t_sign-col3 t_sign-col4 t_sign-col5 t_sign-col6 t_sign-col7 t_sign-col8 t_sign-col9 t_sign-col10 t_sign-col11.
  replace '-' with space into t_sign-col8 .
  concatenate '-' t_sign-col8 into t_sign-col8.
  condense t_sign-col8.

  replace '-' with space into t_sign-col10 .
  concatenate '-' t_sign-col10 into t_sign-col10.
  condense t_sign-col10.

  append t_sign.

  concatenate t_sign-col1 t_sign-col2 t_sign-col3 t_sign-col4 t_sign-col5 t_sign-col6 t_sign-col7 t_sign-col8 t_sign-col9 t_sign-col10 t_sign-col11 into itab separated by space.
  modify itab.  
*  write: itab.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;finally in itab the sign is to the left of the specified value.. thn u can pass this table to the required func module..&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 06:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/a-question-on-string-manipulation-a-bit-complicated-one/m-p/6036864#M1350258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T06:42:40Z</dc:date>
    </item>
  </channel>
</rss>

