cancel
Showing results for 
Search instead for 
Did you mean: 

SC Buttons disabled when Raise an error message in Browser-How to Enable??

Former Member
0 Kudos

My req is that the SC amount exceeds the Budget limit have to raise an Error mesaagse " Amount Excceeds Budget Amount". I am Getting error message in the browser but when you get the error message the Browser SC buttons like BACK,CONTINUE are disbled. Pls help how can i enable the buttons...

Thanks,

Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

<b>The BBP_DOC_CHECK_BADI BADI in SE18 transaction which you are using for issuing messages is not coded properly.</b>

<u><b>Please paste the code here, so that i can help you out.</b></u>

<u>Alternatively, try pressing Refresh button once on the shopping cart. Hope this will bring back the buttons as enabled.</u>

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

Here is my code.

  • Process the logic to check the Budget amount

LOOP AT i_item INTO wa_item WHERE parent = wa_header-guid.

  • Get the Cost Center and account assignment cataogry from Shopping cart

READ TABLE i_account INTO wa_account WITH KEY p_guid = wa_item-guid.

IF sy-subrc = 0.

READ TABLE i_budget INTO wa_budget WITH KEY ac_assgn_cat = wa_account-acc_cat

cost_ctr = wa_account-cost_ctr

currency = wa_item-currency.

IF sy-subrc = 0.

IF NOT wa_budget-budget_spend IS INITIAL.

IF wa_item-price > wa_budget-budget_spend.

MESSAGE e005(zsrm).

CLEAR wa_item-price.

ENDIF.

ENDIF.

IF NOT wa_budget-budget_bala IS INITIAL.

IF wa_item-price > wa_budget-budget_bala.

MESSAGE e006(zsrm).

CLEAR wa_item-price.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

  • ENDIF.

Former Member
0 Kudos

Hi

<u>The code ssems to be incorrect.</u>

<b>Instead of using message directly using MESSAGE keyword, use the et_messages[] table inside BADI - BBP_DOC_CHECK_BADI to pupulate data, when the condition is not met.</b>

<u>Forget this code, paste the code in BBP_DOC_CHECK_BADI as given below.</u>

<b>Here is the code for BADI - BBP_DOC_CHECK_BADI </b>

--


//////////////////////////////////////--



****** Get shopping cart details inside DOC_CHECK_BADI 

    CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
      EXPORTING
        i_guid          = iv_doc_guid
        i_with_itemdata = 'X'
      IMPORTING
        e_header        = ls_header
      TABLES
        e_item          = i_item.

* Process the logic to check the Budget amount
LOOP AT i_item INTO wa_item WHERE parent = wa_header-guid.
* Get the Cost Center and account assignment cataogry from Shopping cart
READ TABLE i_account INTO wa_account WITH KEY p_guid = wa_item-guid.
IF sy-subrc = 0.
READ TABLE i_budget INTO wa_budget WITH KEY ac_assgn_cat = wa_account-acc_cat
cost_ctr = wa_account-cost_ctr
currency = wa_item-currency.
IF sy-subrc = 0.
IF NOT wa_budget-budget_spend IS INITIAL.
IF wa_item-price > wa_budget-budget_spend.

            ls_message-msgty   = 'E'.
            ls_message-msgid   = 'ZSRM'.
            ls_message-msgno   = '006'.
            ls_message-msgv1   = 'Budget amount exceeds limit'.

*----Appending the error message to the ERROR ITAB
            APPEND ls_message TO et_messages.
            CLEAR ls_message.

ENDIF.
ENDIF.
IF NOT wa_budget-budget_bala IS INITIAL.
IF wa_item-price > wa_budget-budget_bala.

            ls_message-msgty   = 'E'.
            ls_message-msgid   = 'ZSRM'.
            ls_message-msgno   = '006'.
            ls_message-msgv1   = 'Budget amount exceeds limit'.

*----Appending the error message to the ERROR ITAB
            APPEND ls_message TO et_messages.
            CLEAR ls_message.
CLEAR wa_item-price.
ENDIF.

ENDIF.
ENDIF.
ENDIF.

ENDLOOP.

Let me know incase you face any difficulties

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

Now working fine. Thank you very much...

Regards,

Kumar S

Answers (0)