cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud SDK : Make Display mode when open Embed Component in Account TI screen

Former Member
0 Kudos

Hi Experts,

I have created the custom business object and assign some fields into it.

I have also assign some custom action into this custom business object. After that i have created the Embed component and and configured into Account_TI screen and its display data.

Now when I open Any Account and go to that newly embed component in silverlight 2 options comes ( Save and Cancel ) to remove this options or to make display mode by default I have followed the below steps:

1) Open Embed Component into UI designer.

2) Go to Properties Window.

3) In the top from the dropdown list select embed component.

4) In the Property go to Configuration --> WorkProtectRelevant equal to false.

5) After save and activate and check but still getting ( Save and Cancel ) option in embed component

Is there any other solution or any other settings require to remove this ( Save and Cancel ) option.

Regards,

Mithun

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Mithun

I had this exact issue you had when trying to read my custom BO and no records were returned. (Note this issue doesn't occur if records existed).

As I mentioned before, the only thing that worked for me was adding a WindowAction - Save in the read event but this is not ideal.

I think we could both raise an incident to SAP as this is very unexpected behaviour.
Maybe we can get them to look at the way C4C handles the read event for future releases.

You could set all the fields to read only but I'm not sure if this will stop the edit mode opening.

We should not have to create a read only indicator and bind to all the fields simply because we have a read of a BO. We have not changed anything on the UI, so this doesn't make sense.


Do you agree?

former_member200567
Active Contributor
0 Kudos

I totally agree.

Former Member
0 Kudos

Hi Brad,

I am agree with you comment I will raise incident to SAP and let you know.

Regards,

Mithun

Former Member
0 Kudos

I will raise this as well

former_member190501
Active Contributor
0 Kudos

Dear Mithun,

Did you get any response from SAP, if yes, Could you please share the solution.

Thanks,

Raju

Former Member
0 Kudos

Hi Raju,

We have tried but did not find any solution to make it display mode but for your information please check below post for same.

Regards,

Mithun

former_member190501
Active Contributor
0 Kudos

Dear Mithun,

Thanks a lot for the reference.

Its working for us after unchecking Relevant for WorkProtect for our defined action event.

Thanks,

Raju

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Mithun

We had this exact same problem where our embedded component would open in edit mode when it did not find any records in the custom BO.

If records existed in the custom BO, the EC would not open in edit mode..

Is this the same as your case?


Try add a condition to check for blank before your read operation. This will prevent the read and stop the edit mode occuring.

Let me know if this works

Cheers

Brad

Former Member
0 Kudos

You can also do a dodgy fix...

You can add a WindowAction - Save at the end of your operations. This will change the screen back to display.

sumeet_narang
Active Participant
0 Kudos

Hi Mithun,


Agree with Brad. If the condition check doesn't work then the save option would definately work. The only thing is that whenever you open the account for the first time you will get a save message which will save the BO entries.

Regards,

Sumeet

Former Member
0 Kudos

Hi Brad and Sumeet,

Thanks for you reply on this post.

In my requirement we do not want to save record anymore.

Also my scenario : We have consuming the on-premise web service into c4c we have created the custom business object ( Not Screen) and based on this custom business object we have created the embed component and  design the screen to embed with Account_TI.

We have Read the Account ID from Account _TI screen and assign to embed component element Alternative key AccountID.

We have created of configured the embed component Inport to Read and Assign the Account ID as below:

My Custom business object :

businessobject ECC_recordBO {

  [AlternativeKey] [Label("Customer Number")] element AccountID : BusinessPartnerInternalID;

  element CtLimit : LANGUAGEINDEPENDENT_LONG_Text;

  element AvailCLimit : LANGUAGEINDEPENDENT_LONG_Text;

  element AccCurrency : CurrencyCode;

  action ViewAcc;

}

My embed component InPort event :

ReadEvent

In ReadBOEvent I have add below actions:

BO Operation

Condition

And under the condition I have use the below actions :

To create BOOperation

Second DataOperation as below :

Assign AccountID from Account_TI to AccountID of embed component.

Also once the user come into the Account_TI screen and go to embed component first its in display mode and when he click on any action under embed component its in edit mode but we do not want to save data anymore.

Regards,

Mithun

Former Member
0 Kudos

Hi Mithun

Sorry it is a little unclear - Did the condition work and the EC now opens in display mode?

You now want to prevent the users doing any actions or editing the screen fields in the EC?

Cheers

Brad

Former Member
0 Kudos

Hi Brad,

Currently the EC work and Inport as well as alternative key populated with AccountID of Account_TI screen.

When I entered into the Account_TI screen It is in display mode but when I go to EC Its change to Display mode to Edit mode.

I want when user click or select EC first its in Display mode and when user click on button exist on EC then the EC change to edit mode otherwise It I want to in display mode.

Regards,

Mithun

Former Member
0 Kudos

I know it isn't clean, but you could add a windowaction - save at the end of your ReadBOEvent. This does mean it will save any changes the user has already made in other account screens.

I mentioned this problem on another blog post and Gert Kix responded with this:

Recently it was brought to my attention that this type of behaviour can occur when an embedded component is added to a custom object and the WorkProtectedRelevant flag on the embedded component is not set. You have this flag on field level but also on embedded component level

I haven't tried this solution yet but I will try in a couple of days. Let me know if you do before then.

Cheers

Brad

former_member200567
Active Contributor
0 Kudos

HI, Mithun .

      The steps you did kind of always lead to edit mode.

      

      If the READ operation is successful, the EC will be in edit mode.

      If the CREATE operation is successful, the EC will also in edit mode.

      

      So, how did you make it read-only mode in the first place?

Regards,

Fred.

Former Member
0 Kudos

Hi Fred,

Can you please help me if you have any other solution to make it display mode?

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi, Mithun.

          I will help as possible as I can. But I still dont understand your use case, sorry.

          Please explain what you are trying to do.

          Is Account_TI always read only?

Regards,

Fred.

Former Member
0 Kudos

Hi Fred,

My Scenario :

We have created custom business object (without screen) and based on that we have created embed component and design as I have mentioned in previous steps.

In My use case we have consume on-premise web services and read data based on Account Id. So once user open any account and go to my embed component then Account ID filled automatically using InPort and alternative key. So user do not need to enter AccountID and once user click on Button before that I want to screen in display mode but when user click on Button after I understand screen change to display to edit mode but before button press I want to make this embed component in display mode.

I know I have used the Create function to create instance of custom business object and may be this reason the screen in edit mode but In one of the video I have seen that using WorkProtectedRelevant make it false it make it display mode.

Please let me know if you need any more details about this scenario.

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi, Mithun.

       Sorry for the late reply.

       I think making the WorkProtectedRelevant to false can not make your screen read-only.

       I think WorkProtectedRelevant is just for confirming your changes to an instance.

        Setting it to false will automatically omit the save confirmation dialog.

      Here are some suggestion.

      1. Add an indicator to your BO with default "true"..

      2. Add an action (for button) to your BO.

      3. Bind the read-only properties of the fields on your EC with the indicator

      4. In the Action event, assign the indicator to "false".

Regards,

Fred.

Former Member
0 Kudos

Hi Fred,

I have tried your suggestion as below :

Add Indicator in Custom business object with default "true" and assign this field to Read Only property to every field using Advance option.

After when I open Account screen and go to my embed component getting same in edit mode.

Is there any other configuration or changes require?

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi , Mithun

       Just a curious question.

       Is there anywhere else where you assign the indicator to 'false' besides in your BO action?

       

       And by the way, how did you assign the default 'true'. ?

       You should do it in the BO definition.

Regards,

Fred.

Former Member
0 Kudos

Hi Fred,

I have not used anywhere false value in my custom solution.

In my custom business object I have make it default value as shown below.

element IndRead : Indicator = true;

And I have open my EC in UI designer and go to property of each fields and assign this Indicator field in Read-Only Advance option and bind it.

Kindly help me if I am wrong anywhere.

Regards,

Mithun

Former Member
0 Kudos

Hi Fred,

I am getting read-only mode for all field that assigned the Indicator but the Account_TI screen still in edit mode.

I want to make it display mode.

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi, Mithun.

       Sorry for my late reply.

        You can do just the same as you did to your custom BO.

        Add an Indicator extension field to the standard BO.

        Open your AccountTI screen, in the extensiblity explorer, select the desired field and click Adjust Properties and use "bind" for Read-Only.

        In the aftermodify event, write the logic.

Regards,

Fred.

Former Member
0 Kudos

I was finally able to make it work in HTML5.

In SL, if you set the WorkProtectedRelevant to false, it works.

In HTML5, if you do the same, and also uncheck this flag on BO 'Create' operation and BO Action, it doesn't work. You have to also set the WorkProtectedRelevant flag to false on every single data field bound to the object.

Hope this helps.

Thanks.

Fernando

DALJEET
Participant
0 Kudos

Hi ,

I found your solution working in my case. Perfect!!

Br'

Daljeet

sumeet_narang
Active Participant
0 Kudos

Hi Mithun,

Do you have the alternative key field which gets the inport Account ID value as visible on the screen. If yes can you make it hidden and see what happens?

Thanks and Regards,

Sumeet Narang

Former Member
0 Kudos

Hi Sumeet,

I have AccountID as alternative key and its hidden in UI Designer. But no success.

Regards,

Mithun

sumeet_narang
Active Participant
0 Kudos

Ok, try one more thing then.

Make the property of the inport event fire as Request Fire on Initialization to False and Request AutoRefire to true. This will not fire the event when you open the screen for the first time but would fire when you make some changes to this screen.

Regards,

Sumeet

Former Member
0 Kudos

Hi Sumeet,

I have made change on Embed component InPort

Property :

RequestFireOnInitilization = False

RequestAutoRefire            = True

When I tested the screen will be in Display mode but when I click on button in embed component no data display. and when I revert the changes the data comes fine.

Also InPort Account and Custom BO Alternative key not populate.

Help me anything wrong in it.

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi, Mithun,

     Are you sure if that confirmation dialog box is coming from your EC not from Account_TI?

Regards,

Fred.

Former Member
0 Kudos

Yes,

Because When I enter into the Account_TI screen It is in display mode and when i click on my embed component its switch to edit mode.

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi, Mithun,

        I think that depens on how you add your EC to Account_TI.

        Have you done some BO Operation "CREATE" on EC?

Regards,

Fred.

Former Member
0 Kudos

Hello Fred,

No, But based on radio-button I am enable and disable the inputbox when user select the radio button.

Regards,

Mithun

former_member200567
Active Contributor
0 Kudos

Hi, Mithun.

        I am knind of comfused in what you have done to your EC.

        Can you please explain your UseCase a bit more?

Regards,

Fred.