cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Screen Exit for ES22 & ES21 : Add Z*field to table Control

ricky_shaw
Contributor
0 Kudos
1,119

Hi,
I need to add an extra Z*field as a column inside the table control in SAP std screens which will be called by tcodes ES21 & ES22.
This ZZ* field is added in table EVERH .

Screen Painter(Se51) : SAPLES20H
screen # : 0200


How do i do this?

BADI : SMOD_EMDK0001

Accepted Solutions (0)

Answers (2)

Answers (2)

umasaral
Contributor
0 Kudos

Hi 

Additionally, you've implemented the BADI SMOD_EMDK0001 and referenced your custom program ZSAPLES20H and screen number 0200 in the BADI implementation.

Steps to Ensure Changes Reflect in Transactions ES21 and ES22

Check if Changes are in Custom Program (ZSAPLES20H):
Verify that you have made the modifications (added ZZ* column) in the custom program ZSAPLES20H and not in the standard program SAPLES20H.

Activate Custom Program:
After making modifications in ZSAPLES20H, activate the program (ZSAPLES20H) using transaction SE38.

Verify Screen Modifications:
Ensure that the modifications (adding ZZ* column to the table control) are correctly done in screen 0200 of ZSAPLES20H using transaction SE51.

Implement BADI SMOD_EMDK0001:
Use transaction SE18 to view the BADI definition SMOD_EMDK0001.
Implement the BADI (SMOD_EMDK0001) and specify your custom program ZSAPLES20H and screen number 0200 in the BADI implementation.

Activate BADI Implementation:
Activate your BADI implementation using transaction SE19.

Check Multiple Use Flag in BADI:
If the BADI (SMOD_EMDK0001) does not have the "Multiple Use" flag checked, ensure that your implementation is active and correctly assigned to the usage.

Testing in Transactions ES21 and ES22:
Finally, test transactions ES21 and ES22 to see if the ZZ* column appears in the table control on screen 0200 of ZSAPLES20H.

umasaral
Contributor
0 Kudos

Hi 

To add a custom field (`ZZ*`) to the table control in transactions ES21 and ES22 (which use screen SAPLES20H screen 0200), you'll need to use a screen exit. In SAP, screen exits are typically implemented using function modules, and the BADI `SMOD_EMDK0001` is commonly used for enhancements related to transaction ES21 and ES22.

Here's a step-by-step guide on how to proceed:

### Step 1: Enhance the Structure

First, you need to enhance the structure `EVERH` to include your custom field (`ZZ*`). This field should already exist in the database table `EVERH`, so you'll enhance the structure to include it in the screen.

1. **Enhance Structure `EVERH`**:
- Use transaction code `SE11`.
- Display the structure `EVERH`.
- Add your custom field (`ZZ*`) to this structure. Ensure it is of the correct data type and length.

### Step 2: Enhance Screen SAPLES20H 0200

Next, you'll enhance the screen `0200` of program `SAPLES20H` to display your custom field in the table control.

1. **Navigate to Screen Painter**:
- Use transaction code `SE51`.
- Enter the screen number `0200` and program `SAPLES20H`.
- Edit the screen layout to include your custom field in the table control.

2. **Add Custom Field to Table Control**:
- Drag and drop a column into the table control area where you want your `ZZ*` field to appear.
- Configure the column properties to display the field from structure `EVERH`.

### Step 3: Implement Screen Exit using BADI `SMOD_EMDK0001`

Now, you'll implement the screen exit using the BADI `SMOD_EMDK0001`. This BADI allows you to add custom logic to the screen processing of ES21 and ES22.

1. **Implement the BADI `SMOD_EMDK0001`**:
- Use transaction code `SE18`.
- Enter the BADI name `SMOD_EMDK0001` and click on Create Implementation.
- Implement the methods provided by the BADI to include your custom logic for displaying and updating the `ZZ*` field in the screen.

### Step 4: Activate Changes and Testing

After making the enhancements and implementing the screen exit, activate your changes and test thoroughly to ensure everything works as expected:

1. **Activate Changes**:
- Activate the structure enhancement in `SE11`.
- Activate the screen layout changes in `SE51`.
- Activate your BADI implementation in `SE18`.

2. **Testing**:
- Test transactions ES21 and ES22 to verify that the `ZZ*` field appears correctly in the table control.
- Ensure that data entry and update operations involving the `ZZ*` field function correctly.

### Additional Tips:

- **Documentation**: Maintain documentation of your changes and enhancements for future reference.
- **Transport**: Ensure to transport your changes through the SAP transport management system (STMS) from development to production systems.

By following these steps, you should be able to successfully add the `ZZ*` field to the table control in transactions ES21 and ES22 using the screen exit approach with BADI `SMOD_EMDK0001`. This approach ensures that your customization integrates smoothly with the standard SAP functionality.

ricky_shaw
Contributor
0 Kudos
Hi, Thanks for the detailed response. I tried these to some extent. As per your steps 1 & 2, HOW do i Edit the screen layout(SAPLES20H) & 200.Do you want me to copy to Z ones?
ricky_shaw
Contributor
0 Kudos

Hi Umasaral,
Thanks for your valuable time in trying to help me out. I think i did close to what you were saying but missing something .

When i opened SAPLES20H in se38, its a func group(ES20H) & i copied that into Z* (SAPLZES20H) which is opened as Func group.

I DO NOT have a Z*prog like : ZSAPLES20H.

So i Copied Func Group ES20H into Z* Func Group ZES20H.

I have SE51 prog : SAPLZES20H with Screen 200 . I added my Z*field column into the Table control & activated it.

I mentioned this same prog(Se51 SAPLZES20H) & screen 200 in BADI Z* Impl call .
Prog Called :SAPLZES20H
Screen :200

I activated the BADi Impl..etc ..but still i don't see my Z*field column in Table control. I am NOT sure if my Z*impl is getting called  . 

You may see the screens attached.

 

ZBAdi_Impl.jpg

ProdAlloc.png