on 03-14-2007 9:33 AM
Hi,
When i am creating a Shopping Cart using Limit Item, the Account details of the SC are not coming from the FM 'BBP_PD_SC_GETDETAIL'.
Basically, we are using BADI 'YBBP_DOC_CHECK_BADI to validate the Shopping Cart. Inside this BADI, FM 'BBP_PD_SC_GETDETAIL' is used to get the details of the Shopping Cart.
When i create a Shopping Cart with Limit Item, then the above FM is not returning any value in the internal table for account details and also the quantity and price fields in internal table of item details are coming as blank and because of this, the Shopping Cart is not getting validated.
But when we create normal Shopping Carts (With out LIMIT ITEM), the FM is returning the values in internal table for account details and the validation is taking place.
can any one give some pointers on why is it happening?
Thanks in advance.
Nitin
Hi,
Do you use the SC with limit WITH or WITHOUT account assignment ?
Kind regards,
Yann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Have you implemented the BADI - BBP_DOC_CHANGE_BADI in SE19 Transaction as well ? I guess, the BADI is having incorrect code.
If yes, please send the code.
<u>Alternatively, look at the following OSS notes.</u>
<b>Note 790973 Change account assignment update time
Note 527648 - Limit shopping carts do not disappear from the sourcing
Note 612552 BBP_DOC_CHECK_BADI / BBP_DOC_CHECK_ICC: deleted items
Note 580548 - Shopping cart: BBP_DOC_CHANGE_BADI - account assignment data
Note 537045 - Shopping cart: Incorrect interface data</b>
Keep me posted.
Hope this will help.
Please reward suitable points, incase it suits your requirements.
Regards
- Atul
Hi
I have seen the code, seems to be OK. Have you implemented the BBP_DOC_CHANGE_BADI as weel ? If yes, please send the code.
<u>Anyways, Do one thing.
In the Web page, create a shopping cart with say 1 limit item with maximum possible qty and price.
Afterwards, instead of ordering it hold it. (Press SC hold button).
Logon in via SRM GUI via the same user (Give this user SAP_ALL access for time being )and then debug that whethet there are any values in BBP_DOC_CHANGE_BADI / BBP_DOC_CHECK_BADI BADIs.</u>
Let me know incase you face any issues.
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
<u>Which SRM version are you using ? For which SRM scenario ?</u>
Is this working fine with Catalog items, Free Text items, etc. ?
<b>I suspect, you might be using the FM -> BBP_PD_DC_GETDETAIL in a wrong manner.</b>
Please send me the detailed information (code) in your next reply.
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,
Below is the code of the BADI 'BBP_DOC_CHECK_BADI':--
method IF_EX_BBP_DOC_CHECK_BADI~BBP_DOC_CHECK.
DATA:
l_logsys TYPE t000-logsys, " Logical system
ls_header TYPE bbp_pds_sc_header_d,
lv_call_value1 TYPE bbp_wfl_app_property,
w_destination TYPE rfcdes-rfcdest, " Destination System
w_costcntr TYPE BBP_PDS_ACC-COST_CTR,
lv_criterion TYPE BBP_WFL_app_criterion,
lv_guid TYPE crmt_object_guid,
ls_item TYPE bbp_pds_sc_item_d,
lt_item TYPE TABLE OF bbp_pds_sc_item_d,
ls_account TYPE bbp_pds_acc,
lt_account TYPE TABLE OF bbp_pds_acc,
l_total_val TYPE ybbpt_icompany-total_val, " Total Value SC
l_item_val TYPE ybbpt_icompany-item_val. " Line item value
DATA:
lt_messages TYPE bbp_smessages_badi,
w_doc_guid TYPE CRMT_OBJECT_GUID.
data:
w_counter(4) type N.
Constants:
cl_msgtyp_e TYPE bbp_smessages_badi-msgty
VALUE 'E'. " Message Type (E)
MOVE iv_doc_guid TO w_doc_guid.
get the details of the shopping cart
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_guid = w_doc_guid
IMPORTING
e_header = ls_header
TABLES
e_item = lt_item
e_account = lt_account
.
If SY-SUBRC NE 0.
EXIT.
ENDIF.
READ TABLE lt_item INTO ls_item WITH KEY del_ind = SPACE.
IF sy-subrc IS INITIAL.
Get the Total SC value and max line item val that is required for
approval from table YBBPT_ICOMPANY for a particular company code
SELECT SINGLE total_val " Total Value of Shopping cart
item_val " Line item value
INTO (l_total_val,
l_item_val)
FROM ybbpt_icompany
WHERE ic_bukrs EQ ls_item-be_co_code.
sy-subrc check not required
ENDIF. " IF sy-subrc IS INITIAL.
For Company code 8000,9000,2500 approval takes place when total SC
value is greater than Total Value of Shopping cart in table
YBBPT_ICOMPANY or if any of the line item value is greater
than Line item value in table YBBPT_ICOMPANY
IF NOT l_total_val IS INITIAL
AND ls_header-total_value LE l_total_val.
LOOP AT lt_item INTO ls_item WHERE
del_ind IS INITIAL
AND VALUE GT l_item_val.
ENDLOOP. " LOOP AT lt_item INTO ls_item
IF NOT SY-SUBRC IS INITIAL.
EXIT.
ENDIF. " IF NOT SY-SUBRC IS INITIAL.
For Company code 8600 and 8290 line item based value is considered for
approval. Approval takes place if any of the line item value is
greater than Line item value in table YBBPT_ICOMPANY
ELSE.
LOOP AT lt_item INTO ls_item WHERE
del_ind IS INITIAL
AND VALUE GT l_item_val.
ENDLOOP. " LOOP AT lt_item INTO ls_item
IF NOT SY-SUBRC IS INITIAL.
EXIT.
ENDIF. " IF NOT SY-SUBRC IS INITIAL.
ENDIF. " IF NOT l_total_val IS INITIAL
LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL.
We consider only items, which are not deleted (del_ind = 'X')
w_counter = w_counter + 1.
Found out to which cost center this item belongs
READ TABLE lt_account INTO ls_account
WITH KEY p_guid = ls_item-guid.
IF sy-subrc = 4.
MOVE 'OTHERS' TO lv_call_value1.
ELSE.
CASE LS_ACCOUNT-ACC_CAT.
WHEN 'CC' or 'ZCC'.
MOVE LS_ACCOUNT-ACC_CAT to LV_CRITERION.
MOVE ls_account-cost_ctr TO lv_call_value1.
DATA : lv_count TYPE N.
*-- Get the data from Shopping Cart approval table YBBPT_SC_APPRV
*-- check if there is any approver for that CC in that table
*-- if not give error message.
SELECT count(*)
FROM ybbpt_sc_apprv
INTO lv_count where approv_criteria IN ('CC', 'ZCC')
AND company_CODE EQ ls_item-be_co_code
AND criteria_value EQ ls_account-cost_ctr.
if NOT lv_count GT 0 .
MOVE 'E' TO lt_messages-msgty.
CONCATENATE text-e02
w_counter
INTO lt_messages-message separated by space.
APPEND lt_messages TO et_messages.
CLEAR lt_messages.
EXIT.
endif .
WHEN 'WBS'.
MOVE 'CC' to LV_CRITERION.
Read the destination for the current R/3 System
Determine the Logical system
CALL FUNCTION 'BBP_LOGSYS_READ'
IMPORTING
e_my_logsys = l_logsys.
sy-subrc check not required
Get the backend destination from table BBP_BACKEND_DEST based on the
logical system
SELECT SINGLE dest " BACKEND
FROM bbp_backend_dest
INTO w_destination
WHERE log_sys EQ l_logsys.
sy-subrc check not required
Retrieve Cost Center from R/3
call function 'YMPUF_GET_CC_FOR_WBS_ELEMENT'
destination w_destination
exporting
posid = ls_account-wbs_elem_e
importing
fkstl = w_costcntr.
if sy-subrc eq 0 .
MOVE w_costcntr TO lv_call_value1.
*--If the Responsible cost center not exists, then append error message
ELSE.
MOVE 'E' TO lt_messages-msgty.
CONCATENATE text-e01
w_counter
INTO lt_messages-message.
APPEND lt_messages TO et_messages.
CLEAR lt_messages.
EXIT.
endif .
ENDCASE.
ENDIF.
ENDLOOP.
endmethod.
Thanks,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.