Skip to Content

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

Price updated as 0 when PIR is extended to new plant via IDOC_INPUT_INFREC

Hi,

I am trying to extend a Purchasing Info record(PIR) to new Plant using the message type: INFREC, Idoc type: INFREC01 which use the function module IDOC_INPUT_INFREC. Though the PIR gets extended to the new plant, the price (EINE-NETPR) is updated as zero.

This I feel is due to a bug in the standard code. Below is the flow of the code which explains why this can be a bug.

  1. IDOC_INPUT_INFREC calls ME_DIRECT_INPUT_INFORECORD
  2. In ME_DIRECT_INPUT_INFORECORD, EINA_AKTYP is set to 'V', since the PIR is already existing. The variable "steukz3" is set to 'J' (JA).
  3. Inside the sub-routine: IA_VER, called in ME_DIRECT_INPUT_INFORECORD, subroutine: VORSCHLAGSWERTE is called. Inside this, sub-routine: VOR_EINE is called
  4. Because the value of steukz3 is 'J', it enters the piece of code where routine 'info_kond_erzeugen_info' is called.
  5. In "info_kond_erzeugen_info", the below code is executed, in which KOMG and VAKE structures are filled. Not sure why there is CLEAR EINE-WERKS, because of this clear the KOTABNR is determined as 018 into *VAKE-KOTABNR, though it should have been 017. Also the VAKE-DATAB and VAKE-DATBI are not determined in this code

      IF kond_copy_preis NE space OR kond_copy_sonst NE space.
*--- Parameter bis auf Konditionsart setzen --------------------------*
    eine-werks = retwerks.
    PERFORM kond_parameter_setzen.
    PERFORM kotabnr_setzen USING komg
                                                              space
                                        CHANGING vake-kotabnr.

    CLEAR eine-werks.
    PERFORM kond_parameter_setzen_refr USING space.
    ENDIF.

  6. Next in the routine: CALL_KOND_TO_KOND_COPY, function module: 'RV_COND_TO_COND_COPY' is called. Inside this FM , the access program is determined for 018 since WERKS is blank. So, the select happens on A018 instead of A017. Even though the condition records do exist in A017 , because the select is on A018, the select fails and error E102 (Exception: NO_COPY_RECORD) is thrown and control immediately exits the FM. But in the call of the FM RV_COND_TO_COND_COPY, the SUBRC value is set to 0 for EXCEPTIONS - OTHERS. Is this correct ? Because of this SY-SUBRC value, the routine : "info_kond_preis_uebernahme" is called, in which VAKE-DATAB and VAKE-DATBI are checked if they are filled. If they are not, then EINE-NETPR,  EINE-EFFPR are set to 0.

  7. I tried changing KOTABNR to 017 in debugger in the  function module: 'RV_COND_TO_COND_COPY' , then condition records created for the Material Info record(Plant-specific) got picked , but even then DATAB and DATBI in VAKE are still blank.

Could someone please let me know, whether there are any Notes to fix this issue ? Or let me know if I am doing something wrong ? I have checked for Notes but could not find any.

To recap: I need to extend already created Purchasing Info record to new Plant, and also update EINE-NETPR using message type: INFREC.

Thanks a lot.

Former Member
replied

Can you go to the conditions  from your extended info record?

I am just asking this to make sure that the information matches and system is able to find the condition from within the info record.

If yes, then run RM06INP0 and see if the info record price gets updated from the conditions

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