I had a requirement given by the business which was a bit difficult. The data was to be pulled from FI and MM module and combined in one report.

The report had to have 5 sections

  1. For section 1 the data needs to be pulled from FI
  2. Subtotal
  3. For section 2 the data needs to be pulled from MM
  4. For section 3 the data needs to be pulled from FI
  5. Sub total
  6. Grand total

I decided to explore all this by using the AMDP method. Given below is a screen shot of my procedure for the first 2 points.

I added one column called color in the structure which i will be using in the ABAP coding. I am also using the select from dummy to add a heading row.

Finally i do a union all and assign it in the out parameter of the procedure.

Capture1.PNG

This is for retrieving the data

Capture2.PNG

This is for the subtotal

Capture3.PNG

In the ABAP Code

Capture4.PNG

For coloring the line just add the line highlighted in the layout

Capture5.PNG

The final out put

     Capture6.PNG

I Hope this helps the fans of code push down.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Jose David Alzate

    Hi Arun,

    Thanks for your post. I wonder if there is any possibilty to create an AMDP to do a query using a for all entries?

    Something like that

        et_pernr = select

            kokrs as kokrs,

            belnr as belnr,

            pernr as pernr       

          from    COEP    

    — For all entries it_repo

          where mandt = :iv_mandt and

                kokrs = :iv_repo-kokrs and

                belnr = :iv_repo-belnr 

                ORDER BY pernr;

    Do you have any idea ?

    (0) 
    1. Arun Kumaar Menon Post author

      Hi Jose

      I am not sure of the for all entries but i have used joins of different result sets like this

      SELECT null aufnr,

                              ‘Net Balance – Income/Loss ‘ io_desc,

                              NULL proj ,

                              NULL prj_name,

                              0 expen,

                              0 bud_qty,

                              0 pur_qty,

                              0 avg_pr,

                              (a.sales -(b.expen + c.expen))  Sales,

                              null color

                              from :et_tot a, :et_hsm b, :et_pesu c;

      Thanks and regards

      Arun

      (0) 

Leave a Reply