cancel
Showing results for 
Search instead for 
Did you mean: 

Stop quotation acceptance by BADI

Former Member
0 Kudos

Hello Guys,

I am making some checks on a quotation when it is accepted, so I implemented the BBP_DOC_CHECK_BADI for object BUS2202.

After the accept button is pressed on the Quotation screen the code in the BADI runs and the checks are done. Some messages of type E and A are being saved on the

ET_MESSAGES table parameter of the BADI.

By sending E and A messages we expect the status of the quotation doesn't change to "Accepted", but it does!

What shall we do to avoid the status change of the quotation.?

Thanks for its time.

Greetings.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

<b>Seems to me like a bug in the SRM System..</b>

Please paste your custom BADI source code in the next reply.

<u>Menawhile, please go through the following SAP OSS notes, which will help -></u>

Note 865269 Bid: Incorrect workflows, incorrect approval preview

Note 855306 Release note SRM Server 5.5 Support Package 01

Note 1059514 - Status 'To be invoiced' missing for accepted quotation

Note 616009 Selection by status 'Bid returned'

Note 634621 - GTOP21 -- Search for Bid Invitations & Bids

Do let me know.

Regards

- Atul

Former Member
0 Kudos

Will take a look at the notes.

Also sending you the code.

Thanks!

  DATA: t_item       TYPE TABLE OF bbp_pds_quot_item_d,
        x_item       TYPE bbp_pds_quot_item_d,
        e_message    TYPE bbp_smessages_badi,
        w_nombre     TYPE bdl_logfun,
        w_process    TYPE bbp_proc_type,
        w_status     TYPE xfeld,
        w_header     TYPE bbp_pds_quot_header_d,
        w_src_guid   TYPE bbp_src_i_guid,
        w_src_object TYPE bbp_src_i_obj_typ,
        w_value_1    TYPE bbp_value VALUE 0,
        w_value_2    TYPE bbp_value VALUE 0,
        w_es_item    TYPE bbp_pds_bid_item_d,
        w_e_item     TYPE bbp_pds_sc_item_d.



  IF iv_cv_updated_active_doc IS INITIAL.

* If the ACCEPT button is pressed
    IF sy-ucomm = 'QOAC'.

      w_nombre = 'VALIDAR_PRECIO_UNITARIO'.

      CALL FUNCTION 'BBP_PD_QUOT_GETDETAIL'
        EXPORTING
          i_guid          = iv_doc_guid
          i_with_itemdata = 'X'
        IMPORTING
          e_header        = w_header
        TABLES
          e_item          = t_item.

      LOOP AT t_item INTO x_item WHERE deduct_ind EQ space.

        w_value_1 = x_item-value.


        CALL FUNCTION 'BBP_PD_BID_ITEM_GETDETAIL'
          EXPORTING
            iv_guid            = x_item-src_guid
            iv_attach_with_doc = ' '
          IMPORTING
            es_item            = w_es_item.


        IF  x_item-src_object_type = 'BUS2208001'
         OR x_item-src_object_type = 'BUS2200001'.

          CALL FUNCTION 'BBP_PD_SC_ITEM_GETDETAIL'
            EXPORTING
              i_guid            = w_es_item-src_guid
              i_attach_with_doc = ' '
            IMPORTING
              e_item            = w_e_item.

          w_value_2 = w_e_item-value.

        ENDIF.

        IF w_value_2 < w_value_1.

          CLEAR e_message.
          e_message-msgty   = 'A'.
          e_message-msgid   = 'ZSRM_ERRORES'.
          e_message-msgno   = '029'.
          e_message-msgv1   =  w_es_item-number_int.
          e_message-msgv2   =  w_es_item-value.
*          e_message-msgv3   =
          APPEND e_message TO et_messages.

        ENDIF.

      ENDLOOP.

    ENDIF.

  ENDIF.