‎2006 Sep 20 4:48 AM
hi
i have put the follwoing query in my module pool
*&---------------------------------------------------------------------*
*& Module val_meins_101 INPUT
*&---------------------------------------------------------------------*
MODULE val_meins_101 INPUT.
DATA:v_meins LIKE t006-msehi.
CLEAR v_meins.
SELECT SINGLE msehi INTO v_meins
FROM t006
WHERE msehi = i_mat_master-meins.
IF sy-subrc IS NOT INITIAL.
MESSAGE e001(zmm) WITH 'Invalid Unit'.
ENDIF.
ENDMODULE. " val_meins_101 INPUTwhen my program runs the value of i_mat_master-meins comes 'PAC' and the query gives error
but when i saw this field in table T006 the entry exists there but this query gives error
i have checked many times but for this particular Unit PAC the query gives error inspite of having value in the table.
kindly tell wats the problem.
abhishek
‎2006 Sep 20 4:56 AM
Hi,
Use the FM CONVERSION_EXIT_CUNIT_INPUT..
tables: t006.
data: v_MSEHI type MSEHI.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = 'PAC'
IMPORTING
OUTPUT = V_MSEHI
EXCEPTIONS
UNIT_NOT_FOUND = 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 single * from t006
where msehi = v_msehi.
write: / sy-subrc.
Thanks,
Naren
‎2006 Sep 20 4:54 AM
I think the entry should be 'PC" and not "PAC".There is no entry for PAC in t006.
‎2006 Sep 20 4:56 AM
Hi,
Use the FM CONVERSION_EXIT_CUNIT_INPUT..
tables: t006.
data: v_MSEHI type MSEHI.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = 'PAC'
IMPORTING
OUTPUT = V_MSEHI
EXCEPTIONS
UNIT_NOT_FOUND = 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 single * from t006
where msehi = v_msehi.
write: / sy-subrc.
Thanks,
Naren
‎2006 Sep 20 5:15 AM
Hi,
The field MSEHI in the table T006 uses a conversion routine CUNIT and hence needs to be used with the conversion routines
CONVERSION_EXIT_CUNIT_INPUT
CONVERSION_EXIT_CUNIT_OUTPUT
for input and output.
Please use CONVERSION_EXIT_CUNIT_INPUT by passing the value PAC .The value obtained from the routine needs to be passed as a variable to the select query.
Regards
Sunil.M