Skip to Content
0

How to update a UDF Value in AR/invoice uisng DIAPI ?

Oct 07, 2017 at 07:06 AM

207

avatar image
Former Member

Hi Experts,

Here I explain My scenerio

1.I have created one sale order with 10 quantities and I select 10 serial number against that particular sale order.

2.Then I create the ARinvoice against that particular sale order.and I have one udf in Invoice screen i didn't enter any values in it

Now I need to update that udf value using DIAPI.

1.Is it possible to update a AR/Invoice screen Udf using DIAPI?

2.Is there any need to change SBO Post Transaction?

Please help me to solve this ..

Thanks Advance.

10 |10000 characters needed characters left characters exceeded

Hi Edy Simon, DIEGO LOTHER and Manikandan. D,

Update: We have checked this issue in detail and found the following:

The line level UDFs on Marketing Documents are disabled in SAP Business One Client for update however you can update the line level UDFs via DI API under the following conditions:

  • You are working in the Brazil (BR) or Mexico (MX) localization.
  • Intrastat is enabled.
  • Sales employee is changed on row level.
  • You update the base price of gross profit.

Refer to SAP Note 2318381 for more information.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

DIEGO LOTHER Oct 07, 2017 at 10:25 PM
1

Hi Manikandan,

Yes, it is possible to update an UDF on invoice document and no, you don't need change anything on SBO Post Transaction.

A sample how to update an UDF on header of the document:

Documents oInvoice = oCompany.GetBusinessObject(BoObjectTypes.oInvoices);
if (oInvoice.GetByKey(149))
{
    oInvoice.UserFields.Fields.Item("U_yourfieldname").Value = "aaa";
    if (oInvoice.Update() != 0)
        MessageBox.Show(oCompany.GetLastErrorDescription());
}

Hope it helps.

Kind Regards,

Diego Lother

Show 15 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Diego Lother,

Actually This is my code, But this is not updating any value. I am trying to update Row level value. Is it possible to update row level value in ARinvoice?

Dim oInvoice As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oInvoices)

If oInvoice.GetByKey(52) Then

oInvoice.Lines.UserFields.Fields.Item("U_LOAD_QTY").Value = "2"

Inx = oInvoice.Update()

If Inx <> 0 Then

Response.Write("")

End If

End If

0

Hi Manikandan,

Yes, it is possible. In your code, you only update the value from the first row. Did you check if happens some error? Your response is blank.

Kind Regards,

Diego Lother

0
Former Member

HI Diego Lother,

Actually, I didn't get any error and also I can't able to update Row level udf value.It doesn't show any changes in INV1 table(rowlevel udf)

I used the below code it didn't show any error.please check this code.Is there any mistakes is this code?

Dim oInvoice As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oInvoices)

If oInvoice.GetByKey(52) Then

oInvoice.Lines.UserFields.Fields.Item("U_Rowleveludf").Value = "2"

Inx = oInvoice.Update()

If Inx <> 0 Then

Response.Write("Error")

End If

End If

NOTE:I can able to update the header level udf value but i can't in Row level(matrix level)

Please help me solve this issue.

0

Manikandan,

Your code seems correct. For me update udf at line level by DI API works fine.

Kind Regards,

Diego Lother

0
Former Member

Hi Diego lother,

Actually, In ARINVOICE I tried to update a line level value in already created ARINVOICE. But i can't able to update a line level value in default Sap screen(ARIVOICE). But I can able to update the Header level values in Sap screen(ARINVOICE)

Sir, Is there any other way to update a line level Udf value in ARinvoice screen?

0

Hi Manikandan,

By SAP Client is not possible to update an udf field on line level of invoice. Unfortunately I don't know if there is other way. Update by DI API works fine for me on version 9.0, 9.1 and 9.2 of SAP.

A question:

Did you debug your code? Check if variable Inx stay with value 0 after call oInvoice.Update().

Kind Regards,

Diego Lother

0

Hi Diego/Manikandan,

There must be some setting or localization issue or something else we don't yet understand.
In my case, I have the same result as Manikandan.
The update returns 0, but the value is not updated into table.
A few in this community said they can do it.

Hi @ankit.chauhan1

Can you confirm?

Regards

Edy

0

Hi Edy,

In my case, I use Brazil localization.

Kind Regards,

Diego Lother

0

Hi Edy Simon ,

While DIEGO LOTHER is using Brazil Localization. Can you and Manikandan. D confirm which localization are you using?

Let me find something about it once you confirm the localizations.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0

Hi Ankit,

I am on Singapore Localization.

I hope you can find something, this feature will be very helpful.

Regards

Edy

0

Hi Edy Simon , DIEGO LOTHER and Manikandan. D

I am discussing this issue internally and will keep you posted once I find something about it.

Thank you very much for your patience till the time!

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0

Hi ANKIT CHAUHAN ,

Thank you for your attention and help.

Kind Regards,

Diego Lother

0
Former Member
ANKIT CHAUHAN

Hi ANKIT CHAUHAN ,

Thank you for your attention and help.please share if you found.

0

Thanks Ankit.

Hope there is a good news.

0

Hi Edy Simon, DIEGO LOTHER and Manikandan. D,

Update: We have checked this issue in detail and found the following:

The line level UDFs on Marketing Documents are disabled in SAP Business One Client for update however you can update the line level UDFs via DI API under the following conditions:

1. If you are working in Brazil or Mexico Localization.

2. If Intrastat is enabled.

We are checking it for more conditions and will keep you updated about the same.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0