Skip to Content

Accessing data from standard fields

Hi...

My question is simple. How do I get the data from a standard field?

As an exsampel i need to get the item-code from the displayed storage item, but how do i get this. I have tried the following

- Connect to the SBO-client

<i>(As normal)</i>

- Added eventhandlers

<i>(Standard Eventhandlers)</i>

- Now I catch the event of the next datarecord menuitem (1288) and want to get the item-code from the displayed in the item-window

I've tried using getting the Datasource for the item-code (Item 5) but the value is always empty.

Could anyone give me a quick exampel how they get a value from a standard datasource-field please?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 01, 2004 at 07:44 AM

    Hi,

    <u>In case you need to get data from GUI element:</u>

    Set oItem = oForm.Items("MyPic")

    Set oEditText = oItem.Specific

    Call MsgBox(oEditText.String)

    <u>In case you need to get data from UserDatasource:</u>

    Set oUserDataSource =

    oForm.DataSources.UserDataSources.Item("Remarks")

    Call MsgBox(oUserDataSource.Value)

    <u>In case you need to get data from Matrix:</u>

    Set oColumn = oMatrix.Columns.Item("PicturName")

    Set oCell = oColumn.Cells.Item(3)

    Set oEdtTxt = oCell.Specific

    sPicName = oEdtTxt.String

    in any case - all these can be found in SDK help and samples.

    Best regards,

    Yaniv Gamliel

    SDK Consultant

    SAP Manage Israel

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks... The first case solved my problem, but i still can't get the userdatasources to work

      See the following test (In C#)

      SAPbouiCOM.Form f = sbo_ui_applicationHandler.app.Forms.Item(FormUID);

      f.DataSources.UserDataSources.Add("ds_uid",SAPbouiCOM.BoDataType.dt_SHORT_TEXT,10);

      SAPbouiCOM.Item myitem = f.Items.Add("myitem_uid",SAPbouiCOM.BoFormItemTypes.it_EDIT);

      SAPbouiCOM.EditText cb = (SAPbouiCOM.EditText)myitem.Specific;

      cb.DataBind.SetBound(true,"","ds_uid");

      cb.Value = "test";

      MessageBox.Show(f.DataSources.UserDataSources.Item("ds_uid").Value);

      This add a datasource to to my form, and add bind it to an editbox.... Then in the last line i try to get the value again, but it leave me a empty value..