on 05-01-2006 4:56 PM
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'?
Hi Nyrvole Vincent,
Try to write the same code in start routine(update rules).
Like
Loop at data_package.
IF Data_package-CASES NE 'CS'.
WEIGHT = Data_package-CASES_REV.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = Data_package-CASES_REV
UNIT_IN = Data_package-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.
Endloop.
Hope it helps
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nyrvole Vincent,
I think the field CASES is not available in communication structure, check. or you are giving wrong name.
Include this field(CASES) in communication structure. Then only you can use as COMM_STRUCTURE-CASES.
Hope it Helps
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.