cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing BADI GCC_PS_PROJECT_LABEL GET_WBS_ELEMENT

former_member184588
Active Participant
0 Kudos

Hello,

I am implementing the BADI GCC_PS_PROJECT_LABEL to synchronise values between cProject an PS.

On the one hand I would like to get the details (in my case values of user defined fields implemented as CI and not as append structure) of the cProjects element to be able to read the fields.

On the other hand I would like to set the values of this fields in the wbs-element.

Unfortunately I am completly new to this topic and have no glue whether to find the cProject-fields nor to set the values of the wbs elements.

Could someone help me?

Thank you,

Vanessa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vanessa,

You can have a look to the standard implementation CPRO_PROJECT_LABEL~GET_WBS_ELEMENT.

It's possible to read the data sent from cProject with this kind of code (it is in the standard implementation):

read table ATTRIBUTES_OF_EXT_OBJ

into ls_attribute

with key data_element = 'DPR_TV_OBJECT_TYPE_CO'.

(replace 'DPR_TV_OBJECT_TYPE_CO' with your custom data element)

A pre-requisite is to implement BADI DPR_FIN_GECCO_CALC with your custom fields (method IF_EX_DPR_FIN_GECCO_ATTR~MODIFY_ATTRIBUTES for WBS-ELEMENTS).

You can then add an enhancement at the end of the method with your logic.

However, just a question: if you want to update fields from CI* includes, why don't you do it in DPR_FIN_GECCO_CALC on cProjects side only? It should work from this point.

Matthias

former_member184588
Active Participant
0 Kudos

Hello Matthias,

if you want to update fields from CI* includes, why don't you do it in DPR_FIN_GECCO_CALC on cProjects side only? It should work from this point.

That is a good question and I can give just a poor answer: I am using it to set the field USER_FIELD_CHAR20_1 for testing purpose to see if it works... and it works. Unfortunately this didn't work for the WBS_ACCOUNT_ASSIGNMENT_ELEMENT. This field is overridden in the GCC_PS_PROJECT_LABEL BADI (for testing purposes I was using this BAPI to change the fields and this works at this place.) Regarding this topic there is a hint 993642.

The other point is that I have no glue how to use my CI* fields. So I skipped this and was looking for a better solution.

A pre-requisite is to implement BADI DPR_FIN_GECCO_CALC with your custom fields (method IF_EX_DPR_FIN_GECCO_ATTR~MODIFY_ATTRIBUTES for WBS-ELEMENTS).

You can then add an enhancement at the end of the method with your logic.

Could you please give some additional advice on this? I think that you are right when you say that the IF_EX_DPR_FIN_GECCO_ATTR~MODIFY_ATTRIBUTES is the best place for my coding). The combination of my implemented BADI GCC_PS_PROJECT_LABEL that is not setting the accounting flags to true and the implementation of BADI DPR_FIN_GECCO_CALC with my custom fields will make my day.

Thank you very very much,

Vanessa

P.S. Are you really talking about DPR_FIN_GECCO_CALC and not DPR_FIN_GECCO_ATTR? If yes, I am lost because again I wouldn't get the point but DPR_FIN_GECCO_ATTR would give a good feeling.

Edited by: Vanessa Martinez on Oct 22, 2008 5:03 PM

Former Member
0 Kudos

Yes you're right, I did a spelling mistake: it's DPR_FIN_GECCO_ATTR.

I never tried to set the accounting flags from cProjects, so I trust you when you say it does not work.

Then, I would advise to try the enhancement I mentionned just above.

In DPR_FIN_GECCO_ATTR, add your accouting fields+value in the ct_attributes table.

ls_attribute-data_element = space.

ls_attribute-value = 'X'.

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.

You should retrieve them in ERP side, in BADI GCC_PS_PROJECT_LABEL (CPRO implementation).

A sample read of this attribute could be:

read table ATTRIBUTES_OF_EXT_OBJ

into ls_attribute

with key data_element = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.

Matthias

former_member184588
Active Participant
0 Kudos

Hello,

this sounds pretty cool. I will try it out and try to find a way to put the passed values to the database.

Thank a lot and have a nice evening,

Vanessa

former_member184588
Active Participant
0 Kudos

Hello,

somehow it doesn't work. I don't see any of my additional field when I am debugging IF_EX_GCC_PS_PROJECT_LABEL~CHANGE_WBS_ELEMENT or is this the wrong method?

The fields are not passed if I use


ls_attribute-data_element = space.
ls_attribute-value = 'X'.
ls_attribute-field_name_orext = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.

nor if I use


ls_attribute-data_element = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.
ls_attribute-value = 'X'.
ls_attribute-field_name_orext = space.

Something is there going wrong and I cannot find out what.

cu, Vanessa

Former Member
0 Kudos

Did you try to debug method CPRO_PROJECT_LABEL~GET_WBS_ELEMENT. (and not CPRO_PROJECT_LABEL~CHANGE_WBS_ELEMENT) ?

The method were we made our enhancement is CPRO_PROJECT_LABEL~GET_WBS_ELEMENT.

Matthias

former_member184588
Active Participant
0 Kudos

It is strange. It seems that this method is never called. I already deactivated the SAP standard implemenation by setting the sort number to zero. My implementation is active but never called (I set a log point to watch this).

Former Member
0 Kudos

Vanessa,

You should not deactivate the standard one, and not create your own implementation. Becuase of the unique Business Key "CPROJECTS", only the standard one can be used. That's why your code is never called.

That's why I said before to build an enhancement at the end of the standard implementation.

Matthias

former_member184588
Active Participant
0 Kudos

Hard work with me, isn't it? Sorry for this.

former_member184588
Active Participant
0 Kudos

Hello,

The fields are not passed if I use


ls_attribute-data_element = space.
ls_attribute-value = 'X'.
ls_attribute-field_name_orext = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.

and if I use this code


ls_attribute-data_element = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.
ls_attribute-value = 'X'.
ls_attribute-field_name_orext = space.

There is written in the controlling cockpit messages that

Component VANESSA_TEST in structure OREXT or BAPI_BUS2054_DETAIL not

available

Message no. IAOM024

Diagnosis

During creation or changing of a Controlling object a value was also

entered for component VANESSA_TEST of structure OREXT or

BAPI_BUS2054_DETAIL. However, component VANESSA_TEST is not contained in

the active structure OREXT or BAPI_BUS2054_DETAIL in the Dictionary .

-


In DPR_FIN_GECCO_ATTR, add your accouting fields+value in the ct_attributes table.

ls_attribute-data_element = space.

ls_attribute-value = 'X'.

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.

You should retrieve them in ERP side, in BADI GCC_PS_PROJECT_LABEL (CPRO implementation).

A sample read of this attribute could be:

read table ATTRIBUTES_OF_EXT_OBJ

into ls_attribute

with key data_element = 'WBS_ACCOUNT_ASSIGNMENT_ELEMENT'.

Means that you are writing in the ls_attribute-field_name_orext and later on you are reading "with key data_element = ....".

Should it be mapped between the BADIs? Which one would be good to transfer my own fields between the BADIs?

Some suggestions?

Have a really nice weekend,

Vanessa

Former Member
0 Kudos

From the message you get in the cockpit, we could guess that you tried to set somewhere the orext field with value 'VANESSA_TEST'. Did you check your code that there is no test lines like this?

Then, to be honnest, I don't remember exactly what I did a few months ago. But you might be right, in ERP system, we should not read data_element, but orext field.

I will have a look on Monday in our system to check this, and will come back to you.

Matthias

former_member184588
Active Participant
0 Kudos

Hello Matthias,

yes, Vanessa_test is one of my test fields to exchange data between cProj and PS and I thought that I could transfer my own customer fields like this. But I didn't thought that this will run into an error

Have a nice start into the week,

Vanessa

former_member184588
Active Participant
0 Kudos

Hello,

does someone knows how to get the type of project element (project, phase, task) within the method change_wbs_element?

Thx, Vanessa

Edited by: Vanessa Martinez on Dec 3, 2008 1:36 PM

Former Member
0 Kudos

Hi,

Here is a sample code from note 925883. object type is retrieved in variable lv_object_type_co.

Matthias

read table ATTRIBUTES_OF_EXT_OBJ

into ls_attribute

with key data_element = 'DPR_TV_OBJECT_TYPE_CO'.

if sy-subrc = 0.

lv_OBJECT_TYPE_CO = ls_attribute-value.

else.

lv_OBJECT_TYPE_CO = space.

endif.

if lv_OBJECT_TYPE_CO eq 'PPO'. "Phase

WBS_ACCOUNT_ASSIGNMENT_ELEMENT = ' '.

endif.

Edited by: Matthias BRISSEAU on Dec 3, 2008 1:42 PM

former_member184588
Active Participant
0 Kudos

Hello Matthias,

oh, this is really unpleasant for me. Sorry that I was to blind to see this field. And thanks for you patience with me.

Thx a lot and have a nice day,

Vanessa

former_member184588
Active Participant
0 Kudos

Okay, new question

This things work great. But when I read my neccessary values (my CI-Fields) out of the table the are not written yet....

In an previous threat you told about that you are writing your values with a little time difference to the database. I think that would be the best for me also. How can I call my FM with a delay? I have seen that I can call a function "in update task" but I don't know how to do it.

I think that I need a separat task to have it asynchron and then it should be delayed ...

Could someone help with some informations?

Thanks a lot, Vanessa

priyatham_kasu2
Active Participant
0 Kudos

Hi,

We are using the standard business key 'CPROJECTS' and the standard implementation of the badi GCC_PS_PROJECT_LABEL. We have both cProjects and PS in the same instance.

I have observed that the badi is not being called when creating the PS Project from cProject.

In the controlling scenario we are using roles of cProject for creating the WBS element and the transfer type in Project is Flag for Transfer. Please suggest me how to call the badi so that the WBS ID can be changed during creation time.

Thanks in Advance,

Priyatham

Former Member
0 Kudos

Hello  Matthias,

Please help me. I implemented BADI DPR_FIN_GECCO_ATTR to automatic generated number into client Requirment for Project, phase, task. Its working Properly. But for every task "-TT-O" is getting suffixed. How to avoid this.please help me to synchronise values between cProject an PS.

Regards

CVA

Former Member
0 Kudos

Hi Siva,

Badi - GCC_PS_PROJECT_LABEL

Method – GET_WBS_ELEMENT

            Development –Outline:

IF lv_object_type_co NE 'DPO'.

      READ TABLE attributes_of_ext_obj INTO ls_attribute

            WITH KEY data_element = 'DPR_TV_PROJECT_ELEMENT_ID_CO'.

IF sy-subrc = 0.

   IF lv_object_type_co EQ 'TTO' .

<Remove TTO from WBS number if needed. You can use Find and Replace or remove 5 chars from the last>

wbs_element = ls_attribute-value.

    ENDIF.                                            

ELSE.                                                  

    wbs_element = ls_attribute-value.

    ENDIF.

  ENDIF.

Former Member
0 Kudos

If your BAdi implementation is not called. Maintain your implementation sequence in Tcode IAOM4.

Answers (0)