‎2010 Apr 20 1:03 PM
hi ,
i got syntax error like below
passing the formal parameter "SUBRC" to the fields SY-SUBRC is not appropriate since
SY-SUBRC is set by statement
the code is like below,
FORM view_sap_locks.
DATA: l_num_locks LIKE sy-tabix.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gclient = sy-mandt
gname = c_order
guname = space
IMPORTING
number = l_num_locks
subrc = sy-subrc
TABLES
enq = t_saplocks
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
please tell me how to proceed
‎2010 Apr 20 1:10 PM
The dump analysis states the reason clearly. You have to define an auxiliary variable V_SUBRC & pass to the FM:
DATA: v_subrc TYPE sy-subrc.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gclient = sy-mandt
gname = c_order
guname = space
IMPORTING
number = l_num_locks
subrc = v_subrc "Use v_subrc here
TABLES
enq = t_saplocks
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.Cheers,
Suhas
‎2010 Apr 20 1:10 PM
The dump analysis states the reason clearly. You have to define an auxiliary variable V_SUBRC & pass to the FM:
DATA: v_subrc TYPE sy-subrc.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gclient = sy-mandt
gname = c_order
guname = space
IMPORTING
number = l_num_locks
subrc = v_subrc "Use v_subrc here
TABLES
enq = t_saplocks
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.Cheers,
Suhas
‎2010 Apr 20 1:11 PM
Hi
Declare SY-SUBRC into Local variable like
DATA : L_SUBRC type SY_SUBRC and pass the L_SUBRC in the function module instead of SY_SUBRC.
Check and let me know.
‎2010 Apr 20 1:13 PM
Hello,
DATA: l_num_locks LIKE sy-tabix.
DATA lv_RC type sy-subrc.----
Add this line to your code
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gclient = sy-mandt
gname = c_order
guname = space
IMPORTING
number = l_num_locks
subrc = lv_rc----
change sy-subrc to lv_rc
TABLES
enq = t_saplocks
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
and test.... I hope you will be able to proceed.....:-)
Regards,
Viahaal