Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8635

Re: Multiple rows selection in additional table Infoset

$
0
0

Hi Saad,

 

Please find the below steps:

 

Infoset (Tcode: SQ02)

Here we will include all of our tables or infotypes that will provide us data for our queries. If you are trying to create queries in HR Module then it is strongly recommended to use a Logical Database to create your queries, because if you are using HR Tables then joining them will be a problem because of date fields (BEGDA/ENDDA).

Logical database will always use inner join and will skip the rows that will not match in corresponding infotypes. For example: You are trying to create a query with Pernr and name from infotype 2 and Work Address from infotype 6. Then the report will not include the persons that do not have a work address. Only employees shown on the report will be those that have a work address subtype of infotype 6 populated. This constraint is usually overlooked and it results in wrong reports.

 

Steps to create a new infoset using logical database PNPCE:

  1. Go to      Transaction SQ02.
  2. Give      Infoset a description, give source of data for infoset i.e. Logical      Database or Tables etc.
  3. If you      have used logical database e.g. PNPCE then a screen will pop-up to select      the infotypes.
  4. Select       the infotypes and continue.
  5. If       you later want to add more infotypes then click on menu item Edit->       Change Info-Type Selectionand add or remove the infotypes.
  6. If you      have used tables then only give one table name and you will be brought to      the screen where you can add more tables and specify joins between tables.
  7. To       add more tables, click on Join Tablesand click on Insert Tables.
  8. You       can drag and drop the matching field from one table to another to specify       joins, you can also change the join type from inner join to outer join.
  9. There      is an area Field Groupin infoset screen, only the fields that appear      here will be available while creating queries. All fields from infotypes      may not be available in field groups, so you will have to manually drag      and drop them in appropriate field groups.
  10. On the      left hand side, under each node of infotype/table you will see some fields      in blank or blue text color. Blue fields are those that are included in      the infoset and hence available for reporting in SQ01.
  11. Save      and generate your infoset. This is mandatory, as when you generate the      infoset, a program is generated with the code reflecting your changes in      infoset.

User Groups (Tcode: SQ03)

Once you have created the infoset you have to assign it to a user group. To create a new user group go to transaction SQ03 and create a new user group and assign users to that user group. If you already have a user group then you do not need to go to SQ03, on the main screen of SQ02 you can click on button Role/User Group Assignmentto specify the user groups tied to that infoset.

Ad-hoc Queries (Tcode: SQ01)

Ad-hoc queries (a.k.a. SAP Queries) are used for reporting off the infoset created in previous steps. So go to transaction SQ01 and create a new query:

  1. Give      name of the query you want to create and hit create button.
  2. You      will be asked the name of the infoset that you want to use.

NOTE: You cannot change the infoset later, so be sure which infoset you want to choose, otherwise you will have to create a new query to choose a different infoset.

  1. There will be various options on next      screen regarding output format, title etc. which are pretty self      explanatory and we will not go into details of them.
  2. A      faster way will be to click on Basic Listbutton.
  3. Expand      the infotype in which you are interested.
  4. You      will see two check boxes in front of each field.
  5. First       box is to display the field on the report.
  6. Second       box is to display the field on the selection screen to restrict the       records based on some criteria.
  7. Fields      will by default have same order in which you select them. It can be      changed visa dragging and dropping on appropriate location in right hand      pane.
  8. Each      infotype will have Additional Fieldsnode which contains the texts for      codes like for Position, it will contain a field text:position which will      display the STEXT for that position.
  9. Save      and Run your report.


Creating custom fields:

Now, we will come back from refreshing memories of creating queries and jump into a little technical area.

 

We can create fields that will fetch data according to out own logic, fields that are not provided by SAP. For that, you will need ABAP access to the system, so if you are working in Production or Quality system then most probably you will not have authorization for that. If you need custom development then best place is the Development environment. We can then either transport the infoset from Development to next systems or we can download and upload it in production (which will again need production system to be opened for some time).

 

To create a custom field:

  1. Go to      your infoset in SQ02 in change mode.
  2. Right      click on the Additional fieldsnode of the infotype in which you want to      create the new custom field and click create.
  3. Give      it a name; this will be the name of the field used inside the ABAP code. Select      Additional Fieldand click continue.
  4. On      next screen, provide following information.
  5. Long       Text: This text will appear in the infoset for that field, and inside the       SQ01 query while developing.
  6. Header       text: This text will appear on top of the field as header, when the       report will be in run mode.
  7. Format:       Give the technical information about your field or simply give the LIKE       reference e.g. P0002-VORNA, it will pick up the attributes from that field.
  8. Sequence       of code: This number will be sequence of the code to be executed inside       that field group. E.g. if you have created 5 custom fields and you want       one fields code to be executed before some other field so that some       variables are set-up then give the appropriate sequence.
  9. Assign      this newly created field to the field group, so that it can be accessed in      reports.
  10. Right      click the newly created field and click Field Code.
  11. This      is the place where you will put all your code.
  12. If you      have used Logical Database then appropriate structures will be filled in      automatically (e.g. P0002, P0006 etc.) you can use same macros as you will      use in your normal HR Programs.
  13. Once      done with the logic, assign the value to the field name, so that it      appears in the query.
  14. This      code will be executed for each pernr.
  15. Save      and generate the infoset.

 

Thanks

Siva


Viewing all articles
Browse latest Browse all 8635

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>