Skip to Content

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

Intercompany Transport Order line item GR/IR indicators

I have a requirement to retrieve an actual price based on an intercompany transport order line item based on the below scenarios:

  1. 1. If the line item has a Goods Receipt but no Invoice receipt, use the current month actual rate based on the goods issue date, or
  2. 2. If the line item has an Invoice Receipt but no Goods Receipt, use the previous month actual rate based on the goods issue date.

I thought I could just grab the fields EKPO-ELIKZ (Delivery Indicator, ‘X’) and EKPO-EREKZ (Final invoice indicator, ‘X’) to by the purchase order number and line item and get the desired results. After debugging, I’m not sure this is completely accurate and was wondering if there were additional steps I need to consider?  Any help would be appreciated!


Here is my current code section I applied this to:


[code]

     SELECT SINGLE elikz erekz FROM ekpo

            INTO (gr_indicator, invoice_indicator)

            WHERE ebeln EQ materials-ebeln

              AND ebelp EQ materials-ebelp.

         IF gr_indicator = 'X' AND invoice_indicator IS INITIAL.

           IF post_per NE materials-wadat+4(2).     "If posting period does not equal the goods issue date, use goods issue date

             poper = materials-wadat+4(2).

             bdatj = materials-wadat(4).

           ELSE.                                                  "Get previous month of goods issue date

             IF materials-wadat+4(2) EQ '01'.

               poper = 12.

               bdatj = materials-wadat(4) - 1.

             ELSE.

               poper = materials-wadat+4(2) - 1.

               bdatj = materials-wadat(4).

             ENDIF.

           ENDIF.

         ELSEIF invoice_indicator = 'X' AND gr_indicator IS INITIAL.         "Use current month of goods issue date

           "Use current rate

           poper = materials-wadat+4(2).

           bdatj = materials-wadat(4).

         ELSE. "No GR or IR                                 "Catch all, use current month of goods issue date

           poper = materials-wadat+4(2).

           bdatj = materials-wadat(4).

     ENDIF.

[/code]

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question