1. User-Exit 및 Screen-Exit
2. Table(STKO)에 Customer 필드 추가
.
3. 관련 코딩 내용은 아래 영문 자료 참고
4. 결과
* 참고 자료
Activities in the ABAP Workbench
You do not need to modify the database tables for master data and transaction data. The tables contain an include, which is automatically filled with your company-specific fields.
You maintain the include structure for the BOM header or the BOM item, as required.
Include Structures in Database Tables
Database table |
Include structure |
STKO
(BOM header) |
CI_STKO |
STPO
(BOM item) |
CI_STPO |
In the ABAP Workbench:
- Maintain company-specific fields in the BOM header or BOM item as dictionary objects. Please use names from the name range reserved for customer-specific fields.
In the ABAP Workbench, choose Dictionary, then select Data elements.
- Then maintain the include structure for the database table.
In the ABAP Workbench, choose Dictionary, then select Structures (for example, structure CI_STKO for the BOM header).
- Enter your company-specific fields.
The fields from the structures are copied to the database tables (STKO and STPO). For this reason, always set new fields at the end of the include structure.
- Activate the include structure.
When you upgrade your system to the next release, the fields are automatically included in the new "standard" system.
Maintain Enhancement Project
The field enhancements for the BOM header or items comprise several component parts that are managed in an enhancement project.
To maintain an enhancement project:
- Create the enhancement project:
– Choose Tools ® ABAP Workbench, then Utilities ® Enhancements ® Project management.
You see the Project Management of SAP Enhancements screen.
– Enter a project name and choose Project ® Create.
You see the Attributes of Enhancement Project screen.
– Enter a Short text and save the project.
- Assign the enhancement that is defined in the standard system for BOM processing to this project:
– On the Attributes screen, choose Components.
On the next screen, enter the enhancement for BOM headers or BOM items that has been defined by SAP.
– Enhancement for BOM header: PCSD0003
– Enhancement for BOM item: PCSD0002
- Display the enhancement components.
The following overview shows the components that are automatically assigned by the system.
Components for BOM Item Enhancement PCSD0002
Menu option: |
SAPLCSDI+002 |
<customer fields> |
Function exits: |
EXIT_SAPLCSDI_002
EXIT_SAPLCSDI_003 |
Customer fields for customer program
Customer fields for SAP program |
Screen area: |
SAPLCSDI0138_CUSPOS01SAPLXSA1000 |
Components for BOM Header Enhancement PCSD0003:
Menu option: |
SAPLCSDI+003 |
<customer fields> |
Function exits: |
EXIT_SAPLCSDI_004
EXIT_SAPLCSDI_005 |
Customer fields for customer program
Customer fields for SAP program |
Screen area: |
SAPLCSDI0114_CUSHDR01SAPLXSA1100 |
- Copy the enhancement to your new project.
- Process the individual components.
– On the Project Management screen, select Enhancement components. Choose Change.
– Replace the general menu option Customer fields with a company-specific description.
- Encode function exit EXIT_SAPLCSDI_002 for transferring R/3 application data to the screen area.
000010function exit_saplcsdi_002.
000020*" *
000030*"*" Local interface:
000040*" IMPORTING
000050*" VALUE(USERDATA) LIKE CSCI_STPO STRUCTURE CSCI_STPO
000060 VALUE(ITEMDATA) LIKE STPOB STRUCTURE STPOB
000070*"--------------------------------------------
000080
000090
000100 include zxcsau02.
000110
000100endfunction.
Edit program zxcsau02.
000010*------------------------------------------------*
000020* INCLUDE ZXCSAU02
000030*-------------------------------------------------*
000040
000050hlp_ci_stpo - userdata.
- Encode function exit EXIT_SAPLCSDI_003 for transferring data from the screen area to the R/3 application.
000010function exit_saplcsdi_003.
000020*" *
000030*"*" Local interface:
000040*" EXPORTING
000050*" VALUE(USERDATA) LIKE CSCI_STPO STRUCTURE CSCI_STPO
000060*"--------------------------------------------
000070
000080
000100 include zxcsau03.
000110
000100endfunction.
Edit program zxcsau03.
000010*------------------------------------------------*
000020* INCLUDE ZXCSAU03
000030*-------------------------------------------------*
000040
000050 userdata = help_ci_stpo.
- In the Screen Painter, create the screen area for program SAPLXCSA – for example, screen 1000. Customer-specific fields are included in this screen.
- Screen attributes:
Screen type – Subscreen
Settings – Hold data
- Settings for screen:
Maintain descriptions for the entry fields on the screen (Edit ® Create element ® Text field).
Insert the entry fields in the screen (Edit ® Create element ® Input/output field).
Assign the entry field on the screen to the corresponding field in the include structure (Goto ® Dict./program fields).
- To maintain the include, edit program SAPLXCSA.
Example:
000010*----------------------------------------------------------*
000020* INCLUDE ZXCSATOP *
000030*----------------------------------------------------------*
000040tables: ci_stpo.
000050
000060data: hlp_ci_stpo like csci_stpo.
- In the Screen Painter, program the flow logic for the screen for program SAPLXCSA – for example, screen 1000.
Example:
000010process before output.
000020module status_1000.
000030*
000040process after input.
000050
000060 chain.
000070 field:ci_stpo-feld_1,
000080 ci_stpo-feld_2,
000090 ci_stpo-feld_3.
000100 module user_command_1000 on chain-request.
000110 endchain.
The chain statement is only executed if the fields in the chain have changed. If there is only one field, only the statement on request is used.
Edit a program that is processed before output (PBO).
Example:
000010module status_1000 output.
000020
000030ci_stpo = hlp_ci_stpo.
000050
000060endmodule. "STATUS_1000 OUTPUT
Edit a program that is processed after input (PAI).
Example:
000010module user_command_1000 input.
000020
000030hlp_ci_stpo = ci_stpo.
000050
000060endmodule. "USER_COMMAND_1000 INPUT
- Once you have created the menu option and programmed the function modules and screen area, you can activate the company-specific enhancement project on the Project Management screen. When you activate the enhancement, the BOM program is regenerated, so the call is active.