cancel
Showing results for 
Search instead for 
Did you mean: 

simple quastion

Former Member
0 Kudos
49

i made this select.

SELECT VERPR

INTO MBEW-VERPR

FROM MBEW

WHERE MATNR = WA_RECORD-MATNR "3000032

AND BWTAR = WA_RECORD-BWTAR

and BWKEY = 1000.

i get 0.00 but in se16 i made this select and i get value

why?

thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos
SELECT VERPR
INTO MBEW-VERPR
FROM MBEW
WHERE MATNR = WA_RECORD-MATNR "3000032
AND BWTAR = WA_RECORD-BWTAR
and BWKEY = '1000'.

give this way and try

Former Member
0 Kudos

no. it's not working

Former Member
0 Kudos

this is the all select.

SELECT single VERPR

INTO MBEW-VERPR

FROM MBEW

WHERE MATNR = WA_RECORD-Z_MATNR

AND BWTAR = WA_RECORD-Z_BWTAR

and BWKEY = '1000'.

*ENDSELECT.

IF SY-SUBRC = 0.

wa_record-z_verpr = MBEW-VERPR.

endif.

Former Member
0 Kudos

Check if your materisal is in internal format while querying

that is are u using the conversion_exit_matn1_input for converting material to internal format. Check this in debug mode first.

Go to SE16 and make the conversion exit mode turned off. pick the matnr and enter into youe wa_record-matnr in debug. if the value comes in , then u need to call the conversion exit FM before doing the select.

Former Member
0 Kudos

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT = WA_RECORD-MATNR

IMPORTING

OUTPUT = WA_RECORD-MATNR

EXCEPTIONS

LENGTH_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

SELECT VERPR INTO MBEW-VERPR FROM MBEW

WHERE MATNR = WA_RECORD-MATNR

AND BWTAR = WA_RECORD-BWTAR

and BWKEY = '1000'.

former_member188685
Active Contributor
0 Kudos

Hi,

how you are populating the WA_RECORD .

please let me know...

please give the related code

regards

vijay

former_member188685
Active Contributor
0 Kudos

Hi liat,

if you are populating manually then you need to use the conversion exit.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = WA_RECORD-MATNR
IMPORTING
OUTPUT = WA_RECORD-MATNR
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2

try that..

Former Member
0 Kudos

i get this err:

"WA_RECORD-Z_MATNR" is not numeric.

Former Member
0 Kudos

io tried the func and all the steps and i get null

Former Member
0 Kudos

here is the popaltion of wa_record.

select VBAKVBELN VBAPMATNR VBAP~ARKTX

VBAPNETWR VBAPKWMENG VBAP~BWTAR

into (VBAK-VBELN , VBAP-MATNR , VBAP-ARKTX ,

VBAP-NETWR , VBAP-KWMENG , VBAP-BWTAR)

from ( VBAK

inner join VBAP

on VBAPVBELN = VBAKVBELN )

where VBAK~VKBUR IN z_phar

and VBAK~ERDAT in z_date

and VBAK~AUART = 'ZPER' or

VBAK~AUART = 'ZREM' or

VBAK~AUART = 'ZC00'.

if sy-subrc = 0.

  • wa_record-z_vbeln = VBAK-VBELN.

wa_record-z_matnr = VBAP-MATNR.

SHIFT wa_record-z_matnr LEFT DELETING LEADING '0'.

wa_record-z_ARKTX = VBAP-ARKTX.

wa_record-z_NETWR = VBAP-NETWR.

wa_record-z_kwmeng = VBAP-KWMENG.

wa_record-z_bwtar = VBAP-BWTAR.

wa_record-z_NETWR_sk = wa_record-z_NETWR * z_mana.

append wa_record to it_record.

endif.

endselect.

Former Member
0 Kudos

i dont know if this is the error, but can u check if u are passing 'O' instead of zero. If u have declared tout record-matnr as mara-matnr or mbew-matnr, this should not happen. please check.

former_member188685
Active Contributor
0 Kudos

<b>SHIFT wa_record-z_matnr LEFT DELETING LEADING '0'.</b>

why are you doing the above one.

remove that...

Former Member
0 Kudos

Why dont you not delete the leading zeros before picking up MBEW data.

Other wise you need to call CONVERSION_EXIT_MATN1_INPUT and pass VBAP-MATNR as the input field. i think this is the problem, let me check with my db and get back

former_member188685
Active Contributor
0 Kudos
SHIFT wa_record-z_matnr LEFT DELETING LEADING '0'.

comment the above line and check it.

is should work.

Regards

vijay

Former Member
0 Kudos

hi,

i checked and it is working perfectly fine for me with this set of code.

parameters: p_matnr like mara-matnr,

p_bwtar like mbew-bwtar.

start-of-selection.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT = p_MATNR

IMPORTING

OUTPUT = p_MATNR

EXCEPTIONS

LENGTH_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

SELECT VERPR INTO MBEW-VERPR FROM MBEW

WHERE MATNR = p_MATNR

AND BWTAR = p_BWTAR

and BWKEY = 'ZELP'.

endselect.

break-point.

Please check if BWKEY is there and also check if the matnr query is correct.

In my case the matnr was 112 and had to pad it with leading zeros using th exit FM.

Hope this time u get thru

Answers (1)

Answers (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

The following are the possiblities :

1.Have you declared matnr and bwtar as follows.

data : begin of wa_record,

...

matnr type mbew-matnr,

bwtar type mbew-bwtar,

end of wa_record.

If not,correct the type declaration part.

2.If the above doesn't works,just try passing the values directly and observe whether you are getting the value.

select verpr into v_verpr

from mbew

where matnr = '3000032'

and bwtar = WA_RECORD-BWTAR

and bwkey = '1000'.

Are you sure that wa_record-bwtar contains values while passing in select statemnt,just check that in debugging.

3. try passing matnr = '0000000003000032'.

Kindly reward points by clicking the star on the left of reply,if it helps.