Detailed manual “How to create a PA infotype in SAP HR” or “How to tame SAP?” (Part 1)
- From the sandbox
- Tutorial
SAP is a fairly common system in large enterprises not only in the West, but also in the post-Soviet countries. There is a lot of gossip and discussion, both positive and negative about SAP. And the negative reviews are mainly related, not so much with the complexity of the system, but with an intuitive interface and the lack of accessible literature (books, instructions) in plain Russian.
With this article, I want to start with accessible instructions on some aspects of SAP that beginner SAPs often have problems with. This article will focus on creating personnel administration infotypes (PA) for the SAP HR module. If you like this instruction and will be useful, dear reader, then I hope it will not be the last.
Soon there will be a year when I work as an internal consultant of SAP on a project to introduce the SAP HR module of a very large enterprise in Ukraine. SAP learned from scratch: Google, downloaded courses, and advice from external consultants. Therefore, in this article I will try to step by step and in an accessible way show how to create PA infotypes for the same newcomers as I was a year ago (although now it is also far from being a "guru").
1. First, start transaction PM01 - create an infotype. Custom infotypes need to be created on a 9-ku (I advise you to check the free number for the infotype first). Also, in the “Subobjects” block , the radio button should be on the “PS Structure” . Next, click the "Generate Objects" button .
The system offers us to create a structure for our infotype. We agree.
2. We create our structure. Standard fields (e.g. BEGDA, PERNR ) do not need to be created, they will automatically be attached to the infotype. As recommended by SAP, the fields should be called ZZ *. We also determine the data types for our fields according to the types of existing fields in the system (eg PLANS , which automatically sets the data type to NUMC and is 8 characters long), or we select the data type (eg CHAR ) by clicking on the “Component Type” button , give it a length and give a short description of our field.
Another good tip. If a search tool is required for any field (such as the standard search tool for selecting a date, by clicking on the icon that appears to the right of the field), go to the “Help / check value. input ” , where we click on the “ key ” and the button “ Search Tool ” . In 90% of cases, the required search tools are in the standard, such as searching for pieces. positions on org. structure as shown in the screenshot.
We activate our structure. If the window shown below doesn’t get scared, we click “No”.
3. After that, click "Back" . We agree to several messages, after which the system offers to fill out a plate (T582A)where the characteristics of our infotype are stored. We need to create a record for our infotype, for this I advise you to copy an existing one.
Save. If we need to change this data, we go into transaction SM30 , where we call the maintenance view V_T582A .
4. Our infotype is created. It can already be created for a person in PA30 , and used as intended if your infotype is simple and does not require any “pull-ups” of values, operations after entering data, etc.
On this, all the instructions usually end, and it turns out that our infotype is not very simple, and what to do next is not clear. So that I will continue to delve into this topic.
In transaction PM01, in the subobject block there are a few more lines that we will need:
a) A module pool ( MPXXXX0 , where XXXX is our infotype), where include programs have already been generated:
- * 10 - Global data;
- * 20 - PBO logic;
- * 30 - PAI logic;
- * 40 - subroutines,
where "*" - "MPXXXX" .
We mainly need PBO logic (Process Before Output) and PAI (Process After Input) . In PBO we describe everything that happens from the moment IT is launched until it is displayed on the screen (for example, we will tighten the current position of the person by whom we create IT in the zzold_pos field) In PAI we describe everything that will happen after pressing “Enter” when we have already entered the information (for example, if we need to calculate how much time is left until the current date zznew_date ).
b) Screen. We, for our infotype, will need a screen 2000 - this is a screen for entering and viewing, the one that appears in transaction PA30. 3000 - to display IT records in a list (in PA30 the icon is “slide with the sun.” 4000 and 5000 - for quick and batch input of IT. Here we will touch only the 2000 screen, because for quick and batch input you will need a separate instruction, and probably several times larger than this
5. First, let's go to2000 screen, there we select the radio button "Format Editor" . In it we will be able to "draw" the screen of our IT. We have already created all the fields from the structure we created. We draw, inspire beauty.
When you select a field, another window opens, with the parameters of the field. There are several nuances. First, fill in the attributes. Here you can configure whether this field is required to be filled out, or note that this field is for output only, or to make the text highlighted (draws it blue). Secondly, the first field opposite the inscription "Groups" must be filled out. The value is "006", indicates that this field is always visible. “Googling” you can find what values you need to enter in these 4 fields, for example, to display the field only after pressing Enter. This is a very important point, for already created fields there will be “006”, but if you create a new field and do not fill out the group, you will not see a new field on the screen, and you can suffer for a long time.
The next step is to select the line “Execution Logic” with the radio button, where we will write the execution logic for our screen.
In the window that opens, everything has already been generated, but we can only register additional logic. There is also Process Before Output and Process After Input. In the PXXXX module , where XXXX- our infotype, we can write everything that ABAP allows us to do. Below is an example of code in this module, where we, when creating an infotype for a person, tighten his staff, and out of 1000 IT in a regular position, we tighten the descriptive text.
In addition, in PAI, you can also create your own module in which you can describe the logic after we have filled in the data and pressed Enter.
Here we look at whether we have changed the full-time position and read from 1000 IT describing the text for the new full-time position.
Below is a screenshot of what the created infotype looks like.
That's it, the creation of our infotype is over. I tried to explain everything as accessible as possible for beginners. I hope my article comes in handy. If you have questions, then write, I will always be happy to help.
With this article, I want to start with accessible instructions on some aspects of SAP that beginner SAPs often have problems with. This article will focus on creating personnel administration infotypes (PA) for the SAP HR module. If you like this instruction and will be useful, dear reader, then I hope it will not be the last.
Soon there will be a year when I work as an internal consultant of SAP on a project to introduce the SAP HR module of a very large enterprise in Ukraine. SAP learned from scratch: Google, downloaded courses, and advice from external consultants. Therefore, in this article I will try to step by step and in an accessible way show how to create PA infotypes for the same newcomers as I was a year ago (although now it is also far from being a "guru").
1. First, start transaction PM01 - create an infotype. Custom infotypes need to be created on a 9-ku (I advise you to check the free number for the infotype first). Also, in the “Subobjects” block , the radio button should be on the “PS Structure” . Next, click the "Generate Objects" button .
The system offers us to create a structure for our infotype. We agree.
2. We create our structure. Standard fields (e.g. BEGDA, PERNR ) do not need to be created, they will automatically be attached to the infotype. As recommended by SAP, the fields should be called ZZ *. We also determine the data types for our fields according to the types of existing fields in the system (eg PLANS , which automatically sets the data type to NUMC and is 8 characters long), or we select the data type (eg CHAR ) by clicking on the “Component Type” button , give it a length and give a short description of our field.
Another good tip. If a search tool is required for any field (such as the standard search tool for selecting a date, by clicking on the icon that appears to the right of the field), go to the “Help / check value. input ” , where we click on the “ key ” and the button “ Search Tool ” . In 90% of cases, the required search tools are in the standard, such as searching for pieces. positions on org. structure as shown in the screenshot.
We activate our structure. If the window shown below doesn’t get scared, we click “No”.
3. After that, click "Back" . We agree to several messages, after which the system offers to fill out a plate (T582A)where the characteristics of our infotype are stored. We need to create a record for our infotype, for this I advise you to copy an existing one.
Save. If we need to change this data, we go into transaction SM30 , where we call the maintenance view V_T582A .
4. Our infotype is created. It can already be created for a person in PA30 , and used as intended if your infotype is simple and does not require any “pull-ups” of values, operations after entering data, etc.
On this, all the instructions usually end, and it turns out that our infotype is not very simple, and what to do next is not clear. So that I will continue to delve into this topic.
In transaction PM01, in the subobject block there are a few more lines that we will need:
a) A module pool ( MPXXXX0 , where XXXX is our infotype), where include programs have already been generated:
- * 10 - Global data;
- * 20 - PBO logic;
- * 30 - PAI logic;
- * 40 - subroutines,
where "*" - "MPXXXX" .
We mainly need PBO logic (Process Before Output) and PAI (Process After Input) . In PBO we describe everything that happens from the moment IT is launched until it is displayed on the screen (for example, we will tighten the current position of the person by whom we create IT in the zzold_pos field) In PAI we describe everything that will happen after pressing “Enter” when we have already entered the information (for example, if we need to calculate how much time is left until the current date zznew_date ).
b) Screen. We, for our infotype, will need a screen 2000 - this is a screen for entering and viewing, the one that appears in transaction PA30. 3000 - to display IT records in a list (in PA30 the icon is “slide with the sun.” 4000 and 5000 - for quick and batch input of IT. Here we will touch only the 2000 screen, because for quick and batch input you will need a separate instruction, and probably several times larger than this
5. First, let's go to2000 screen, there we select the radio button "Format Editor" . In it we will be able to "draw" the screen of our IT. We have already created all the fields from the structure we created. We draw, inspire beauty.
When you select a field, another window opens, with the parameters of the field. There are several nuances. First, fill in the attributes. Here you can configure whether this field is required to be filled out, or note that this field is for output only, or to make the text highlighted (draws it blue). Secondly, the first field opposite the inscription "Groups" must be filled out. The value is "006", indicates that this field is always visible. “Googling” you can find what values you need to enter in these 4 fields, for example, to display the field only after pressing Enter. This is a very important point, for already created fields there will be “006”, but if you create a new field and do not fill out the group, you will not see a new field on the screen, and you can suffer for a long time.
The next step is to select the line “Execution Logic” with the radio button, where we will write the execution logic for our screen.
In the window that opens, everything has already been generated, but we can only register additional logic. There is also Process Before Output and Process After Input. In the PXXXX module , where XXXX- our infotype, we can write everything that ABAP allows us to do. Below is an example of code in this module, where we, when creating an infotype for a person, tighten his staff, and out of 1000 IT in a regular position, we tighten the descriptive text.
TABLES: PA0001, HRP1000.
DATA: FLAG(1).
IF FLAG IS INITIAL.
FLAG = '1'.
SELECT SINGLE * FROM PA0001 WHERE PERNR eq P9508-PERNR
AND BEGDA le P9508-BEGDA
AND ENDDA ge P9508-BEGDA.
MOVE PA0001-PLANS TO P9508-ZZOLD_POS.
SELECT SINGLE * FROM HRP1000 WHERE OBJID eq PA0001-PLANS
AND OTYPE eq 'S '
AND BEGDA le P9508-BEGDA
AND ENDDA ge P9508-BEGDA.
MOVE HRP1000-STEXT TO P9508-ZZOLD_POS_TEXT.
ENDIF.
In addition, in PAI, you can also create your own module in which you can describe the logic after we have filled in the data and pressed Enter.
IF P9508-ZZOLD_POS NE PA0001-PLANS.
SELECT SINGLE * FROM HRP1000 WHERE OBJID EQ P9508-ZZOLD_POS
AND OTYPE EQ 'S '
AND BEGDA LE P9508-BEGDA
AND ENDDA GE P9508-BEGDA.
MOVE HRP1000-STEXT TO P9508-ZZOLD_POS_TEXT.
ENDIF.
CLEAR HRP1000.
SELECT SINGLE * FROM HRP1000 WHERE OBJID EQ P9508-ZZNEW_POS
AND OTYPE EQ 'S '
AND BEGDA LE P9508-BEGDA
AND ENDDA GE P9508-BEGDA.
MOVE HRP1000-STEXT TO P9508-ZZNEW_POS_TEXT.
Here we look at whether we have changed the full-time position and read from 1000 IT describing the text for the new full-time position.
Below is a screenshot of what the created infotype looks like.
That's it, the creation of our infotype is over. I tried to explain everything as accessible as possible for beginners. I hope my article comes in handy. If you have questions, then write, I will always be happy to help.