Skip to Content

FM to update Production order Settlement quantity

Hello everyone


I need to change the quantity of the settlement in the production order.
Tcode CO02 - Header - Settlement rule

The IBAPI_ALM_ORDERSRULE_CHANGE should do it but I continuously failing to use it.

The function always ending with the error message: Log not found (in main memory)

Performing some debugging, the function IBAPI_EINZELREGVERPROBEN_KOBS is the one that is returning the error message.

We can see the note 1471675 has been implemented. But the perform gt_cobra_buf_get is generating the error.

I just need to update the quantity of the settlement.

All suggestion will be highly appreciated.

Regards

DATA: ls_COBL     TYPE BAPI_ALM_ORDER_COBL,
      ls_COBL_UP  TYPE COBL_IBAPI_UPDATE,            
      ls_CAUFVD   TYPE CAUFVD,            
      ls_AFVGD    TYPE AFVGD,            
      lt_PS_MESSAGES TYPE PS_MESSAGES.  

SELECT SINGLE plnbez INTO @DATA(lv_matnr)                
         FROM afko              
        WHERE aufnr = '000000501483'.  

" Production order number  
SELECT SINGLE objnp INTO @DATA(lv_objnp)                
         FROM afpo 
        WHERE aufnr = '000000501483'   " Production order number                     AND matnr = @lv_matnr.

SELECT SINGLE * INTO CORRESPONDING FIELDS OF ls_cobl                
         FROM cobrb              
        WHERE rec_objnr1 = lv_objnp.  

ls_cobl-AQZIF = 0.          

" Change quantity to 0  
ls_cobl_up-AQZIF = 'X'.   

" Update this field  
ls_caufvd-objnr = ls_cobl-objnr.  

CALL FUNCTION 'IBAPI_ALM_ORDERSRULE_CHANGE'    
    EXPORTING  is_cobl        = ls_cobl      
               is_cobl_up     = ls_cobl_up      
               is_caufvd      = ls_caufvd
*     IS_AFVGD                      =   
    IMPORTING  ET_MESSAGES                   = lt_PS_MESSAGES   
   EXCEPTIONS  ERROR_CHANGING_SRULE          = 1    
               ERROR_READING_SRULE           = 2     
               MANDATORY_FIELD_MISSING       = 3     
               OTHERS                        = 4.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 31, 2017 at 01:58 PM

    Hello everyone

    I am sorry, I just realized that I already asked this question.

    But no one has answer yet.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 09, 2017 at 09:57 PM

    Hello everyone

    I just realized that I did ask that question but in another forum where no one has answered.

    So the question is still up to date.

    it is now a little urgent to find a solution to update the production order settlement quantity.

    The current process is using a phantom part as header. But the quantity and cost calculation take into account that phantom part. The problem is the real components cost are split with that phantom part. It should not. This phantom part should have a quantity at 0 where the components are sharing the costs. That is why we need to have that header material quantity at 0.

    All suggestions will be highly appreciated.

    Regards

    Daniel

    Add comment
    10|10000 characters needed characters exceeded