Question:
During the completion of an invoice the relevant Cost Center is entered into the position line of the invoice. When in look into the workflow container I can't find the Cost Center. It seems only the data available in the header is in the container.
Is there a way to get the Cost Center which is entered into the position line of an invoice into the workflow container.
I want to use the Cost Center in a role. So if the Cost Center is 40000 the workitem is send to Mr. Big. and if the Cost Center is 50000 the workitem is send to Mr. Little.
Greeting Axelreno
Answer:
During the completion of an invoice the relevant Cost Center is entered into the position line of the invoice. When in look into the workflow container I can't find the Cost Center. It seems only the data available in the header is in the container.
Is there a way to get the Cost Center which is entered into the position line of an invoice into the workflow container.
I want to use the Cost Center in a role. So if the Cost Center is 40000 the workitem is send to Mr. Big. and if the Cost Center is 50000 the workitem is send to Mr. Little.
You don't mention which business object you're using
to represent the invoice in your workflow,
but I'll assume it's either BKPF, BUS2081 or FIPP.
The best way to get the cost centre is to extend
your business object (to ZBKPF, ZBUS2081 or ZFIPP)
and to code a virtual attribute based on object BUS0012.
You should then be able to access this attribute
in the workflow container (via your business object reference)
and pass the value to your role.
Regards,
Tim
Answer:
Shoud i use delegation in order to add the virtual attribute.
Isn't Cost center an attribute of a different business object that I can use. Also there can be more Cost Centers per invoice (one per line item).
I don't have SAP system at my disposal right now. What kind of business object is bus0012.
And how exactly do i extend the business object ?
Gr. Axelreno
Answer:
Shoud i use delegation in order to add the virtual attribute.
Yes, create a subtype of your current invoice object,
and delegate system-wide.
Isn't Cost center an attribute of a different business object that I can use.
Don't know - you'll have to have a look;
personally, I think it makes sense to include
it as an attribute for your main invoice object -
keeps everything in sync etc...
Also there can be more Cost Centers per invoice (one per line item).
Yes, and I had assumed (from the wording of your original post)
that you were prepared for this -
i.e. you knew which cost centre you were interested in.
If you want to take all of them into account,
you'll have to create a multiline virtual attribute,
then evaluate them accordingly in your role.
If it's a SAP delivered role,
it could be the case that it expects to receive a single-line attribute,
so you might have to use the table parallel processing option
in your activity step to create multiple groups of workitems.
Either that or code your own role...
I don't have SAP system at my disposal right now. What kind of business object is bus0012.
It's the business object for cost centre.
And how exactly do i extend the business object ?
Extend just means creating a subtype, delegating,
then adding your own extra stuff.
Hope that helps,
Tim