cancel
Showing results for 
Search instead for 
Did you mean: 

Line item mix of order and cost center.

former_member560682
Participant
0 Kudos

Hello Everyone,

We created a shopping cart in the SRM with one line item and this line item is mix of order and cost center.

SAP requires the cost center and order be separated on line item. So for this we cancel requisition and reissue with item splits. So in this split we have one line item with the order and the other one with the cost center in account assignment of the purchase order.

But we want the permanent solution of this situation. We need hard error to prevent the user mixing cost center and order OR we have to develop a process to handle this situation.

Can you guys advice me on this?

What should I do to prevent this situation?

Regards,

Khushbu.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

We had the same issue and we put the code in Doc check BADI. Something like below.

CLEAR : t_item, l_temp_cat, l_line_item, l_partner_guid.

l_partner_guid = wa_partner-partner_no.

*-- For each line item

LOOP AT it_item INTO t_item.

CLEAR l_line_item.

l_line_item = sy-tabix.

CHECK t_item-del_ind EQ ' '.

CLEAR t_acc.

*-- Read the first category

READ TABLE it_account INTO t_acc WITH KEY p_guid = t_item-guid

del_ind = ' '.

l_temp_cat = t_acc-acc_cat.

CLEAR t_acc.

*-- Check for category other than the first one

LOOP AT it_account INTO t_acc WHERE p_guid EQ t_item-guid

AND acc_cat NE l_temp_cat

AND del_ind EQ ' '.

*-- If found then populate the error message and exit from the loop

regards,

MRao

Answers (2)

Answers (2)

former_member560682
Participant
0 Kudos

Thanks everyone for your reply.

@ Masa : We have one line item with order and cost center. So we want just one account assignment object for one line item. So we want to restrict user to select more than one account assignment objects for one line item. So the question is that how can we raise a hard error when user selects more than one account assignment object at shopping cart?

@ Sanjeev : Can you give me the detailed steps to do this?

Thanks,

Khushbu.

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

What is the actual error message?

Regards,

Masa

former_member206968
Active Contributor
0 Kudos

Hi,

You can use bbp_doc_check_badi to issue error message. Read the accounting data and then give error message if same item has two different acct. objects.

Rgds

Sanjeev

Former Member
0 Kudos

You can do the validation as Sanjeev said above OR disable the ADD button in Account assignment tab of the SC so that users cannot add another account assignment. By this you can only have one Acct assignment for each line item.

Thanks,

Jagadish