Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
jogeswararao_kavala
Active Contributor

Introduction

The first usual improvisation requirement in self-made Infoset Queries by beginners, is often the requirement of calling other reports from ALV output, just the same way we do in Standard reports.  In ABAP-coded Z Report Programs, there are several techniques of achieving this by syntax like Call Transaction, Submit etc.

The very objective of this documentation is to achieve the same. This topic was briefly discussed in the document 10 Useful Tips on Infoset Queries. But, when the author experienced few exceptions in the technique suggested there and found a solution subsequently, he got the idea of having an exclusive document on this topic.

This document has assumption that readers have working knowledge in developing Infoset Queries.

Here we Start

We have seen earlier, that for enabling Report Calling from the ALV output of an Infoset Query, we need to do these steps in SQ01.

Note: If your Report Assignment option is found disabled, then the reason and setting to restore is here: How to make 'Report assignment' available in 'SQ01'

Click here on   then on then select  TR (Transaction Code) or RT (Report Program),

  1. When we select TR we need to put only the Transition code.

     


Example:

IE03 if our ALV lines are having Equipment field and we want Equipment Master display upon clicking on the ALV row.

If we have a Maintenance Order Number in the ALV, and we want to have Display Order Screen upon clicking on this row, then we give the Tcode IW33 here.

     2.  In the other case, when we want to call List Reports like IW37 , then we need to select RT in the Report type, where we need to give the

          Program  name (in this case RIAFVC20) in the Report field  and the variant name.

        

So far, it looked very much OK, until I found recently that few field names like EQUNR, MATNR, DOKNR etc, do not exhibit the desired behaviour.


Few cases  where this call report was not working are discussed here.

In one of my Queries, I have Material number (MATNR) in the ALV output, for which I used Report Type TR with Tcode MM03, for the purpose of  Material Master Display. What happened here, was no Material number was passing to the MM03 initial screen, so the display interrupted, In another case, the first attempt display was coming, but the next attempt on different material line in the ALV, the material master display of the first attempt was repeating. Broadly there is a technical problem in passing the Material number.

Another such case was with the Tcode CV03N  (Display of DMS Document) , where the DOKNR, DOKAR field values were not passing to the CV03N initial screen.

Here is the solution I worked-out, using the QU Report Type of Report Assignment


We are taking the MM03 case

As mentioned above, the report Type QU (Query), in the Report Assignment came to rescue.

This option has 3 fields.

First field (User Group):  You know, your User Group.

Second field (Query): We need to develop a simple query for this field.

Third field (Variant): Optional.

So, what required was that a simple Infoset query using MARA table (Material Master) to be created.

And this Query name, was given in the field 2 above.

Let’s see the steps of creating the simple Query for Report Assignment purpose.


SQ02

We are Creating an Infoset (I named it MM03) with Direct read of table option.

This is because, we use only one table.

Select this default option, and Continue.

With this the Key field MATNR is added to the Field Group folder in the Infoset.

And in the Infoset Code Section, give the following code


  Generate Infoset and do not forget to assign it to your User Group.


SQ01

Create a Query (Say MM03) using the above Infoset.

Note:

This query name is going to be used in the Report Assignment.

Go to Basic list screen and Tick the MATNR field in the List fields column.

Save the Query.



Testing.


Here we are examining, the behaviour of 3 cases of Report Assignment)  in the ALV output of an Infoset Query.

We know that when multiple Call report assignments are there in the query, then the options appear as a menu as shown above, upon clicking on a row.

  • Here the first option in the menu namely Display PM Order, is that where I used report type TR and given Tcode IW33,
  • Second one, namely Report Assignment MM03 is through Report Type QU with Query field value MM03 (created as explained above)
  • Third one was the option which was malfunctioning i.e., Report Type TR and Tcode MM03

Now when tested, the first option with TR report-type works satisfactorily, without any problem, passing the Order number (AUFNR) correctly everytime.

The third option, again with report type TR works erratically, unable to pass material number (MATNR) correctly.

The second option is our solution to the erratic behaviour of MM03 through TR report type. i.e., through QU report type. This works very correctly like the first case.

In the case of Display Equipment (IE03) , the above method would work, with the following code in SQ02.

PARAMETERS:

EQUNR LIKE EQUI-EQUNR.
SET PARAMETER ID 'EQN' FIELD EQUNR.
CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
EXIT.

So that is about the Problems and the Solutions

As referred in the beginning, another parameter which gave trouble in calling reports through report-type TR was, DOKNR (DMS document number).

I have solved this issue too in a similar manner.  The transaction called was CV03N. The code used in the Infoset is given below.

Note

See the Syntax used  PARAMETER ID  in the syntax used in both the cases above.

The Parameter Id used in MM03 case was, MAT,  and in the CV03N case was CV1  and CV2.

MAT is the Parameter Id for field MATNR, CV1 is for DOKNR and CV2 is for DOKAR.


This parameter-id is the key factor for any Call report to function properly.

Where do we get this?

For example for MATNR, place cursor in MATNR field of any screen, and press F1 on key-board. The pop-up has this value.

Similarly for any other field.

That’s everything I think, about this document.

The author hopes that this document also will be useful to the members, the way the  other documents by the author, in the series of Infoset-queries.

Thank you

Jogeswara Rao K



05/11/2015:

A tip in this context of Report Assignment.

Recently I made 3 ALV reports using Query for Equipment, Functional Location and Material BOMs . And then I was trying to use Report Assignment in the SQ01 of Equipment BOM. i.e., I was trying to call ALV report of Material BOM, when we click on the Component material field of Equipment BOM ALV. My issue was it was not taking to that report. I analyzed the reason to be:The BOM Component field (IDNRK) does not have a ParameterId on which the Report Assignment function depends.


What I did:

I created a user field MATNR in the Infoset Query by giving data type MARA-MATNR which has a Parameter Id MAT, and then equated that to BOM component (IDNRK) field. Means I gave code in the Code area of this user-field MATNR as: MATNR = STPO-IDNRK.

Then I took this user-field to SQ01 and then to List fields (ALV). Now I thought that the ALV has PID, and the Report Assignment would work. But it was not working. Then  I realized the reason to be that as long as IDNRK field is there in ALV it would not work. I removed the IDNRK field from ALV. I already have the values of BOM component material values in my user-field MATNR. But then I had to remove the text field also associated with IDNRK field from the ALV. Now it worked. Now it is taking me to the Material BOM report assigned in the Report assignment when I click on any ALV line of the Equipment BOM, when that material has got a BOM of it own.

But I lost the Component Description field which I had to remove alongwith IDNRK field from the ALV. So what I did was I created another user-field MAKTX in SQ02 and in its code retrieved the Description field from MAKT table. ( Select single maktx from makt into maktx where matnr = stpo-idnrk.). Now I took this MAKTX field also to SQ01 and then to List. So I got back the lost fields also and finally made the Report assignment to work.


Again with a view not to lose this information by memory erosion and for the benefit oft he forum I'm preserving here.

Regards

KJogeswaraRao


22 Comments
former_member182535
Active Contributor
0 Kudos

Hi Jogesh,

                   This is very useful documents for Functional Guy's which that we can able to generate such kind of report.

Thanks for sharing...Keep it up..!!!

0 Kudos

Nice ....Very useful document...

peter_atkin
Active Contributor
0 Kudos

Nice work...

Also see the following OSS Note which explains a work-around for the report-report interface:

http://service.sap.com/sap/support/notes/383077

PeteA

former_member223087
Participant
0 Kudos

Hello

That's a great job.

I'm now on an EHP7 system and calling IE03, the equipment number is not transfered to the called transaction. Same issue with IW33.

Any idea?

jogeswararao_kavala
Active Contributor
0 Kudos

Hello JOSEPH,

I have already dealt this case: See this section of the post.

So far, it looked very much OK, until I found recently that few Parameters like MATNR, DOKNR etc, do not exhibit the desired behaviour.

Yours is exactly the same case I illustrated for MM03 in the above section. Work in similar lines, develop a simple query for Display Equipment and use it here.

The code part in SQ02 will be:


PARAMETERS:


EQUNR LIKE EQUI-EQUNR.
SET PARAMETER ID 'EQN' FIELD EQUNR.
CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
EXIT.



Good luck

KJogeswaraRao





former_member223087
Participant
0 Kudos

Ok, thanks a lot.

I probably missed this part.

I've read that it doesn't word for MATNR, and other fields. But in you example IE03 seemed to be ok.

10 Useful Tips on Infoset Queries

Tips2. You mentionned IE03.

Maybe to be more accurate on my issue, here are the steps:

Run my query / run report IE03, SAP stays on the first screen of IE03 with equipment number blank and error message to fill in an equipment number.

Now go to IE03, display the first equipment number found.

Go back to the query / Run it / Run report for IE03, IE03 is displayed but with the equipment number just displayed before with direct IE03 and NOT with the one from the query line.

Thank you very much for your help.

Regards

Olivier

jogeswararao_kavala
Active Contributor
0 Kudos

Thank you. In that case I have to correct.

jogeswararao_kavala
Active Contributor
0 Kudos

I've just tested IE03 in the method explained for MM03. It's working fine.

former_member223087
Participant
0 Kudos

Maybe to be more accurate on my issue, here are the steps:

Run my query / run report IE03, SAP stays on the first screen of IE03 with equipment number blank and error message to fill in an equipment number.

Now go to IE03, display the first equipment number found.

Go back to the query / Run it / Run report for IE03, IE03 is displayed but with the equipment number just displayed before with direct IE03 and NOT with the one from the query line.

I will have a look now with your method.

I let you know.

Thanks

Olivier

jogeswararao_kavala
Active Contributor
0 Kudos

Sure,

I have ensured this, so it will not disappoint. I have corrected the point you identified in the other document.

Thank you.

former_member223087
Participant
0 Kudos

It works!!

thanks.

I've just changed the transaction code in the ABAP code of the info-set because I use a transaction which calls IE03 witha default transaction variant.

The result is great!!

Regards

Olivier

chanda
Contributor
0 Kudos

Dear Sir,

Can you please help me on the below ?

SQ01/SQ01 How to get data from tables  If  (condition) Table 1 else table 2

Thank you ,

Sudhir.

Former Member
0 Kudos

Thanks a lot for sharing this with us.

I find your article very good in content and organized.

It helped me in one of the current tasks

Many thanks again !

Alex

jogeswararao_kavala
Active Contributor
0 Kudos

Thank you Alex,

Such feedbacks give the author more satisfaction compared to the scores he gets through the RATINGs and LIKEs for the article.

Regards

Former Member
0 Kudos

Dear Jogeswara,

I have one query related to infosets.

Posted : Coding in Infosets /CRM segmentation

I am sure with your expertise you will be able to help me with the issue.

I appreciate your help !!

Regards,

Kritika

Brian_Conforto
Explorer
0 Kudos
Hello,

Congratulations and thanks for this useful information.

is it possible to have a conditional formatting for a field?

Example: if field > 10 then color = red.

 

Regards,

Brian
jogeswararao_kavala
Active Contributor
0 Kudos
Might be possible for a super expert in this field. Common people would go to ABAP report program for such special features. These features are easily achieved there.

Regards

 
0 Kudos
Dear Jogeswara,

is it somehow possible to select several lines of the SAP Query result and load the objects in a transaction? In my case the SAP Queries shows iPPE nodes and position variants. I doubleclick on the them and then the transaction starts and loads the object.

But for the transaction PDN it is possible to load several objects with the method cl_ppeguieng_cntl=>launch(). But I do not know how to handover several objects to this mehtod.

Regards

Florian
omggiridar
Member
0 Kudos

Hello Joginder, Excellente!!!!.

Want to provide few feedbacks and this is from S4HANA Onpremise 1909.

I am not sure but when I add the code in SQ02 DATA section as mentioned it is adding a field in Selection screen of SQ01.

Further after report execution getting the same error since MATNR is not passed to SAPMMG01 and initial screen 1000, SAPLMGMM, screen 0060 giving an error

*PARAMETERS: matnr LIKE mara-matnr.
*SET PARAMETER ID ‘MAT’ FIELD matnr.
*CALL TRANSACTION ‘MM03’ AND SKIP FIRST SCREEN.
*EXIT.

Below are 2 SAP OSS notes as workarounds

383077 – BBS: Calling up the transaction does not work

73870 – Parameters when calling mm03 from the ABAP/4 query report

Any suggestions to make this work

astrokov
Explorer
0 Kudos
Thank you!
Sergiu
Contributor
0 Kudos

Case ANEP-BELNR  and BKPF-BELNR both must be displayed, ANEP-BELNR <> BKPF-BELNR and from query with transaction FB03 must be called BKPF-BELNR.

TCODE: SE11

ID BLN

TCODE: SQ02.

ZBELNR_ANEP

 

Code

 

In SQ01 Basic List use BKPF-BELNR and ZBELNR_ANEP, don't use ANEP-BELNR. in SQ01 call transaction with FB03 will use Parameter ID from BKPF-BELNR.

 

On the other hand if you don't have a field with required Parameter ID you can define a field ZBELNR with LIKE Reference BKPF-BELNR and fill the value with code.

 

Regards,

Sergiu Iatco

Sergiu
Contributor
0 Kudos

In the case of transaction MM03, the requirement is to display Basic Data 1 View.

A solution with the program you can reuse in any other query is the following.

SE38: Z_CALL_TCODE_MM03

 

*&---------------------------------------------------------------------*
*& Report Z_CALL_TCODE_MM03
*&---------------------------------------------------------------------*
REPORT Z_CALL_TCODE_MM03.

PARAMETERS: P_MATNR TYPE MATNR.
SET PARAMETER ID 'MAT' FIELD P_MATNR.
SET PARAMETER ID 'MXX' FIELD 'K'.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

SE93:  Z_CALL_TCODE_MM03

 

In SQ01 assign transaction Z_CALL_TCODE_MM03.

Regards,

Sergiu Iatco

Labels in this area