cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid new deliveries for a purchase order

LuisRocco
Explorer
0 Kudos

Hi, I need some help on how should be the logic to avoid the creation of a new delivery for a purchase order.

I tried through abap code at USEREXIT_SAVE_DOCUMENT_PREPARE of MV50AFZ1, but with no luck.

      SELECT vbeln posnr vgbel vgpos
        INTO CORRESPONDING FIELDS OF TABLE lt_lips
        FROM lips
        FOR ALL ENTRIES IN xlips
        WHERE vgbel = xlips-vgbel
          AND vgpos = xlips-vgpos.

      SORT lt_lips BY vgbel vgpos.

      LOOP AT xlikp ASSIGNING <fs_likp> WHERE updkz NE 'D'.
        LOOP AT xlips ASSIGNING <fs_lips>
                         WHERE vbeln EQ <fs_likp>-vbeln
                           AND updkz NE 'D'.

          READ TABLE lt_lips TRANSPORTING NO FIELDS WITH KEY vgbel = <fs_lips>-vgbel
                                                             vgpos = <fs_lips>-vgpos BINARY SEARCH.
          IF sy-subrc EQ 0.
            MESSAGE e002(zmm76).
          ENDIF.
        ENDLOOP.
      ENDLOOP.
View Entire Topic
0819
Explorer
0 Kudos

Hi,

Is there any information for select? All logic is executed but no message?