Skip to Content

Partial confirmation of process order

Hi everyone.

I'm having a problem about the process order's confirmation. I want the confirmation always as final, but I don't know what happen and sometimes it's partial.

I'm using the bapi BAPI_PROCORDCONF_CREATE_HDR to confirm, and I'm setting the field FIN_CONF to be a final confirmation.

Thanks to all who can help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 17, 2017 at 12:44 PM

    Enio,

    Thank you for posting a response as to what happened in your scenario and how you fixed it. It will really help others. I do have one suggestion though. There are other, better ways of implementing the wait. Please read my blog here Waiting for lock objects to release – using lock modes U and V, and consider using the option 4 that I laid out. Option 2 (using FM ENQUEUE_READ) will also work. Make sure that you read the comments - there is a lot of useful insight as to why the WAIT UP TO x SECONDS is not a good choice.

    Raghu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 02, 2017 at 10:32 AM

    Dear Enio,


    Make sure plant & order type confirmation parameters configuration should be selected as final confirmation radial button.

    Best Regards

    Venkat

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 17, 2017 at 11:15 AM

    Hi dears.

    I was setting the flag to be a final confirmation in the BAPI parameters. But the problem was in the execution time.

    What was I doing? After the confirmation BAPI I was calling a BAPI to change the order's user status, and the time between the bapi of final confirmation and change user status wasn't too enough. I put a sleep time and the problem was solved.

    This is the code, maybe someone can have the same problem.

          DATA(_ORDER_DATA) =
              VALUE BAPI_PI_HDRLEVEL_T( ( ORDERID        = _SHIPMENT-AUFNR
                                          FIN_CONF       = 'X'
                                          POSTG_DATE     = DATA
                                          CONF_TEXT      = 'Service confirmation'
                                          YIELD          = QUANTITY
                                       ) ).
    
    
            CALL FUNCTION 'BAPI_PROCORDCONF_CREATE_HDR'
              EXPORTING
                POST_WRONG_ENTRIES = '0'
              IMPORTING
                RETURN             = RETURN
              TABLES
                ATHDRLEVELS        = _ORDER_DATA
                DETAIL_RETURN      = RETURN_DETAILS.
    
    
            DELETE RETURN_DETAILS WHERE TYPE NE 'E'.
            IF ( RETURN_DETAILS IS INITIAL ).
              ME->MODIFY_PLANNING( _PLANNING ). "//Commit all
    
              WAIT UP TO 5 SECONDS.
    
              TRY.
                  ME->CHANGE_PO_USER_STATUS( ORDER = _SHIPMENT-AUFNR STATUS = ME->PO_STATUS-CONCLUIDO ).
                CATCH ZCX_PP_SERVICES.
              ENDTRY.
    
            ELSE.
              ME->SET_MESSAGES( RETURN_DETAILS ).
            ENDIF.
    
    Add comment
    10|10000 characters needed characters exceeded