Skip to Content
avatar image
Former Member

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


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.

  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
                                        CHANGING vake-kotabnr.

    CLEAR eine-werks.
    PERFORM kond_parameter_setzen_refr USING space.

  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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 05, 2015 at 06:58 AM

    Nice technical explanation but I somehow feel some basic logic is missing.

    You extend the info record to a new plant, which means a new level of information.

    How can you expect that this level gets a price from condition records?

    Condition records are dependent data, they cannot exist before the info record at this level exists, hence you can't have a price based on info records, prices are to be loaded with COND_A Idoc.

    You may want to go through my blogs Stumbling blocks in purchasing info record migration by LSMW IDOC method and Difficulties in price condition load for purchasing info records with COND_A IDoc method

    Add comment
    10|10000 characters needed characters exceeded