Skip to Content
avatar image
Former Member

Crystal Layout with sub report

Hi Experts,

I am creating a crystal layout of Sales Order with commands.

This sale order contain its header and line items. So i added a command by the query.

Main Report - Command Query:

SELECT distinct a.[DocEntry], a.[DocNum], a.[DocType], a.[DocStatus], a.[DocDate], a.[DocDueDate],a.[CardCode],a.[CardName],a.[Address],a.[NumAtCard],
a.[DocCur],a.[DocTotal],a.[DocTotalFC],a.[PaidToDate],a.[PaidFC],a.[Ref1],a.[Ref2],a.[Comments],b.[DocEntry], b.Itemcode, b.Dscription, b.Quantity, b.Price, b.LineTotal FROM [ORDR] a inner join [RDR1] b on a.DocEntry = b.DocEntry
where a.DocEntry = {?DocEntry}

I set the header fields at the report header and line fields at the details area. Till this it is ok.

I have a PO number stored in the ORDR table and i want to fetch the data (line items) of the PO in the subreport. So i inserted one more section in the details area. Now how can i pass the PO number stored in ORDR to get the PO details in the subreport.

Please help me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Apr 04, 2017 at 12:48 PM

    I assume you have placed subreport in the lower detail section

    Right click Subreport and select Edit subreport links

    Assuming PO Num is a.DocNum drag that into the top right pane.

    In lower left drop down select corresponding filed from subreport.

    Main report and SR are now linked by this data, if you open Select expert in SR you will see Crystal has created a new parameter which is sued to filter SR data.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi, Thanks for reply.

      I added a command in the subreport which fetches the PO data (line items) and passing the po number from main

      report to subreport which is stored in the sales order table. As i placed the sub report in the details area, i am getting

      the subreport result but twice (duplicated). I don't know what to do. can anyone help me.

      subreport.jpg (76.6 kB)
  • Apr 04, 2017 at 02:47 PM

    What do you mean?

    Is the subreport duplicated or the data in the subreport duplicated.

    How many detail lines do you get in main report for each PO?


    Add comment
    10|10000 characters needed characters exceeded

  • Apr 06, 2017 at 12:42 PM

    Not familiar with SAP and how it passes Parameters.

    Sorry can't help, you will need to contact SAP forum and ask how reports are integrated into application.


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 06, 2017 at 01:11 PM


    I have created a crystal layout (through OLEDB Connection) for Sales Order with subreport (with common paramter 'DocEntry'). When i assigned the layout to the sales order and viewing as layout preview it is asking me to enter the parameter.

    My question, why it is not taking running DocEntry from SAP B1 sales order automatically. Is there anything i have to supply in layout?

    Can anyone help me?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ahmed,

      DocKey@ is working only after i save the document (Quotation) otherwise not working.

      means preview before adding the document is not working.