2006 Jun 06 5:34 PM
Hello SAPients.
I have this code:
catch system-exceptions others = 1.
submit (lvc_progid) via selection-screen.
endcatch.
but the error is not catched, I always get a short dump when program doesn't exist, I also tried this:
catch system-exceptions LOAD_PROGRAM_NOT_FOUND = 1.
submit (lvc_progid) via selection-screen.
endcatch.
but when I syntax check the program I get the error "system-exception" expected, not "LOAD_PROGRAM_NOT_FOUND".
What am I doing wrong?
Thank you in advance for your help.
2006 Jun 06 5:36 PM
Try this:
TRY.
submit (lvc_progid) via selection-screen.
CATCH LOAD_PROGRAM_NOT_FOUND.
ENDTRY.
Try this:
TRY.
submit (lvc_progid) via selection-screen.
CATCH LOAD_PROGRAM_NOT_FOUND.
ENDTRY.
2006 Jun 06 5:36 PM
Try this:
TRY.
submit (lvc_progid) via selection-screen.
CATCH LOAD_PROGRAM_NOT_FOUND.
ENDTRY.
2006 Jun 06 5:45 PM
I think the TRY statement doesn't exists in 4.6C. I get the error message Statement "TRY" is not defined. Please check your spelling.
2006 Jun 06 5:49 PM
The LOAD_PROGRAM_NOT_FOUND is not a system exception. This is the reason for the sytax error.
If you are not on newer version of SAP, then the TRY statement will not be avaialbe for you. You can try this code. It checks the report name against the report program table.
report zrich_0001.
data: xtrdir type trdir.
data: report(30) type c value 'ZTEST'.
select single * from trdir
into xtrdir
where name = report.
if sy-subrc = 0.
submit (report) via selection-screen.
else.
message e001(00) with 'Program does not exists'.
endif.
Regards,
Rich Heilman
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |