on 10-15-2007 7:10 PM
Basically, using the UI-API, I'm capturing the events for the Sales Order UDF form (-139), but I need to interact with the Sales Order form that it's attached to. How do I know the UID of the Sales Order form that goes with the UDF form that is known??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Matthias. What I'm gathering from the forums is that even though SAP seems to be connecting the SO form and its UDF form somehow, it doesn't provide this linkage to the API. So it's no procedurally possible to link the SO and UDF forms together. Instead, you have to use events and just "hope" that it's capturing the right one.
I did come up with the solution below, and it's the same as suggested in one of the forums. I've also used this same technique for other similar issues as well, such as figuring out which form was the opener of another form.
Since the main system form is always activated when you click within the UDF, on the "activate" event for the main form, I'm immediately copying a reference to the form in a global variable (LastForm):
If Not pVal.BeforeAction And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE Or pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) Then
If FormType > 0 And FormType < 200 Then
LastForm = SBO_Application.Forms.Item(FormUID)
end if
end if
Since I'm checking for the formtype to be >0, it doesn't track the UDF forms, only the main forms.
Then in the UDF form, I can retrieve its main form with LastForm.
hi Bryan,
u can do it easily by getform() method.
just write the statement
Set oForm = oApplication.Forms.GetForm(139, 1)
now form object oForm is representing the sales order form in ur UDF.
hope u will get idea.
ifsatisfied, rewards points
regards
nirdesh panwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bryan,
If you want to add UDF in Sales Order using UI API,
oForm=app.Forms.FormType("139",1)
oItem=oForm.Items.Add("Label1",STATIC_TEXT)
oItem.Top=xx
oItem.Width=xx
oItem.Height=xx
oItem.Left=xx
oLabel=oItem.Specific
oLabel.Caption="Sample Text"
Hope this will be help for you and give me reward points,
Regards,
G.Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bryan,
UID will differ at each time. I think u want to add some fields in the SalesOrder? If so reply me i help u
Regards,
Anitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.