cancel
Showing results for 
Search instead for 
Did you mean: 

copy from purchase indent to purchase order.

Former Member
0 Kudos

Hi

I am developing an ADDOn purchase indent.

in that added a copyto button which does the functionality of copying the content of existing form to purchase order.

i am able to open purchase order form but ,, how can i add / copy the content. can you please give me any hints of it .

Thanks Regarding

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Narayana,

U can copy the cotents to the Purchase order form, Once the form is opened just get the form references and copy the data.

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

Hi

This is the code i have written to access the purchase order form

but the references are not working properly..

SBO_Application.ActivateMenuItem("2305")

Dim f As SAPbouiCOM.Form

f = SBO_Application.Forms.Item("142")

'f.Select()

' f.Execute() Dim f As SAPbouiCOM.Form

Dim oField As SAPbouiCOM.EditText

'f = SBO_Application.Forms.Item("142")

oItem = f.Items.Item("14")

oField = oItem.Specific

oField.String = "helllllo"

can please get me the sample code to copy the the data from indent form to purchase order

Former Member
0 Kudos

The code which ur using is fine i guess thats the same way wich i used to, Use a Try and a Catch block and catch the exact error that ur facing,

Hope it helps,

Vasu Natari.

Nussi
Active Contributor
0 Kudos

Hi Narayana,

you create the form object "f" wrong.


SBO_Application.ActivateMenuItem("2305")
Dim f As SAPbouiCOM.Form

f = SBO_Application.Forms.ActiveForm

this should help you

lg David

Former Member
0 Kudos

HI

This is my full code.. written in itemevent.

If pVal.Before_Action = False Then

Select Case pVal.FormUID

Case "TBL_INDENT1_"

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_CLICK

If pVal.ItemUID = "28" And pVal.FormMode <> "3" Then

Try

SBO_Application.ActivateMenuItem("2305")

Dim f As SAPbouiCOM.Form

f = SBO_Application.Forms.Item("142")

*****************

Dim oField As SAPbouiCOM.EditText

'f = SBO_Application.Forms.Item("142")

oItem = f.Items.Item("14")

oField = oItem.Specific

oField.String = "helllllo"

SBO_Application.MessageBox("Its a TESTING")

Catch ex As Exception

SBO_Application.MessageBox("Its a TESTING FOR COPY TO FUNCTIONALITY ")

End Try

End If

End Select

End Select

End If

when the code is executing after opening the form.. wen we assign form 142.. then it skips to catch block...

can u help me plz......

give me a hint to solve it..

Thanks Regarding.

Former Member
0 Kudos

Plz use this in the catch box and tell me thats the exception ur getting, y did u hard code the mesage in catch block.

And as david suggested use the active form.

Msgbox(ex.message)

Vasu Natari.

Former Member
0 Kudos

Hi I am very sorry .. i tried with u code.. replaced as

SBO_Application.ActivateMenuItem("2305")

Dim f As SAPbouiCOM.Form

f = SBO_Application.Forms.ActiveForm

Dim oField As SAPbouiCOM.EditText

oItem = f.Items.Item("14")

oField = oItem.Specific

oField.String = "helllllo"

SBO_Application.MessageBox("Its a TESTING")

now it is unable to open the purchase order form,,,

Nussi
Active Contributor
0 Kudos

Hi,

this code opens the form -> SBO_Application.ActivateMenuItem("2305")

my code runs AFTER the form should already be open.

the error is somewhere else (above the code i suggested).

lg David

Former Member
0 Kudos

Thank u very much.. i am able to open the purchase order form, what i need to do is the content of the indent form form which i designed is to be filled to purchase order.

code what i wrote is...

SBO_Application.ActivateMenuItem("2305")

Dim f As SAPbouiCOM.Form

f = SBO_Application.Forms.ActiveForm

'Dim f As SAPbouiCOM.Form

'f = SBO_Application.Forms.Item("142")

'f.Select()

' ' f.Execute() Dim f As SAPbouiCOM.Form

Dim oField As SAPbouiCOM.EditText

oItem = f.Items.Item("16")

oField = oItem.Specific

oField.String = "Based On PurchaseIndent:" + oForm.Items.Item("3").Specific.Value

Dim sSql As String = ""

Dim oRS As SAPbobsCOM.Recordset

oItem = f.Items.Item("38")

oMatrix = oItem.Specific

oColumns = oMatrix.Columns

sSql = "select a.U_ITEM as Code, a.U_DESC as Descp,a.U_QTY as Quantity,a.U_RATE as price from [@TBL_INDENTROWS1] a,[@TBL_INDENT1] b where a.DocEntry=b.DocEntry and b.U_INDNO='" & oForm.Items.Item("3").Specific.Value & " '"

oRS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

oRS.DoQuery(sSql)

If oRS.RecordCount > 0 Then

Dim i As Integer = 0

oRS.MoveFirst()

While oRS.EoF = False

i = i + 1

oMatrix.Columns.Item("1").Cells.Item(i).Specific.Value = oRS.Fields.Item("Code").Value******************************************************

oMatrix.Columns.Item("3").Cells.Item(i).Specific.Value = oRS.Fields.Item("Descp").Value

oMatrix.Columns.Item("11").Cells.Item(i).Specific.Value = oRS.Fields.Item("Quantity").Value

oMatrix.Columns.Item("13").Cells.Item(i).Specific.Value = oRS.Fields.Item("price").Value

' oMatrix.AddRow()

oRS.MoveNext()

End While

End If

when the control reaches to the column 1 it raises exception ..

can u plz help me in solving the matrix issue,,

Former Member
0 Kudos

Can u please tell what the error was..??

Vasu Natari.

Former Member
0 Kudos

Item-Form item in not editable..

this is the exception

raised..

Former Member
0 Kudos

Well in the PO u need to add the vendor to add a line to the Matrix, so plz try adding the vendor and then u try to add the lines to the matrix, Plz check the flow frm the UI.

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

i have written code in copyto button itself .

how to change the code such that it reflect when vendor code is selected..

cant we enable matrix of po.. make it editable

Former Member
0 Kudos

In ur code itself u can put the vendor too... or if the user selects the vendor then u can fill the matrix in the lost focus of the Vendor field.

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

thanks alot for guiding me..

it is working..

can u please help me solving another issue that

working with linkbutton.. please get me a sample code for it..

Former Member
0 Kudos

Good to here that its working.... now i guess u can give the points and close this thread.

For ur link button i suggest u open another thread.

Vasu Natari.

Former Member
0 Kudos

Hi

how to write the code in button click for po form.

we have to update stock when add is clicked.

can u.. please get me some code for it.

Former Member
0 Kudos

If u talking abt PO screen then for the inventory updates we dont need to write any code the system will take care of it all.

Vasu Natari.

Former Member
0 Kudos

Hi

i need to write code to update my user defiened tables.

the qty ordered should be reflected in my tables. this should be done when add of po is click..

Former Member
0 Kudos

Hi

Thanks for all your guidance.. i am able to load form but the thing is my table is to be updated with the values given in po. when the add button in po is click so that event is left now.. can u plz guide me through.

how to collect the click event to add button of po.

Former Member
0 Kudos

Plz write ur code in the Item Event.

Now u want to update ur UDT when the PO is clicked..?? for this In the Item event of the PO screen in the Item Pressed event of Item UID 1(Add update button) and when BeforeAction = False u can use direct SQL query or DI objects for updating ur UDT.

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

If pVal.Before_Action = False Then

Select Case pVal.FormUID

Case SBO_Application.Forms.ActiveForm

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_CLICK

If (pVal.ItemUID = "1") Then

SBO_Application.MessageBox(" updating indent form")

End If

End Select

End Select

End If

this is the code i wrote for button click even of add

is it correct or not

plz verify it plzzz/

Former Member
0 Kudos

hi.........

can u plz help me to catch the button click event of po form from indent form,

where the updation of tables is required.

Answers (0)