Skip to Content

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

How to keep PO GR date in ODS when Invoice record comes in

This is for PO's ODS. With process key 2, the posting date is the GR date and with process key 3, the posting date is the Invoice Date (the GR date is not in the record).

In my update rules to the ODS, when the process key = 2, I set the posting date to the GR date and when the process key = 3 I set the posting date to an Invoice Date object. But since I don't set anything to the GR date, it is overwritten with a blank so I loose it.

Is there anyway of making sure that the process key 3 record does not overwrite a GR date object with the blank.

thanks

Suzanne

replied

Okay, I understand. If you don't fill the fields, you will get an null for the GR Date.

This will be a problem for you when you get an IR before a GR (the GR will overwrite the IR Date) and when you get the IR (overwrites the GR Date).

You can lookup the GR or IR date in your ODS if the value is null.

Something like this in the update rules' start routine <this isn't exact code>:

Loop at Data_package.

IF data_package-ZGRDATE EQ '00000000'.

SELECT * from /BIC/AZODS00 "to read from an ODS named ZODS.

INTO TABLE l_my_itab

WHERE

P0NUM = data_package-PONUM.

POITM = data_package-POITM.

IF SY-SUBRC = 0 "the PO and Item were found

data_package-ZGRDATE = l_my_itab-ZGRDATE.

ENDIF.

ENDIF.

ENDLOOP.

Basically, this code will read your PO data from ZODS into l_my_itab if your GR Date is null. Duplicate this for your IR Date.

Good luck.

Brian

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