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

Query

Former Member
0 Likes
693

hi friends,

Could u please send me the details how can we write this type query

Select the Characteristic Value (AUSP-ATWRT), where the Internal characteristic(AUSP-ATINN) equals ‘AVE_TABLET_WEIGHT’, the Class type (AUSP-KLART) equals ‘023’, and the Object(AUSP-OBJEK) = the material number’s Finished product material number(MARA-MATNR).

To find this, remove the last 3 digits from the material number.

Ex.

0378-0457-01-C1

0378-0457-01

Regards

srinu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
545

hi ,

to remove last 3 digits do like this:

data : x type i,

matnr1 type mara-matnr.

x = strlen (mara-matnr).

x = x - 3.

matnr1 = mara-matnr + 0(X).

select atwrt

from ausp

into v_atwrt

where atinn = 'AVE_TABLET_WEIGHT’ and

klart = '023'

objek = matnr1.

endselect.

Regards

Ashok P

2 REPLIES 2
Read only

Former Member
0 Likes
546

hi ,

to remove last 3 digits do like this:

data : x type i,

matnr1 type mara-matnr.

x = strlen (mara-matnr).

x = x - 3.

matnr1 = mara-matnr + 0(X).

select atwrt

from ausp

into v_atwrt

where atinn = 'AVE_TABLET_WEIGHT’ and

klart = '023'

objek = matnr1.

endselect.

Regards

Ashok P

Read only

Former Member
0 Likes
545

DATA : V_ATWRT TYPE AUSP-ATWRT,

V_MATNR TYPE MARA-MATNR,

V_STRLEN TYPE I.

*-This code is to fetch the material no (except the last 3 characters)

v_strlen = strlen( MARA-MATNR ).

v_strlen = v_strlen - 3.

v_matnr = mara-matnr+0(v_strlen).

*--here V_MATNR Will have material no except the last 3 characters.

select SINGLE ATWRT

INTO V_ATWRT

FROM AUSP

WHERE ATINN = AVE_TABLET_WEIGHT’

AND KLART = '023'

AND OBJEK = V_MATNR.

IF SY-SUBRC = 0.

WRITE 😕 V_ATWRT.

ENDIF.

check this code, & let us know, if you need any help further.

regards

srikanth

Message was edited by: Srikanth Kidambi

Message was edited by: Srikanth Kidambi