Skip to Content
0
Former Member
Jul 09, 2007 at 08:45 PM

EDI Delivery - Not raising error for invalid ISO UOM

91 Views

Standard SAP FM IDOC_OUTPUT_DELVRY include LV56KF62 performs Unit_of_measure_sap_to_iso but does not analyze the return code and incorrectly generates an invalid IDoc. The function called, unit_of_measure_sap_to_iso raises an error internally when the iso-code is invalid but an error message is not raised.

Is there a correction for this situation?

Standard SAP code follows:

((LV56KF62)

PERFORM UNIT_OF_MEASURE_SAP_TO_ISO USING TAB_LIPS-VRKME

CHANGING E1EDL24-VRKME.

(UNIT_OF_MEASURE_SAP_TO_ISO)

FORM UNIT_OF_MEASURE_SAP_TO_ISO USING VALUE(SAP_CODE) TYPE ANY

CHANGING ISO_CODE TYPE ANY.

DATA: H_ISO_CODE LIKE T006-ISOCODE.

CALL FUNCTION 'UNIT_OF_MEASURE_SAP_TO_ISO'

EXPORTING

SAP_CODE = SAP_CODE

IMPORTING

ISO_CODE = H_ISO_CODE

EXCEPTIONS

NOT_FOUND = 1

NO_ISO_CODE = 2

OTHERS = 3.

IF ( SY-SUBRC IS INITIAL ).

ISO_CODE = H_ISO_CODE.

ELSE.

CLEAR ISO_CODE.

ENDIF.

ENDFORM. " UNIT_OF_MEASURE_SAP_TO_ISO

FUNCTION UNIT_OF_MEASURE_SAP_TO_ISO.

*"----

-


""Lokale Schnittstelle:

*" IMPORTING

*" SAP_CODE LIKE T006-MSEHI

*" EXPORTING

*" ISO_CODE LIKE T006-ISOCODE

*" EXCEPTIONS

*" NOT_FOUND

*" NO_ISO_CODE

*"----

-


  • Deklarieren

data: code(3) type c.

  • Maßeinheit bestimmen

SELECT SINGLE * FROM T006

WHERE MSEHI = SAP_CODE.

IF SY-SUBRC <> 0

OR T006-ISOCODE IS INITIAL.

move SAP_CODE to code.

MESSAGE E035 WITH CODE "B20K071649

RAISING NOT_FOUND.

ENDIF.

ISO_CODE = T006-ISOCODE.

IF ISO_CODE IS INITIAL.

RAISE NO_ISO_CODE.

ENDIF.

ENDFUNCTION.