This is just tiny shot, that can save a time ;-) Of course you could check any output type in a similar way.
Method definition:
METHODS:
is_zrea_processed
IMPORTING iv_vbeln TYPE string
RETURNING value(rv_zrea_processed) TYPE abap_bool. " Yes/No
Method implementation:
METHOD is_zrea_processed.
DATA: lt_nast TYPE STANDARD TABLE OF nast,
lt_nastx TYPE STANDARD TABLE OF nast,
ls_key TYPE msg1,
lt_key TYPE STANDARD TABLE OF msg1.
ls_key-sign = 'I'.
ls_key-option = 'EQ'.
ls_key-low = iv_vbeln.
APPEND ls_key TO lt_key.
CALL FUNCTION 'RV_MESSAGE_READ'
EXPORTING
msg_kappl = 'V2'
TABLES
msg_xnast = lt_nastx
msg_ynast = lt_nast
ri_objky = lt_key.
FIELD-SYMBOLS: <fs_nast> TYPE nast.
READ TABLE lt_nast ASSIGNING <fs_nast> WITH KEY objky = 'ZREA'.
IF ( <fs_nast> IS ASSIGNED ) AND ( <fs_nast>-vstat EQ '1').
rv_zrea_processed = abap_true.
ELSE.
rv_zrea_processed = abap_false.
ENDIF.
ENDMETHOD. "is_zrea_processed
No comments:
Post a Comment