I’m sure that some of you have used the functionality called report assignment when creating queries. For those that have not, this is a function that allows you to assign additional reports that you can jump to within the query’s results. As an example, you have a query of material master data. You can assign a jump to the material master itself. I found some issues with making this work properly, so I found a trick to make it do what I wanted. Let me explain:
This report assignment function allows you to assign a transaction or another query (among other things) so that the transaction or query is called within the results. I’ll show you where and how below.
My complaint about using a transaction is I often found that the field value that I expected to see populated was not. This is particularly true with the material master. I found using a query produces better results. The key is the InfoSet. I have to admit that I’m not 100% confident in my explanation of the code below, but I think I’m close.
Let’s use the example of the material master. Create a simple InfoSet with a direct read of the table MARA and include only the key fields in the field group defaults. I named my InfoSet “REPORT_ASSIGNMENT_MM03” because I’ll use it to execute the transaction MM03. Name yours as you see fit. You should have an InfoSet that looks like so:
Click on the “Extras” button and pick the “Code” tab and the “DATA” code section. You could also go directly there by choosing the menu path Goto | Code | DATA.
Enter the following code:
Here is the code snippet:
PARAMETERS: matnr LIKE rmmg1-matnr. SET PARAMETER ID 'MAT' FIELD matnr. CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN. EXIT.
The PARAMETERS command defines a variable for the selection screen. To define the variable, I used a structure variable that is linked with that screen field (RMMG1-MATNR). You can find it by looking at the technical information in the help for that field.
I found that using the exact screen field is crucial when you want the query to populate the value into the screen.
Next, the SET PARAMETER command pushes the value from the query results into the parameter ID ‘MAT’ using the screen field variable defined above.
Looking again at the technical information, you can see the parameter ID for the field Material shown here. You may note that this is the same ID that you would use in your user profile.
Next, you have the CALL TRANSACTION statement with the modifier SKIP FIRST SCREEN. I think the effect here is pretty clear – run MM03 and skip the selection screen where you see the field for material.
Finally, you have an EXIT command to end the processing in the InfoSet after the user finishes with the MM03 transaction. It effectively pushes the user back to the original results.
Save and generate the InfoSet. Don’t forget to assign to the proper user group and provide any authorizations that you might use in your environment. Now you’ll need to create a very basic query that incorporates the newly created InfoSet.
This query should be very basic – much like the InfoSet. Give it a title and assign the one field to the basic list.
After saving, you’re ready to use this query in another query’s report assignment. Go to your original query’s Title, Format screen and select the menu path Goto | Report Assignment.
This brings up the list of all reports that are assigned to this query. Obviously, you can add more than one. For example, you can add one entry for changing a material and another for displaying a material.
Click on the button indicated (label “Insert Row”). Enter the user group and query name created previously.
Now the new “report” query is assigned.
If only one report is defined, the result of a double click within the results of the original query will take you straight into the material master skipping the initial screen. Depending on your settings, you may be required to select the views and organizational levels. If, as in my example above, you assign two queries, then you’ll see a popup window asking you to choose which option you want.
Although I haven’t tried it, you could conceivably build in a check for authority in the code of the new InfoSet. If you have authority to change, the CALL TRANSACTION would take you to MM02, otherwise to MM03.
I have also created the similar InfoSet & query combinations for purchase orders and sales orders.
The screenshot above is for display of purchase orders. In this case, the PARAMETERS definition follows the same approach that I used for the material master where the field you see when the transaction starts is not linked with the underlying table EKKO, but with a structure called RM06E.
The screenshot above is for display of sales orders. In this case, the PARAMETERS definition is slightly different. It does not reference the screen field.
For the transaction VA03, you can see that the screen field is linked with the transparent table VBAK and not a structure like RMMG1. In this case, I used the Data Element, but could easily have used LIKE vbak-vbeln.
If you are familiar with SAP Query already, you know that you can generate some very robust results with a little extra effort in the InfoSet and query. This trick is particularly helpful, in my opinion, because it turns a simple set of records into a interactive report. I’d like to hear your comments on how you are using it!
2012/12/04 at 10:26
Hi,
Thank you very much this is really useful! I have a report on which i want to double-click a document number which takes you to transaction FB03. I’ve tried this and it works but company code and fiscal year also need to be filled. Is there a way of doing this by adding extra code?
Thanks
Ben
2012/12/04 at 19:56
Definitely! If you’re working with FB03 and can see the document number filled in, you probably have made a parameter like BLN linked with RF05L-BELNR. You’ll need to add two more entries for company code and fiscal year. If I were doing it, the code would look something like:
PARAMETERS:
belnr LIKE rf05l-belnr,
bukrs LIKE rf05l-bukrs,
gjahr LIKE rf05l-gjahr.
SET PARAMETER ID 'BLN' FIELD belnr.
SET PARAMETER ID 'BUK' FIELD bukrs.
SET PARAMETER ID 'GJR' FIELD gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
EXIT.
2012/12/05 at 10:14
That works perfectly thanks again. Going to find plenty of uses for this!
2012/12/06 at 17:16
Hi Feimster, sorry to ask again but do you have any idea why this one won’t work (it just asks to enter the document number)? I’ve got a report on sales contracts and want to double click to display the contract. I’ve made a similar one for a sales order report which does work.
PARAMETERS:
VBELN LIKE VBAK-VBELN.
SET PARAMETER ID ‘AUN’ FIELD VBELN.
CALL TRANSACTION ‘VA43’ AND SKIP FIRST SCREEN.
EXIT.
Many thanks
Ben
2012/12/08 at 05:51
Ben – Looking at the transaction VA43, I can see why you picked AUN as the parameter and I would have done the same thing. I found a post on SCN related to VA43 that points to the parameter KTN. This one seems to work.
2012/12/10 at 10:44
Feimster, thanks again!! Works great.
2013/06/20 at 09:20
Hi, hope you are well. I’m trying to create a report assignment for transaction F-32 for clearing customer accounts. The account field, which needs to be filled with the customer number, does not have a Parameter ID field. Does that mean you can’t fill the field with the customer number?
Many thanks
Ben
2013/06/20 at 17:10
Ben,
I was curious about this situation so I spent a few minutes trying to figure it out and, in fact, had to enlist the help of one of my developer friends (thanks, Eric). The statement CALL TRANSACTION has other additions that you can use. He recommended using the BDC option, and, as it turns out, it wasn’t that hard to do. You shouldn’t need to make any changes in your calling query & infoset, but make sure that you have both customer number and company code. I created the report assignment infoset using KNB1 and just those two fields. I changed the infoset coding that you find in the original post. In the DATA section, remove the original code and replace with:
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
wa_bdcopt TYPE ctu_params.
Now switch to the Record Processing section and add this code:
CLEAR: it_bdcdata, wa_bdcdata.
wa_bdcdata-program = 'SAPMF05A'.
wa_bdcdata-dynpro = '0131'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=PA'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'BKPF-BUKRS'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'RF05A-AGKON'.
wa_bdcdata-fval = knb1-kunnr.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BKPF-BUKRS'.
wa_bdcdata-fval = knb1-bukrs.
APPEND wa_bdcdata TO it_bdcdata.
wa_bdcopt-dismode = 'N'.
CALL TRANSACTION 'F-32'
USING it_bdcdata
OPTIONS FROM wa_bdcopt.
EXIT.
Essentially, I’m building a set of instructions for the first screen of F-32 where I populate both the customer (the group with FNAM = ‘RF05A-AGKON’) and the company code (the group with FNAM = ‘BKPF-BUKRS’). The groups of statements above the two just mentioned are required to identify the program screen, to establish the field where focus is set, and finally to insert the next command (FVAL = ‘=PA’). At the end of the code above, you can see the CALL TRANSACTION again using the BDC data table (it_bdcdata) that I built. There is another little bit there (OPTIONS) where I have assigned a code to mimic the functionality from the original posting (AND SKIP FIRST SCREEN). Right above the CALL TRANSACTION statement, you can see where I’ve set DISMODE = ‘N’. This instruction basically says execute the BDC without showing the screens but if there is an error or warning on the called transaction, don’t display the called transaction. I’ve tested this and it seems to work okay. Please let me know how it works for you. Good luck!
2013/06/21 at 10:16
Feimster,
Thank you so much once again, to Eric also. I’m getting the message ‘Selection data of calling program does not match query’. My query is displaying customer open items using table BSID. I have both the company code field and the customer number listed in my report. I have tried it with the both fields listed in the report assignment query and also with just the customer number listed. Do you have any idea why it’s not working for me?
Ben
2013/06/22 at 03:29
I made a simple query using BSID like you said. I only used the key fields of the table in the results so it’s very, very basic. I made the report assignment to this new query using the same query that calls F-32. It didn’t work for me either, although I did not get the same error message. I went back to the infoset that has the BDC code and changed the DISMODE to E instead of N. Now it works for me. I cannot explain why this small change made a difference. Try it and let me know.
2013/06/24 at 10:00
I changed DISMODE to E but I’m still getting the same error message. I then tried creating a simple query using BSID but i get the same error. Just to confirm, the code is exactly as you stated above and you just changed the ‘E’ instead of ‘N’? Many thanks.
2013/06/27 at 14:13
Yes – I just changed DISMODE to E rather than N. Ben, I have to admit I’m a little stumped as to how we should proceed next. Are you able to download the infoset and query?
2013/07/09 at 16:34
Hi,
I am using Data read. prog and I want to go to multiple transactions: one being project (CJ20N) and another being material (MM03). When the user doubleclicks on project, want to call CJ20N, When the user doubleclicks on Material, want to go to MM03.
2013/07/11 at 01:12
Jim,
I’ve made one or two queries where I have multiple report assignments (transactions). I don’t think that you are able to jump directly into a specific transaction depending upon where the user double-clicks. If I recall correctly, the user is presented with a popup window and they have to select the transaction they want to execute. Is that what you are seeing?
2013/07/13 at 08:27
Hi,
I was using this function in report assignment in SAP query for accessing the display serial no. IQ03, i have wrote following code in DATA selection of Info set.
PARAMETERS:
sernr LIKE risa0-sernr .
SET PARAMETER ID ‘SER’ FIELD sernr.
CALL TRANSACTION ‘IQ03’ AND SKIP FIRST SCREEN .
EXIT.
when i go for query execution then this transaction IQ03 calling before the output of query.
Please suggest me what i have done mistake in coding .
2013/07/13 at 20:43
Alok,
This code must be contained in a different Infoset, not the one you construct to retrieve the serial number data. In other words, you must have two Infosets and two queries. The first Infoset/Query combination is the data you want to display. The second Infoset/Query is a very basic one that never actually shows results because of the code you’ve indicated above – it should jump straight to the transaction IQ03. In the first Infoset/Query, you assign the second Infoset/Query to the report assignment. You may need to incorporate a second parameter in the code because IQ03 has two entries: MATNR and SERNR. Thus, your code should look something like:
PARAMETERS:
matnr LIKE risa0-matnr,
sernr LIKE risa0-sernr.
SET PARAMETER ID 'MAT' FIELD matnr.
SET PARAMETER ID 'SER' FIELD sernr.
CALL TRANSACTION 'IQ03' AND SKIP FIRST SCREEN.
EXIT.
2013/07/17 at 04:34
Hi,
feimster,
Thanks for reply , but it means for this function in SAP query, if i want to attached several report transactions then number of info set will be required. my requirement to run the report transaction from IQ03 and VA03 , for this i have to create one info set and query for IQ03 , and second for Va03 , both the queries will further assigned to main query report assignment.
Secondly in sap query i want to filter and show the one row of a table for maximum date and time entry. Example if table MKPF several rows for specific movement , material , plant but having different posting date and time then by default the current to be show in SAP queries.
2013/07/17 at 05:19
To your first point: yes, you “may” need a unique infoset/query combination for each transaction you wish to assign. I say “may” because there are certain transactions that work directly with the report assignment. I’m providing you a method to execute transactions that do not work.
Unfortunately, I cannot understand your request in your second point. Is this related to report assignment?
2013/07/17 at 05:52
Sorry,
The second point is not related to report assignment in a sap query , it is related to check a particular row of a table where multiple row are there. I mean it is related to the record processing in SAP query .
i want to show a specific row in report output where record entry exists for maximum date and time in table MKPF, so how i can code in a infoset.
2013/07/17 at 14:26
I’d like to keep the comments in this post related specifically to the post itself rather than venturing off on other topics. I’ll keep your question in mind for a future post.
2013/09/09 at 10:07
Hi Feimster. Have you ever managed to get this to work for FBL5N open items? I’ve tried but the DD_KUNNR-LOW Screen Field doesn’t get accepted in the coding. I don’t need to specify a company code for this one.
Many thanks
Ben
2013/09/16 at 19:33
Ben – I think I did get it to work, but the sandbox got refreshed recently so my work got wiped out. Let me run through it again and get back to you by the end of the week.
2013/09/17 at 09:34
Thanks Feimster would be great if you could when you get the chance, cheers.
2013/09/18 at 22:52
Ben – I made it work for FBL5N, too. I’m making a post about it so hopefully the instructions will be clear enough.
2013/09/19 at 05:25
[…] had a follow up question to my previous post about report assignment within SAP Query. He wanted to know if I had successfully called the […]
2013/10/25 at 10:29
excellent post! thanks
2013/11/08 at 14:17
I stumble across this site by accident and oh my! This was one of the most useful post on SAP I’ve seen in a long time. I’m not new to SAP but my skills are limited and this post really makes me look good!
I’ll be back!
Thanks
Carmen
2013/11/14 at 10:03
Dear sir,
can you please guide me the code for assigning ‘XD03’-display customer Master in Query.
2013/11/14 at 13:52
Hi Abdul,
Please see code below.
PARAMETERS:
KUNNR LIKE RF02D-KUNNR,
BUKRS LIKE RF02D-BUKRS,
VKORG LIKE RF02D-VKORG,
VTWEG LIKE RF02D-VTWEG,
SPART LIKE RF02D-SPART.
SET PARAMETER ID ‘KUN’ FIELD KUNNR.
SET PARAMETER ID ‘BUK’ FIELD BUKRS.
SET PARAMETER ID ‘VKO’ FIELD VKORG.
SET PARAMETER ID ‘VTW’ FIELD VTWEG.
SET PARAMETER ID ‘SPA’ FIELD SPART.
CALL TRANSACTION ‘XD03’ AND SKIP FIRST SCREEN.
EXIT.
You can use just the first line of code to display the basic customer details:
PARAMETERS:
KUNNR LIKE RF02D-KUNNR.
SET PARAMETER ID ‘KUN’ FIELD KUNNR.
CALL TRANSACTION ‘XD03’ AND SKIP FIRST SCREEN.
EXIT.
2013/11/18 at 04:09
Hi Feimster,
Your tutorial was very good and helping me.
I have a few question about this. What i want to show is after i generate the query into the ALV grid, how can i assign the Set Parameter and Call transaction into the ALV Grid? so the user can dirrectly click on the number, let say the Delivery Order List, after i click the DO Number it will dirrectly open the VL03N
SET PARAMETER ID ‘VL’ FIELD lips-vbeln.
CALL TRANSACTION ‘VL03N’ AND SKIP FIRST SCREEN.
EXIT.
2013/11/18 at 04:19
Im also confuse, where to put this Call Transaction into what segment ( DATA, Start of Selection, etc)
Thank you
2013/11/18 at 06:06
The CALL TRANSACTION code should be in the DATA section of the Extras.
2013/11/18 at 05:57
I’ve succeded with this Call Transaction.
I’ve miss about create two kind of infoset, the first one is the main query, and the other one was the Call Transaction.
I wanna ask more about, how if we have 2 parameter that we want to call?
exampel on the main query, there is 2 field, DO Number and SO Number.
If we click the DO it will open the VL03n, if we click on the SO it will open the VA03.
Thank you
Erick
2013/11/18 at 06:11
You can definitely assign two (or more) transactions to be called from the main query. But for each of these “calls”, you will need to create a unique CALL TRANSACTION infoset and query. Within the main query, you will assign all of these new “call” queries. When you assign multiple “call” queries to the main query, your user will be forced to make a choice about which transaction should be called. There is a popup that will appear will all of the choices. If she chooses the VL03N call, the query will use the delivery number. If she chooses the VA03 call, the query will use the sales order.
2014/02/07 at 13:42
Hi Feimster,
Hope you are well.
Do you know if it’s possible to set up a report assignment for /OPT/VIM_ANALYTICS?
The screen fields is S_DPNUM-LOW
I’ve tried the following code but it just hangs…
PARAMETERS:
DOCID LIKE /OPT/VIM_1HEAD-DOCID.
SET PARAMETER ID ‘/OPT/DOCID’ FIELD DOCID.
CALL TRANSACTION ‘/OPT/VIM_ANALYTICS’ AND SKIP FIRST SCREEN.
EXIT.
Many thanks
Ben
2014/02/08 at 06:27
Ben,
You are trying to call a bolt-on transaction – I think it’s for OpenText’s Vendor Invoice Management, right? You might try the CALL TRANSACTION without the clause AND SKIP FIRST SCREEN to verify that you’ve at least got the transaction call correct. Once you’ve validated that point, ensure that you have all the required selection fields populated.
2014/02/10 at 10:29
Feimster,
Yes it’s Vendor Invoice Management. Thanks for the advice, I tried without AND SKIP FIRST SCREEN and the transaction call is correct. The Document Processing Number is not populating.
If I use the screen field:
DOCID LIKE S_DPNUM-LOW.
I get an error: Field “S_DPNUM-LOW” is unknown. It is neither in one of the specified tables nor defined by a “DATA” statement. .
So this is the code I’ve used instead:
DOCID LIKE /OPT/VIM_1HEAD-DOCID.
Thanks
Ben
2014/03/28 at 10:34
Hi Feimster,
Have you ever manged to feed the results from one report into another report? I have one report that gives me the accounting docs relating to a PO and i’d like to feed the document numbers from that report into another of my reports which then gives me accounting information for those documents.
At the moment i’m doing this manually, but ideally i’d like to have this all proceesed in report before passing to users.
I’m guessing if it’s possible it could be acheived with something similar to Report Assignment?
Alternatively i wonder if it would be better to record the PO number from user input at the Selection Screen then create some internal tables using the entries from EKKO, BKPF etc.
Many thanks
Ben
2014/03/31 at 15:58
So you want to pass ALL the results from query 1 into the selection screen of query 2? I can’t say that I’ve tried that before. I’m guessing that the results of query 1 are relevant for some sort of analysis, right? Otherwise, you’d just include the results of query 2 in query 1.
2014/03/31 at 19:50
Query 1 extracts the docs related to a PO from EKBE and I do Select Single to get the relative accounting docs from BKPF. I’d like to pass these values (BELNR) into the selection screen of query 2. BELNR will also show in the results of report 2.
I can’t figure out a way of getting all this info into one report. Do you think it would be possible to create a selection field for PO number, record user input, get values from ekbe & bkpf using coding in the infoset and then pass the values to the table join (same join as report 2) all in one report?
Many thanks
2014/04/02 at 14:04
There must be multiple accounting documents for each PO line item, right? Why wouldn’t a left outer join work between EKBE and BKPF? I was able to add BKPF as a part of a join. Alternatively, you could add BKPF as an additional table. I feel like I’m missing something in your question here.
2014/04/02 at 14:48
BKPF has a field AWKEY which you get by concatenating EKBE-GJAHR and EKBE-BELNR. BELNR only matches in both tables for Invoice Receipts. There’s one accounting document for each material document but for each accounting document i want to see the entries to each G/L account, including GR/IR account.
2014/04/04 at 13:31
I think thi sis more complex than I thought as PO Account Maintenance can create postings relating to several POs within one accounting document. Thanks for taking the time to look.
I’ve got a PO report which gets the info i require using BSEG, it’s very inefficient but will have to do for the time being.
Thanks for the code on how to call ME23N by the way, that’s really helpful!
2014/04/05 at 07:48
This might be a time when you’d want to consider trying to build a custom report in ABAP rather than using Query. You can probably tell I like to push the limits of Query, but there are definitely certain times when a programmer can do something that Query simply cannot. Let me know how it turns out.
2014/05/21 at 01:04
Feimster.. PLEASE HELP PLEASE…. I’m CLOSE…
How would i do this for a report to go directly into MD04? I can get the material # to populate but not the plant? Please help!
2014/05/21 at 03:11
You populate the material field on that screen using the parameter ID “MAT” and plant field using “WRK”. So the code you’ll need in the “DATA” section of the infoset should be something like this:
PARAMETERS:
matnr LIKE rm61r-matnr,
werks LIKE rm61r-werks.
SET PARAMETER ID 'MAT' FIELD matnr.
SET PARAMETER ID 'WRK' FIELD werks.
CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
EXIT.
When you use transactions that have the PIDs built-in to the screen, it makes calling them very easy. Look at this post for details on how to call a transaction that doesn’t use parameter IDs. It is more complicated, but not beyond comprehension.
2014/05/21 at 11:26
WORKS!!! THank you!!!!
2014/05/21 at 19:03
About the MD04 ? above……. DO you know why my query results would show different total amounts then MD04? For instance, I ran my query for plant and MRP controller wide open and got result of 338 materials. Now in MD07 ran same parameters and it showing 374 materials..?
2014/05/21 at 20:00
Without knowing what your query/infoset is based on, I can’t say exactly why you are seeing different results.
2014/05/21 at 20:09
I’m using join with Marc and MARA. and only fields i’m using are MARA-MATNR,MARC-DISPO, and MARC-WERKS. AND assigned the report assignment with the code you gave me above for MD04.
2014/05/22 at 18:33
If you are using the methods I’ve described in this post, you should have two infosets and two queries, right? The first infoset/query combination is your main query where I think you have results showing material and plant (and probably other stuff, too). The second is really a placeholder where you should include the ABAP snippet that points to the parameter IDs and the transaction MD04. In this second combo, the infoset can be as simple as a direct table read of MARC and the query can simply have the fields MATNR and WERKS. You’ll never actually see the results of this query because the code directs it to MD04. How does this compare to what you’ve got?
2014/05/22 at 19:27
Yes, that is just about exactly how mine is, except for a direct table read of MARA instead of marc. Also i added one other parameter to my code so the MRP area will match the plant. I’ve taken that out and tested and still got same results. Now when running my main query by just MRP controller and Plant… then sort all all the materials in ascending order, I get numerous materials showing up more than once and sometimes 4 or more….I guess it may be some MRP setting we have on the material master???… this thread has still been a tremendous help!
2014/06/05 at 11:20
Feimster,
I have successfully created this query with report assignment and works great. When drilling down to the material i have it bypassing the input screen for MD04 and going directly into the stock requirements list for that material/plant. My question to you is.. is it possible to add the icon “next” and “Previous” to the MD04 screen? Oppose to the user having to back out to the query results and drill back into md04. If you run MD04/MD07 for multiple items this icon does show up. But when running the query and drilling into MD04 those icons do not show up. Any suggestions?
2014/06/05 at 11:41
The short answer is: For MD04, it’s not possible with queries and infosets.
The long answer is: Those buttons show up when you’ve entered new material numbers directly in the MD04 transaction. Since you are bypassing the initial screen by pushing a single material – the one you’ve double-clicked on – to the transaction, it will only know that number and not the entire breadth of numbers in your query’s results. You would need to turn this into an ABAP report to get something like that.
You may get closer what you’re looking for by using MD07 and jumping into the list of materials then jumping into the material that the user double-clicked on. This would involve a little more ABAP in the report query, but theoretically it’s possible. Using MD07 would give you “a” list of materials, but it may not be “the” list that you have in your query results.
2014/06/06 at 15:33
Feimster,
Could you possibly do a new tutorial for a query that shows the quantity of deliveries scheduled for future weeks. For example this query would show say…. 5 deliveries scheduled on Monday, 5 Tuesday, 5 Wednesday, 9 Thursday, and 13 Friday?
This has always been a problem for us and our WH staff. If we could get a list like this show the amount of deliveries then we could have our planners smooth out their PO delvery dates over the week.
2014/06/10 at 17:20
How would i get the PO to autopopulate for ME22n? Is that possible?
2014/06/12 at 16:32
I have a query that jumps to ME23N, but you should be able to use the same approach for ME22N. In the report assignment query which is based on a direct table read of EKKO, I have the following code in the DATA section:
PARAMETERS:
bstnr LIKR rm06e-bstnr.
SET PARAMETER ID 'BES' FIELD bstnr.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
EXIT.
Obviously, you’ll need to change the transaction code above, but this method works.
2014/06/20 at 18:40
If possible, How can i call transaction MM03 to a specific tab (Plant Data Storage 1)?
2014/06/23 at 17:38
Yes – I think you can. You’ll need to add some code in the report assignment Infoset that initiates a BDC. Look at this post on how to do that. Obviously, you’ll want to use MM03 rather than FBL5N. When you are making your recording, I would follow these steps in the material master: start MM03, type in your material number, click on the “Select View(s)” button, deselect all, select “Basic Data 1”, then Enter. Now that you’re in the material master, go to the list of tabs and select “Plant data / stor. 1”. You’ll see a popup for plant and storage location. Technically, you don’t have to enter anything as there are fields on that view that are global, but you can probably use data from your query here.
2014/08/06 at 18:48
Can you do a tutorial on how to create a query for materials and their average usage for certain number of periods?
2014/09/08 at 17:05
Cool staff! Just tried and it works!!! Love it!!!
2015/03/13 at 16:37
Hi,
I adapted your solution for CJ20N it worked 100% for me, I’ve posted on this link http://scn.sap.com/message/15818251#15818251
I refer to your site there, giving part of the credit for the solution.
Thanks,
Ronald Barcellos.
2015/03/17 at 12:21
Thanks, Ronald! I’m really glad it worked for you and, more importantly, I hope it can help others.
2015/05/26 at 12:12
How can i get this drilldown to work for transaction KKBC_ORD? I am setting the Parameter ID ‘ANR’ however, the order # is not populating in the field KKB0-AUFNR.
2015/05/27 at 03:15
I tried branching into this transaction from a very basic production order query – order number, created by, and created on. The basis of this infoset happens to be AUFK because I needed a list of production orders. Then I created the report assignment infoset and query and assigned to the original query. The report assignment query is also based on AUFK and this one is more important since it is this query that we’re feeding AUFNR from the original query. In the results of the first query, I double-click on a production order number and it populates that order in KKBC_ORD. It does not execute. In the report assignment infoset, I used the following code in the “DATA” section:
PARAMETERS: aufnr LIKE kkb0-aufnr.
SET PARAMETER ID ‘ANR’ FIELD aufnr.
CALL TRANSACTION ‘KKBC_ORD’.
EXIT.
Are you using something similar?
2015/05/27 at 11:53
Yes. I got the order to populate however, is it possible to get it to execute? I tried using “AND SKIP FIRST SCREEN” but no luck.
2015/05/27 at 12:37
Or is their a way to get straight to the process order cost analysis with parameter IDs in txn COR3? In COR3 you have to enter the order number, execute the transaction then you have to “GO TO” and then choose “COST” and then “ANALYSIS”
2015/05/29 at 06:41
In order to have it execute, you have to create a BDC within the report assignment infoset. This applies for any situation where you might want to drill farther into a transaction than just the first screen. I did this for a query where the users wanted to see the details of an outline agreement rather than just the overview.
I tried this code and it seems to work for me. Again, this should be posted in the “DATA” section of the infoset.
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
wa_bdcopt TYPE ctu_params.
PARAMETERS: aufnr LIKE kkb0-aufnr.
“for bdc
CLEAR wa_bdcdata.
wa_bdcdata-program = ‘SAPMKKB0’.
wa_bdcdata-dynpro = ‘0100’.
wa_bdcdata-dynbegin = ‘X’.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = ‘BDC_CURSOR’.
wa_bdcdata-fval = ‘KKB0-AUFNR’.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = ‘BDC_OKCODE’.
wa_bdcdata-fval = ‘=OSNY’.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = ‘KKB0-AUFNR’.
wa_bdcdata-fval = aufnr.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcopt.
wa_bdcopt-dismode = ‘E’.
“for transaction
CALL TRANSACTION ‘KKBC_ORD’
USING it_bdcdata
OPTIONS FROM wa_bdcopt.
EXIT.
2015/05/29 at 11:21
This works great!!! Is it possible to exit back straight to the query rather than hitting back twice? Not a big deal if not, only one extra click. Thanks Feimster!
2015/05/28 at 18:31
Fiemster,
I too, would like to know if it’s possible to drill down into the Process Order Cost analysis via KKBC_ORD or COR3 and have it execute automatically.
2015/05/29 at 10:48
Perfect!!! Thank you!
2015/05/29 at 13:10
Feimster,
I had this working. I can’t find anything that has changed, when i double click on the order, the drill down goes to KKBC_ORD but it populates “AUFNR” in the order field and i get an error stating ” Order AUFNR does not exist” do you know what i could of done wrong?
2015/06/03 at 04:40
Is there a message number that you can look up on Google? You mentioned that these are coming from COR1. Could it be that KKBC_ORD isn’t designed for process orders? I’m not familiar with process orders.
2015/11/17 at 12:58
Thank you very much. I have adapted this for a few transactions. I was about to write an ABAP report but using another query is a better an faster solution for me.
2016/01/28 at 21:41
This worked Like a charm for PO Display. I tried to do the same for Contract Display (ME33K). I get the message “Selection data of calling program does not match query”
this is what I wrote on the Data section of the code
PARAMETERS:
EVRTN like RM06E-EVRTN.
SET PARAMETER ID ‘VRT’ FIELD EVRTN.
CALL TRANSACTION ‘ME33K’ AND SKIP FIRST SCREEN.
EXIT.
Pls help
Regards
2016/02/05 at 00:03
I’ve written one for ME32 which should be pretty similar to ME33K. I had to do some BDC trickery to get it to work – see my other post that explains how to do it for FBL5N. Here’s the code that I have in my infoset for ME32:
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
wa_bdcopt TYPE ctu_params.
PARAMETERS: evrtn LIKE rm06e-evrtn,
ebelp LIKE rm06e-ebelp.
"for bdc
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPMM06E'.
wa_bdcdata-dynpro = '0205'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'RM06E-EVRTN'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=AB'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'RM06E-EVRTN'.
wa_bdcdata-fval = evrtn.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPMM06E'.
wa_bdcdata-dynpro = '0220'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'RM06E-EBELP'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '/00'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'RM06E-EBELP'.
wa_bdcdata-fval = ebelp.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcopt.
wa_bdcopt-dismode = 'E'.
CALL TRANSACTION 'ME32'
USING it_bdcdata
OPTIONS FROM wa_bdcopt.
EXIT.
2016/02/10 at 13:48
Thanks for the info.
However when I changed the parameter id to CTR and it worked. My colleague asked me to switch the PID, not sure how he found CTR over VRT
PARAMETERS:
EVRTN TYPE EBELN.
SET PARAMETER ID ‘CTR’ FIELD EVRTN.
CALL TRANSACTION ‘ME33K’ AND SKIP FIRST SCREEN.
EXIT.
2016/02/16 at 14:56
It is very strange that the field on the transaction itself shows one PID but that it works better with another. Glad you found it to work!