cancel
Showing results for 
Search instead for 
Did you mean: 

Event-AfterLoading for an opened status

jalda
Explorer
0 Kudos

Hi,

I'm new to scripting, I need help in After Loading Event for filling in information to an element declared in extended business object for Activity Business object.
I have gone through all the links in this community like
https://archive.sap.com/discussions/thread/3846927
https://archive.sap.com/discussions/thread/3796437

But from all the above links i came to know that we can't do anything to the element declared in extended BO in an After loading event.(like modifying element value).

So here is my requirement : I need to modify a value while loading a node(i.e., during after loading event). Is that possible ? or at least can i create an instance of other BO so that i can modify element value of that BO or can i call web services to make changes to the element.

At last I need to change my element's value during After Loading Event.

Thanks you in advance

Thanks,

Adithya

Accepted Solutions (1)

Accepted Solutions (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Adithya,

The event AfterLoading is reserved for transient elements which are not persisted and need to calculated after loading and every roundtrip (as mentioned in the links).

What do you want to achieve?

With 1711 you at able to extend the SAP BO AP.PC.ActivityManagement.Global:Activity not only with regular Extension Fields, Actions and Nodes but also with transient Extension Fields. 🙂

HTH,
. Horst

jalda
Explorer
0 Kudos

Hi Horst,
Thanks for the update.
Simply, Is there any way for updating a field value and persist it when we open a view ?

Thanks,
Adithya

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Adithya,

Persisting data on opening a UI?
That's wrong design.

Why do you want to do such thing?

Bye,
. Horst

jalda
Explorer
0 Kudos

Hi Horst,
Requirement is : when a user opens and view a task assigned to him, I need to update a read_task field(custom field provided at extended BO of Activity task) which is available in Activity task TI - which says that the user has viewed the task. And when Task creator sees the task he/she need to understand that assignee has viewed the task. For this purpose i need to persist data during after loading event. Thanks for updating.

Adithya.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Adithya,

This should not be done direct in the UI on the instance assigned to the UI. Changing data by simply looking at it reminds me to Heisenberg's Uncertainty Relation. 🙂
Instead you should use another BO (as SAP I would use a workflow ) for tracing this information.

HTH,
. Horst

jalda
Explorer
0 Kudos

🙂 Thanks.

Could you please explain me briefly how can i use another BO to update a field or through a workflow.

I have tried using workflow too, but I didn't see After Loading event, Instead i saw before save in workflow steps.

Thanks,
Adithya

HorstSchaude
Product and Topic Expert
Product and Topic Expert

Hello Adithya,

The possibilities of Workflow within PDI are limited. 😞 Therefore I wrote "as SAP"

In brief I would

  • Define an Extension Node at the Activity BO
  • This node should be annotated as [SeparatelyLockable]
  • Define an action at this node which updates the req. information
  • Call this action during the AfterLoading

HTH,
. Horst

jalda
Explorer
0 Kudos

Hi Horst,

Can we call an action during AfterLoading event ? I have seen in other links that we can't call an action during the After Loading event.

Thanks,
Adithya

HorstSchaude
Product and Topic Expert
Product and Topic Expert

Hello Adithya,

You're right and I'm sorry. 😞

The restriction to the transient elements is that strict that even actions or create calls for other BOs are not allowed. 😞

Another idea:

  • You may add an EC to the UI based on the Activity
  • On loading the EC (this is not related to the event AfterLoading) you trigger an action from the EC
  • This action set the element
  • The next operation in the EC is Commit Work

HTH,
. Horst

former_member422907
Contributor
0 Kudos

Hi,

I have very the same request from customer and facing very the same problem as Jalda.

Actually customer want that during stetting the status of activity task "in process" that field owner is populated with name of the person that triggers this action.

Problem at mine side is that in PDI I cannot created script files for activity task., and therefore I cannot write the code for changing owner.

Here is the screenshot:

Horst do you have idea?

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Zoran,

You mention "Activity Task":

  • Please provide the complete path incl.namespace because we have different "Activity" and "Task".
  • Are you using C4C or ByD?

Thanks,
. Horst

former_member422907
Contributor
0 Kudos

Hi,

I use C4C. I need to set task from activity WC. Here is the screenshot:

In PDI I used namespace:

http://sap.com/xi/AP/FO/Activity/Global

for business object:

ActivityTask

Is this correct?

br,

Zoran

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Zoran,

IMHO it should be the

[Extension] businessobject AP.PC.ActivityManagement.Global:Activity {

HTH,
. Horst
former_member422907
Contributor
0 Kudos

Thanks Horst!

That solved my problem.

Btw. What is http://sap.com/xi/AP/FO/Activity/Global used for?!

I believe this is solution for JALDA ADITHYA also

br,

Zoran

jalda
Explorer
0 Kudos

Hi Horst,
Thanks for giving me another idea. I'll follow links for How to use EC and i'll try my solution with EC (as i'm a newbie for SAP cloud application studio and for UI Designer i don't know how to use it). Thanks for the support.

Thanks,
Adithya

HorstSchaude
Product and Topic Expert
Product and Topic Expert

Hello Zoran,

We migrated the ActivityTask, Appointment, PhoneCalll, ... activities from the old implementation (using template and projections, old runtime framework) in AP.FO.Activity.Global to a new design & implementation. Therefore we needed a new namespace.

As there are still e.g. data types inside the old namespace we can not deprecate the whole namespace, but we deprecated the BOs.

HTH,
. Horst

jalda
Explorer
0 Kudos

Hi horst.schaude,

When i opened my solution in sap cloud application studio, i'm able to see my custom field(read task) in the UI of Activity Task as shown below

But when i open the activity task without opening my solution in sap cloud application studio, i'm not able to see my custom field in the UI as shown below

What will be the issue ? could you please explain how to resolve it.

Thanks,
Adithya.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Adithya,

As this is a new topic please create a new question, else any searching for an answer based on the initial question of this topic will not work.

Thanks,
. Horst

jalda
Explorer
0 Kudos

Hi horst.schaude,

I created a question. Link is https://answers.sap.com/questions/332756/xbo-fields-are-not-visible-when-custom-solution-is.html.

Thanks,
Adithya

Answers (0)