Posted: Wed Oct 22, 2008 4:02 pm Post subject: Не отрабатывает ФМ "DEQUEUE_EHPLOGIE" в 4.0
Доброго времени суток всем!
Подскажите, пож-та, если кто сталкивался - возникла следующая трабла:
блокирую ответственность с помощью функции ENQUEUE_EHPLOGIE. Логично предположить, что разблокировать надо с помощью ФМ DEQUEUE_EHPLOGIE. Вызываю - не работает В sm12 остается запись блокирования.
В чем может быть причина ?
Age: 170 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Wed Oct 22, 2008 7:57 pm Post subject:
Функция DEQUEUE_EHPLOGIE правильная, может не все входные параметры для нее указали?
например:
Code:
FUNCTION rh_activate_origins.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(ACT_TARGET_CLIENT) LIKE SY-MANDT
*" DEFAULT SY-MANDT
*" VALUE(ACT_TARGET_PLV) LIKE HROBJECT-PLVAR
*" VALUE(ACT_SOURCE_PLV) LIKE HROBJECT-PLVAR
*" REFERENCE(ENQUEUE) LIKE PP0C-EQDQ OPTIONAL
*" TABLES
*" ACT_ORIGINS STRUCTURE HRMDORIGIN
*" ACT_PLOGI STRUCTURE PLOGI
*" ACT_PLOGI_DEL STRUCTURE PLOGI_DEL
*" T_XMSG STRUCTURE SPROT_U
*"----------------------------------------------------------------------
DATA: t77s0_repli TYPE flag_x.
DATA: enq1_subrc LIKE sy-subrc,
enq2_subrc LIKE sy-subrc.
DATA: origin_subrc LIKE sy-subrc.
LOOP AT act_origins.
CLEAR: enq1_subrc, enq2_subrc.
IF NOT enqueue IS INITIAL.
* try to lock the object in the active plv(client-specified!!!)
CALL FUNCTION 'ENQUEUE_EHPLOGIE'
EXPORTING
mandt = act_target_client
plvar = act_target_plv
otype = act_origins-otype
objid = act_origins-objid
EXCEPTIONS
foreign_lock = 01
system_failure = 02.
enq1_subrc = sy-subrc.
IF enq1_subrc = 0.
* try to lock the object in the custplv(client-specified!)
CALL FUNCTION 'ENQUEUE_EHPLOGIE'
EXPORTING
mandt = act_target_client
plvar = act_source_plv
otype = act_origins-otype
objid = act_origins-objid
EXCEPTIONS
foreign_lock = 01
system_failure = 02.
enq2_subrc = sy-subrc.
ENDIF.
ENDIF.
IF enq1_subrc = 0 AND enq2_subrc = 0.
* we could lock the object in active plv and cust plv
CALL FUNCTION 'RH_CHECK_ORIG_IS_ACTIVE' "QDO new function
IMPORTING
repli_is_set = t77s0_repli.
IF NOT t77s0_repli IS INITIAL. "distributed orgmanagement
CALL FUNCTION 'RH_CHECK_OBJECT_IS_ORIGINAL'
EXPORTING
client = act_target_client
plvar = act_target_plv
otype = act_origins-otype
objid = act_origins-objid
EXCEPTIONS
otype_is_not_relevant = 1
object_is_not_original = 1
object_is_not_existing = 2 "Arno Note 173794
object_not_registered = 3
own_logical_system_not_defined = 4
OTHERS = 5.
origin_subrc = sy-subrc.
ELSE. " without distributed orgmanagement
origin_subrc = 1. "trate as not-original
ENDIF. " distributed orgmanagemnet
IF origin_subrc <> 0.
* Object is not original or not existing
* => write HRMDORIGIN entry into active plan version
DELETE FROM hrmdorigin CLIENT SPECIFIED
WHERE mandt = act_target_client
AND plvar = act_target_plv
AND otype = act_origins-otype
AND objid = act_origins-objid.
UPDATE hrmdorigin CLIENT SPECIFIED
SET plvar = act_target_plv
WHERE mandt = act_target_client
AND plvar = act_source_plv
AND otype = act_origins-otype
AND objid = act_origins-objid.
ELSE.
* Object is original => stop activation of this object
* completely
DELETE act_plogi
WHERE mandt = act_origins-mandt
AND otype = act_origins-otype
AND objid = act_origins-objid.
DELETE act_plogi_del
WHERE mandt = act_origins-mandt
AND otype = act_origins-otype
AND objid = act_origins-objid.
* no import of the object, because object is original
CLEAR t_xmsg.
t_xmsg-level = '2'.
t_xmsg-severity = 'W'.
t_xmsg-langu = sy-langu.
t_xmsg-ag = '5W'.
t_xmsg-msgnr = '627'.
t_xmsg-var1 = act_origins-otype.
t_xmsg-var2 = act_origins-objid.
t_xmsg-var3 = act_target_client.
APPEND t_xmsg. "
ENDIF.
IF NOT enqueue IS INITIAL.
* dequeue the object in active plvar
CALL FUNCTION 'DEQUEUE_EHPLOGIE'
EXPORTING
mandt = act_target_client
plvar = act_target_plv
otype = act_origins-otype
objid = act_origins-objid.
* dequeue the object in custom plvar
CALL FUNCTION 'DEQUEUE_EHPLOGIE'
EXPORTING
mandt = act_target_client
plvar = act_source_plv
otype = act_origins-otype
objid = act_origins-objid.
ENDIF.
ELSE. "Object could not be locked
CLEAR t_xmsg.
t_xmsg-level = '2'.
t_xmsg-severity = 'W'.
t_xmsg-langu = sy-langu.
t_xmsg-ag = '5W'.
t_xmsg-msgnr = '628'.
t_xmsg-var1 = act_origins-otype.
t_xmsg-var2 = act_origins-objid.
t_xmsg-var3 = act_target_client.
APPEND t_xmsg.
ENDIF.
ENDLOOP.
Да вроде все нужные параметры указываю: mandt, plvar, otype, objid.
'ENQUEUE_EHPLOGIE' вызываю - срабатывает, потом пробую 'DEQUEUE_EHPLOGIE' с теми же параметрами - не хочет
Не проходит даже тест ФМ
Ето всё мне нужно для того, чтоб проверить, блокировано ли ведение ответственности:
Вызываю 'ENQUEUE_EHPLOGIE', если sy-subrc = 0, то ответственность не была блокировна. Но своим вызовом ф-ции я ее блокирнула и теперь, чтоб присвоить ее пользователю надо как-то разблокировать.
Может как-то иначе можно посмотреть, блокирована ли ответственность?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.