‎2008 Jun 18 4:13 AM
Hi ,
pls see my requirement ,
in group of materials i have to check the materials with 11 char first ,
later in 11 char materials i have to take only the materials having all 10 char with numbers and one with '-'.But the '-' can be in any place but we have to take only those materials .
can any one pls tell me the logic for this ,
for ex: 1234567891-, 1234-567835
THX
‎2008 Jun 18 4:16 AM
hi,
ws_char11 = matnr+0(11).
if ws_char11 CO '0123456789-'.
"success
else.
" error in material no.
endif.
Hope this helps.
Regards,
Subramanian
Edited by: Subramanian PL on Jun 17, 2008 8:17 PM
‎2008 Jun 18 4:33 AM
Hi,
Try this..
Data l_11 type c.
l_11 = material + 10(1).
if l_11 eq '-'.
*accept material.
else.
*discard the material.
endif.
Reward pts. if helpfull.
Regards,
Dhan
‎2008 Jun 18 4:43 AM
Hi Chaya,
I assume all ur materials are available in one itab.
Now...
LOOP AT itab INTO wa.
CLEAR l_len.
l_len = strlen(wa-matnr).
CHECK l_len EQ 11.
CLEAR l_count1, l_count2, l_count.
DO l_len TIMES.
IF wa-matnr+l_count(1) IN '0123456789'.
ADD 1 TO l_count1.
ELSEIF wa-matnr+l_count(1) EQ '-'.
ADD 1 TO l_count2.
ENDIF.
ADD 1 TO l_count.
ENDDO.
CHECK l_count1 EQ 10 AND l_count2 EQ 1.
"Means u have 10 digits as numbers and 1 digit as -
APPEND wa TO itab1.
ENDLOOP.
Now ur itab 1 has required materials.
Thanks,
Vinod.