a week ago
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.
Hi, finally I got the solution, the check should be against EKBE table.
DATA: lt_ekbe TYPE TABLE of ekbe.
IF sy-batch EQ abap_true.
IF likp-vbeln+0(1) EQ '$'.
LOOP AT xlips INTO DATA(ls_lips).
SELECT belnr buzei
INTO CORRESPONDING FIELDS OF TABLE lt_ekbe
FROM ekbe
WHERE ebeln = ls_lips-vgbel
AND ebelp = ls_lips-vgpos.
IF sy-subrc EQ 0.
MESSAGE w000(zmm76) WITH 'Ya existe una entrega para la PO '
ls_lips-vgbel
'posición'
ls_lips-vgpos.
LEAVE SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it that you want to prevent delivery creation only for one purchase order or multiple open POs ? What exactly the Business requirement is ? Please share some information on Business requirement so that, it will be easy to assist you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not just tick the "Delivery completed" checkbox on the purchase order item?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is there any information for select? All logic is executed but no message?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
14 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.