i am calling the FM 'JOB_OPEN' in my code to catch the error message when sy-subrc ne 0 but it is giving dump as there is nothing coming in sy-msgid, sy-msgtype. but when i just run this FM in SE37 then I am able to get the error for example when I pass blank for jobname then error comes is 'job missing' which is fine.
But this error I am not able to display from ABAP code which is as :
CALL FUNCTION 'JOB_OPEN'
jobname = g_jobname
jobcount = g_jobcount
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Please suggest how to correct it ???