'use strict';var avia_is_mobile=!1;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&'ontouchstart' in document.documentElement){avia_is_mobile=!0;document.documentElement.className+=' avia_mobile '} else{document.documentElement.className+=' avia_desktop '};document.documentElement.className+=' js_active ';(function(){var e=['-webkit-','-moz-','-ms-',''],n='',o=!1,a=!1;for(var t in e){if(e[t]+'transform' in document.documentElement.style){o=!0;n=e[t]+'transform'};if(e[t]+'perspective' in document.documentElement.style){a=!0}};if(o){document.documentElement.className+=' avia_transform '};if(a){document.documentElement.className+=' avia_transform3d '};if(typeof document.getElementsByClassName=='function'&&typeof document.documentElement.getBoundingClientRect=='function'&&avia_is_mobile==!1){if(n&&window.innerHeight>0){setTimeout(function(){var e=0,o={},a=0,t=document.getElementsByClassName('av-parallax'),i=window.pageYOffset||document.documentElement.scrollTop;for(e=0;e

Creating a new scale model class for LOG-PP-CFB

You are here:

The default scale model class provided by SAP for communication via an RFC connection does not pass the unit of measure (UOM) to ERP-Scale. This means that ERP-Scale is unable to convert the weight received from the sale to the UOM required by SAP and can lead to incorrect data being returned to SAP.

We advise creating a custom scale model class by copying the standard class CL_CFB_SCALE_MODEL_RFC_1.

Please review SAP Note 1532217 for information regarding creating a new scale model class.

Copy the class CL_CFB_SCALE_MODEL_RFC_1 to ZPP_CL_CFB_SCALE_MODEL_RFC_1 and make the following code changes:


  lv_unit = ls_scale-unit.

* Send tare to scale system.

* Pocket Programs - ERP-Scale    May 2016
* With a tare of Zero, no UOM is sent to ERP-Scale. This can lead to
* inconsistent results as there is no check that the UOM returned
* from the scale matches the UOM expected by SAP
* Modify code to always send tare with UOM to ERP-Scale , even if
* tare is zero.
*  IF iv_tare > 0.
    CALL METHOD me->pack_tare
        iv_unit        = lv_unit
        iv_tare        = iv_tare
        ev_tare_packed = lv_data.

    CALL METHOD me->send_command(
        iv_funcname        = lv_funcname
        iv_command         = gc_command-send_tare
        iv_rfc_destination = lv_rfc_destination
        iv_device          = lv_device
        iv_data            = lv_data
        ev_retcode         = lv_retcode ).

    IF  lv_retcode <> '0'.
      ev_manual_mode = abap_true.

*  ELSE.
**   Send a "clear tare" command.
*    CALL METHOD me->send_command(
*        iv_funcname        = lv_funcname
*        iv_command         = gc_command-clear_tare
*        iv_rfc_destination = lv_rfc_destination
*        iv_device          = lv_device
*        ev_retcode         = lv_retcode ).
*    IF  lv_retcode <> '0'.
*      ev_manual_mode = abap_true.
*      EXIT.
*    ENDIF.

* Read stable weight
Was this article helpful?
Dislike 0
Views: 131
Still have questions? Create a support ticket