Skip to Content

Important Question on BADIs

Hello Experts,

Is it possible to achieve a screen-enhancement using BADI. Let me explain in detail on what I wanna achieve.

Requirement:

Let us assume that I have a standard SAP transaction that has several fields; now the customer requests to put 2 more additional Z-fields on to screen.

I know that this very much achievable through a lot of options that SAP has provided to the developers. But here I want to achieve this requirement using a custom BADI.

I was thinking will the following steps of logical execution that are mentioned below make us achieve the same.

1. We will define a custom BADI in SE18 using the Enhancement Spot Technology.

2. Create an Interface containing 2 methods namely

PUT_DATA_TO_SCREEN

GET_DATA_FROM_SCREEN

3. Create an Enhancement Implementation.

4. Create a BADI implementation that holds the logic for the above methods.

5. Create a screen of the Subscreen type. Arrange the required fields on the screen.

6. Write the program for the screen by creating either a module pool or a function group.

It holds the following content (From help.sap.com)

Topinclude:

DATA:

lo_exit TYPE REF TO zif_ex_badi_screen,
flight TYPE sflight.

At PBO time:

MODULE status_0100 OUTPUT.

IF lr_exit IS INITIAL.
CALL METHOD cl_exithandler=>get_instance_for_subscreens
CHANGING
instance = lo_exit
EXCEPTIONS
OTHERS = 6.
ENDIF.
CALL METHOD exit->get_data_from_screen
IMPORTING
flight = flight
EXCEPTIONS
reserved = 1
OTHERS = 2.
ENDMODULE.

At PAI time:

If data has been changed, the method PUT_DATA_TO_SCREEN is called at PAI.

MODULE user_command_0100 INPUT.
CALL METHOD exit->put_data_to_screen
EXPORTING
flight = flight
EXCEPTIONS
reserved = 1
OTHERS = 2.
ENDMODULE.

7. Choose the Subscreens tab. Enter the name of the called program and of the subscreen.

8. Make a trigger to the BADI from the Standard program.

Will this work out?

Regards,

Tanmoy

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jan 06, 2014 at 07:19 AM

    Hi Tanmoy,

    This is how a standard will work if sap provides. I do not think this will work because where you are going to keep you includes and how the document flow you will handle.

    Regards,

    Madhu.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2014 at 09:42 AM

    Hi tanmoy,

    Can you please tell me the fields that you are going to add is custom fields, or standard fields.

    On both cases it is possible,but logic differs.

    May be the method suggested by you above helps you are not, but i have done the same as above with slight modifications, and it can be done 😊

    Please get back if you need any info on this 😊

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.