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

char operations

Former Member
0 Likes
712

HI gurus!

in my program , i have matnr code of 18 char and which is in selection option of the program.But i want matnr only starting with 5 which is 14th char in the code and matnr code enter in the select option.

so i tried

WHERE a~vkbur IN area AND

b~matnr in mat AND

  • b~matnr = '_____________5____' and

  • b~matnr = '%5____' and

Regards,

Rahul

6 REPLIES 6
Read only

Former Member
0 Likes
677

make the selection parameter as 5 char field.. instead of matnr

AT SELECTIO-SCREEN OUTPUT event check if the value of this selection opion starts with 5.. if yes then proceed further and shift this 5char value in actual matnr...

if the value does not start with 5 then give error and STOP. this will not let the user go ahead till user enters matnr starting with 5.

Read only

Former Member
0 Likes
677

hi you can get MATNR starting with 5 using b~matnr eq '5%'. but you cannot get matnr starting with 5 and where 5 is the 14th character using SELECT statement.

first you get MATNR's starting with 5 and then use logic to find out whether it's 14th character or not...

if matnr+14(1) eq '5'....like that

Read only

Former Member
0 Likes
677

WHERE a~vkbur IN area AND

bmatnr in mat AND substr(bmatnr,13,1) = '5'

Read only

0 Likes
677

no its giving error

Read only

0 Likes
677

Try

WHERE a~vkbur IN area AND

bmatnr in mat AND bmatnr+13(1) EQ '5'

Read only

0 Likes
677

try this..it will work definitely...

b~matnr like '_%5____'

Message was edited by:

Muthurajan Ramkumar