Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Setting flag account assignment element in PS within BADI doesn't work

Hello,

I would like to set the flag for account assignement element and billing element in PS depending on some fields of cProjects. Hint 993642 says that can be done in GCC_PS_PROJECT_LABEL. Unfortunately I don't know how to pass some parameters from cProjects to the relevant method.

For transfering the standard fields I am using (thanks to Matthias) the BADI DPR_FIN_GECCO_ATTR.

There are several blocks with fields I set. Each block looks similar to (except the field and the value)

ls_attribute-data_element     = space.
      ls_attribute-value            = space.
      ls_attribute-field_name_orext = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.
      ls_attribute-fldname_receiver = space.
      ls_attribute-struc_name_copa  = space.
      ls_attribute-field_name_copa  = space.
      ls_attribute-ext_attr_name    = space.
      ls_attribute-ext_attr_value   = space.
      INSERT ls_attribute INTO TABLE ct_attributes.

In the default method the WBS_ACCOUNT_ASSIGNMENT_ELEMENT and WBS_BILLING_ELEMENT are overridden constant to 'X' like hint 993642 describes. But at least I have no glue how to pass my relevant parameters to the method to be able to set the values in my own implementation of this method.

So, does someone knows how to pass values to this method?

Thx,

Vanessa

Edited by: Vanessa Martinez on Oct 28, 2008 9:23 AM

replied

Vanessa,

This is available in standard, by using BADI DPR_FIN_GECCO_ATTR / modify_attributes method.

As I explained before in another topic, you have to replace the orext field by the standard WBS-E field one (listed in structure BAPI_BUS2054_DETAIL in your ERP system).

As a result, for instance:

*COMPANY CODE

ls_attribute-data_element = space.

ls_attribute-value = <ls_project_int>-ZZCOMPANYCODE.

ls_attribute-field_name_orext = 'COMPANY_CODE'.

ls_attribute-fldname_receiver = space.

ls_attribute-struc_name_copa = space.

ls_attribute-field_name_copa = space.

ls_attribute-ext_attr_name = space.

ls_attribute-ext_attr_value = space.

INSERT ls_attribute INTO TABLE ct_attributes.

As this BADI is on cProjects side, you can easily determine your object type by calling method get_object_type from ir_common instance.

This works perfectly. However, as soon as an error occurs for one field, all the integration is cancelled. So check carefully the controlling cockpit.

Matthias

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question