Skip to Content

This is the sequel of the previous document I posted earlier.

Here I’m gonna explain some more tips about how to make your ABAP query to look more professional like a ABAP program report.

If you want to remove a table in the table join from infoset, you first need to delete it in the query.

5-10-2012 1-40-20 PM.png

5-10-2012 1-41-14 PM.png

Now on the selection screen if you want to change description of the fields, the order in which they appear, show hide intervals, etc you can do it in the query itself.

5-10-2012 1-42-05 PM.png

Below is an example

5-10-2012 1-45-21 PM.png

The selection screen changes like below:

5-10-2012 1-49-50 PM.png

Now you want to include your own conditions, rescrict the report to run only for certain values, hide fields, for that you just need to create a variant (shown above).

Now I create a variant with following conditions.

5-10-2012 1-59-45 PM.png

If you check the box Only display in catalog, users cannot see the variant, so they cannot change it themselves.

Now after the variant is applied,

5-10-2012 2-00-56 PM.png

Now you may want this report to start with this variant as default. So that users don’t have to input the values every time.

You’d have to assign the default variant in change query mode as shown below.

5-10-2012 2-02-24 PM.png

Your query is ready but it still not as user friendly as a program with transaction code so we assign the tcode to it.

5-10-2012 2-03-12 PM.png

Now click on the In background push button to know the program name of the query.

5-10-2012 2-03-45 PM.png

Go to SE93 and create a transaction of type report, assign the above program to the tcode.

5-10-2012 2-05-30 PM.png

To report this post you need to login first.

16 Comments

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

  1. Neeraj Agrawal

    Dear Jeevan,

    Thank you for sharing this useful information.

    Just wanted to know…

    Is it possible to use an OR command in a query?

    Taking a very basic eg.: If I need a list of materials with MRP controller “X” or MRP Type “Y”

    I can build a query directly for table MARC but can i incorporate this OR condition??

    (without having to write a code of course)

    (0) 
    1. Ravi k

      Hello Every one,

      I am getting issues like in SQ01 query chnages

      * Output sequence of lines does not correspond to database structure
        Line 01 (contains fields from table ANLB) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 01 (contains fields from table ANLB) cannot appear before
        line 06 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 02 (contains fields from table ANLCV) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 02 (contains fields from table ANLCV) cannot appear before
        line 06 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 03 (contains fields from table ANLCV) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 03 (contains fields from table ANLCV) cannot appear before
        line 06 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 04 (contains fields from table ANLCV) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 04 (contains fields from table ANLCV) cannot appear before
        line 06 (contains fields from table ANLAV)

      any one can help me

      (0) 
    2. Ravi k

      Hello Every one,

      I am getting issues like in SQ01 query chnages

      * Output sequence of lines does not correspond to database structure
        Line 01 (contains fields from table ANLB) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 01 (contains fields from table ANLB) cannot appear before
        line 06 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 02 (contains fields from table ANLCV) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 02 (contains fields from table ANLCV) cannot appear before
        line 06 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 03 (contains fields from table ANLCV) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 03 (contains fields from table ANLCV) cannot appear before
        line 06 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 04 (contains fields from table ANLCV) cannot appear before
        line 05 (contains fields from table ANLAV)

      * Output sequence of lines does not correspond to database structure
        Line 04 (contains fields from table ANLCV) cannot appear before
        line 06 (contains fields from table ANLAV)

      any one can help me

      (0) 
  2. Ravi k

    Hello Every one,

    I am getting issues like in SQ01 query chnages

    * Output sequence of lines does not correspond to database structure
      Line 01 (contains fields from table ANLB) cannot appear before
      line 05 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 01 (contains fields from table ANLB) cannot appear before
      line 06 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 02 (contains fields from table ANLCV) cannot appear before
      line 05 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 02 (contains fields from table ANLCV) cannot appear before
      line 06 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 03 (contains fields from table ANLCV) cannot appear before
      line 05 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 03 (contains fields from table ANLCV) cannot appear before
      line 06 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 04 (contains fields from table ANLCV) cannot appear before
      line 05 (contains fields from table ANLAV)

    * Output sequence of lines does not correspond to database structure
      Line 04 (contains fields from table ANLCV) cannot appear before
      line 06 (contains fields from table ANLAV)

    any one can help me

    (0) 
  3. Eduardo Hinojosa

    Hi

    Good post, but an additional comment. If the program AQ* is linked to a tcode in SE93, when you change something and transport the request from development to production, remember to generate again in SQ01 is you want the tcode trigger the modifications

    Regards

    Eduardo

    (0) 

Leave a Reply