Skip to Content

BAPI_PRODORDCONF_CREATE_TT confirmation issues

Hi Experts,

I need some advice about prod. ord. confirmation using bapi BAPI_PRODORDCONF_CREATE_TT in SAP R/3 7.00.

This works fine 99'9% of time, but sometimes I get OK from the bapi but still remaining errors in CO1P, wich prevents furter operation in this order (I need to settle the order trough batch input in KO88 and cancel notification through BAPI_PRODORDCONF_CANCEL in case KO88 fails)

I've tried all combinations of parameter POST_WRONG_ENTRIES with same results, BAPI always returns OK but confirmation still incomplete and order blocked for further processing until somebody resolves CO1P/COGI manually.

The error in CO1P usually has a "Backflush" message.

Is there any way to force a bapi failure in case something goes wrong in confirmation, avoiding CO1P/COGI? Or is it posible to catch an process such errors before KO88 or BAPI_PRODORDCONF_CANCEL?

I've searched forum and wiki and nobody seems to have trouble with this issue (maybe there's an OSS note wich solves it)

thanks and regards,

F. Blay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 18, 2007 at 03:41 PM

    Done!

    I'll explain becaus sb could have the same problem.

    We can check if confirmation has finished completely using BAPI_PRODORDCONF_GETDETAIL which indicates if goods movements are already done.

    Sample code:

    FUNCTION ZCHECKLOCKOF.
    *"----------------------------------------------------------------------
    *"*"Interfase local
    *"  IMPORTING
    *"     REFERENCE(I_RUECK) TYPE  CO_RUECK
    *"     REFERENCE(I_RMZHL) TYPE  CO_RMZHL
    *"     REFERENCE(I_TRIES) TYPE  I DEFAULT 3
    *"  EXCEPTIONS
    *"      BLOCKED
    *"      MOVERROR
    *"----------------------------------------------------------------------
    
      DATA tp_tries  TYPE sy-tabix.
      DATA wa_return           TYPE BAPIRET1.
      DATA wa_conf_detail      TYPE BAPI_PP_CONFIRM.
      DATA ta_gdgoodsmovements TYPE TABLE OF BAPI2017_GM_ITEM_SHOW.
      DATA ta_failedgmoves     TYPE TABLE OF BAPI_CORU_FGM.
      DATA wa_failedgmoves     TYPE BAPI_CORU_FGM.
    
      tp_tries = 1.
    
    *"Infinite loop
      WHILE 0 = 0.
    
        CLEAR sy-subrc.
        CLEAR wa_return.
        CLEAR wa_conf_detail.
        REFRESH ta_gdgoodsmovements.
        REFRESH ta_failedgmoves.
    
        CALL FUNCTION 'BAPI_PRODORDCONF_GETDETAIL'
          EXPORTING
            confirmation              = i_rueck
            confirmationcounter       = i_rmzhl
          IMPORTING
            RETURN                    = wa_return
            CONF_DETAIL               = wa_conf_detail
          TABLES
            GOODSMOVEMENTS            = ta_gdgoodsmovements
            FAILEDGMOVES              = ta_failedgmoves.
    
        IF  sy-subrc <> 0 OR ta_failedgmoves[] IS NOT INITIAL.
    
    *"      Some goods movements not yet done
    
             READ TABLE ta_failedgmoves INTO wa_failedgmoves WITH KEY MSG_TYPE = 'E'.
            IF sy-subrc = 0.
    
    *"        Some goods movement has an error so exit
               RAISE MOVERROR.
    
             ENDIF.
    
    *"    ORDER blocked
           IF tp_tries GE i_tries.
    
    *"        Limit of tries reached
            RAISE BLOCKED.
    
           ENDIF.
    
         ELSE.
    
    *"    ORDER not blocked
           EXIT.
    
        ENDIF.
    
    *" Wait 1 sec. and increment tries
        WAIT UP TO 1 SECONDS.
        tp_tries = tp_tries + 1.
    
      ENDWHILE. " 0 = 0?
    
    ENDFUNCTION.
    

    regards

    Edited by: Francisco Blay on Jul 9, 2009 7:21 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2019 at 03:10 AM

    I had the same problem. Thank you :)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.