<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ABAPでの文字列処理]]></title><description><![CDATA[<p><span style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px">このトピックでは、ABAP言語で文字列処理の方法を取り上げて説明します。</span></p><h2 class="sectionedit4 page-header" id="チェック関連" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:40px;margin-bottom:20px;font-size:30px;padding-bottom:9px">チェック関連<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E9%96%A2%E9%80%A3" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h2><div class="level2" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"></div><h3 class="sectionedit5" id="文字列の長さを取得" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の長さを取得<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E9%95%B7%E3%81%95%E3%82%92%E5%8F%96%E5%BE%97" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列の長さを取得するには、関数STRLENを使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA : l_v(20) TYPE C,
       l_i     TYPE I.
l_v = 'ABCDEFG'.
l_i = STRLEN( l_v ). "変数に「7」が保持されることになる</pre></div><h3 class="sectionedit6" id="全角半角チェック" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">全角半角チェック<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E5%85%A8%E8%A7%92%E5%8D%8A%E8%A7%92%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列に全角文字や半角文字が入っていないかをチェックするには、以下の手順で行うことができます。</p><ul class=" fix-media-list-overlap" style="margin-bottom:10px;overflow:hidden"><li class="level1"><div class="li">汎用モジュールSTRING_LENGTHで文字列の表示長(全角:2､半角:1)を取得　<br />このモジュールは、 CL_ABAP_LIST_UTILITIESクラスのDYNAMIC_OUTPUT_LENGTHメソッドを実行しています。</div></li><li class="level1"><div class="li">関数STRLENで文字列の文字数を取得</div></li><li class="level1"><div class="li">文字数と表示長を比較</div></li></ul></div><h3 class="sectionedit7" id="文字列の内容検索" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の内容検索<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E5%86%85%E5%AE%B9%E6%A4%9C%E7%B4%A2" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列の内容を検索するには、命令FINDを使用することができます。 オプションを使って、探したい値の開始位置を調べるときに使うことが多いです。</p></div><h2 class="sectionedit8 page-header" id="演算関連" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:40px;margin-bottom:20px;font-size:30px;padding-bottom:9px">演算関連<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%BC%94%E7%AE%97%E9%96%A2%E9%80%A3" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h2><div class="level2" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"></div><h3 class="sectionedit9" id="文字列のオフセット" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列のオフセット<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E3%82%AA%E3%83%95%E3%82%BB%E3%83%83%E3%83%88" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列のオフセット処理は、ABAP言語固有の仕様に取り込まれています。 構文：<span style="font-weight:700">文字列+開始位置（指定桁数）</span>　　※開始位置は0から</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string,
      l_r TYPE string.  
l_v = 'w,f,mj'.
l_r = l_v+2(2)."変数に「f,」が保持されることになる
</pre></div><h3 class="sectionedit10" id="文字列の置換" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の置換<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E7%BD%AE%E6%8F%9B" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列の一部を他の文字列で置換するには、命令REPLACEを使用することができます。 構文：　REPLACE &lt;置換前&gt; WITH &lt;置換後&gt; INTO &lt;置換対象文字列&gt;.</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string.
<p>l_v = 'w,f,mj'.<br />
REPLACE ',' WITH ';' INTO l_v.&quot;変数に「w;f;mj」が保持されることになる</pre></div><h3 class="sectionedit11" id="文字列の分割" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の分割<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E5%88%86%E5%89%B2" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">一つの文字列を区切り文字の指定により複数の文字列に分割するには、命令SPLITを使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap"><br />
DATA: l_s1 TYPE string,<br />
l_sx TYPE string.<br />
DATA: lt_r  TYPE TABLE CHAR10.<br />
l_s1 = 'w,f,mj'.<br />
l_sx = ','.<br />
SPLIT l_s1 AT l_sx INTO TABLE lt_r.</p>
<ul>
<li>「lt_r」には、1行目に「w」2行目に「f」3行目に「mj」が保持されることになる</pre></div><h3 class="sectionedit12" id="文字列のシフト" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列のシフト<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E3%82%B7%E3%83%95%E3%83%88" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列を指定文字数分移動するには、命令SHIFTを使用することができます。 構文：　SHIFT &lt;移動対象文字列&gt; [BY &lt;移動文字数&gt; PLACES] [モード].</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string.<br />
l_v = 'abcdefghij''.<br />
SHIFT l_v BY 3 PLACES CIRCULAR. &quot;変数に「defghijabc」が保持されることになる<br />
</pre></div><h3 class="sectionedit13" id="文字列の結合" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の結合<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E7%B5%90%E5%90%88" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">2つ以上の文字列を一つに結合するには、命令CONCATENATEを使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap"><br />
DATA: l_s1 TYPE string,<br />
l_s2 TYPE string,<br />
l_s  TYPE string.<br />
l_s1 = 'w'.<br />
l_s2 = 'f'.<br />
CONCATENATE l_s1 l_s2 INTO l_s SEPARATED BY space. &quot;変数に「w f」が保持されることになる</pre></div><h3 class="sectionedit14" id="空白の削除" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">空白の削除<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E7%A9%BA%E7%99%BD%E3%81%AE%E5%89%8A%E9%99%A4" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列に入っている空白を削除するには、命令CONDENSE を使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string.<br />
l_v = 'a  bf c   d'.<br />
CONDENCE l_v.&quot;変数に「a bf c d」が保持されることになる、文字列と文字列の間に一つの空白が残る <br />
CONDENCE l_v NO-GAPS.&quot;変数に「abfcd」が保持されることになる、すべての空白が削除される<span style="background-color:rgb(255, 255, 255);white-space:normal;font-family:&quot;Trebuchet MS&quot;, &quot;Helvetica Neue&quot;, Helvetica, Tahoma, sans-serif;font-size:16px"></span><span style="background-color:rgb(255, 255, 255);white-space:normal;font-family:&quot;Trebuchet MS&quot;, &quot;Helvetica Neue&quot;, Helvetica, Tahoma, sans-serif;font-size:16px"></span></pre></div></li>
</ul>
]]></description><link>http://www.isummary.jp/topic/233/abapでの文字列処理</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 11:53:55 GMT</lastBuildDate><atom:link href="http://www.isummary.jp/topic/233.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Dec 2019 12:59:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ABAPでの文字列処理 on Fri, 06 Dec 2019 12:59:55 GMT]]></title><description><![CDATA[<p><span style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px">このトピックでは、ABAP言語で文字列処理の方法を取り上げて説明します。</span></p><h2 class="sectionedit4 page-header" id="チェック関連" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:40px;margin-bottom:20px;font-size:30px;padding-bottom:9px">チェック関連<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E9%96%A2%E9%80%A3" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h2><div class="level2" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"></div><h3 class="sectionedit5" id="文字列の長さを取得" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の長さを取得<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E9%95%B7%E3%81%95%E3%82%92%E5%8F%96%E5%BE%97" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列の長さを取得するには、関数STRLENを使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA : l_v(20) TYPE C,
       l_i     TYPE I.
l_v = 'ABCDEFG'.
l_i = STRLEN( l_v ). "変数に「7」が保持されることになる</pre></div><h3 class="sectionedit6" id="全角半角チェック" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">全角半角チェック<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E5%85%A8%E8%A7%92%E5%8D%8A%E8%A7%92%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列に全角文字や半角文字が入っていないかをチェックするには、以下の手順で行うことができます。</p><ul class=" fix-media-list-overlap" style="margin-bottom:10px;overflow:hidden"><li class="level1"><div class="li">汎用モジュールSTRING_LENGTHで文字列の表示長(全角:2､半角:1)を取得　<br />このモジュールは、 CL_ABAP_LIST_UTILITIESクラスのDYNAMIC_OUTPUT_LENGTHメソッドを実行しています。</div></li><li class="level1"><div class="li">関数STRLENで文字列の文字数を取得</div></li><li class="level1"><div class="li">文字数と表示長を比較</div></li></ul></div><h3 class="sectionedit7" id="文字列の内容検索" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の内容検索<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E5%86%85%E5%AE%B9%E6%A4%9C%E7%B4%A2" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列の内容を検索するには、命令FINDを使用することができます。 オプションを使って、探したい値の開始位置を調べるときに使うことが多いです。</p></div><h2 class="sectionedit8 page-header" id="演算関連" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:40px;margin-bottom:20px;font-size:30px;padding-bottom:9px">演算関連<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%BC%94%E7%AE%97%E9%96%A2%E9%80%A3" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h2><div class="level2" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"></div><h3 class="sectionedit9" id="文字列のオフセット" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列のオフセット<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E3%82%AA%E3%83%95%E3%82%BB%E3%83%83%E3%83%88" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列のオフセット処理は、ABAP言語固有の仕様に取り込まれています。 構文：<span style="font-weight:700">文字列+開始位置（指定桁数）</span>　　※開始位置は0から</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string,
      l_r TYPE string.  
l_v = 'w,f,mj'.
l_r = l_v+2(2)."変数に「f,」が保持されることになる
</pre></div><h3 class="sectionedit10" id="文字列の置換" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の置換<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E7%BD%AE%E6%8F%9B" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列の一部を他の文字列で置換するには、命令REPLACEを使用することができます。 構文：　REPLACE &lt;置換前&gt; WITH &lt;置換後&gt; INTO &lt;置換対象文字列&gt;.</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string.
<p>l_v = 'w,f,mj'.<br />
REPLACE ',' WITH ';' INTO l_v.&quot;変数に「w;f;mj」が保持されることになる</pre></div><h3 class="sectionedit11" id="文字列の分割" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の分割<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E5%88%86%E5%89%B2" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">一つの文字列を区切り文字の指定により複数の文字列に分割するには、命令SPLITを使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap"><br />
DATA: l_s1 TYPE string,<br />
l_sx TYPE string.<br />
DATA: lt_r  TYPE TABLE CHAR10.<br />
l_s1 = 'w,f,mj'.<br />
l_sx = ','.<br />
SPLIT l_s1 AT l_sx INTO TABLE lt_r.</p>
<ul>
<li>「lt_r」には、1行目に「w」2行目に「f」3行目に「mj」が保持されることになる</pre></div><h3 class="sectionedit12" id="文字列のシフト" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列のシフト<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E3%82%B7%E3%83%95%E3%83%88" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列を指定文字数分移動するには、命令SHIFTを使用することができます。 構文：　SHIFT &lt;移動対象文字列&gt; [BY &lt;移動文字数&gt; PLACES] [モード].</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string.<br />
l_v = 'abcdefghij''.<br />
SHIFT l_v BY 3 PLACES CIRCULAR. &quot;変数に「defghijabc」が保持されることになる<br />
</pre></div><h3 class="sectionedit13" id="文字列の結合" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">文字列の結合<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E6%96%87%E5%AD%97%E5%88%97%E3%81%AE%E7%B5%90%E5%90%88" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">2つ以上の文字列を一つに結合するには、命令CONCATENATEを使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap"><br />
DATA: l_s1 TYPE string,<br />
l_s2 TYPE string,<br />
l_s  TYPE string.<br />
l_s1 = 'w'.<br />
l_s2 = 'f'.<br />
CONCATENATE l_s1 l_s2 INTO l_s SEPARATED BY space. &quot;変数に「w f」が保持されることになる</pre></div><h3 class="sectionedit14" id="空白の削除" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:rgb(51, 51, 51);margin-top:20px;margin-bottom:10px;font-size:24px">空白の削除<a class="anchorjs-link " href="https://www.sappane.com/kdict/abap/16/16/26#%E7%A9%BA%E7%99%BD%E3%81%AE%E5%89%8A%E9%99%A4" style="color:rgb(51, 122, 183);opacity:0;-webkit-font-smoothing:antialiased;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1;font-family:anchorjs-icons;padding-left:0.375em"></a></h3><div class="level3" style="font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size:14px"><p style="margin-bottom:10px">文字列に入っている空白を削除するには、命令CONDENSE を使用することができます。</p><p style="margin-bottom:10px">例：</p><pre class="code" style="font-family:Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;font-size:13px;padding:9.5px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(51, 51, 51);overflow-wrap:break-word;background-color:rgb(245, 245, 245);border-radius:4px;white-space:pre-wrap">DATA: l_v TYPE string.<br />
l_v = 'a  bf c   d'.<br />
CONDENCE l_v.&quot;変数に「a bf c d」が保持されることになる、文字列と文字列の間に一つの空白が残る <br />
CONDENCE l_v NO-GAPS.&quot;変数に「abfcd」が保持されることになる、すべての空白が削除される<span style="background-color:rgb(255, 255, 255);white-space:normal;font-family:&quot;Trebuchet MS&quot;, &quot;Helvetica Neue&quot;, Helvetica, Tahoma, sans-serif;font-size:16px"></span><span style="background-color:rgb(255, 255, 255);white-space:normal;font-family:&quot;Trebuchet MS&quot;, &quot;Helvetica Neue&quot;, Helvetica, Tahoma, sans-serif;font-size:16px"></span></pre></div></li>
</ul>
]]></description><link>http://www.isummary.jp/post/233</link><guid isPermaLink="true">http://www.isummary.jp/post/233</guid><dc:creator><![CDATA[峯文]]></dc:creator><pubDate>Fri, 06 Dec 2019 12:59:55 GMT</pubDate></item></channel></rss>