9.7.11

SAP Note 26315 - ME12 ME13 ME21 Wrong purchase order in info record

Symptom:

    1. During the creation of a purchase order, the system suggests an incorrect price.
    2. In the info record, a purchase order that belongs to a different material or a different vendor is shown as the last purchase order.
Cause and prerequisites

Unknown. Possibly an undetected problem from the past.

Solution
The incorrect relationships can be cancelled with the following report. Please execute the report repeatedly at intervals in the case of long runtimes. Parameter P_UPDATE determines whether the changes are to be made in the database.


report tkmist89.

tables: ekpo, eina, ekko, lfa1, eine.
select-options: p_infnr for eine-infnr.
parameters: p_update.

select * from eine where ebeln ne space
and infnr in p_infnr.
select single * from ekpo where ebeln eq eine-ebeln
and ebelp eq eine-ebelp.
check sy-subrc eq 0.
select single * from ekko where ebeln eq ekpo-ebeln.
check sy-subrc eq 0.
select single * from eina where infnr eq eine-infnr.
check sy-subrc eq 0.
if ekko-lifnr ne eina-lifnr.
write: / 'Best. anderer Lieferant', ekko-lifnr, eina-lifnr,
eina-infnr, ekko-ebeln, ekpo-ebelp.
endif.
if ekpo-matnr ne eina-matnr.
write: / 'Best. anderes Material ', ekpo-matnr, eina-matnr,
eina-infnr, ekko-ebeln, ekpo-ebelp.
endif.
if p_update ne space.
if ekpo-matnr ne eina-matnr or
ekko-lifnr ne eina-lifnr.
* Verbindung aufheben, da nicht richtig
update eine
set
ebeln = space
ebelp = space
datlb = 0
where
infnr = eine-infnr
and ekorg = eine-ekorg
and esokz = eine-esokz
and werks = eine-werks.
endif.
endif.
endselect.

Additional key words

Info record.

No comments:

Post a Comment