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

Going around termination and continuing processing other documents in a report

Former Member
0 Likes
1,146

Dear all,

we wrote a report in which values of a field in selected sales documents are changed.

Problem:  Upcoming an error while saving a document, such as duplicated purchase order, the whole program is terminated, leaving

other selected documents unprocessed.

What a user see:  the program report an error, with "Enter" the whole report is end.

Errors are trigged in

CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'

How to go around the termination and continue to process other selected documents?

Thanks a lot!

Best Regards


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,109

In its attributes the FM is not released and it has no content under EXCEPTIONS.

Is it necessary to change the FM to released in order to catch the error?

Thank you very much!

Best regards

Dear all,

we wrote a report in which values of a field in selected sales documents are changed.

Problem:  Upcoming an error while saving a document, such as duplicated purchase order, the whole program is terminated, leaving

other selected documents unprocessed.

What a user see:  the program report an error, with "Enter" the whole report is end.

Errors are trigged in

CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'

How to go around the termination and continue to process other selected documents?

Thanks a lot!

Best Regards


7 REPLIES 7
Read only

gouravkumar64
Active Contributor
0 Likes
1,109

Hello,

Not sure,but may be some problem in NUMBER RANGE !!!

Thanks

Gourav.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,109

Well this is not a BAPI so errors may arise in call FM or COMMIT-WORK, so could you try :

  • Check your data before calling FM
  • Catch errors with TRY/ENDTRY
  • Execute update in another LUW (e.g. calling a FM starting a new task)
  • Use a BAPI like BAPI_SALESORDER_CHANGE

Regards,

Raymond

Read only

Former Member
0 Likes
1,109

Used is a SAP Standard FM for update, there are no exceptions raised. Further more,

"commit work and wait." is used in this function module.

Is there a possibility to go around errors and continuing processing?

Thanks very much!

Read only

0 Likes
1,109

You can always catch ERROR_MESSAGE in the EXCEPTIONS option of the CALL FUNCTION statement even if the function has no exception in its signature.

Used is a SAP Standard FM for update

Yes, but check its atributes, it is not released (so use at your[company] risk) even if widely used.

(Use of Standard SAP function modules in custom development)

Regards,

Raymond

Read only

Former Member
0 Likes
1,110

In its attributes the FM is not released and it has no content under EXCEPTIONS.

Is it necessary to change the FM to released in order to catch the error?

Thank you very much!

Best regards

Read only

0 Likes
1,109

No, you must not change a standard object if no proven and important need. You would thennrequire an acces key. (http://service.sap.com/sscr)

CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
   EXPORTING
     referenced_document_number = ' '
     referenced_document_type   = ' '
     synchron                   = ' '
     i_no_messages              = ' '
     status_buffer_refresh      = 'X'
     requisition_buffer_refresh = 'X'
     referenced_notification    = ' '
     referenced_pm_order        = ' '
     RESULT                     = ' '
     i_vbakkom_ref              = i_vbakkom_ref
   IMPORTING
     evbak                      = evbak
   TABLES
     efxvbep                    = efxvbep
     efxvbap                    = efxvbap
     attr_tab                   = attr_tab
     efxvbpa                    = efxvbpa
   EXCEPTIONS
     error_message              = 1.

Regards,

Raymond

Read only

0 Likes
1,109

Yes we catched error messages without change of attributes of FMs

via

   EXCEPTIONS 

  error_message              = 1. 

in CALL FUNCTION instruction

Now all left documents are processed.

Thanks a lot for your help!

Best regards