Thursday, 21 July 2016

Screen Enhancements



  • An instance of the BADI class must be passed to the user of the BADI to allow that user to get the data to be displayed on the screen.
  • For this purpose , the instance is saved in a public static read-only attribute DYNPRO_INSTANCE of the BADI call. This attribute is generated.
  • A public static method SET_INSTANCE_FOR_SUBSCREEN sets the attribute on the application side to the parameter passed.
  • Using the method GET_INSTANCE_FOR_SUBSCREEN the parameter is then read on the user side.

Note : The Definition of Each screen Enhancement should contain the following.

Methods :

  1.  PUT_DATA_TO_SCREEN   :- Transport Data to the Subscreen
  2. GET_DATA_FROM_SUBSCREE :- Transport Data from screen.
  3. And one more method (DESCRIBE ) to provide the details of the Module pool program and sub-screen Details.


Ex:

  • Adding custom sub-screen to XD01 Transaction Code.


Steps :

  • To find out BADI Definition.
  • Go to Transaction Code : XD01.


  • Select Account-Group and enter the Customer .
  • Press Enter.

 
  • Screen looks like.

  • Click on System-> Status.

  •  Pop-up will appear.

  • Double click on Program.
  • Screen looks like,
  • Click on Goto -> Attributes.
  • Pop-up will appear .
  • Copy the Package name.
  • Go to Transaction code SE18.
  • Click on BAdI name radio button and click on F4 help.
  • Pop-up will appear.
  • Click on Information System Button.
  • Pop-up will appear.
  • Enter the package  name and Press continue.
  • Pop-up with BAdI Definition will appear.




  •   Click on BADI definition.
       
  • Double click on BADI definition.

  • For Documentation help.
  • Click on Goto->Documentation ->Display.



  •  Go though on Documentation Help.

Implementation of BAdI.

  • Go to Transaction Code : SE11

  • Enter the Table name and click on Display.
  • Screen looks like,

  • Click on Append structure.
  • Pop-up will appear.

  • Click on Create append button.
  • Enter the Append Structure name , start's with Y or Z<structure name> and click on continue.
  • Enter the require fields.
  • Save -> Check -> Activate the structure.







  • Execute Transaction code  SPRO  to find out the sequence Steps to work with Screen Enhancements
  • Screen looks like,
  • Click on " SAP Reference IMG " button.
  • Screen looks like,
  • Click on Logistic - General -> Business Partner -> Customers -> Controls -> Adoption of Customer's own Master  Data fields. ( We can see the steps for the screen Implementation ).



  • Execute : "Prepare Modification - Free Enhancement of Customer Master Record".
  • Pop-up will appear.
  • Click on continue.
  • Screen looks like,
  • Click on "New-Entries".
  • Enter Screen grp  and description,
  • Click on Save.
  • Save it  in package.
  • Select the already created Screen Group (Z2) and double click on Label  Tab Pages.
  • Screen looks like,
  • Click on New-Entries  Button.
  • Enter the Screen number , Function Code of the TAB and description.
  • Save it.
  • Go back to SPRO.
  • Execute : Business Add-In : Processsong of Master Data Enhancements.
  • Pop-up will appear.


Note :

The Implementation for CUSTOMER_ADD_DATA is already exists. So instead of creating a New Implementation , Its is better to change same implementation by De-activating the Implementation , which allows the changes.

  • Select the Implementation Name ZCUSTOMER_ADD_DATA and click on Display.
  • Copy the Implementation name.


  • Go to Transaction Code SE19.
  • Enter Classical BAdI Implementation  radio button and enter the BAdI Implementation name.
  • Click on Change.
  • Screen look like,
  • Click on Deactivate.



  • Check the status bar.
  • Click on Interface Tab.
  • Double click on Implementation Class name.
  • Class Builder screen looks like.
  • Double click on CHECK_ADD_ON_ACTIVE.
  • Enter the logic,
  • Save ->Check ->Activate.
  • Click back button.
  • Activate the Class.
  • Click on Back button.
  • Save -> Check -> Activate.
  • Go back to Transaction Code SPRO.
  • Execute :Business Add-In: Customer Sub-screens.
  • Pop-up will appear.
  • Click on Create button.
  • Pop-up will appear.
  • Copy the BAdI Definition name.




  • Go to  Transaction code SE19.

  • Click on Classical BAdI and  enter the BAdi definition name.




  • Click on Create Implementation .


  • Pop-up will appear.
  • Enter the Implementation name , start's with Z<implementation name> and click on continue.


  • Enter the short description.


  • Click on Insert Row.



  • Enter the Screen group name.



  • Click on Save.
  • Pop-up will appear.
  • Click on continue.

  • Pop-up will appear.




  • Either select or Create Enhancement Implementation.
  • To Create Enhancement Implementation.
  • Click on Create.


  • Enter the Enhancement Implementation name , start's with Z<Implementation name>.
  • Enter the short description.
  • Click on continue.


  • Select Enhancement Implementation name and click on continue.


  • Check the status bar.
  • Click on Interface Tab.


  • Double click on Implementing Class.

  • Class Interface looks like,

  • Double click on Method : GET_TAXI_SCREEN.



  • Enter the code,




Note : Make sure that the Module pool Program : SAPMZCUSTOM_SCREEN is created with subscreen Number 4000.


  • Go Transaction Code : SE80.
  • Select Program from Drop-down List.
  • Enter the Program name start's with SAPMZ<program name >.

  • Click on Display.
  • Pop-up will appear.
  • Click on Yes.
  • One more pop-up will appear.
  • Click on Continue.
  • Pop-up will appear.
  • Click on continue.
  • Click on Save.

  • Save it either in Package or Local Package.
  • Right click on object  name and click on activate.
  • Right click on object  name -> Create -> Screen.
  • Pop-up will appear.
  • Enter the Screen Number and click on continue.


  • Enter the short description.
  • Select Screen Type as Subscreen.
  • Click on Layout.
  • Goto-> Secondary Window ->  Dictionary / Program Fields.
  • Enter the Table name and Click on " Get from Dictionary ".
  • Select the appended structure fields.
  • Press Enter.
  • Save -> Check -> Activate.
  • Click on Back.
  • Double click on Program name.
  • Right click and click on Activate.



  • Save -> Check -> Activate.


  • Click on Back button.
  • Click on Activate,


  • Click on Back Button.


  • Save-> check -> Activate.

Test

  • Go to Transaction code : XD01.


  • Enter the Account Group.
  • Enter the Customer Number.
  • Press ENTER.
  • Enter the following details.
  • Click Custom created screen.

  • Enter the details.

  • Click on Save.
  • Check the status bar.
  • Go to Transaction code XD03.

  • Enter the customer Number.
  • Press Enter.
   



  • Click on Legacy Customer Data.
  • Our Screen Enhancement works successfully.


;;;;;

1 comment:

  1. Thanks for the step by step process of add custom tab screen in xdo1

    ReplyDelete