Adding Customer Fields In IMA11 (Appropriation Request / CSN) Using Exit AAIR0002
Using this enhancement AAIR0002 we can add the user fields in appropriation requests in a sub screen and place it in IMA11. In order to perform the addition of adding the custom fields in IMA11 following steps needs to be done.
For Example i have a requirement to add the material no in the appropriation requests.
1. Firstly create a structure CU_IMAU in SE11
2. Create a Screen lets say 1234 in Function Group XAI1 and create an input field by clicking on F6 and give IMAK table name and select ZZ_MATNR as shown in below figure
PROCESS AFTER INPUT.
MODULE pai_fill_user_entered_data.
*& Module PAI_FILL_USER_ENTERED_DATA INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pai_fill_user_entered_data INPUT.
IMAK_CI_INCLUDE-ZZ_IMMATNR = IMAK-ZZ_IMMATNR.
PERFORM SET_USERFIELD_DATA changing IMAK_CI_INCLUDE.
ENDMODULE. " PAI_FILL_USER_ENTERED_DATA INPUT
*&---------------------------------------------------------------------*
gd_aktyp = I_aktyp .
IF I_AKTYP ='H' OR I_AKTYP = 'V'. "Create Or Change
clear : ET_required[].
ET_REQUIRED-gbox = '1234'.
append ET_required.
ENDIF.
Now Select the Customer Tab Row and double click on Position of Groups and in the next screen select your screen no from the F4 list and save the customization.
After adding the screen in layout go to SPRO->Investment management.>Appropriation Request->Masterdata->Control Data->Maintain Appropriation Request Type
here you will find the Request types select the type and give your layout name in there
Using this enhancement AAIR0002 we can add the user fields in appropriation requests in a sub screen and place it in IMA11. In order to perform the addition of adding the custom fields in IMA11 following steps needs to be done.
For Example i have a requirement to add the material no in the appropriation requests.
1. Firstly create a structure CU_IMAU in SE11
2. Create a Screen lets say 1234 in Function Group XAI1 and create an input field by clicking on F6 and give IMAK table name and select ZZ_MATNR as shown in below figure
Click on F6 and get the ZZ_matnr From IMAK Table |
After creating the Screen 1234 Go the Flow Logic and Enable PBO And PAI
PROCESS BEFORE OUTPUT.
MODULE fill_data_from_imak.PROCESS AFTER INPUT.
MODULE pai_fill_user_entered_data.
While creating the Module FILL_DATA_FROM_IMAK you will be asked to create a new include create an include and add the below code here perform GET_USERFIELD_DATA is used to supplies the values from to the transfer structure
*&---------------------------------------------------------------------*
*& Module FILL_DATA_FROM_IMAK OUTPUT
*&---------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE fill_data_from_imak OUTPUT.
*IMAK_CI_INCLUDE-x = 'X'.
PERFORM GET_USERFIELD_DATA CHANGING IMAK_CI_INCLUDE.
PERFORM READ_REQUEST_DATA.
IMAK-ZZ_IMMATNR = XIMAK-ZZ_IMMATNR.
IF gd_aktyp = 'A'. "When in Display Mode
LOOP AT SCREEN.
IF screen-name = 'IMAK-ZZ_IMMATNR' .
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " FILL_DATA_FROM_IMAK OUTPUT
*& Module FILL_DATA_FROM_IMAK OUTPUT
*&---------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE fill_data_from_imak OUTPUT.
*IMAK_CI_INCLUDE-x = 'X'.
PERFORM GET_USERFIELD_DATA CHANGING IMAK_CI_INCLUDE.
PERFORM READ_REQUEST_DATA.
IMAK-ZZ_IMMATNR = XIMAK-ZZ_IMMATNR.
IF gd_aktyp = 'A'. "When in Display Mode
LOOP AT SCREEN.
IF screen-name = 'IMAK-ZZ_IMMATNR' .
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " FILL_DATA_FROM_IMAK OUTPUT
PAI.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------**& Module PAI_FILL_USER_ENTERED_DATA INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pai_fill_user_entered_data INPUT.
IMAK_CI_INCLUDE-ZZ_IMMATNR = IMAK-ZZ_IMMATNR.
PERFORM SET_USERFIELD_DATA changing IMAK_CI_INCLUDE.
ENDMODULE. " PAI_FILL_USER_ENTERED_DATA INPUT
After doing the coding in Screen
3. Go to tcode CMOD and create a Implementation for the Exit AAIR0002
Give the Project Name and click on create and after that assign the go to enhancement assignments
and give the exit name AAIR0002 next click on Components goto -->EXIT_SAPLAIA1_001
create include ZXAI1U01.
*&---------------------------------------------------------------------*
*& Include ZXAI1U01*&---------------------------------------------------------------------*
gd_aktyp = I_aktyp .
IF I_AKTYP ='H' OR I_AKTYP = 'V'. "Create Or Change
clear : ET_required[].
ET_REQUIRED-gbox = '1234'.
append ET_required.
ENDIF.
Activate the project .
4. After doing all this finally we need to ask our Functional to assign the tab in appropriation requests
Goto->SPRO->Investment management->Appropriate Requests->Master Data->Control Data->Specify Tab Layout For Appropriation Requests
Here you need to copy the SAP --Standard tab layout to a custom one ZSAP(Ex.)
now select the ZSAP row and click on Tab Page Titles and provide the title name for your Tab
Give title as per your requirement for understanding i gave customer tab |
After adding the screen in layout go to SPRO->Investment management.>Appropriation Request->Masterdata->Control Data->Maintain Appropriation Request Type
here you will find the Request types select the type and give your layout name in there
Request Type |
and save .
after the customization now we can check our customer screen in IMA11.
after the customization now we can check our customer screen in IMA11.
Hope this will be helpful to some extent, if any changes or corrections please suggest.
Thanks.
Thank you so much :)
ReplyDeleteYou have made my day so fabulous. Thank you so much for detail explanation.
ReplyDelete