cancel
Showing results for 
Search instead for 
Did you mean: 

Checking locks in RVKRED77 / RVKREDSP / Z_RVKRED77_PARALLEL

JimSpath
Active Contributor
0 Kudos

We're facing challenges in credit master reorgs (I'm posting this for a colleague, so please bear with me).

After looking at relevant notes (363343, 400311, 755395) and searching the forum, I wonder if anyone has found logic missing from the SAP suggested code. When we run this, there may be a condition that does not permit the tables to be locked, so we wait and start the entire job again. Within Z_RVKRED77_PARALLEL, these enqueue locks are tried:

CALL FUNCTION 'ENQUEUE_EVVBAKE'
       EXPORTING
            vbeln = con_enqueue_batch.
  CALL FUNCTION 'ENQUEUE_EVVBAKE'.
  CALL FUNCTION 'ENQUEUE_EVVBLKE'.
  CALL FUNCTION 'ENQUEUE_EVVBRKE'.

(...)


  IF NOT variant1 IS INITIAL.
    PERFORM fill_joblist USING variant1 user '1'.
  ENDIF.

But there is no check on success/failure. I was thinking of adding a "delay and retry" within this block so we could attempt to continue at that point. Good, bad, crazy?

Thanks,

Jim

Accepted Solutions (1)

Accepted Solutions (1)

eduardo_hinojosa
Active Contributor
0 Kudos

Hi Jim,

Perhaps you need write the unlock, because I understand that you have problems with locks, ie, in RVKRED07 you have this coding:


  IF noblock IS INITIAL.
    CALL FUNCTION 'DEQUEUE_EVVBAKE'.
    CALL FUNCTION 'DEQUEUE_EVVBLKE'.
    CALL FUNCTION 'DEQUEUE_EVVBRKE'.
  ENDIF.

For instance


IF NOT variant1 IS INITIAL.
    CALL FUNCTION 'DEQUEUE_EVVBAKE'.
    CALL FUNCTION 'DEQUEUE_EVVBLKE'.
    CALL FUNCTION 'DEQUEUE_EVVBRKE'.
   " WAIT UP TO 2 SECONDS.                                 "try it, perhaps you avoid problems
   PERFORM fill_joblist USING variant1 user '1'.
ENDIF.

Other suggestion. Perhaps it will easier to call RVKRED77 because it call RVKRED07 (ie: report LIKE sy-repid VALUE 'RVKRED77', ), well, it's an idea how to do more simple the maintenance of variants.

Well, I hope this helps you

Regards,

Eduardo

PD: I'm thinking, and perhaps if you see that locks are losing in SM13, you can do this:


IF NOT variant1 IS INITIAL.
    "DELETE LOCKS
    CALL FUNCTION 'DEQUEUE_EVVBAKE'.
    CALL FUNCTION 'DEQUEUE_EVVBLKE'.
    CALL FUNCTION 'DEQUEUE_EVVBRKE'.
    "Call the reorg. with its own locks / unlocks
    PERFORM fill_joblist USING variant1 user '1'.
    "Set newly the locks 
    CALL FUNCTION 'ENQUEUE_EVVBAKE'
      EXPORTING
        vbeln = con_enqueue_batch.
    CALL FUNCTION 'ENQUEUE_EVVBAKE'.
    CALL FUNCTION 'ENQUEUE_EVVBLKE'.
    CALL FUNCTION 'ENQUEUE_EVVBRKE'.
ENDIF.

Edited by: E_Hinojosa on Nov 12, 2010 12:54 PM

JimSpath
Active Contributor
0 Kudos

Eduardo:

Thank you very much. I probably did not state the case very well. I am not looking for code to deal with the dequeue; that is presumably in the SAP supplied boiler plate. What I'm looking for is confirmation that attempting the enqueue several times (if any of the tables are in use on the first attempt) makes sense from a business perspective. As it stands, the SAP code tries once, does not check if the enqueue succeeds or not, so the standard code could fail later on.

Jim

eduardo_hinojosa
Active Contributor
0 Kudos

Hi Jim.

In my opinion the developer try to guarantee that the locks work during the running of the report, because if a submit of one job (in the chain of function modules that ends with CLOSE_JOB) ends and unlock before other submit begins to work, one user or one job lock any entry and then you know the result, the failure of job and then begin what documents are updated and what not. I remember when after some changes in customizing I run this report and it's difficult to find the right time to do it, so, for a bigger volume of date it must be a nightmare.

I hope this helps you

Regards

Eduardo

Answers (1)

Answers (1)

Lakshmipathi
Active Contributor
0 Kudos

I am afraid there is very remote chance of getting a suitable suggestion from this forum especially to this query Better to post in ABAP forum.

thanks

G. Lakshmipathi

JimSpath
Active Contributor
0 Kudos

Lakshmipathi:

Perhaps you are right, though I live for remote chances. We shall see if there are any responses here. I considered the ABAP forum and decided against it, as this is not primarily a coding question. We can write the code if the business logic makes sense. The goal of the question is to air the business process logic in public. On the ASUG SD forum, one of my peers said that solving this challenge will help many others. Thanks!

Jim