SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Не отрабатывает ФМ "DEQUEUE_EHPLOGIE" в 4.0



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
clare
Участник
Участник



Joined: 11 Dec 2007
Posts: 13
Location: Ярославль

PostPosted: Wed Oct 22, 2008 4:02 pm    Post subject: Не отрабатывает ФМ "DEQUEUE_EHPLOGIE" в 4.0 Reply with quote

Доброго времени суток всем!
Подскажите, пож-та, если кто сталкивался - возникла следующая трабла:

блокирую ответственность с помощью функции ENQUEUE_EHPLOGIE. Логично предположить, что разблокировать надо с помощью ФМ DEQUEUE_EHPLOGIE. Вызываю - не работает Sad В sm12 остается запись блокирования.
В чем может быть причина ?
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 65
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Wed Oct 22, 2008 7:57 pm    Post subject: Reply with quote

Функция 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.

ENDFUNCTION.
Back to top
View user's profile Send private message Blog Visit poster's website
clare
Участник
Участник



Joined: 11 Dec 2007
Posts: 13
Location: Ярославль

PostPosted: Thu Oct 23, 2008 1:35 pm    Post subject: Reply with quote

Да вроде все нужные параметры указываю: mandt, plvar, otype, objid.
'ENQUEUE_EHPLOGIE' вызываю - срабатывает, потом пробую 'DEQUEUE_EHPLOGIE' с теми же параметрами - не хочет Sad

Не проходит даже тест ФМ Sad

Ето всё мне нужно для того, чтоб проверить, блокировано ли ведение ответственности:
Вызываю 'ENQUEUE_EHPLOGIE', если sy-subrc = 0, то ответственность не была блокировна. Но своим вызовом ф-ции я ее блокирнула и теперь, чтоб присвоить ее пользователю надо как-то разблокировать.

Может как-то иначе можно посмотреть, блокирована ли ответственность?
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 65
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Oct 23, 2008 2:18 pm    Post subject: Reply with quote

Влокировку можно просто прочитать ФМ 'ENQUEUE_READ'

Code:
    DATA: l_garg LIKE seqg3-garg,
          lt_enq LIKE seqg3 OCCURS 1 WITH HEADER LINE.
      REFRESH lt_enq.
      CONCATENATE sy-mandt rbkp-belnr rbkp-gjahr INTO l_garg.
      CALL FUNCTION 'ENQUEUE_READ'
         EXPORTING
              gclient               = sy-mandt
              gname                 = 'RBKP'
              garg                  = l_garg
              guname                = sy-uname
         TABLES
              enq                   = lt_enq
         EXCEPTIONS
              communication_failure = 1
              system_failure        = 2
              OTHERS                = 3.
      IF sy-subrc IS INITIAL.
        CHECK NOT lt_enq[] IS INITIAL.
      ENDIF.
      REFRESH lt_enq.
Back to top
View user's profile Send private message Blog Visit poster's website
clare
Участник
Участник



Joined: 11 Dec 2007
Posts: 13
Location: Ярославль

PostPosted: Fri Oct 24, 2008 1:05 pm    Post subject: Reply with quote

Спасибо большое!! Наверное так разумнее ))
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.