Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

materials

Former Member
0 Likes
426

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

3 REPLIES 3
Read only

Former Member
0 Likes
412

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

Read only

Former Member
0 Likes
412

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

Read only

vinod_vemuru2
Active Contributor
0 Likes
412

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.