2007 Sep 28 5:45 AM
Hi....I am uploading condition records from legacy system using LSMW by recording. If a duplicate record exists then the record is not appended in the condition table which is ok as standard SAP behaves in this way. My requirement is to send the duplicate record to the error file. Please suggest how to do!
Hi....I am uploading condition records from legacy system using LSMW by recording. If a duplicate record exists then the record is not appended in the condition table which is ok as standard SAP behaves in this way. My requirement is to send the duplicate record to the error file. Please suggest how to do!
2007 Sep 28 5:51 AM
Hi,
Refer the theard you may get an idea.
https://forums.sdn.sap.com/click.jspa?searchID=5559350&messageID=2400803
Regards
2007 Sep 28 6:28 AM
No that is basically not my problem....i.e, basically normal error handling...but I need to send a duplicate record to the error file.
2007 Sep 28 12:49 PM
Hi Roy,
Go through this code and analyze it and apply the logic as per ur requirement
Just write the code in the Mapping step
go to mapping step--
> u findout the pop window check the box and press enter,
there u have to declare a variable in the Global Declaration.
and in the Begin of Transactions u have to write the logic..
For Eg:
select single matnr into RLBES-MATNR from MARA
where BISMT = BINS-MATNR.
IF SY-SUBRC <> 0.
RLBES-matnr = BINS-MATNR.
MOVE-CORRESPONDING BINS TO err_file.
MOVE 'Material not created' TO err_file-error.
APPEND err_file.
WRITE : 'NO MATERIAL'.
skip_record.
endif.
__END_OF_PROCESSING__
FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = error_file_name
TABLES
DATA_TAB = err_file.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
This example used GUI_DOWNLOAD . Ofcourse this is now not recommended so you can use the latest FMs for download.
Thanks