There are two requirements by client.
1) While creating PM order via (IW31), he needs to add details about shift in-charge and the respective shift at the IW31 screen.
ENHANCEMENT : IWO10018 (Maintenance order: User fields on order header)
2) Same fields should also get displayed while list editing report IW38.
ENHANCEMENT: IWOC0004 (Change single-level list editing PM/QM/SM ALV settings)
Note: Plz take help from functional person to find both the above exits via t-code SPRO.
How to add new fields at maintenance order?
Step 1: First read the documentation for enhancement (IWO10018) in SMOD.
Step2: Then execute the exit and activate the same.
Step3: Goto AUFK table. Create CI_AUFK structure with two fields shift incharge (ZZSIC) and Shift (ZZSHIFT). Activate.
Here it may take minimum 30 min to activate the table. As it hits many views and structures while activating. See the warning message after activation, which is normal, and would not affect your work.
Note: When you want to add further fields after activating the CI_AUFK structure then it will again take min 20 min to activate with same warning message. Hence it is suggested that complete all required fields at first go. Since activating CI_AUFK structure means regenerating table.
Step4: Click on screen exit SAPLCOIH green button.
It will ask to create screen no. 900. Create in sub screen area and activate the same.
Click on maintain in orig.. button.
Step5: Create subscreen area and attach the respective structure fields to each input field.
CI_AUFK-ZZSIC to Shift Incharge and CI_AUFK-ZZSHIFT to Shift.
Step6: Then create PBO and PAI module pools.
Step 7: All PBO modules are saved in include ZXWOCO01 and All PAI modules are saved in ZXWOCI01.
Step8: Code each module as given below or as per your requirement.
Step 9: Once you activate the code, it will start showing in IW31/ IW32/IW33 t codes under enhancement tab.
Step10: Now you can write your own code at each exit.
EXIT_SAPLCOIH_018: This is getting triggered PBO module. Hence all data from SAP application to screen area are passed at this exit. Use import parameters SAP_CAUFVD_IMP and COCI_AUFK_IMP.
Step 11: EXIT_SAPLCOIH_019: Customer Enhancement for User Fields for Order Header PAI. This exits saves data after PAI module. Hence pass data from screen area to SAP application by using export parameter COCI_AUFK_EXP.
How to display new field at list disply?
Now how to display the same added fields at IW38 list editing report. (Enhancement name: IWOC0004
Step1: Plz read the documentation for your reference.
Step2: Activate the enhancement. (It should be assigned to a project )
Step3: Now in report IW38 (RIAUFK20), search for REUSE_ALV_GRID_DISPLAY.
Under tables you will find OBJECT_TAB as the internal table for displaying data.
And it includes a structure RIHAUFK_LIST
We need to append our own structure to the above structure by clicking at Append structure button. So that while populating data via OBJECT_TAB internal table it will refer the fields and will start showing the data at list display.
Step4: Now goto IWOC0004 and activate. In EXIT_SAPLIREP1_001 write ur own code to modify the list display at IW38.
The fields will start populating at IW38 list display.