cancel
Showing results for 
Search instead for 
Did you mean: 

adding order with B1WS

Former Member
0 Kudos

Hi everyone

I wanted to add a sales order using the b1ws OrdersService

here is my dummy test:

public static bool AddOrder(String sessionID)
        {
            OrdersService orderService = ServiceFactory.createOrdersService(sessionID);

            Document sapOrder = new Document();
            sapOrder.CardCode = "C76052";
            sapOrder.DocDueDate = DateTime.Now;
            sapOrder.DocDueDateSpecified = true;
            DocumentDocumentLine docLine = new DocumentDocumentLine();
            docLine.ItemCode = "346";
            docLine.ItemDescription = "item desc";
            docLine.Quantity = 5;
            docLine.UnitPrice = 1;
            docLine.QuantitySpecified = true;            
            sapOrder.DocumentLines = new DocumentDocumentLine[] { docLine };
            try
            {
                DocumentParams orderParams = orderService.Add(sapOrder);
            }
            catch(Exception e) 
            {
                return false;
            }
            return true;
        }

it gives me an exception which message is "exchange rate not updated"

can anyone tell me what this means, or better whats wrong with my code??

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Genc,

The error you are having is not related to B1WS.

It is a functional requirement in your B1 application. To be able to create documents in different currencies (Dollar, Euro,...) you need to define the exchange rates.

If you try to create the same order directly with B1 application you will see that a window asking you to enter the exchange rates will pop up. After you define the exchange rate in B1 just try to run your sample using B1WS one more time, it should work.

Hope it helps

Trinidad.

Former Member
0 Kudos

Hi Maria,

if you can plz help me with the Error at the below attached post.

http://scn.sap.com/thread/3687019

thanks,

Ravi.

Answers (0)