Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2756

Re: Extracting material from a string

$
0
0

Hi Jess,

 

Try.

 

If the material value  will be stored  as first in the entries then you fix the size to be 14 (mara-matnr length), separate the special symbols(:) using  split  or

use.

TABLES: mara.

DATA: lv_text TYPE string VALUE '317837-0010: US10: Ready for Dchain 03',

       itab  TYPE TABLE OF string,

       wa    LIKE LINE OF  itab.

 

SPLIT lv_text AT ':' INTO TABLE itab.

loop at itab INTO wa.

CONDENSE wa NO-GAPS.

SELECT SINGLE matnr FROM mara INTO mara-matnr WHERE matnr = wa.

IF sy-subrc  IS INITIAL.

MESSAGE 'Material Exit' TYPE 'S'.

EXIT.

ENDIF.

ENDLOOP.


Hope it helpful,


Regards,

Venkat.


Viewing all articles
Browse latest Browse all 2756

Trending Articles



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