Your SlideShare is downloading. ×
Abap query
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Abap query

1,380
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,380
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
229
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ABAP QueryPublished by Team of SAP Consultants at SAPTOPJOBS www.sap-topjobs.com Copyright 2005@SAPTOPJOBSAll rights reserved. No part of this publication may be reproduced, stored in aretrieval system, or transmitted in any form, or by any means electronic ormechanical including photocopying, recording or any information storage andretrieval system without permission in writing from SAPTOPJOBS.
  • 2. TABLE OF CONTENTINTRODUCTION ..................................................................................................3Scenario 1.............................................................................................................41. Finding Database tables for creating queries.................................................42. Create a User group ....................................................................................193. Create an Infoset .........................................................................................274. Assign Infoset to User Group.......................................................................395. Create Query ...............................................................................................41Scenario 2...........................................................................................................641. Creating an Infoset ......................................................................................652. Assign Infoset to User group........................................................................863. Create a Query ............................................................................................884. Transporting Queries .................................................................................108
  • 3. INTRODUCTIONIn every project we come across situations where the client is not satisfied by thestandard SAP reports. In such situations most of the times functional consultantshave to be at the mercy of ABAPERS. This not only costs time but also a gooddeal of money for the client.ABAP Query was a blessing in disguise for both functional SAP consultants aswell as end users of the company. Here, one could easily design various reportswithout any technical knowledge. Functional consultants will find this tool veryuseful and an added skill in today multi tasking environment.We have attempted to bring you meat of ABAP query in this document. I am sureyou would find this very useful in your current job as a consultant or a end user.
  • 4. Scenario 1 1. Finding Database tables for creating queries We want to view the company code segment of the entire customer masters in the company. Standard reports available do not give the desired information. Therefore we feel the need to create an ABAP Query. To create an ABAP query you need to know the database table where the information exists. How can that be obtained? Option 1 We want to see the company code information of a customer. Use the relevant transaction code to see the information. In this case it is FD03 Go to the company code data
  • 5. Position the cursor on the field Recon. account and press functionkey F1 on the key board to see the field help.
  • 6. Click on Technical info
  • 7. Thus you get the Transparent table name – KNB1Here you have easily got the table.Option 2Sometimes the table name is not as easily available as was available inoption 1.In the same transaction
  • 8. Click on
  • 9. Click on the field Name and now again press function key F1 onthe keyboard
  • 10. Click on
  • 11. In the above screen transparent table is not visible.Note down the field name NAME1In another session type in transaction code SE90 in the command field.
  • 12. Click
  • 13. ClickClick
  • 14. Double click
  • 15. Update the following:-
  • 16. Click
  • 17. Click down to find where customer table for general data appears
  • 18. We will use the table KNA1 for General data in Customer Master.
  • 19. 2. Create a User groupUse the following path:-SAP menu à Tools à ABAP Workbench à Utilities à SAP Query à SQ01QueriesClick
  • 20. Update the following:-
  • 21. Click
  • 22. Update the following:-ClickAssign users to the user group. You need to assign the users of the particulardepartment to the user group.Click on
  • 23. You will update the relevant users who will be using these queries.
  • 24. Click
  • 25. Click onClick
  • 26. 3. Create an InfosetClick Environment à Infosets
  • 27. Update the following:-
  • 28. Click
  • 29. ClickUpdate the following:-
  • 30. ClickClick
  • 31. Click
  • 32. Click
  • 33. You will notice in the above screen that some fields have T above themThis means that in this field text is also available.Now we need to select fields from the table (left hand side) to the FieldGroup/data fields (right hand side).Position the cursor onThen position the cursor on
  • 34. Click on Insert field(s) in field group
  • 35. ClickHold the Ctrl key on the keyboard and select other fields alsoBy clicking
  • 36. Click
  • 37. ClickClick to generate the infosetThe infoset is now ready to use in the query.Click
  • 38. 4. Assign Infoset to User GroupUpdate the following:-Click
  • 39. SelectClickClick
  • 40. 5. Create QueryHere we maintain the source fields which are to be updated with the data.Click to select user group
  • 41. SelectClick
  • 42. Update the following:-Click
  • 43. ClickClick
  • 44. Update the following:-
  • 45. Click
  • 46. SelectClick
  • 47. Update the following:-
  • 48. Click
  • 49. Click
  • 50. Update the following:-
  • 51. ClickClick
  • 52. Click
  • 53. Double clickClick
  • 54. Double clickSimilarly double click other fields to select
  • 55. Click
  • 56. Update the following:-ClickClick
  • 57. Update the following:-
  • 58. In the above you screen shot you see that the Customer text is being showing asCustomer number. We need to change this.Click twice
  • 59. ClickClick the field will open upChange it to Customer Name
  • 60. Click onClick
  • 61. ClickClickClick onClick until you reach
  • 62. Now you can execute this queryBy selectingClickScenario 2In scenario 1 we saw a simple query, where in all information required wasavailable in a single table.But that is not the case always. Information which we require is not available in asingle table and is scattered across in more than one table. In such as scenarioyou need to create a join between these tables through a common field betweenthese tables.In this scenario we want to have information of the customer master with name,address and also the accounting information.We have seen earlier that the customer address information is available in thetable KNA1 and the accounting information for the customer is available in thetable KNB1. These 2 tables can be joined based on the common field customernumber in them.
  • 63. Let us proceed with creating a new query 1. Creating an InfosetUpdate the following:-
  • 64. Click
  • 65. Update the following:-Click
  • 66. ClickUpdate the following:-Click
  • 67. ClickClick
  • 68. ClickClickSelect
  • 69. Click on Settings à SettingsClick
  • 70. SelectNow click
  • 71. Click
  • 72. Position the cursor onClick Undo relationship
  • 73. ClickClick
  • 74. Now Update the following:-
  • 75. Click
  • 76. Click
  • 77. Click
  • 78. Click
  • 79. ClickClick
  • 80. ClickThereafter select all the fields you want to move on the right side.Press the Ctrl button to select more than one field.ClickClick
  • 81. Click until you will seeSelect the following fields
  • 82. SelectClick
  • 83. ClickClick onClickClickClick
  • 84. 2. Assign Infoset to User groupClick
  • 85. SelectClick onClick twice
  • 86. 3. Create a QueryClick Other user groupClickClick
  • 87. Click
  • 88. UncheckUpdate the following:-Click
  • 89. Click
  • 90. Update the following:-
  • 91. Click
  • 92. SelectClick
  • 93. Select
  • 94. Click
  • 95. Click
  • 96. Click
  • 97. Update the following:-
  • 98. Click
  • 99. Click
  • 100. Click
  • 101. Click
  • 102. Click twiceClick onClick thriceTo execute a querySelectAnd then Click
  • 103. 4. Transporting QueriesClick
  • 104. Update the following:-
  • 105. ClickClick
  • 106. Click
  • 107. Click

×