cancel
Showing results for 
Search instead for 
Did you mean: 

METHOD if_ex_bbp_doc_check_badi~bbp_doc_check Questions

Former Member
0 Kudos

1. Running into an issue where when i delete a item from SC it still gets passed to bbp_doc_check method that we have customized.

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

i_guid = iv_doc_guid

i_with_itemdata = 'X'

IMPORTING

e_header = ls_header

TABLES

e_item = lt_item

e_account = lt_account

e_partner = lt_partner.

2. When i run in debug mode using SM50 and breakpoints...i see the completed method get executed 2 times.

3. Also the following step in program gets executed 2 times in both runs

IF ls_account-zzitem_type_flag = 'E'.

MOVE 'Y' TO lv_expense_found.

ELSEIF ls_account-zzitem_type_flag = 'C'.

MOVE 'Y' TO lv_capital_found.

ENDIF.

4. What does the following statement do?

REFRESH : li_zmatrl_bo_status.

I am new to SRM and any help is appreciated.

Thanks,

Nikhil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

1. Running into an issue where when i delete a item from SC it still gets passed to bbp_doc_check method that we have customized.

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

i_guid = iv_doc_guid

i_with_itemdata = 'X'

IMPORTING

e_header = ls_header

TABLES

e_item = lt_item

e_account = lt_account

e_partner = lt_partner.

2. When i run in debug mode using SM50 and breakpoints...i see the complete method get executed 2 times.

3. Also the following step in program gets executed 2 times in both runs (when 1 item is present in shopping cart...basically its n + 1 times where n = number of items whethere deleted or not) first with ls_account-zzitem_type_flag value as XI then product categories of the item.

IF ls_account-zzitem_type_flag = 'E'.

MOVE 'Y' TO lv_expense_found.

ELSEIF ls_account-zzitem_type_flag = 'C'.

MOVE 'Y' TO lv_capital_found.

ENDIF.

4. What does the following statement do?

REFRESH : li_zmatrl_bo_status.

I am new to SRM and any help is appreciated.

Thanks,

Nikhil

Former Member
0 Kudos

hi

Any response to my questions?

All help is appreciated?

Also if any one has some basic documentation of bbp_doc_check or bbp_doc_change bapi interact when different actions occur is appreciated?

Thanks,

Nikhil

Former Member
0 Kudos

Hi Nikhil,

It is not clear what exactly your problem is. Is there a problem that you are facing with your badi implementation? Please, check for the loops to find out why the particular code is executed twice.

Regards

Saravanan

Please award if useful

yeushengteo
Advisor
Advisor
0 Kudos

Hi,

This BADI allows SRM customer to check that the document data is semantically correct based on the business rule you want to implement.

If you have a need not to execute the check BADI logic when you are performing a deletion action on screen, you can check the sy-ucomm value of this action within the BADI and bypass the program codes in this BADI completely.

Regards.

Former Member
0 Kudos

Hi,

1. When an item is deleted, the indicator DEL_IND would be set in the line item details. So, you deleted item will be still there but with the deletion indicator set.

2. The below statement clears/initializes the internal table li_zmatrl_bo_status.


REFRESH : li_zmatrl_bo_status.

3. doc_check_badi will be called for all events on the shopping cart application. Hence use SY-UCOMM to restrict when it should process the data.

4. Note that there can be multiple account assignments for a single line item. Please check that.

Regards

Kathirvel

Former Member
0 Kudos

hi,

I am checking for

LOOP AT lt_account INTO ls_account WHERE del_ind = space.

Inspite of that I get the deleted item in ls_account

Is there are syntax issue?

Also when there is change is SC what are the events that take place in background and their sequence?

1. ZBBP_DOC_CHANGE_BADI and then

2. ZBBP_DOC_CHECK_BADI ?

Thanks,

Nikhil

Former Member
0 Kudos

Hi,

If the indicator is not "X", I don't think it would mean that it has a space. You can check the negative condition of del_ind = "X".

Regards

Saravanan.

Former Member
0 Kudos

Hi,

BBP_DOC_CHANGE_BADI is called when you make changes in the SC data.

BBP_DOC_CHECK_BADI is called when you click on the "CHECK' button on the SC screen.

BR,

Disha.

DO reward points for useful answers.

Former Member
0 Kudos

Hi,

There is no sytax or coding problem in your logic. Since the line item has the deletion indicatot set, I would recommend you to adopt the below logic:


* Loop at Item Table
LOOP AT lt_item INTO ls_item WHERE del_ind <> "X".

* Loop into the acoount assignment for the corresponding line item 
LOOP AT lt_account INTO ls_account WHERE P_GUID = ls_item-guid.

* Your logic goes here

ENDLOOP.

ENDLOOP.

Now the account assignment table not be processed for the deleted items.

Best Regards

Kathirvel

Former Member
0 Kudos

Hi Kathirvel,

That was it ....my loop was reading lt_account for all items even if they were deleted.

Instead of loop i used

READ TABLE lt_account INTO ls_account

WITH KEY p_guid = ls_item-guid.

which fixed the issue.

Thanks ALL for your help and feedback

Nikhil

Answers (0)