SAP Note 657185 - RTO: Sample code for calculating bucket consumptions 4.0

Component : Production Data Structure -

Solution : https://service.sap.com/sap/support/notes/657185 (SAP Service marketplace login required)

Key words :
call function '/sapapo/cres_kapid_get_resuid'           exporting              iv_logsys           = iv_logsys              iv_r3kapid          = ls_reqcaps-kapid           importing              ev_resuid           = lv_resid           exceptions              not_qualified       = 1, call function '/sapapo/cres_resource_read'      exporting        i_resuid            = lv_resid      importing        e_res_head          = ls_reshead      exceptions        not_qualified        = 1        not_found            = 2        simversid_is_initial = 3, call function 'unit_conversion_simple'        exporting            input                = time            unit_in              = unit            unit_out             = lv_unit_second        importing            output               = time        exceptions, key ext_plannr = ls_reqcaps-ext_plannr                  vornr      = ls_reqcaps-vornr                  actnr      = ls_reqcaps-actnr                  mode_indx  = ls_reqcaps-modus                  zaehl      = ls_reqcaps-zaehl, key ext_plannr = ls_reqcaps-ext_plannr                vornr      = ls_reqcaps-vornr                actnr      = ls_reqcaps-actnr                zaehl      = ls_reqcaps-zaehl, call function 'si_unit_get'         exporting            dimension           = lc_unit_dimension_time         importing            si_unit             = lv_unit_second         exceptions             dimension_not_found = 1            unit_not_found      = 2, ->/sapapo/conv_into_sec        exporting          unit = ls_modes-unit        changing          time = ls_modes-dur2, ->/sapapo/conv_into_sec        exporting          unit = ls_modes-unit        changing          time = ls_modes-dur1, typeunit importing type /sapapo/unittime changing type /sapapo/dur1, compute ls_reqcaps-bcap1 = ls_modes-dur1                                       ls_reqcaps-cap2

Related Notes :

1462965CIF-PDS: variable bucket consumption capacity has value "0"
1327805CIF-PDS: wrong mode duration calculation
497808Queue error due to incorrect master data (RC 144, 145, etc)