cancel
Showing results for 
Search instead for 
Did you mean: 

Account assignment category not passed into Target Objects Badi

Former Member
0 Kudos

Hi all,

The Account assignment Category entered in the Cost Assignment Tab in the Shopping Cart, is not getting passed in the BBP_TARGET_OBJECTS ( Target objects BADI ). But it is available before in the Change Badi and aavailable after in the Backend Document Creation Badi's.

The requirement is basically to decide whether to create a PO or Preq based on the Account assignment category. Since this value is not available in the Badi, I am not sure what to do. Please help.

Thanks,

Steve

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

<b>You are not using BADIs correctly. Please paste the code of both BADIs - BBP_DOC_CHANGE_BADI and BBP_TARGET_OBJECTS BADI here.</b>

<b>Here is the sample code for BBP_TARGET_OBJECTS_BADI</b>

method IF_EX_BBP_TARGET_OBJECTS~DETERMINE_TARGET_OBJECTS.

  data: w_item_data type BBP_BAPIPOGN.
  clear: w_item_data.

*--- 2 is for Purchase Requisition

*---loop through selected catalogue items and for zero items set  to 3
*---for purchase order.

  loop at item_data into w_item_data.

  if w_item_data-CATALOG <> ''.
      w_item_data-OBJ_TO_GEN = '3'. " Purchase Order
      modify item_data from w_item_data.
      clear: w_item_data.
  endif.
  endloop.

endmethod.

Hope this will help.

Regards

- Atul

Former Member
0 Kudos

Hi atul,

Your example shows that PO's are created based on the field w_item_data-CATALOG. We are trying to create PO's based on the field w_item_data-ACCT_ASCAT which is the account assignment field in the Cost Assignment tab. But basically no values are passed through this field. So I guess the code has nothing to do with this.

Thanks,

Steve

Former Member
0 Kudos

Hi

I have just given you a sample piece of code.

Please paste the code, what you have done for the BADIs. Then I can guide you, how to go about it.

Hope this will help.

Regards

- Atul

Former Member
0 Kudos

Steve,

the account assignement category is not passed between R/3 and SRM.

Usually the settings in R/3 are e.g. for Cost Center = K and CC in SRM

SRM derives / validates via a somehow strange logic and is not using the

Category field at all. That explains your findings, that the information is there and also not.

Are you sure all needed settings are in place? Via the BADI you should be able

to influence, which Backend Doc gets created based on your rules.

Thanks,

Claudia

Former Member
0 Kudos

Hi

<u>Please ensure that you have made the correct SRM and R/3 Account Assignment settings in this case.</u>

<u>Refer to the links for making proper Account assignment configuration settings.</u>

<b>http://help.sap.com/saphelp_srm50/helpdata/en/62/1123fbb9aa4fc9a83e875428e9daac/frameset.htm

http://help.sap.com/saphelp_srm50/helpdata/en/30/2f20380217de3fe10000009b38f889/frameset.htm</b>;

<b>Please ensure that you have maintained the correct GL Account (Based on R/3 system) in the SRM system.</b>

Here are the steps ->

<b>Log on SPRO Transaction in SRM.

o IMG&#8594;SRM Server&#8594; Cross Application Basic Settings&#8594; Account Assignment.

&#61607; Define Account Assignment Categories. In this step you define different Account

assignment Categories and assign fields to these Account Assignment Categories.

&#61607; You can also define how the EBP Account Assignment Category assigned to

Backend Category

o IMG&#8594;SRM Server&#8594; Cross Application Basic Settings&#8594; Define G/L Account for Product Category and Account Assignment Category

&#61607; You specify the G/L account that is to be posted to in Financial Accounting in the backend system, depending on the product category and the account assignment category.

&#61607; Note that for each product category that you work with, you have to enter all possible account assignment categories and a G/L account</b>

Hope this will help.

Please reward suitable points.

Regards

- Atul

Former Member
0 Kudos

Folks,

The configuration is fine and thats why the Account assignment categories are passed perfectly through the Doc Change Badi, just before the Target Objects Badi and it is available even in the Backend Badi's which is triggered after the Target Objects Badi. The Target Objects badi also has a interface parameter table ITEM_DATA , which has this Account Assignment field. The only thing is that it is not filled at all.

SRM has this value in the Other two Badi's but not in this one, but our client needs to decide the Backend document created based on this Account assignment category field. I am trying to find a way by which this value can be retrieved.

Thanks,

Steve

Former Member
0 Kudos

Hi

<b>I guess, there is some problem with either the code you have implemented with the BADI Implementation using SE19 in this case.

Please provide your code of the BBP_TARGET_OBJECTS BADI by pasting it here and ill surely resolve your issues at the earliest.</b>

<u>Anyways, for the time being, why not leave this BBP_TARGET_OBJECTS BADI and

go for either the BBP_CREATE_PO_BACK and BBP_CREATE_REQ_BACK BADIs

or

use BBP_TARGET_OBJTYPE BADI.</u>

Hope this will help.

Please reward suitable points, incase it suits your requirement.

Regards

- Atul

Former Member
0 Kudos

Atul,

I think you did not understand what I am trying to tell you. You want me to handle everthing in the BBP_CREATE_BE_PO_NEW or BBP_CREATE_BE_RQ_NEW. As per my requirement the PO is created only if Account assignment has some specific values. Otherwise it will be always P requisition that has to be created. So we have to decide in the Target Objects Badi itself, whether to create a PO or Preq. Once it goes to BBP_CREATE_BE_RQ_NEW, we cant do anything about creating a PO right.

This the code in that BADI

loop at item_data into wa_item.

if wa_item-acctasscat = '5'.

wa_item-pbj_to_gen = '3'. " PO

modify item_data from wa_item.

endif.

endloop.

Here if I dont get the values of wa_item-acctasscat, how am I going to determine whether to create a PO or not? So the problem, I think, is not with the code. It is that the wa_item-acctasscat has no value in this BADI.

Thanks,

Steve

Former Member
0 Kudos

Hi

<i>I have few questions</i>

<b>1) Have you maintained the same account assignment categories in both SRM as well as the R/3 system.

Like in your case, you say Account assignment category '5' (Is this having the purpose and same value in both SRM as well as R/3 - Say Account assignment '5' denotes "Cost Center", similarly '6' denotes "WBS Element" -> likewise, it applies the same meaning both in R/3 as well as SRM)

2) Can you send the BBP_DOC_CHANGE_BADI code as well in your next reply.</b>

<u>Incase nothing works,

I suggest you create a custom field in the SRM item level and populate it with the Account assignment category in the BBP_DOC_CHANGE_BADI for every shopping cart line item

and once that is done.

Inside either of these BADI Implementations -> BBP_TARGET_OBJECTS / BBP_TARGET_OBJTYPE, you will get the A/c Assignment value populated at the item level and based on that you can do whatever your requirement is</u>

Let me know incase need more insights in this area.

Waiting for your reply.

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

I guess the BBP_TARGET_OBJTYPE has the value where as the other one does not. thanks for your timely and quick replies. I am awarding u full points.

Thanks folks,

Steve

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

I am surprised.. This cannot be possible.

Which SRM version are you using ? Can you paste the code of the BADIs here ?

I am sure, there is problem in the custom BADI implementation.

As an alternative, Use Transaction SE19 and for the time being, de-activate all the BADIs and how standard SAP functionality reacts in this case.

Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

Hi atul,

We are using SRM 5.0. I tried deactivating the Doc change BADI and Catalog Transfer Badi but still the account assignment field ( ACCTASSCAT ) is empty in the table ITEM_DATA. Also the table ACCT_DATA holds only the last item of the Shopping cart and hence this also is not useful.

Is there any other solution for this?

Thanks,

Steve