‎2007 Dec 11 10:13 AM
Hi Experts,
When I am going to table EKPO(SE11) for line items of PO,
It shows me value in MEINS field 'STD'. but when I double click on the same records the value which is displayed is 'HR'.
In this case I found that value 'HR' is correct one.
but in my program populates the values in internal table 'STD' which further yeilds wrong results..
What can be the problem??
‎2007 Dec 11 10:17 AM
There is no problem. There is an conversion exit on MEINS that converts the data as held in the database (STD = Stunde in German) to the (english) language equivalent - HR.
Look at domain MEINS. You'll see it has conversion exit CUNIT. Double click on it, and you'll see the function modules to use directly in your program to get the correct output.
matt
‎2007 Dec 11 10:17 AM
There is no problem. There is an conversion exit on MEINS that converts the data as held in the database (STD = Stunde in German) to the (english) language equivalent - HR.
Look at domain MEINS. You'll see it has conversion exit CUNIT. Double click on it, and you'll see the function modules to use directly in your program to get the correct output.
matt
‎2007 Dec 11 10:21 AM
hi,
the problem is that there is a conversion exit behind MEINS. The exits are:
CONVERSION_EXIT_CUNIT_INPUT
CONVERSION_EXIT_CUNIT_OUTPUT
The value in the table is stored in German, while is displayed in English (or your logon language).
You can also check the conversion settings when you display the data (in SE11).
hope this helps
ec
‎2007 Dec 11 10:21 AM
It´s because this field have a type with CUNIT conversion, so when you are going to select this values, the selection returns the conversion values, so you have to compare with the correct value HR. The function modules to convert de dates are CONVERSION_EXIT_CUNIT_INPUT
CONVERSION_EXIT_CUNIT_OUTPUT.
‎2007 Dec 11 10:22 AM
Hi Dhananjay,
Conversion routines
CONVERSION_EXIT_CUNIT_INPUT Conversion exit for commercial (3-char) measurement unit INPUT
CONVERSION_EXIT_CUNIT_OUTPUT Conversion exit for commercial (3-char) measurement unit OUTPUT
are attached with this data element MEINS that convers that data.
Call this FM in your program and use it.
Regards,
Mukesh Kumar
‎2007 Dec 11 10:23 AM
Hi Dhananjay,
The field MEINS has Convertion Routine so it display like that 'STD' is correct Value use that value.
Plz Reward if helpful,
Mahi.
‎2007 Dec 11 10:31 AM
Thanx all for ur replies...
I am writing following code for the same
data : var1(3).
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = 'STD'
LANGUAGE = SY-LANGU
IMPORTING
LONG_TEXT =
OUTPUT = var1
SHORT_TEXT =
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.
write var1.
But the VAR1 is not returning any value..?? Am I using correct FM with Correct parameters??
‎2007 Dec 11 10:36 AM
Execute
data : var1(3).
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = 'STD'
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = var1.
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.
write var1.
If you face any problem revert back
‎2007 Dec 11 10:42 AM
Hi MUkesh..
Thanx for ur code sample...
But now its giving error : Unit STD is not created in language EN
What can be the problem??
‎2007 Dec 11 10:51 AM
you have to use the other FM: CONVERSION_EXIT_CUNIT_OUTPUT:
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = 'STD'
LANGUAGE = 'EN'
IMPORTING
LONG_TEXT =
OUTPUT = here you'll get HR
SHORT_TEXT =
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2.
ec
‎2007 Dec 11 12:20 PM
‎2007 Dec 11 12:23 PM