Requirement to have Additional User-Fields in various Tabs of Equipment, Functional Location or Fleet Masters is very common. Though there is a hassle-free way of having the Z-fields through Class and Characteristic way, it has got its own limitations like unable to become a part of Standard reports.
In this article, the User-Exit way of having these custom fields has been elaborated. Enhancement ITOB0001 has been demonstrated here. The process will be same for ITOB0003 (Fleet Master).
While trying to achieve this by joining the information pieces available in the forum and outside, the author spent sufficient time to achieve all requirements related to this.
At the end of this article we will be able to:
- Create our own fields in the Equipment, Functional Location or Fleet Masters
- Input values and save these values to the related Database Tables
- Edit these values through Tcodes IE02, IL02.
- Will have these fields in standard reports like IH08, IH06, IE37.
Here we go (ABAP Workbench)
Step 1 (Preparation of EQUI Table)
Let’s suppose we are intending to have 40char long field, named PO Number into the Equipment Master.
1st step is to create this Z-field into the include table of EQUI table.
For this run Tcode SE11, Give value CI_EQUI and Go to Change mode. Add a Z-field in this table say ZZITO_PONO
with component type TXT40 (for 40char long field). Activate table.
Here I want to share a vital information with the readers. i.e., as long as I tried this task with field names like ZZPONO etc, it never worked. And there consumed lot of time. Then at some place I read about the SAP note 594757, which states that without a prefix ZZITO_ to the Custom fields, this task would not be successful.
Next, we need to add this field ZZITO_PONO, also to the include table CI_EQUI _U with component type IIND (Char1). Do it in the same way as above (through SE11). Activate table.
With this we completed adding our Z-field to the database table EQUI (through its include tables)
Step 2 (Enhancement – Create Sub-Screen)
Create a project ZPMEQUIP through Tcode CMOD and assign the Enhancement ITOB0001.
Now Run Tcode SMOD with value ITOB0001 and click on Test button.
See here, we have 2 Function-exits and 5 Screen exits. Let’s select the first Screen, namely 1000 . Double click on this and Create a Sub-Screen through the steps there on.
Now Click on Layout Arrow above to go to Screen Painter and Create your Fields here. In our case we are creating One field.
As shown in the picture , drag the ‘T’ icon to the screen are to create a Text field and name tis field as ‘PO Number’.
Similarly drag the icon below to create an Input/Output field and Give the Dictionary address to the Input field i.e., EQUI-ZZITO_PONO .
(I hope you recall that this is the field we have created in EQUI table in the step1)
Step3 ( Enhancement – Give Codes in Function Exits)
We have 2 function Exits, namely
The first Exit imports the Z-field values from the EQUI table to the Equipment Master
The second one exports Z-field values from the Equipment Master to the EQUI table.
Now the codes to be written in the Exits.
Write following code in the include (ZXTOBU01) of function-exit EXIT_SAPLITO0_001.
E_SUBSCREEN_NUMBER = ‘1000’.
I_OBJECT_TYPE = ’02’ .
I_ACTIVITY_TYPE = ‘3’ .
EQUI-ZZITO_PONO = I_DATA_EQUI-ZZITO_PONO.
Write following code in the include (ZXTOBU02) of function-exit EXIT_SAPLITO0_002
E_UPDATE_DATA_EQ-ZZITO_PONO = EQUI-ZZITO_PONO.
E_UPDATE_FLAGS_EQ-ZZITO_PONO = ‘X’.
Step 4 (SPRO Preparation)
- Navigate to this section of SPRO.
- Select Screen Group (Equipment) on the right (Profile Standard) and D’Click on the Activity and layout of views on the Right.
- Give value 150 in the line of desired Tab page of Equipment Master.
- Assign this profile (in this case Standard) to the intended Equipment Category, through this setting.
After this SPRO setting, you will be able to see your Z-Field at the bottom of the Organization Tab page of that particular Equipment Category. Verify by running IE02 / IE03 transactions.
Try by inputting a value, Save and rerun IE02 and verify your value is stored or not.
In fact, the part of Step3 above ( coding in the Exits ) did not work as long as I did not come across the above referred SAP note. After using the prefix ZZITO_ to the Z-field these codes started working. values inserting.
Now if you go to IE03, unlike all other greyed-out fields, your Z-field will be seen Editable. Though there is no provision to save the edits here, you’d definitely like to have this too in Greyed-out mode.
For this we need to write a small code in the PBO (Process Before Output) module of the screen 1000 we have created.
Double click on the Screen number 1000 of the enhancement, (you are in the Flow Logic Tab) ,
D’Click on the STATUS_1000 of the PBO module. and insert this code between the MODULE, END MODULE lines like this
MODULE STATUS_1000 OUTPUT.
IF SY-TCODE = ‘IE03’.
LOOP AT SCREEN.
SCREEN-INPUT = ‘0’.
Lastly Do not Forget to
Activate the Function Group XTOB from Tcode SE80. Right click on the Function Group and click on the Activate option
Now the Last Step.
Step 5 (Have this Z-field in the Standard Report , in this case IE05, IH08)
To have our Z-field in IH08 output, first we need to know the structure of this report output.
For this click on any cell in the ALV screen and press F1 key.
Here click on the Technical Information icon. The resulting pop-up will show you the Structure against field name Table. Here the Structure is RIHEQUI_LIST .
Now through SE11 go to the above Structure, Click on an Append Structure on the Application toolbar and Create an Append structure having this field. Activate table.
Now Run IH08 and see in the output list in the Column Set (the list not displayed). You should find this field PO Number.
Often you do not find this. It is time to clear ALV buffer through program BALVBUFDEL.
For this run Tcode SE38 give the above program and hit Execute.
Now run IH08 again and verify, your field is there.
This work is with a larger objective in mind to avoid re-inventing the wheel after sometime and at the same time providing the Total Solution about this task at one place. This work involves Appending structures and Activation of Tables, which should be done by experienced ABPAers only.
Also this work can be extended to Functional Location Masters with the same enhancement used above and to the Fleet Masters with enhancement ITOB0003.
..and I feel it is important to mention the version I experienced all these and documented, it is ECC6.0 no EHPs.
Hope members find this useful.
Jogeswara Rao K