Skip to Content
0
Former Member
Dec 22, 2012 at 01:20 PM

How to handle exceptions while calling a function module without interrupt the program execution

70 Views

Hi Experts,

I have developed program to import excel into sap. And i am creating Opportunities by passing that excel data.

My excel has 300 rows, when i am executing the program if get an error the program has to continue the execution by skipping that that record and that record has to place in the error table. After the program execution it has to display successful records as well error records which are not saved in the database.

For this i am able to display successful records but not error ones.

I am calling below function module.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

IT_OPPORT_H = IT_OPPORT_H

IT_PARTNER = IT_PARTNER

IMPORTING

ET_EXCEPTION = ET_EXCEPTION

CHANGING

CT_ORDERADM_H = it_orderadm_h

* CT_ORDERADM_I = it_orderadm_i

CT_INPUT_FIELDS = it_input_fields

ct_partner_attributes = it_partner_attributes

EXCEPTIONS

ERROR_OCCURRED = 1

DOCUMENT_LOCKED = 2

NO_CHANGE_ALLOWED = 3

NO_AUTHORITY = 4

OTHERS = 5

.

In this if sy-subrc <> 0.

the error message has move error table and program will continue with next record.

Can anyone please tell me how to do this.

Thanks in advance.

Regards,

Suman