Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
LeonardoAraujo
Active Contributor

ABAP Report Wizard was a very interesting project that we worked on. The final product not only works, but was downloaded over 2000 times.


The original tool allows the generation of ABAP report via a Wizard that utilizes a SAP graphical tool to define the table join for the data selection. Additionally, the Selection screen, data declaration and end-of-selection events are built.

 

This helps generating ABAP reports, but it is very specific.

 

So, to celebrate the 2000 download mark for the ABAP Report Wizard, I here deliver a reduced version of the tool to help build "Select Join" statements in ABAP.

 

The idea is that now, being a smaller and more generic tool, it will be used by even more people.

 

See a demo of it here:

http://www.beyondtechnologies.ca/downloads/join_wizard.swf

 

1       Installation Guide

(Please make sure you have installed the ABAP Report Wizard Before)

Link: Reduce development costs with ABAP Report Wizard (Community Day Launch in Vegas!) 2007-10-01 

1.1 Download the wizard and instructions

 

ABAP Report Wizard Project on Google Code

 

1.2     Install Source Code via SAPlink



The ABAP Join Wizard was developed on NetWeaver 7.0.  Since it is a much smaller and simpler application, in comparison to the ABAP Report Wizard, it is possible that it will work on earlier releases, but that has not been confirmed. 

The first step is to import the SAPlink nugget file into your system.  If you do not have SAPlink installed on your system, you can download it from http://code.google.com/p/saplink/.  You will also need the following plug-ins which can be downloaded from http://code.google.com/p/saplink-plugins/

Required Plug-ins

•    Function Groups
•    Documentation  “DOCV - SE61 Documentation    docv“

Once you have SAPlink and the required plug-ins installed, you can run the executable program, ZSAPLINK.  Select the radiobutton for “Import Nugget”, and select the nugget file from the file location. Lastly, click the “Execute” button, or hit F8.

IMPORTANT: These instructions work both on SAPLink 0.1.3.  and 0.1.4. If you have a newer version (higher release) you are FINE!




Hopefully, the following screen will yield all success messages, signified by the green lights.
Notice that most of the imported objects follow a similar naming convention, and hopefully these objects do not conflict with existing objects in your system.

UPDATE: You might be required to enter a package. You will probably never transport this to other systems (since it is used only in DEV), but it is a good idea to add to a specific self-containing package.


See? It works on 0.1.4…

1.3    Activation of Imported Objects


Next, you need to activate all objects which have been imported. Of course, there are a few ways to do this, but in order to insure a clean activation, follow these steps.

1)    Go to SE80, and select “Inactive Objects” from the object navigator drop down.


 

2)    Open the Class Library. Select ZCL_BT_ABAP_JOIN, then right-click and choose, “Activate”.

3)    Repeat the previous step for class ZCL_BT_ JOIN_SELECTION_FIELDS;

4)    Next, open the Function Groups, select ZWIZ_BT_JOIN_WIZARD, right click and select ACTIVATE;

 

1.4    Creating the Pattern (VERY IMPORTANT !!!)


In SE80,  choose  Utilities -> More Utilities -> Edit Pattern -> Create Pattern.


 In the dialog enter,  Z_JOIN_WIZARD and click the green check.



In the pattern editor, enter *$&$MUSTER and click “Save” and then the “Back” button.



 

2    How to use the Join Wizard

 

2.1    Starting the Wizard


Now that the pattern has been created, you can now use the wizard.  In SE80, put your cursor on an empty line within the source code editor, and click the pattern button.


In the dialog, select the radiobutton for “Pattern” and enter the name of the pattern as Z_REPORT_WIZARD and click the green check.  The wizard will then be triggered.


 

2.2    Using the ABAP Report Wizard


This first screen of the wizard is simply for information purposes, click continue to go to the first step of the wizard.  In this step, you will define the data source.  You can either do a single table read, or a table join.  If you select “Table”, you will be asked to enter the name of the table.  If you select “Table Join”, you will be asked to define the table join by clicking the “Define” button.


When you click the “Define” button, you will be presented with a graphical join editor.  Click the “Insert Table” icon on the application toolbar.  Enter the name of the first table in the join.


The table will then be added to the display.


Next, click the “Insert Table” icon on the application toolbar again to add the second table in the join.  Again, give the name of the table and hit enter.  The graphical editor will then display both tables as well as the join condition between the two.  Click the “Back” button to leave the editor.


Continuing to the next step of the wizard, you will need to define the selection criteria. Click “Continue” when finished defining your selection screen.


The next step of the wizard is to define the output fields in your report. Open the node of the specific table an select the fields that you want to be displayed in the ALV Output.  Click “Continue” when finished selecting your output fields.


The last screen is a “Completion” screen.  Simply click the complete button.


The required source code will then be written to your program. Example below:


*----------------------------------------------------------------------*
* Code generated by ABAP Join Wizard v. 1.0                            *
*----------------------------------------------------------------------*
* Report Name:                                                         *
* Created by: EXT719                                                   *
* Created on: 2009/02/16 at 23:09:19 EST_                              *
*----------------------------------------------------------------------*

*---------------------------------------------*
*       D A T A   D E C L A R A T I O N       *
*---------------------------------------------*


* Types
TYPES: BEGIN OF ty_target,
      mara_matnr  TYPE mara-matnr,
      ersda       TYPE mara-ersda,
      ernam       TYPE mara-ernam,
      laeda       TYPE mara-laeda,
      werks       TYPE marc-werks,
      marc_pstat  TYPE marc-pstat,
      marc_lvorm  TYPE marc-lvorm,
      END OF ty_target.

* Internal tables and work areas
DATA:
      it_data        TYPE TABLE OF ty_target,
      wa_data        LIKE LINE OF it_data.

*---------------------------------------------*
*       D A T A   S E L E C T I O N           *
*---------------------------------------------*

SELECT a~matnr a~ersda a~ernam a~laeda b~werks b~pstat b~lvorm
  FROM ( mara AS a
           INNER JOIN marc AS b ON a~matnr = b~matnr )
  INTO TABLE it_data   " <--  Attention ! Field sequence !
  WHERE a~matnr IN so_matnr AND
        a~ersda IN so_ersda AND
        a~ernam IN so_ernam AND
        b~werks IN so_werks ..

 

 

Reference Links below:

ABAP Report Wizard reaches 2000 Downloads! 2009-02-19

SDN Community project ABAP Report Wizard @ ASUG'08 ! 2008-05-02 

ABAP Report Wizard - One of the best kept secrets of SDN... 2008-01-21 

Reduce development costs with ABAP Report Wizard (Community Day Launch in Vegas!) 2007-10-01 

How to Install the ABAP Report Wizard 2007-10-01 

Community Day Vegas: Automate ABAP report generation using ABAP Report Wizard (a true SDN project) 2007-09-17 

SDN Day Session: Using Wizards to Automate ABAP Code Generation  2006-09-19

 

 

 

Leonardo De Araujo

ABAP Report and Join Wizards Team

9 Comments