cancel
Showing results for 
Search instead for 
Did you mean: 

How to click the Menu id..

Former Member
0 Kudos

HI..

Normally We are clicking the item by using the uid..

oitem.click(reular, doulble)

my requirement is (see the image)

this is purchase order after right click we can see the options..

save as draft has menuid =some number..

how can i click this one....

is it possible..in particular event...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi srnivas,

Its not clear to me if you want to save a draft document or replicate user click at SBO UI.

to save a draft document see this example taken from SDK Help

Sub AddInvoice_Click()
    Dim RetVal As Long
    Dim ErrCode As Long
    Dim ErrMsg As String

    'Create the Documents object
    Dim vDrafts As SAPbobsCOM.Documents
    Set vDrafts = vCmp.GetBusinessObject(oDrafts)

    'Set values to the fields
    vDrafts.DocObjectCode = oInvoices
    vDrafts.CardCode = "BP234"
    vDrafts.HandWritten = tNO
    vDrafts.DocDate = "21/8/2003"
    vDrafts.DocTotal = 264.6

    'Invoice Lines - Set values to the first line
    vDrafts.Lines.ItemCode = "A00023"
    vDrafts.Lines.ItemDescription = "Banana"

    vDrafts.Lines.Quantity = 50

    'Invoice Lines - Set values to the second line
    vDrafts.Lines.Add
    vDrafts.Lines.ItemCode = " A00033"
    vDrafts.Lines.ItemDescription = "Orange"

    vDrafts.Lines.Quantity = 1

    'Add the Invoice
    RetVal = vDrafts.Add

   'Check the result
    If RetVal <> 0 Then
        vCmp.GetLastError ErrCode, ErrMsg
        MsgBox ErrCode & " " & ErrMsg
    End If
End Sub

To replicate user click try this (also seen at SDK Help, dont know if it works)

B1_Application.Menus.Item("5907").Activate() 'im using B1DE. if not change b1_application to your ui aplication object

Hope this helps you

Former Member
0 Kudos

K Sir I Will Try....Later doing another Work..

Thanks for sharing your knowledge...

Answers (0)