Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

IW32 validation in for tab "Operation"

I want a validation in the action of removing the transaction "IW32" tab "operations" have tested different user exit however nothing meets my need, all I tested are not executed at the time of removal.
Any suggestions?

Former Member
Former Member replied

For the record, I got a resolution to the issue. It was necessary to create an "enhancement" in LCODTU03 include used by this transaction, in last place, with the code below.


DATA: BEGIN OF WL_EKPO,
         EREKZ TYPE EKPO-EREKZ,
         ELIKZ TYPE EKPO-ELIKZ,
         BNFPO TYPE EKPO-BNFPO,
         BANFN TYPE BANFN,
       END OF WL_EKPO,

       BEGIN OF WL_EBAN,
         BANFN TYPE EBAN-BANFN,
         EBELN TYPE EBAN-EBELN,
         FRGZU TYPE EBAN-FRGZU,
         BNFPO TYPE EBAN-BNFPO,
       END OF WL_EBAN.

   DATA: VMSG    TYPE BAPI_MSG.

   IF ( SY-TCODE EQ 'IW32' )
   AND ( SY-UCOMM EQ 'OPT1' )
   AND ( AFVGD-BANFN IS NOT INITIAL ).
     SELECT SINGLE BANFN EBELN FRGZU BNFPO
       FROM EBAN
       INTO CORRESPONDING FIELDS OF WL_EBAN
       WHERE BANFN = AFVGD-BANFN
        AND  BNFPO = AFVGD-VORNR.

     CHECK SY-SUBRC IS INITIAL.

     IF WL_EBAN-FRGZU = 'X'.
       SELECT SINGLE EREKZ ELIKZ BNFPO BANFN
         FROM EKPO
         INTO CORRESPONDING FIELDS OF WL_EKPO
         WHERE BANFN = WL_EBAN-BANFN
          AND  BNFPO = WL_EBAN-BNFPO.

       IF SY-SUBRC IS INITIAL.
         CONCATENATE 'Existem requisição aprovada (' WL_EBAN-BANFN '), pedido (' WL_EBAN-EBELN ') para o componente ('WL_EBAN-BNFPO').' INTO VMSG.
         MESSAGE VMSG TYPE 'I'.
         SUBRC = 4.
         MESSAGE E398(00) WITH 'Não foi possível eliminar o item.'.
       ELSE.
         CONCATENATE 'Existem requisição aprovada (' WL_EBAN-BANFN ') para o componente ('WL_EBAN-BNFPO').' INTO VMSG.
         MESSAGE VMSG TYPE 'I'.
         SUBRC = 4.
         MESSAGE E398(00) WITH 'Não foi possível eliminar o item.'.
       ENDIF.
     ENDIF.
   ENDIF.


Grateful for everyone's help;

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question