Skip to Content
0

Partial confirmation of process order

Dec 30, 2016 at 03:32 PM

169

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Raghu Govindarajan Jan 17, 2017 at 12:44 PM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

It is a incredible way to wait an object be released. I have replaced my code to this.

Thank you!

0
Venkat Sri Jan 02, 2017 at 10:32 AM
0

Dear Enio,


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

Best Regards

Venkat

Share
10 |10000 characters needed characters left characters exceeded
Enio Rafael Jan 17, 2017 at 11:15 AM
0

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.
Share
10 |10000 characters needed characters left characters exceeded