Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8507

Re: migo: valuation data locking issue

$
0
0

Yep,

 

 

the program call the function with the enqueue (lock / unlock object)

And you need also a job that launch the batch-input not finished.

 

 

Regards

Fred

 

 

The function :

 

 

FUNCTION zbc_bdc_submit_locked.

*"----------------------------------------------------------------------
*"*"Interface locale :
*" IMPORTING
*" VALUE(IT_ENQUEUE) TYPE WLF_SEQG3_TAB OPTIONAL
*" VALUE(W_UNAME) TYPE SYUNAME
*" VALUE(W_MAXWAIT) TYPE SYTABIX OPTIONAL
*" VALUE(W_NOM) TYPE APQ_GRPN
*"----------------------------------------------------------------------


  DATA : gw_flag_wait(1) ,
         is_enq TYPE seqg3 ,
         is_bdc TYPE bdcdata ,
         it_enq TYPE wlf_seqg3_tab WITH HEADER LINE.


* Si pas de limit d'attente, limite passé à 5 tours.

  IF w_maxwait IS INITIAL.
    MOVE 5 TO w_maxwait.
  ENDIF.


* Vérifie qu'aucune entrée de blocage marché ne tourne.

  DO w_maxwait TIMES.

* Recherche des entrées de blocage sur le user.

    CALL FUNCTION 'ENQUEUE_READ'
      EXPORTING
        gclient = sy-mandt
        guname  = w_uname
      TABLES
        enq     = it_enq
      EXCEPTIONS
        OTHERS  = 3.

* Recherche si entrée de blocage du user correspond à celui marqué
* pour le batch.

    LOOP AT it_enqueue
          INTO is_enq.
      READ TABLE it_enq
           WITH KEY gname = is_enq-gname
                    garg  = is_enq-garg.
      IF sy-subrc EQ space.
        MOVE 'X' TO gw_flag_wait.
      ENDIF.
    ENDLOOP.
    IF sy-subrc NE space.
      EXIT.
    ENDIF.
    IF gw_flag_wait EQ space.
      EXIT.
    ELSE.
      WAIT UP TO 20 SECONDS.
      CLEAR gw_flag_wait.
    ENDIF.

  ENDDO.


  IF gw_flag_wait EQ space.
    SUBMIT rsbdcsub WITH mappe = w_nom
                    WITH von   = sy-datum
                    WITH bis   = sy-datum
                    EXPORTING LIST TO MEMORY
                    AND RETURN.
  ENDIF.

ENDFUNCTION.


Viewing all articles
Browse latest Browse all 8507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>