cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a PO Form with a specific Po number

Former Member
0 Kudos

Hi Experts

How can i open a Form with a specific docnum by SDK. I know how to open form But I do not know how to fill it with specific data.

Thanks

Regards

Gorge

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There is one work around for that. After u open the form do the following...

1. By default the form opens in Add mode change it to Find Mode (u can activate the menu id 1281[for find]).

2. Place the required doc no(item 😎 in the respective field.

3. Now click on the find button (item 1)

Now the form opens with the required data. But there will be lot of flickering i guess for that u can use FORM FREEZ and FORM UNFREEZ.

Hope this helps,

Vasu Natari.

Former Member
0 Kudos

Thanks for quick reply

The form is not opened in find mode. My code is given below

<B1Listener(BoEventTypes.et_MATRIX_LINK_PRESSED, False, New String() {"2000000342"})> _

Public Overridable Sub OnAfterMatrixLinkPressed(ByVal pVal As ItemEvent)

Dim ActionSuccess As Boolean = pVal.ActionSuccess

Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)

B1Connections.theAppl.ActivateMenuItem("2050") ' for Sales order form

End Sub

<B1Listener(BoEventTypes.et_FORM_LOAD, False, New String() {"2000000342", "139"})> _

Public Overridable Sub OnAfterFormLoad(ByVal pVal As ItemEvent)

Dim ActionSuccess As Boolean = pVal.ActionSuccess

Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)

If pVal.FormTypeEx = "139" Then

Dim MenuItem As SAPbouiCOM.MenuItem

MenuItem = B1Connections.theAppl.Menus.Item("1281")

MenuItem.Activate()

oItem = Form.Items.Item("8")

'oItem.Enabled = True

editName = oItem.Specific

editName.Value = 40

oItem = Form.Items.Item("1")

oItem.Click()

End If

end sub

It gives error "Item is not Editable"

Edited by: Gorge Ance on May 29, 2009 12:07 PM

Former Member
0 Kudos

Hi,

By default the form opens in ADD Mode.. change that to Find mode.

And execute ur code.

Click the menu (FIND) after the form is opened. Make sure u execute ur code in the befere action = FALSE.

Vasu Natari.

Former Member
0 Kudos

Hi Vasu

I know that form is open in add mode . So i Activate menuitem(1281) as mention in code. but it does not change in find mode , I checked that before action is false. code for activate menuitem is given below

If pVal.FormTypeEx = "139" Then

Dim MenuItem As SAPbouiCOM.MenuItem

MenuItem = B1Connections.theAppl.Menus.Item("1281")

MenuItem.Activate()

Form.Mode = BoFormMode.fm_FIND_MODE

oItem = Form.Items.Item("8")

'oItem.Enabled = True

editName = oItem.Specific

editName.Value = 40

oItem = Form.Items.Item("1")

oItem.Click()

end if

Thanks

Regards

Gorge

Former Member
0 Kudos

Hi,

Please use a try and catch block..

If pVal.FormTypeEx = "139" Then
TRY
'Dim MenuItem As SAPbouiCOM.MenuItem
'MenuItem = B1Connections.theAppl.Menus.Item("1281")
'MenuItem.Activate()

objSBOAPI.SBO_Appln.ActivateMenuItem("1281")  ' Change objsboapi with ur application object.

Form.Mode = BoFormMode.fm_FIND_MODE
oItem = Form.Items.Item("8")
'oItem.Enabled = True
editName = oItem.Specific

editName.Value = 40

oItem = Form.Items.Item("1")
oItem.Click()

Catch (ex as exception)
Msgbox(ex.Message)
End TRY

end if

Try the above code and check if its working

Vasu Natari.

Former Member
0 Kudos

hi Vasu

It gives the same message "Item is not Editable" mean form is opened in Add mode not in findmode

Thanks

Regards

Gorge

Answers (0)