Skip to Content
author's profile photo Former Member
Former Member

Merging multiple delivery records into one

Hi,

In SAP Business One, I have a Sales Order with multiple rows and I would like to merge these into 1 record? How could I do it?

Example: Sales Order 12345 have the following rows:

Item No. Quantity

Prod1 100

Prod2 200

Prod3 300

Expected output is:

12345, Prod1, 100, Prod2, 200, Prod3, 300

Thanks,

Noel

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 28, 2016 at 06:45 PM

    SELECT T0.DocNum,

    (SELECT ItemCode + ',' + CAST(Quantity AS VARCHAR(10)) + ',' FROM RDR1

    WHERE T0.DocEntry = DocEntry FOR XML Path(''))

    FROM ORDR T0

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 28, 2016 at 07:09 PM

    SELECT cast (T0.DocNum as varchar(10)) + ' , ' +

    (SELECT ItemCode + ' , ' + CAST(Quantity AS VARCHAR(10)) + ' , ' FROM RDR1

    WHERE T0.DocEntry = DocEntry FOR XML Path('') )

    FROM ORDR T0

    Regards,

    Vinoth

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.