SAP Function Modules

ISP_UNIT_CONVERSION SAP Function module - IS-M/AM: Convert Ad Sizes/Units







ISP_UNIT_CONVERSION is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ISP_UNIT_CONVERSION into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: JHTD
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ISP_UNIT_CONVERSION - ISP UNIT CONVERSION





CALL FUNCTION 'ISP_UNIT_CONVERSION' "IS-M/AM: Convert Ad Sizes/Units
  EXPORTING
    spaltigkeit =               " tjj47-seite_fsp  Page/Column Format
*   seitenformat =              " tjj01-seite_form
*   fix_groesse =               " tjj13-azart_area
    breite =                    " jhamot-breite_i
    breite_eh =                 " jhamot-breite_ieh
    hoehe =                     " jhamot-hoehe_i
    hoehe_eh =                  " jhamot-hoehe_i_eh
*   zus_menge =                 " jhamot-zus_menge
*   zus_berech =                " jhamot-zus_berech
    search_unit =               " jhamot-breite_ieh
*   pv_booking_unit =           " belegeinh     IS-M/AM: Booking Unit
*   pv_content_component =      " inhk_kfm      IS-M: Business Content Component
*   pv_ad_design_type =         " azart_gest    IS-M: Design Ad Type
  IMPORTING
    compute_value =             " komp-mglme    Converted Quantity
  EXCEPTIONS
    UNIT_SEITENF = 1            "
    UNIT_SPALTIGK = 2           "
    UNIT_HOEHE = 3              "
    NO_COMPUTE = 4              "
    MISSING_AREA = 5            "
    .  "  ISP_UNIT_CONVERSION

ABAP code example for Function Module ISP_UNIT_CONVERSION





The ABAP code below is a full code listing to execute function module ISP_UNIT_CONVERSION including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_compute_value  TYPE KOMP-MGLME .


SELECT single SEITE_FSP
FROM TJJ47
INTO @DATA(ld_spaltigkeit).


SELECT single SEITE_FORM
FROM TJJ01
INTO @DATA(ld_seitenformat).


SELECT single AZART_AREA
FROM TJJ13
INTO @DATA(ld_fix_groesse).


SELECT single BREITE_I
FROM JHAMOT
INTO @DATA(ld_breite).


SELECT single BREITE_IEH
FROM JHAMOT
INTO @DATA(ld_breite_eh).


SELECT single HOEHE_I
FROM JHAMOT
INTO @DATA(ld_hoehe).


SELECT single HOEHE_I_EH
FROM JHAMOT
INTO @DATA(ld_hoehe_eh).


SELECT single ZUS_MENGE
FROM JHAMOT
INTO @DATA(ld_zus_menge).


SELECT single ZUS_BERECH
FROM JHAMOT
INTO @DATA(ld_zus_berech).


SELECT single BREITE_IEH
FROM JHAMOT
INTO @DATA(ld_search_unit).

DATA(ld_pv_booking_unit) = 'Check type of data required'.
DATA(ld_pv_content_component) = 'Check type of data required'.
DATA(ld_pv_ad_design_type) = 'Check type of data required'. . CALL FUNCTION 'ISP_UNIT_CONVERSION' EXPORTING spaltigkeit = ld_spaltigkeit * seitenformat = ld_seitenformat * fix_groesse = ld_fix_groesse breite = ld_breite breite_eh = ld_breite_eh hoehe = ld_hoehe hoehe_eh = ld_hoehe_eh * zus_menge = ld_zus_menge * zus_berech = ld_zus_berech search_unit = ld_search_unit * pv_booking_unit = ld_pv_booking_unit * pv_content_component = ld_pv_content_component * pv_ad_design_type = ld_pv_ad_design_type IMPORTING compute_value = ld_compute_value EXCEPTIONS UNIT_SEITENF = 1 UNIT_SPALTIGK = 2 UNIT_HOEHE = 3 NO_COMPUTE = 4 MISSING_AREA = 5 . " ISP_UNIT_CONVERSION
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_compute_value  TYPE KOMP-MGLME ,
ld_spaltigkeit  TYPE TJJ47-SEITE_FSP ,
ld_seitenformat  TYPE TJJ01-SEITE_FORM ,
ld_fix_groesse  TYPE TJJ13-AZART_AREA ,
ld_breite  TYPE JHAMOT-BREITE_I ,
ld_breite_eh  TYPE JHAMOT-BREITE_IEH ,
ld_hoehe  TYPE JHAMOT-HOEHE_I ,
ld_hoehe_eh  TYPE JHAMOT-HOEHE_I_EH ,
ld_zus_menge  TYPE JHAMOT-ZUS_MENGE ,
ld_zus_berech  TYPE JHAMOT-ZUS_BERECH ,
ld_search_unit  TYPE JHAMOT-BREITE_IEH ,
ld_pv_booking_unit  TYPE BELEGEINH ,
ld_pv_content_component  TYPE INHK_KFM ,
ld_pv_ad_design_type  TYPE AZART_GEST .


SELECT single SEITE_FSP
FROM TJJ47
INTO ld_spaltigkeit.


SELECT single SEITE_FORM
FROM TJJ01
INTO ld_seitenformat.


SELECT single AZART_AREA
FROM TJJ13
INTO ld_fix_groesse.


SELECT single BREITE_I
FROM JHAMOT
INTO ld_breite.


SELECT single BREITE_IEH
FROM JHAMOT
INTO ld_breite_eh.


SELECT single HOEHE_I
FROM JHAMOT
INTO ld_hoehe.


SELECT single HOEHE_I_EH
FROM JHAMOT
INTO ld_hoehe_eh.


SELECT single ZUS_MENGE
FROM JHAMOT
INTO ld_zus_menge.


SELECT single ZUS_BERECH
FROM JHAMOT
INTO ld_zus_berech.


SELECT single BREITE_IEH
FROM JHAMOT
INTO ld_search_unit.

ld_pv_booking_unit = 'Check type of data required'.
ld_pv_content_component = 'Check type of data required'.
ld_pv_ad_design_type = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ISP_UNIT_CONVERSION or its description.