Давно написал ФМ для отражения в PPOME столбца с разрядом (уровень из ИТ1005) и ЧТС/окладом. Может кому пригодиться.
FUNCTION z_hr_planned_compensation_fill.
*»———————————————————————-
*»*»Локальный интерфейс:
*» IMPORTING
*» VALUE(COL_KEY) TYPE TV_ITMNAME
*» VALUE(TREE_HANDLE)
*» VALUE(KEY_DATE) LIKE OBJEC-BEGDA
*» VALUE(BEGDA) LIKE OBJEC-BEGDA
*» VALUE(ENDDA) LIKE OBJEC-ENDDA
*» TABLES
*» TREE_OBJECTS STRUCTURE TREE_OBJEC
*» TREE_STRUCTURE STRUCTURE TREE_STRUC
*» COLUMN_CONTENT STRUCTURE ORGNODECON
*» LEGEND_ICON_TEXT STRUCTURE TREELEGEND OPTIONAL
*»———————————————————————-
DATA: lt_p1005 TYPE STANDARD TABLE OF p1005 WITH HEADER LINE.
DATA: l_betrg1 TYPE betrg.
DATA: l_betrg2 TYPE betrg.
DATA: s_cpmin TYPE string,
s_cpmax TYPE string.
DATA: s_betrg1 TYPE string,
s_betrg2 TYPE string.
DATA: sal_subrc TYPE sy-subrc.
LOOP AT tree_objects.
IF tree_objects-otype = ‘S’.
* Commented — authorities already checked in ‘HR_READ_PLANNED_COMPENSATION’
*
* AUTHORITY-CHECK OBJECT ‘PLOG’
* ID ‘PLVAR’ FIELD tree_objects-plvar
* ID ‘OTYPE’ FIELD tree_objects-otype
* ID ‘INFOTYP’ FIELD ‘1005’
* ID ‘SUBTYP’ DUMMY
* ID ‘ISTAT’ FIELD tree_objects-istat
* ID ‘PPFCODE’ FIELD ‘DISP’.
*
* sal_subrc = sy-subrc.»Полномочия на просмотр норм. оплаты в деньгах
CALL FUNCTION ‘HR_READ_PLANNED_COMPENSATION’
EXPORTING
p_molga = ’33’
* P_TRFAR =
* P_TRFGB =
p_indda = key_date
p_position = tree_objects-objid
* P_JOB =
IMPORTING
p_p1005 = lt_p1005
EXCEPTIONS
no_active_planversion_found = 1
more_than_one_record_found = 2
no_record_found = 3
OTHERS = 4
.
CHECK sy-subrc EQ 0.
MOVE-CORRESPONDING tree_objects TO column_content.
CASE lt_p1005-cpind.
WHEN ‘T’. » Указана вилка тарифов
IF lt_p1005-trfs1 <> lt_p1005-trfs2.
SELECT SINGLE betrg FROM t510 INTO l_betrg1
WHERE
molga = ’33’ AND
trfar = lt_p1005-trfar AND
trfgb = lt_p1005-trfgb AND
trfkz = lt_p1005-trfkz AND
trfgr = lt_p1005-trfg1 AND
trfst = lt_p1005-trfs1 AND
begda LE key_date AND
endda GE key_date.
SELECT SINGLE betrg FROM t510 INTO l_betrg2
WHERE
molga = ’33’ AND
trfar = lt_p1005-trfar AND
trfgb = lt_p1005-trfgb AND
trfkz = lt_p1005-trfkz AND
trfgr = lt_p1005-trfg2 AND
trfst = lt_p1005-trfs2 AND
begda LE key_date AND
endda GE key_date.
IF l_betrg1 IS INITIAL OR l_betrg2 IS INITIAL.
column_content-content = ‘Ошибка чтения данных’.
ELSE.
s_betrg1 = l_betrg1.
s_betrg2 = l_betrg2.
IF sal_subrc = 0.
CONCATENATE lt_p1005-trfs1 ‘-‘ lt_p1005-trfs2 ‘(‘ s_betrg1 ‘-‘ s_betrg2 ‘)’ INTO column_content-content.
ELSE.
CONCATENATE lt_p1005-trfs1 ‘-‘ lt_p1005-trfs2 INTO column_content-content.
ENDIF.
ENDIF.
ELSE. » Указан один тариф, а не вилка
SELECT SINGLE betrg FROM t510 INTO l_betrg1
WHERE
molga = ’33’ AND
trfar = lt_p1005-trfar AND
trfgb = lt_p1005-trfgb AND
trfkz = lt_p1005-trfkz AND
trfgr = lt_p1005-trfg1 AND
trfst = lt_p1005-trfs1 AND
begda LE key_date AND
endda GE key_date.
IF sy-subrc <> 0.
column_content-content = lt_p1005-trfs1.
ELSE.
IF sal_subrc = 0.
s_betrg1 = l_betrg1.
CONCATENATE lt_p1005-trfs1 ‘(‘ s_betrg1 ‘)’ INTO column_content-content.
ELSE.
column_content-content = lt_p1005-trfs1.
ENDIF.
ENDIF.
ENDIF.
WHEN ‘S’.
column_content-content = ‘Не настроено’.
WHEN ‘D’.
IF sal_subrc = 0.
s_cpmin = lt_p1005-cpmin.
s_cpmax = lt_p1005-cpmax.
IF lt_p1005-cpmin = lt_p1005-cpmax.
CONCATENATE ‘(‘ s_cpmin ‘)’ INTO column_content-content.
ELSE.
CONCATENATE ‘(‘ s_cpmin ‘-‘ s_cpmax ‘)’ INTO column_content-content.
ENDIF.
ENDIF.
ENDCASE.
CONDENSE column_content-content NO-GAPS.
APPEND column_content.
ENDIF.
ENDLOOP.
ENDFUNCTION.