Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Locking reservation number using ENQUEUE_EMRKPF

ANSHUMAN10
Explorer
0 Likes
1,278

Hi Experts,

I am using FM CO_WB_MAINTAIN_GOODS_MOVEMENTS to update the goods movement.

Before that I want to lock the reservation number so that other users dont access the same one.

I found FM ENQUEUE_EMRKPF which can do this .

I am not sure which import parameters should I pass to it. Could anyone please suggest me the same ?

Also ,suggest me if there is any better way for it.

Thanks in advance !

Regards,

Anshuman.

1 ACCEPTED SOLUTION
Read only

ANSHUMAN10
Explorer
0 Likes
782

Thanks for the help the issue was resolved using the code

CALL FUNCTION 'ENQUEUE_EMRKPF'

EXPORTING

*   MODE_RKPF            = 'E'

*   MANDT                = SY-MANDT

   RSNUM                = pt_gm_tab-rsnum

*   X_RSNUM              = ' '

*   _SCOPE               = '2'

*   _WAIT                = ' '

*   _COLLECT             = ' '

EXCEPTIONS

   FOREIGN_LOCK         = 1

   SYSTEM_FAILURE       = 2

   OTHERS               = 3

          .

2 REPLIES 2
Read only

Former Member
0 Likes
782

Hi Barua,

You can try with this.

LOOP AT DRKPF.
       CALL FUNCTION 'ENQUEUE_EMRKPF'
         EXPORTING
             RSNUM          = DRKPF-RSNUM
         EXCEPTIONS
             FOREIGN_LOCK   = 2
             SYSTEM_FAILURE = 3.
       CASE SY-SUBRC.
         WHEN 2.
           IF SY-PFKEY NE 'FEHLER'.
             SET PF-STATUS 'FEHLER'.
             MOVE 'STANDARD' TO PF_ALT.
             MOVE X TO XFEHLER.
             DELETE DRKPF.
           ENDIF.
*         xclose = x.
*         perform next_row using 2 space.
           WRITE 02 DRKPF-RSNUM.
         WHEN 3.
           MESSAGE E110.
       ENDCASE.

For reference please refer the standard report RM07RVER (Manage reservations).

Regards,

Ramya R

Read only

ANSHUMAN10
Explorer
0 Likes
783

Thanks for the help the issue was resolved using the code

CALL FUNCTION 'ENQUEUE_EMRKPF'

EXPORTING

*   MODE_RKPF            = 'E'

*   MANDT                = SY-MANDT

   RSNUM                = pt_gm_tab-rsnum

*   X_RSNUM              = ' '

*   _SCOPE               = '2'

*   _WAIT                = ' '

*   _COLLECT             = ' '

EXCEPTIONS

   FOREIGN_LOCK         = 1

   SYSTEM_FAILURE       = 2

   OTHERS               = 3

          .