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

Check customer's locking

Former Member
0 Likes
1,446

Hey, there.

I'm searching for a FM which checks if a customer is locked by another user or not.

I have a FM which makes a batch input of XD02 transaction and I want to know before the BI proccessing if sombodey is editing the customer data at the same time and build an error message appropiatally.

Thanks in advace,

R.R.

1 ACCEPTED SOLUTION
Read only

former_member182371
Active Contributor
0 Likes
874

Hi,

try to do something like:

CALL FUNCTION 'ENQUEUE_EXKNA1'

EXPORTING

KUNNR = KNA1-KUNNR

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2.

CASE SY-SUBRC.

WHEN 1.

SPERR_USER = SY-MSGV1.

MESSAGE E042 WITH KNA1-KUNNR SPERR_USER.

"von anderem Benutzer gesperrt

WHEN 2.

MESSAGE E038. "Systemfehler

ENDCASE.

Best regards.

Hi,

try to do something like:

CALL FUNCTION 'ENQUEUE_EXKNA1'

EXPORTING

KUNNR = KNA1-KUNNR

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2.

CASE SY-SUBRC.

WHEN 1.

SPERR_USER = SY-MSGV1.

MESSAGE E042 WITH KNA1-KUNNR SPERR_USER.

"von anderem Benutzer gesperrt

WHEN 2.

MESSAGE E038. "Systemfehler

ENDCASE.

Best regards.

3 REPLIES 3
Read only

Former Member
0 Likes
874

Hi Rebeka,

I will try to find it out and send you on Moday.

Darshan

Read only

former_member182371
Active Contributor
0 Likes
875

Hi,

try to do something like:

CALL FUNCTION 'ENQUEUE_EXKNA1'

EXPORTING

KUNNR = KNA1-KUNNR

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2.

CASE SY-SUBRC.

WHEN 1.

SPERR_USER = SY-MSGV1.

MESSAGE E042 WITH KNA1-KUNNR SPERR_USER.

"von anderem Benutzer gesperrt

WHEN 2.

MESSAGE E038. "Systemfehler

ENDCASE.

Best regards.

Read only

0 Likes
874

Thanks, Pablo.

You had been very helpful (and won 10 points...)