cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hey All,

Does anyone know how I can update the TrgetEntry and TargetType fields from the SDK for a sales order? I can update the baseentry and basetype fields. Shouldn't I also be able to update the target fields?

I really need to update these fields. Can I use SQL to do it directly if it is not possible through the API?

0 Likes
View Entire Topic
Former Member
0 Likes

Hi there,

May I know what is the purpose to update the TrgetEntry and TrgetType for your Sales Order?

If you create a DO or A/R Invoice base on the Sales Order, both the target field should be updated unless you create your DO or A/R Invoice using SDK.

If you use SDK to create the DO or A/R Invoice, you can set its' baseref and basetype to your desire Sales Order for both DO and A/R Invoice. Thus, your Sales Order should have Target fields updated.

Hope this help....

Former Member
0 Likes

Thanks guys for the informative replies. The purpose for trying to do this is the client wants a sales order and purchase order to be directly linked using the base document and target document menu items on the tool bar. I can set the base fields on the PO and that works great linking back to the sales order. I guess I was hoping I could set the target doc fields on the sales order as this would then allow the user to click the target doc menu item to bring up the related PO. I told them I did not think it was possible through SDK. We will have to go with the alternative method of UDFs.

Does anyone know how i could fire the same logic that is presented to the user when they click the target doc menu item? (IE open the correct purchase order)

Former Member
0 Likes

Hi Curtis,

What we do is add a UDF in the Sales Order lines, and populate it using the SBO_SP_Transaction_Notification when the Purchase Order is created.

Then we catch the double click event on the UDF, and if it has a value, open the related PO.

Hope helps,

Ibai Peñ

Former Member
0 Likes

Hey Ibai.

Thanks so much for the post. How do you open the PO form? The rest of it I understand how to do.

Former Member
0 Likes

Hi Curtis,

What we do is to use the UI API and make the same as you would do it by hand using the B1 GUI.

So:

In the click event, take the PO number and store it. Then execute:

Me.SBOAplication.ActivateMenuItem("2305")

On the MenuEvent, catch the 2305, and if you have a PO stored, set the number in the edittext, and click the find button:

Dim oEditText As SAPbouiCOM.EditText

oEditText = Me.SBOAplication.Forms.ActiveForm.Items.Item("8").Specific

oEditText.Value = NumPedidoCompra

Me.SBOAplication.Forms.ActiveForm.Items.Item("1").Click()

Hope helps,

Ibai Peñ

Former Member
0 Likes

thank you for raise this question.

We have similar challenge and will resolve this problem with a popup box that give user choice to pick delivery/AR-invoice or Purchase order as target document while item on tool bar.

Antoher option to be considered would be to create a button in sales order that link to the target PO. This way business logic in SBO is the same.

-Geir