Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2151

CO11N Confirmation in BAPI

$
0
0

hi Expert,

Hi Im Using a BAPU for Production Order Confirmation and It is configured for the Milestone Confirmation. When 2nd Operation is confirmed, 1st operation  also confirm.

Issue is,

Even though it is working fine operation time for the 2nd operation is not captured. See the snap shot of AFRU table bellow.

Image 1.jpg

 

Im using these BAPI for Confirmation.

BAPI_PRODORDCONF_GET_TT_PROP

BAPI_PRODORDCONF_CREATE_TT

 

See the code for reference.

 

 

       i_link-index_confirm = '1'.

       i_link-index_goodsmov = '1'.

       append i_link.

 

       perform fill_timeticket.

 

       call function 'BAPI_PRODORDCONF_GET_TT_PROP'

         exporting

           propose            = propose

         tables

           timetickets        = lt_timetickets

           goodsmovements     = i_gm

           link_conf_goodsmov = i_link

           detail_return      = lt_return.

 

       read table lt_return with key type = 'E'.

       if sy-subrc = 0.

         call function 'BAPI_TRANSACTION_ROLLBACK'.

         message s303(me) display like 'E'

                        with lt_return-message.

         write : lt_return-message.

       else.

         read table lt_return index 1.

         call function 'BAPI_TRANSACTION_COMMIT'.

 

         perform fill_timeticket.

 

         clear: ls_return, lt_return[], lt_return-conf_no, lt_return-conf_cnt.

         refresh : lt_return[].

 

         call function 'BAPI_PRODORDCONF_CREATE_TT'

           importing

             return             = ls_return

           tables

             timetickets        = lt_timetickets

             goodsmovements     = i_gm

             link_conf_goodsmov = i_link

             detail_return      = lt_return.

 

         read table lt_return with key type = 'E'.

         if sy-subrc eq 0.

           call function 'BAPI_TRANSACTION_ROLLBACK'.

           message s303(me) display like 'E'

                            with lt_return-message.

 

           write : lt_return-message.

         else.

           read table lt_return index 1.

           call function 'BAPI_TRANSACTION_COMMIT'.

           wait up to 6 seconds.

           message s303(me) with lt_return-message.

           if lt_return-conf_no is not initial and lt_return-conf_cnt is not initial.

             message 'Wade Goda' type 'I'.

           endif.

           "Write Comfirmation here

         endif.

 

       endif.


**********************************


form fill_timeticket.

   clear   : lt_timetickets.

   refresh : lt_timetickets.

 

   lt_timetickets-orderid   = wa_gish-zaufnr.

   lt_timetickets-operation = '0020'.

   lt_timetickets-yield     = wa_gish-zquantity.

   lt_timetickets-scrap     = wa_gish-zscrap.

 

 

   select single rueck

     into lt_timetickets-conf_no

     from afru

    where aufnr eq wa_gish-zaufnr

      and vornr eq lt_timetickets-operation.

 

   append lt_timetickets.

endform.


Viewing all articles
Browse latest Browse all 2151

Trending Articles