Skip to Content
author's profile photo Former Member
Former Member

UI: folders, xml and databinding

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.

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2004 at 10:45 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 17, 2004 at 10:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 17, 2004 at 10:56 AM

    Sorry, small mistake, use oForm.Update instead oForm.Refresh (or use both, works nearly always)

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Axel,

      perfect!

      I tried out your solution on SBO 6.20.36 and it does work allright.

      The only problem is that the folders do not show any graphical behavior such as highlighting the folder which is being clicked. Also, when calling the folder.select method, I receive yet another generic failure shutting down the whole application ;(

      The val_on /val_off attributes do not seem to have any effect at all. (Are they referring to the pane which is activated?)

      With the useage of folders I have also noticed that for some reason the form mode changes to update mode. I guess this mode is activated if the content of a datasource is changed. Since the folder items are bound to a user datasource, it causes the mode change when a new folder is chosen. Has anyone encountered the same behaviour or fund a solution to this?

      Every answer raises a million new questions, but I have the impression that this is getting all of us better information.

      Thank you, Lutz Morrien

  • Posted on Mar 22, 2004 at 05:10 PM

    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 comment
    10|10000 characters needed characters exceeded