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 Issue while creating Measurement Document by Call Transaction

Former Member
0 Likes
989

Hi All,

i am writing a BDC program using call transaction for transaction IK11 to create measurement documents. The input file contains measurement readings for the same measurement point at different times. The problem i face is that sporadically it is skipping say 1 in 10 records giving a message that the measuring point is locked. It seems that the system locks were not getting released by the time the next loop pass came along. so to get past this issue, i did an explicit release of the lock object for measuring points followed by an explicit commit work. However this hasnt been enough the frequency of records skipped has just reduced to 1 of 30.

Can anyone help?

The code snippet is pasted below, which shows what i have done to get past the issue.

*-----Loop for all records

LOOP AT it_struc1 INTO x_struc1.

v_linno = v_linno + 1.

*-----Filling bdcdata

PERFORM bdc_dynpro USING: 'SAPLIMR0' '1210'.

PERFORM bdc_field USING: 'BDC_OKCODE' '=GDDO',

'IMRG-POINT' x_struc1-point,

'RIMR0-DFTIM' x_struc1-dftim,

'RIMR0-DFDAT' x_struc1-dfdat,

'RIMR0-DFRDR' x_struc1-dfrdr.

PERFORM bdc_dynpro USING: 'SAPLIMR0' '5210'.

PERFORM bdc_field USING: 'BDC_OKCODE' '=BU',

'IMRG-ITIME' x_struc1-dftim,

'IMRG-IDATE' x_struc1-dfdat,

'RIMR0-CNTRC' x_struc1-cntrc,

'IMRG-READR' x_struc1-dfrdr.

*-----Create Internal format for Point

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = x_struc1-point

IMPORTING

output = x_struc1-point.

*-----Start new transaction according to parameters

PERFORM bdc_transaction USING 'IK11'.

*-----Release Locks

CALL FUNCTION 'DEQUEUE_EIMPTT'

EXPORTING

mode_imptt = 'X'

mandt = sy-mandt

point = x_struc1-point.

*-----Do Explicit Commit Work

COMMIT WORK.

*-----Clear BDC Table

REFRESH it_bdcdata.

ENDLOOP.

Hi All,

i am writing a BDC program using call transaction for transaction IK11 to create measurement documents. The input file contains measurement readings for the same measurement point at different times. The problem i face is that sporadically it is skipping say 1 in 10 records giving a message that the measuring point is locked. It seems that the system locks were not getting released by the time the next loop pass came along. so to get past this issue, i did an explicit release of the lock object for measuring points followed by an explicit commit work. However this hasnt been enough the frequency of records skipped has just reduced to 1 of 30.

Can anyone help?

The code snippet is pasted below, which shows what i have done to get past the issue.

*-----Loop for all records

LOOP AT it_struc1 INTO x_struc1.

v_linno = v_linno + 1.

*-----Filling bdcdata

PERFORM bdc_dynpro USING: 'SAPLIMR0' '1210'.

PERFORM bdc_field USING: 'BDC_OKCODE' '=GDDO',

'IMRG-POINT' x_struc1-point,

'RIMR0-DFTIM' x_struc1-dftim,

'RIMR0-DFDAT' x_struc1-dfdat,

'RIMR0-DFRDR' x_struc1-dfrdr.

PERFORM bdc_dynpro USING: 'SAPLIMR0' '5210'.

PERFORM bdc_field USING: 'BDC_OKCODE' '=BU',

'IMRG-ITIME' x_struc1-dftim,

'IMRG-IDATE' x_struc1-dfdat,

'RIMR0-CNTRC' x_struc1-cntrc,

'IMRG-READR' x_struc1-dfrdr.

*-----Create Internal format for Point

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = x_struc1-point

IMPORTING

output = x_struc1-point.

*-----Start new transaction according to parameters

PERFORM bdc_transaction USING 'IK11'.

*-----Release Locks

CALL FUNCTION 'DEQUEUE_EIMPTT'

EXPORTING

mode_imptt = 'X'

mandt = sy-mandt

point = x_struc1-point.

*-----Do Explicit Commit Work

COMMIT WORK.

*-----Clear BDC Table

REFRESH it_bdcdata.

ENDLOOP.

2 REPLIES 2
Read only

Former Member
0 Likes
744

Can you not SORT your file and update measuring point details for every measuring point one-time only? Currently, i think you are updating measuring point for each and every record.

Other option could be to check lock before starting BDC for that particular MP.

Read only

0 Likes
744

I have tried releasing the lock before the BDC, but that did not help.

I cannot sort it and upload for one measuring point one time only, as each record is a reading for a particular meas point as a recorded at a certain time, so an input file will contain say 100+ records for a single measuring point only.