Skip to Content
Author's profile photo Former Member

RFQ Rejection in ME45


Trying to find a solution for the RFQ rejection I came across multiple threads but could not find a solution which will close the issue for me. So once I found a solution decided to share it.


In standard SAP system the RFQ release strategy does not cover rejection; it only has two options that is Release and Cancel Release.


The solution targets RFQ release using transaction ME45. The standard transaction provides user with two options.

  • RFQ Release
  • Cancel RFQ Release

To solve the rejection problem, I use the implicit enhancement option technique.

Finding the place to put my code:

When the user clicks the (Release/Cancel Release) ICON in the ALV grid, system triggers an ALV callback function. Tracing the code I reached to a METHOD rel_resetrel in include LMEREPI20. Here based on the ICON system decides to call the BAPI for Release or Cancel Release. I placed my code here

Enhancement Point:

The implicit enhancement point is created at the start of the METHOD rel_resetrel in include LMEREPI20.

As soon as the user clicks the ICON to release the RFQ, standard program triggers the callback function and finally lands in the above mentioned method. Here the enhancement checks if the action is to Release the RFQ, then a POPUP_TO_CONFIRM function is called and user is asked if he wants to Release or Reject the RFQ.

If the user selects the Release button, the enhancement doesnot proceed and leaves it to the standard system to trigger the release BAPI.

In case the user selects the Reject button, the enhancement calls a custom function Z_MM_DEL_RFQ, which through a BDC deletes all the line items of the RFQ. If the funciton returns with success, it deletes the line from the ALV table gt_outtab_purchdoc_rel, so that the line disappears once the control is returned back to the user. In case of an error system displays it.

Code Extract


METHOD rel_resetrel.“””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””$”$\SE:(1) Class LCL_REPORTING_CNT_PURCHDOC_REL, Method REL_RESETREL, Start                                                                                  A*$*$-Start: (1)———————————————————————————$*$*ENHANCEMENT ZMM_RELEASE_ME45.    “active version*If transaction code is ME45 and icon is not released yet the ask user to confirm is he wants to approve or reject
DATA ls_me45outtab       TYPE merep_outtab_purchdoc_rel.
DATA lv_me45_ans TYPE c.
FIELD-SYMBOLS: <ME45_line> LIKE LINE OF gt_outtab_purchdoc_rel.
IF sytcode = ‘ME45’ .
MOVE-CORRESPONDING im_wa TO ls_me45outtab.
IF ls_me45outtabicon_release = lcl_datablade_purchdoc_rel=>my_icon_allowed. “This means not relased yet*Ask user if he wants to release or reject(delete item)
titlebar              = ‘Decision’
= ‘Please select the required action’
= ‘Release’*         ICON_BUTTON_1         = ‘ ‘
= ‘Reject’*         ICON_BUTTON_2         = ‘ ‘
= ‘ ‘
= lv_me45_ans
= 1
OTHERS                = 2.
IF lv_me45_ans = 2. “If Reject button is selected then delete the RFQ line item other wise continue so the standard BAPIs are called
= ls_me45outtabebeln
= 1
OTHERS      = 2.
IF sysubrc <> 0.
MESSAGE ID symsgid TYPE ‘I’ NUMBER symsgno
WITH symsgv1 symsgv2 symsgv3 symsgv4.
ELSE.* update output table
LOOP AT gt_outtab_purchdoc_rel ASSIGNING <ME45_line> WHERE
= ls_me45outtabebeln.
DELETE gt_outtab_purchdoc_rel.
ENDIF.ENDENHANCEMENT.*$*$-End:   (1)———————————————————————————$*$*

Rest is standard







Funciton Z_MM_DEL_RFQ


FUNCTION z_mm_del_rfq.*”———————————————————————-*”*”Local Interface:*”  IMPORTING*”     REFERENCE(EBELN) TYPE  EBELN*”  EXCEPTIONS*”      ERR_MESSAGE*”———————————————————————-
DATA:   lt_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

  PERFORM bdc_dynpro      USING ‘SAPMM06E’ ‘0305’.
PERFORM bdc_field       USING ‘BDC_CURSOR’
PERFORM bdc_field       USING ‘BDC_OKCODE’
PERFORM bdc_field       USING ‘RM06E-ANFNR’
PERFORM bdc_dynpro      USING ‘SAPMM06E’ ‘0320’.
PERFORM bdc_field       USING ‘BDC_CURSOR’
PERFORM bdc_field       USING ‘BDC_OKCODE’
PERFORM bdc_dynpro      USING ‘SAPMM06E’ ‘0320’.
PERFORM bdc_field       USING ‘BDC_CURSOR’
PERFORM bdc_field       USING ‘BDC_OKCODE’
PERFORM bdc_dynpro      USING ‘SAPMM06E’ ‘0320’.
PERFORM bdc_field       USING ‘BDC_CURSOR’
PERFORM bdc_field       USING ‘BDC_OKCODE’

  CALL TRANSACTION ‘ME42’  USING gt_me45_bdcdata MODE ‘N’ UPDATE ‘S’ MESSAGES INTO lt_messtab.
LOOP AT lt_messtab WHERE msgtyp = ‘E’.
MESSAGE ID lt_messtabmsgid TYPE lt_messtabmsgtyp NUMBER lt_messtabmsgnr
WITH lt_messtabmsgv1 lt_messtabmsgv2 lt_messtabmsgv3 lt_messtabmsgv4 RAISING err_message.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      thanks!!! that saved me, i've changed by adding an error message using the FM message_store