Application Development 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: 

Error - DBIF_RSQL_SQL_ERROR- While updating Vendor information

Former Member
0 Kudos
148

Hi guys,

We are getting short dumps once in a while while updating vendor information (XK02/XK03). The short dump is happening at custom Enhancement point. 

I could not able to replicate this error in TEST and unable to find the problem. Do I need to change any code in this enhancement spot?? Below is the code..

 

Looks like it is a locking issue while updating..

1. Do I need to write Roll back statement after Commit?

2. Do I need to use ENQUEUE/DEQUEUE for LFA1,ADR6 and ADRC??

 

Kindly suggest. Attached Code and short dump error.

2 REPLIES 2

Former Member
0 Kudos
84

GET PARAMETER ID 'EMP_VEN' FIELD lv_emp_id.

IF lfa1-lifnr IS INITIAL.
lv_vendor
= OBJECTID.
ELSE.
lv_vendor
= lfa1-lifnr.
ENDIF.

*Get adrnr
SELECT SINGLE adrnr ktokk INTO (lv_adrnr, lv_ktokk) FROM lfa1 WHERE lifnr = lv_vendor.

*Get email
SELECT SINGLE * INTO ls_adr6 from adr6 WHERE addrnumber = lv_adrnr.

*IMPORT lv_emp_id FROM MEMORY ID 'EMP_VEN'.
IF NOT lv_emp_id IS INITIAL AND lv_ktokk = 'ZEMP'.
SELECT SINGLE * INTO ls_user FROM user_addr WHERE bname = lv_emp_id.
IF sy-subrc NE 0.
*          MESSAGE E036(ZFI_VEN) WITH lfb1-altkn.
ENDIF.

lv_fullname
= ls_user-name_textc.
DESCRIBE FIELD lv_fullname LENGTH lv_name_len IN CHARACTER MODE.
IF lv_name_len > 35.

CALL FUNCTION 'TEXT_SPLIT'
EXPORTING
length
= 35
text   = lv_fullname
IMPORTING
line   = lv_name_first
rest  
= lv_fullname.

DESCRIBE FIELD lv_fullname LENGTH lv_name_len IN CHARACTER MODE.
IF lv_name_len > 35.
CALL FUNCTION 'TEXT_SPLIT'
EXPORTING
length
= 35
text   = lv_fullname
IMPORTING
line   = lv_name_second
rest  
= lv_name_third.
ENDIF.

ELSE.
lv_name_first
= lv_fullname.
lv_name_second
= ''.
lv_name_third
= ''.
ENDIF.

CALL FUNCTION 'HR_FBN_GET_USER_EMAIL_ADDRESS'
EXPORTING
user_id      
= ls_user-bname
reaction     
= 'I'
IMPORTING
email_address
= lv_email
TABLES
error_table  
= lt_error.

lv_fullname
= lv_name_first.
lv_email_ucase
= lv_email.
SET LOCALE LANGUAGE sy-langu.
TRANSLATE lv_fullname TO UPPER CASE.
TRANSLATE lv_email_ucase TO UPPER CASE.

IF NOT lv_email IS INITIAL.

IF ls_adr6 IS INITIAL.
ls_adr6
-smtp_addr = lv_email.
ls_adr6
-addrnumber = lv_adrnr.
ls_adr6
-date_from = '00010101'.
ls_adr6
-consnumber = '2'.
ls_adr6
-flgdefault = 'X'.
ls_adr6
-home_flag = 'X'.
ls_adr6
-smtp_srch = lv_email_ucase.
INSERT INTO adr6 VALUES ls_adr6.

ELSE.
UPDATE adr6 SET smtp_addr = lv_email
smtp_srch
= lv_email_ucase
WHERE addrnumber = lv_adrnr.
ENDIF.
lv_email_flg
= 'X'.
ENDIF.
UPDATE lfa1 SET name1 = lv_name_first
name2
= lv_name_second
name3
= lv_name_third
mcod1
= lv_fullname
WHERE lifnr = lv_vendor.
UPDATE adrc SET name1 = lv_name_first
name2
= lv_name_second
name3
= lv_name_third
mc_name1
= lv_fullname
flagcomm6
= lv_email_flg
WHERE addrnumber = lv_adrnr.

IF sy-subrc = 0.
COMMIT WORK.
ENDIF.

IF sy-subrc NE 0.
*Do nothing
ENDIF.

0 Kudos
84

Any answers??