Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

ABAP 7.40: using function 'segment' instead of command 'split'

$
0
0

The following coding has to be translated into ABAP 7.40:

 

DATA:

  source    TYPE string VALUE 'MARA-MATNR=12345',

  tabname   TYPE tabname,

  fieldname TYPE fieldname,

  attribute TYPE string.

 

  SPLIT:

    source AT '-'

           INTO tabname fieldname,

    fieldname AT '='

              into fieldname attribute.

 

  " RESULT: tabname = 'MARA', fieldname = 'MATNR', attribute = '12345' !

 

I do not understand the F1 help of "segment" functions' features....

 

appendix:

via trial & error:

 

tabname    = segment( val = source index = 1 sep = '-' ).
fieldname  = segment( val = segment( val = source index = 2 sep = '-' ) index = 1 sep = '=' ).
attribute  = segment( val = source index = 2 sep = '=' ).

 

any shorter codings?


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>