on 06-24-2016 3:19 PM
Sap, Developers?
I've been trying to speed up the form drawing of our add-ons using xml via LoadBatchActions. What I want to do is basically two things:
So far, I managed to do it only on form properties, for instance, its title and position, but when it comes to the form items, everything seems to be ignored by the LoadBatchActions call. Here is an exemple of a xml used to update a user defined form.
<?xml version=\"1.0\" encoding=\"UTF-16\"?>
<Application>
<forms>
<action type=\"update\">
<form uid=\"1621670730\" left=\"399\" top=\"0\" width=\"759\" height=\"596\" client_width=\"725\" client_height=\"558\"> <datasources>
<DataTables>
<action type=\"add\" />
</DataTables>
<dbdatasources>
<action type=\"add\" />
</dbdatasources>
<userdatasources>
<action type=\"add\" />
</userdatasources>
</datasources>
<Menus />
<items>
<action type=\"update\">
<item enabled=\"0\" uid=\"ETDocNum\" />
<item enabled=\"1\" uid=\"FDTrackCT\" />
<item enabled=\"1\" uid=\"FDCCe\" />
<item enabled=\"1\" uid=\"FDDocAnt\" />
</action>
</items>
<ChooseFromListCollection>
<action type=\"add\" />
</ChooseFromListCollection>
<DataBrowser />
<Settings />
</form>
</action>
</forms>
</Application>
Thanks,
Hi Abel,
Remove all tags not used.
Here is a working sample.
<Application>
<forms>
<action type="update">
<form uid="">
<items>
<action type="update">
<item uid="">
</item>
</action>
</items>
</form>
</action>
</forms>
</Application>
You need to set the uid of the form and the uid of the item at runtime.
ps: I once tried to remove all valid values with XML, but there was an issue in the SDK that made it impossible. Adding is possible I'll check if that is still the case and if so, report to SAP. Message was edited by: Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Pedro,
Your template did work out. I am able to add valid values to comboboxes, alternate visibility of form items and change their positions. However I also want to act on the property 'Enabled' of some items, which I couldn't. Do you know if load batch actions does have support to this functionality? What are the load batch actions command limitations?
Hi Bruno,
of course you can declare it. the property is enabled="1" for enabled items and enabled="0" for disabled items.
Below you can found a sample for an enbled combobox
<item uid="cbWhs" type="113" left="120" tab_order="0" width="140" top="50" height="14" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute/>
<specific AffectsFormMode="1" TabOrder="4">
<ValidValues>
<action type="add"/>
</ValidValues>
<databind databound="1" table="@MY_TABLES" alias="U_Whs"/>
</specific>
</item>
Kind Regards,
Evangelos D. Plagianos
Hi Abel,
You should be able to also affect the Enabled status of an item. There are a few exceptions though:
On system forms you cannot enable a disabled item;
If you have AutoManagedAttributes set (you can set auto managed enable/disable viewable/unviewable that varies with the form mode) they may override your settings.
It's also possible that an error occurred, and you can get the error information by using: application.GetLastBatchResult();
Returns a string indicating the results (errors or warnings) of the last call to the LoadBatchActions method.
Pedro Magueija
If this answer is helpful or correct, marking it as such is a form of saying thank you.
Hi Pedro,
Application.GetLastBatchResult(); doesn't return any erros. It is not very helpful.
I don't recall now exactly if I tried to enable/disable items on user forms, so I am gonna check it out. On system forms I did it and it doesn't work as you said.
I will also check the auto managed attribute.
I'll post my tests as soon as I can.
Thank you for your help!
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.