Hi all,
could anyone post a sample showing how to create and actually use folders on a SAP form using an xml file?
I have used the GetAsXml method of the form object to get the definition of the SAP form business partners. However, when I batchload this form back into SAP, the folders do not seem to work properly.
As far as I understand, all controls on a form can be on different panes. The panes are controlled by the folders. The folders themselves and all objects that are always visible are on pane 0. Should they be marked form_pane=0 to_pane=3, if they are to be visible on all panes?
The documentation also states, that folders need to be grouped with other folders to work properly. Can folders be grouped via xml? Or only by code? Documentation also states
"To hold data for this element, you must connect it to a UserDataSource object.". Any idea how that works?
There also is an object called PaneComboBox which is used to control panes. Can anyone give an example for useage of this object?
Thank you for reading this. Sorry for posting more and more questions. the deeper I get into the subject, the more I miss documentation of certain issues.
TIA, Lutz Morrien
This is a quote from the xml I received for the folders:
quote:
end of quote.
I realize that there is a sample of using folders in the "complex form sample" provided by SAP.
(See code below).
However I do not know how to provide this functionality via xml (or what part of functionality).
Lutz Morrien
Sample:
'//***************************
'// Adding Folder items
'//***************************
For i = 1 To 2
oItem = oForm.Items.Add("Folder" & i, SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem.Left = (i - 1) * 100
oItem.Width = 100
oItem.Top = 6
oItem.Height = 19
oFolder = oItem.Specific
'// set the caption
oFolder.Caption = "Folder" & i
oFolder.DataBind.SetBound(True, "", "FolderDS")
If i = 1 Then
oFolder.Select()
Else
oFolder.GroupWith(("Folder" & i - 1))
End If
Next i
Hi Lutz !
Hope it's not too late, but I'm working at the same problem and figured it out today ... you must have the following parts in your XML:
<b>1. Create a User datasource (UDS)</b>
<userdatasources>
<action type="add">
<datasource size="1" type="9" uid="udsFold"/>
</action>
</userdatasources>
<b>2. Create Folder items linked to the UDS</b>
<Item description="" disp_desc="0" enabled="1" from_pane="0" height="20" left="6" linkto="" right_just="0" tab_order="1" to_pane="0" top="87" type="99" uid="fdContent" visible="1" width="103">
<Specific caption="Inhalt" val_off="0" val_on="1">
<databind alias="udsFold" databound="1" table=""/>
</Specific>
</Item>
<Item description="" disp_desc="0" enabled="1" from_pane="0" height="20" left="84" linkto="" right_just="0" tab_order="2" to_pane="0" top="87" type="99" uid="fdLogist" visible="1" width="103">
<Specific caption="Logistik" val_off="0" val_on="2">
<databind alias="udsFold" databound="1" table=""/>
</Specific>
</Item>
<b>3. Group your folder items</b> (create another "items" section, do NOT use the same one as for items/add)
<items>
<action type="group">
<Item uid="fdLogist"/>
<Item uid="fdContent"/>
</action>
</items>
<b>4. Open the form with "loadBatchAction"</b> and refresh it, otherwise the folders will be invisible until you click on them
Dim oXMLDoc1 As MSXML2.DOMDocument
Set oXMLDoc1 = New MSXML2.DOMDocument
oXMLDoc1.Load ("BR_Order.srf")
Form1.goApp.LoadBatchActions oXMLDoc1.xml
Dim oForm As SAPbouiCOM.Form
Set oForm = Form1.goApp.Forms.Item("BR_frmOrder")
oForm.Refresh
After that you can handle your folders like it is shown in the VB sample.
Hope this helps. I would send you the whole XML but I can see no way to add an attachment here ...
With best regards
Axel
Sorry, small mistake, use oForm.Update instead oForm.Refresh (or use both, works nearly always)
Hi Lutz !
Sorry for the late answer, email notification seems not to be working anymore. I had the same problems in version 6.2 with some folder objects, although I was not using XML but the common UI-API functions. If I remember correctly I could activate the folders manually handling an item event but this did not work with changing the form mode, it was always overwritten. I'd like to give you better news but I think you will have to live with it until the next update.
Regards
Axel
Add a comment