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

LOAD_PROGRAM_NOT_FOUND

h_senden2
Active Contributor
0 Likes
1,691

Hi,

i'm having the following code which ends in a LOAD_PROGRAM_NOT_FOUND runtime error, even with the TRY-ENDTRY and CATCH-ENDCATCH solution.

On purpose i have tested it with a non-existing reportname, but i expected the program (TRY, CATCH) to handle the error in a smooth way.

TRY.

      SUBMIT (l_progname)
             AND RETURN
              VIA JOB p_jobname NUMBER p_jobcount
               TO SAP-SPOOL
                  SPOOL PARAMETERS   p_print_parms
                  ARCHIVE PARAMETERS p_arc_parms
                  WITHOUT SPOOL DYNPRO.
      PERFORM write_error_message.

*      CATCH cx_root INTO lc_error.
      CATCH CX_SY_PROGRAM_NOT_FOUND into lc_error.

  ENDTRY.

  IF lc_error IS NOT INITIAL.
    l_error_text = lc_error->get_text( ).
    WRITE: l_error_text.
    g_subrc = 25.
    EXIT.
  ENDIF.

Any suggestions ?

regards,

Hans

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,345

chk the solution given by RICH

9 REPLIES 9
Read only

Former Member
0 Likes
1,345

Hi hans,

Try without the braces:

SUBMIT l_progname

Regards,

Ravi

Read only

0 Likes
1,345

The braces are required, because i want not to start report L_PROGNAME but the dynamically filled (L_PROGNAME).

Read only

0 Likes
1,345

HI,

Are you sure, if you are getting the value of the program in L_PROGNAME?

Keep an breakpoint and see if you are getting the program name.

Or, may be the program name is not correct.

Regards,

ravi

Read only

former_member183804
Active Contributor
0 Likes
1,345

Hello Hans,

you might put your logic in a RFC-enabled module then you survive any short dump. Else you might try first an dynamic assign to any (even non existing) global variable within the report and check with LOAD REPORT PART pghead.

Regards

Klaus

Read only

Former Member
0 Likes
1,346

chk the solution given by RICH

Read only

0 Likes
1,345

That approach will miss programs with syntax-errors.

Regards

klaus

Read only

0 Likes
1,345

Of course, the solution provided by Rich does work. Also in my case.

But i want that the SAP's exception handler (try,catch) to handle the error. Just the way it works for other runtime errors.

Read only

0 Likes
1,345

Hello Hans,

no there is no way to achieve that. Check the online docu section 'not catchable' there are only 2 strategies avoid or try in seperate RFC-task.

Regards

klaus

Read only

0 Likes
1,345

As suggested by RICH , LOAD_PROGRAM_NOT_FOUND cannot be caught by TRY ..CATCH as it is not a system exception