Hi,
Refer to the below code..
WHILE lv_true = zif_sd_constants=>gc_true. "X
PERFORM check_inv_job_status CHANGING lv_job_fin. "Use SHOW_JOBSTATE fm here
IF lv_job_fin = zif_sd_constants=>gc_true."X
EXIT.
ENDIF.
ENDWHILE.
thanks,