Está en la página 1de 1

*&------------------------------------------------------------------------------*

*& Method:
GET_TYEP
*& Description: Get type Conditions
*&------------------------------------------------------------------------------*
method GET_TYPE.
DATA LV_PARVW TYPE PARVW.
DATA LT_KNVP TYPE TABLE OF KNVP.
DATA LS_KNVP TYPE KNVP.
DATA ls_msg TYPE ZTS_MSG.
SELECT PARVW
APPENDING CORRESPONDING FIELDS OF TABLE LT_KNVP
FROM KNVP
WHERE KUNN2 EQ IV_KUNNR AND ( PARVW EQ 'ZV' OR PARVW EQ 'ZS' ).
IF SY-SUBRC = 0.
LOOP AT LT_KNVP INTO LS_KNVP.
IF LS_KNVP-PARVW EQ 'ZV'.
EV_TYPE = 'V'.
EXIT.
ELSEIF LS_KNVP-PARVW EQ 'ZS'.
EV_TYPE = 'S'.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
ls_msg-MSGTYPE = 'E'.
MESSAGE I400(ZMSG) INTO ls_msg-MSG_TXT.
APPEND ls_msg TO ET_MSG.
ENDIF.
endmethod.