Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Material number from right to left 9 characters

Hi Experts,

I have a small quiery about choosing 9 characters from material number from right to left.

In my internal table i have both numeric and alpha numeric material numbers.

for numeric material numbers i can use offset. But for alpha numeric materials i cannot use offset since it varies length.

Please suggest a solution for this.

Thanks

Mohana

Former Member
replied

Hi,

Refer:-

DATA lv_len TYPE i.
DATA lv_off TYPE i.

lv_len = strlen( v_matnr ).

IF lv_len > 9.
  lv_off = lv_len - 9.
  write : v_matnr+lv_off(lv_len).
ELSE.
  write : v_matnr.
ENDIF.

Hope this helps you.

Regards,

Tarun

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question