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

FM VIEW_ENQUEUE

Former Member
0 Likes
1,064

Hi All,

I am using fm VIEW_ENQUEUE to enqueue the records of the table but the problem is even when a range is passed then also it is locking the whole table..

I want it to lock only those p[articular records so that some other user can update other records simultaneously..

please help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
723

Yes I am passing X to that paramenter..

But instead of passing any view name i am passing table name to it..

So can you please suggest something

3 REPLIES 3
Read only

Former Member
0 Likes
723

Hi,

are you passing an 'X' to parameter ENQUEUE_RANGE ??

DATA rangetab LIKE vimsellist OCCURS 1 WITH HEADER LINE.
  CLEAR: rangetab, rangetab[].
  rangetab-viewfield = 'TYPE'.
  rangetab-operator  = 'EQ'.
  rangetab-value     = etype.
  rangetab-tabix     = 2.
  rangetab-ddic      = 'S'.
  rangetab-converted = 'X'.
  APPEND rangetab.

  CALL FUNCTION 'VIEW_ENQUEUE'
    EXPORTING
      action               = 'E'
      enqueue_mode         = 'E'
      view_name            = 'VUSREXTID'
      enqueue_range        = 'X'
    TABLES
      sellist              = rangetab
    EXCEPTIONS
      client_reference     = 1
      foreign_lock         = 2
      invalid_action       = 3
      invalid_enqueue_mode = 4
      system_failure       = 5
      table_not_found      = 6
      OTHERS               = 7.

Read only

Former Member
0 Likes
724

Yes I am passing X to that paramenter..

But instead of passing any view name i am passing table name to it..

So can you please suggest something

Read only

0 Likes
723

Hi Palak,

Check this out,

ld_viewname LIKE ocus-table

ld_error.

DATA lt_sellist LIKE vimsellist OCCURS 0 WITH HEADER LINE.

CLEAR ld_error.

lt_sellist-viewfield = 'AFAPL'.

lt_sellist-operator = 'EQ'.

lt_sellist-value = ld_afapl.

lt_sellist-ddic = 'B'.


> see if this helps

APPEND lt_sellist.

CALL FUNCTION 'VIEW_ENQUEUE'

EXPORTING

action = vcl_enq_action

enqueue_mode = 'E'

view_name = ld_viewname

enqueue_range = 'X'

TABLES

sellist = lt_sellist

EXCEPTIONS

client_reference = 1

foreign_lock = 2

invalid_action = 3

invalid_enqueue_mode = 4

system_failure = 5

table_not_found = 6

OTHERS = 7.

CASE sy-subrc.

WHEN 0.

CLEAR ld_error.

WHEN 2.

ld_error = 'L'. " Tabelle gelockt

WHEN OTHERS.

ld_error = 'X'. " Systemfehler.

ENDCASE.

CLEAR sy-subrc.

ENDFORM. " ENQUEUE_TABLES

Hope it helps you,

Abhijit G. Borkar