Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

0UNIT Conversion

I am using the UNIT_CONVERSION_SIMPLE FM to translate a unit field when it is not equal to 'CS'. The first thing I am checking is to see if the 'unit' coming in is equal to 'CS'. If it is not, then I call the FM to do some conversion. I get an error message saying that "COMM_STRUCUTRE does not have component called 'cases'.

IF COMM_STRUCTURE-CASES NE 'CS'.

WEIGHT = COMM_STRUCTURE-CASES_REV.

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'

EXPORTING

INPUT = COMM_STRUCTURE-CASES_REV

UNIT_IN = COMM_STRUCTURE-CASES

UNIT_OUT = 'CS'

IMPORTING

OUTPUT = WEIGHT

EXCEPTIONS

CONVERSION_NOT_FOUND = 1

DIVISION_BY_ZERO = 2

INPUT_INVALID = 3

OUTPUT_INVALID = 4

OVERFLOW = 5

TYPE_INVALID = 6

UNITS_MISSING = 7

UNIT_IN_NOT_FOUND = 8

UNIT_OUT_NOT_FOUND = 9

OTHERS = 10.

ENDIF.

How can I check to make sure the unit coming in is NE to 'CS'?

Not what you were looking for? View more on this topic or Ask a question