<?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: Convert string to currency using &amp;quot;split&amp;quot; in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055574#M1353118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is helpful.  I guess my main problem is the types in SAP.  I'm pretty new to SAP so please forgive me.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a table that I want to update with data from an external '|' delimited text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It all will work fine, except the SAP table I created has an element zfmusfga-hsl that is of type data element VLCUR9 which appears to be a currency data type of length 17.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI returns data type bapicurr-bapicurr.  I have to define in the internal table itab2 the hsl element as bapicurr-bapicurr or the bapi function module will not work.  If I do that, the following code does not update the custom table that I created correctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ZFMUSFGA FROM TABLE itab2.&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE i899 WITH sy-dbcnt 'Records Written to ZFMUSFGA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a nutshell, I have a bapicurr data type in an internal table and I'm trying to update a VLCUR9 data element in a table I created.  It does not seem to want to allow that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2009 21:34:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-31T21:34:43Z</dc:date>
    <item>
      <title>Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055566#M1353110</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;Is it possible to modify the split command to include a conversion of one of the fields from string to currency?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have these data structures:&lt;/P&gt;&lt;P&gt;Types: Begin of ttab,&lt;/P&gt;&lt;P&gt;       rec(1000) type c,&lt;/P&gt;&lt;P&gt;       end of ttab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab type table of ttab with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: Begin of itab2 OCCURS 0,&lt;/P&gt;&lt;P&gt;        sir_id like zfmusfga-gl_sirid,&lt;/P&gt;&lt;P&gt;        refdocnr like zfmusfga-refdocnr,&lt;/P&gt;&lt;P&gt;        budat like zfmusfga-budat,&lt;/P&gt;&lt;P&gt;        racct  like zfmusfga-racct,&lt;/P&gt;&lt;P&gt;        usnam like zfmusfga-usnam,&lt;/P&gt;&lt;P&gt;        ryear like zfmusfga-ryear,&lt;/P&gt;&lt;P&gt;        poper like zfmusfga-poper,&lt;/P&gt;&lt;P&gt;        rfistl like zfmusfga-rfistl,&lt;/P&gt;&lt;P&gt;        rfund like zfmusfga-rfund,&lt;/P&gt;&lt;P&gt;        belnr like zfmusfga-belnr,&lt;/P&gt;&lt;P&gt;        hsl like zfmusfga-hsl,         &lt;/P&gt;&lt;P&gt;      end of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;split itab-rec at '|' into itab2-sir_id&lt;/P&gt;&lt;P&gt;                           itab2-refdocnr&lt;/P&gt;&lt;P&gt;                           itab2-budat&lt;/P&gt;&lt;P&gt;                           itab2-racct&lt;/P&gt;&lt;P&gt;                           itab2-usnam&lt;/P&gt;&lt;P&gt;                           itab2-ryear&lt;/P&gt;&lt;P&gt;                           itab2-poper&lt;/P&gt;&lt;P&gt;                           itab2-rfistl&lt;/P&gt;&lt;P&gt;                           itab2-rfund&lt;/P&gt;&lt;P&gt;                           itab2-belnr&lt;/P&gt;&lt;P&gt;                           itab2-hsl.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't work because zfmusfga-hsl is a currency type, not a string.  Is there an easy way to convert itab2-hsl into currency within the split command?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 18:22:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055566#M1353110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T18:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055567#M1353111</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;Not sure if thats not possible. but there is no harm in declaring the internal table field hsl as type char in internal table. the same would work in select statements also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Types: Begin of ttab,
rec(1000) type c,
end of ttab.

data: itab type table of ttab with header line.

data: Begin of itab2 OCCURS 0,
sir_id like zfmusfga-gl_sirid,
refdocnr like zfmusfga-refdocnr,
budat like zfmusfga-budat,
racct like zfmusfga-racct,
usnam like zfmusfga-usnam,
ryear like zfmusfga-ryear,
poper like zfmusfga-poper,
rfistl like zfmusfga-rfistl,
rfund like zfmusfga-rfund,
belnr like zfmusfga-belnr,
hsl(10) type c,
end of itab2.

Loop at itab.
split itab-rec at '|' into itab2-sir_id
itab2-refdocnr
itab2-budat
itab2-racct
itab2-usnam
itab2-ryear
itab2-poper
itab2-rfistl
itab2-rfund
itab2-belnr
itab2-hsl.
append itab2.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 18:29:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055567#M1353111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T18:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055568#M1353112</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;Try this Function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'HRCM_STRING_TO_AMOUNT_CONVERT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 18:32:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055568#M1353112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T18:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055569#M1353113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The answer to your question is definitely NO. If you want to know how to convert it if you don't know, please tell us what is the expected format of "HSL" in the file, and then we can give you a precise answer. For example, does it contain thousands separator (is it comma or something else), where is the sign, does it have fixed decimals without decimal separator, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 18:59:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055569#M1353113</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-08-31T18:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055570#M1353114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The format is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16,919.51-&lt;/P&gt;&lt;P&gt;50.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always 2 decimals separated by period.  Comma separates thousands with trailing minus sign.  It is CURR data type, length 17 with decimal 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess I will have to import it as HSL(20) type C and then somehow convert the internal table field into another field of type currency and delete the character field from the internal table.  It just seems like a cumbersome solution to a simple problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 19:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055570#M1353114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T19:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055571#M1353115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;while spliting just keep every thing as it is and remove that itab2-hsl and put gv_hsl which should be of type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then convert this gv_string to currency and pass it to itab2-hsl. &lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 19:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055571#M1353115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T19:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055572#M1353116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made the following changes, but I get a convert error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gv_hsl type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;split itab-rec at '|' into itab2-sir_id&lt;/P&gt;&lt;P&gt;                           itab2-refdocnr&lt;/P&gt;&lt;P&gt;                           itab2-budat&lt;/P&gt;&lt;P&gt;                           itab2-racct&lt;/P&gt;&lt;P&gt;                           itab2-usnam&lt;/P&gt;&lt;P&gt;                           itab2-ryear&lt;/P&gt;&lt;P&gt;                           itab2-poper&lt;/P&gt;&lt;P&gt;                           itab2-rfistl&lt;/P&gt;&lt;P&gt;                           itab2-rfund&lt;/P&gt;&lt;P&gt;                           itab2-belnr&lt;/P&gt;&lt;P&gt;                           gv_hsl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;string = gv_hsl&lt;/P&gt;&lt;P&gt;decimal_separator = '.'&lt;/P&gt;&lt;P&gt;thousands_separator = ','&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;betrg = itab2-hsl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?  Please give me actual code-- I am very new to ABAP.  Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 20:52:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055572#M1353116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T20:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055573#M1353117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;welcome to sap world, sometimes we think we are in the prehistoric era &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To convert, just remove the commas (REPLACE ALL OCCURRENCES OF ',' IN l_hsl_char WITH '') then call BAPI_CURRENCY_CONV_TO_INTERNAL to copy l_hsl_char into your l_hsl packed variable, pass also the currency code to which l_hsl corresponds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: instead of calling the BAPI, you might prefer to code l_hsl = l_hsl_char, but I don't advise it as it would not be multi-currency compatible (even if the local currency will never change).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 20:55:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055573#M1353117</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-08-31T20:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055574#M1353118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is helpful.  I guess my main problem is the types in SAP.  I'm pretty new to SAP so please forgive me.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a table that I want to update with data from an external '|' delimited text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It all will work fine, except the SAP table I created has an element zfmusfga-hsl that is of type data element VLCUR9 which appears to be a currency data type of length 17.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI returns data type bapicurr-bapicurr.  I have to define in the internal table itab2 the hsl element as bapicurr-bapicurr or the bapi function module will not work.  If I do that, the following code does not update the custom table that I created correctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ZFMUSFGA FROM TABLE itab2.&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE i899 WITH sy-dbcnt 'Records Written to ZFMUSFGA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a nutshell, I have a bapicurr data type in an internal table and I'm trying to update a VLCUR9 data element in a table I created.  It does not seem to want to allow that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 21:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055574#M1353118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T21:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055575#M1353119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, I forgot to say that you have to declare a separate l_bapicurr variable (type bapicurr-bapicurr) to be used with the BAPI, and after the call you do : l_hsl = l_bapicurr&lt;/P&gt;&lt;P&gt;that's all &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 22:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055575#M1353119</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-08-31T22:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to currency using "split"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055576#M1353120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!  10 points for gryffindor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2009 11:58:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-currency-using-quot-split-quot/m-p/6055576#M1353120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-01T11:58:15Z</dc:date>
    </item>
  </channel>
</rss>

