Skip to Content
0
Feb 27, 2014 at 11:52 AM

Problem adding a SO, price source always manual

319 Views

Hi everyone,

I have this problem when adding a sales order using DI, I will try to explain my scenario.

I have a business partner with a price list defined for all items, so when I create a new document manually on SAP it will automatically fill the price of the items and also sets that list as price source. On top of that I have a transaction notification preventing users from adding a document with price source as "Manual".

Now the problem is when I try to add a SO with DI, I only set the Item Code and Quantity and when I add the document it fires the transaction notification and I can't add the document.

I disabled the transaction notification and add the document, it automatically fill the prices correctly but it sets the price source as "Manual", what am I missing?

transaction notification is this:

if @object_type = '17' and @transaction_type in ('A','U')
begin
  if (select count(*) from RDR1 t1 where t1.SpecPrice = 'N' and t1.DocEntry = @list_of_cols_val_tab_del) > 0
  begin
  select @error = '5005'
  select @error_message = N'It is not allowed to change the price manually'
  end
end


The code for adding lines is just this:

ordr.Lines.UoMEntry = UomEntry;
ordr.Lines.ItemCode = ItemCode;
ordr.Lines.Quantity = item.ItemQuantity;
ordr.Lines.Add();

I've attached two images, one added manually from SAP BO and other added from DI.

Hope someone could help me with this.

Thanks.

Attachments

PO_DI.jpg (46.3 kB)
PO_Mannualy.jpg (44.3 kB)