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

program is giving dump now

Former Member
0 Likes
597

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

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
538

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

3 REPLIES 3
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
539

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

Read only

Former Member
0 Likes
538

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.

Read only

Former Member
0 Likes
538

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