on 03-13-2007 1:59 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.