DO 10 TIMES.
SELECT
SINGLE *
FROM mkpf
INTO ls_mkpf
WHERE mblnr = ps_goodsmvt_header-ref_mblnr
AND mjahr = ps_goodsmvt_header-ref_mjahr.
IF sy-subrc = 0.
p_rc = 0.
EXIT.
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.
DO 10 TIMES.
SELECT
SINGLE *
FROM mkpf
INTO ls_mkpf
WHERE mblnr = ps_goodsmvt_header-ref_mblnr
AND mjahr = ps_goodsmvt_header-ref_mjahr.
IF sy-subrc = 0.
p_rc = 0.
EXIT.
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.