Application Development 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: 

How to get the value for UMREZ

Former Member
0 Kudos

Hello Abapers,

I was trying to get the value for UMREZ from MARM table. My where condition is satisfying but I am not able to get the value into my varaiable (lv_umrez). Please help.

Below is the code I have written. Try to correct me if anything is wrong.

data: lv_umrez type marm-umrez.

select single umrez from marm

into lv_umrez

where matnr = '100000528'

and meinh = 'BAG'.

Appreciate your help.

Thanks,

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Nana,


data: lv_umrez type marm-umrez.

select single umrez from marm
into lv_umrez
where matnr = '100000528' "--> The error may be because of this stmt.
and meinh = 'BAG'.

Use the conversion exit CONVERSION_EXIT_MATN1_INPUT to select data:


DATA: lv_matnr type matnr value '100000528'.

  CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
      input  = lv_matnr
    IMPORTING
      output = lv_matnr.

data: lv_umrez type marm-umrez.

select single umrez from marm
into lv_umrez
where matnr = lv_matnr
and meinh = 'BAG'.

Try this !!!

BR,

Suhas

3 REPLIES 3

ThomasZloch
Active Contributor
0 Kudos

Probably a formatting issue with both MATNR and MEINH. You need to convert them to internal values before doing the select.

Use function modules CONVERSION_EXIT_MATN1_INPUT and CONVERSION_EXIT_CUNIT_INPUT.

Thomas

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Nana,


data: lv_umrez type marm-umrez.

select single umrez from marm
into lv_umrez
where matnr = '100000528' "--> The error may be because of this stmt.
and meinh = 'BAG'.

Use the conversion exit CONVERSION_EXIT_MATN1_INPUT to select data:


DATA: lv_matnr type matnr value '100000528'.

  CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
      input  = lv_matnr
    IMPORTING
      output = lv_matnr.

data: lv_umrez type marm-umrez.

select single umrez from marm
into lv_umrez
where matnr = lv_matnr
and meinh = 'BAG'.

Try this !!!

BR,

Suhas

Former Member
0 Kudos

Thank you so much Suhas. My problem is solved. Rewarded Points.