Archive

Posts Tagged ‘Function Module’

Conversion Exit

January 29th, 2009

If you notice, some fields in SAP tables have different values when you view them in SE16. For example, try to see table IFLO (functional location master) and input the functional location value. In my case, it’s UJ-UTI-GRL. Execute.

The displayed value is not UJ-UTI-GRL, but ‘?0100000000000000162′ instead. ‘UJ-UTI-GRL’ is the external value while ‘?0100000000000000162′ is internal value. When we access the table from the program, it only recognizes internal value. All wee need to do is do the conversion for the field using ‘CONVERSION_EXIT_TPLNR_INPUT’ to get the internal value and ‘CONVERSION_EXIT_TPLNR_OUTPUT’ vice verso.

Here’s the example code:
data: D_TPLNR TYPE TPLNR.
CALL FUNCTION ‘CONVERSION_EXIT_TPLNR_INPUT’
EXPORTING
input = viqmel-tplnr
IMPORTING
OUTPUT = D_TPLNR.

And voila! You’ll get your internal value for functional location stored in D_TPLNR variable.

You can also find other fields conversion exits. Go to SE37 and find other function module containing ‘CONVERSION_EXIT_XXX_INPUT’ where XXX is the field name.

Enjoy!

vera ABAP ,