Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Intercompany Transport Order line item GR/IR indicators

0 Kudos

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]

1 REPLY 1

Former Member
0 Kudos

I would use the PO history table (EKBE) instead. There may be partial deliveries that you have to decide how to handle and I don't think you can count on users to set the 'Final' indicators.

Rob