Tuesday, July 31, 2018

Enhancing Vendor Master


Enhancing Vendor Master

Requirement : Creation of Custom tab and Custom fields in vendor master transactions by using Enhancement spot technique.

Solution :
                1. Creation of custom field in LFB1 using append structure
                2. Go to configuration settings and mention the Tab name and screen names
                3. Implement Enhancement spot 'VENDOR_ADD_DATA'
                                                      Method : CHECK_ADD_ON_ACTIVE
                4. Implement Enhancement spot  'VENDOR_ADD_DATA_CS'
                                                      Method : GET_TAXI_SCREEN
                5. Creation of module pool program for designing of screen along with required fields
                6. Make the required fields editable in change transaction only.

Step 1: Creation of custom field in LFB1 table using Append structure .


Step 2: Go to SPRO transaction --> Financial accounting -- > follow the below path

and click on ' Prepare modification free enhancement in vendor master record ' 



Step 3: Click on ' New entries ' button to create new screen group.


 Step 4: Give meaningful name / name given by functional team and click on ' Label tab pages button  to give the new tab page name.



Step 5: Give the description and name of page as below.




Step 6: Go to SE18 transaction and create new implementation for Enhancement spot 'VENDOR_ADD_DATA'.

Here we have created implementation name as ' ZMM_CHGXXX_VENDORSAQ ' 





Now it will ask for BADI definition name and class name, Provide details as below.


Step 7: Go to SE24 transaction and give class name which we have provided in above step.


Go to method ' Check_add_on_active ' and use below mentioned logic.




(In below code, 'Z3' is our screen group name)
  METHOD IF_EX_VENDOR_ADD_DATA~CHECK_ADD_ON_ACTIVE.
    
IF i_screen_group 'Z3'.
      e_add_on_active 
'X'.
      
ENDIF.
 
 ENDMETHOD.



Step 8: Create implementation for BADI 'VENDOR_ADD_DATA_CS' and also give class name and implementation name (same process as step 6 )




Step 9: Go to SE24 and give class name which we have created in above step.



Go to Method 'Get_taxi_screen '  and write below logic

MODULE status_9001 OUTPUT.
   LOOP AT SCREEN.
  IF sy-tcode EQ 'XK03'.

      CASE screen-group1.
        WHEN 'G1'.
          screen-input = 0.
          MODIFY SCREEN.
      ENDCASE.
    ENDIF.
   ENDLOOP.
ENDMODULE.



Here Z3 --> Screen group name,
ZTAB2 --> Function code/Screen name
'ZMMR_VENDORSAQ -- > module pool program that we need to create

'9001' --> screen number


Step 10: Creation of module pool program with above details.
Program name: ZMMR_VENDORSAQ
Screen number: '9001'

SE51--> Create

 Go to Lay out in the program


 Design the layout with required fields..here in our scenario we required only one field from LFB1 Table

Field name:  ZVENSAQ(vendor SAQ) and group name as 'G1'


 Now we are making this field editable only in change transactions by using below PBO Event

MODULE status_9001 OUTPUT.
   LOOP AT SCREEN
.
  
IF sy-tcode EQ 'XK03'.

      
CASE screen-group1.
        
WHEN 'G1'.
          
screen-input 0.
          
MODIFY SCREEN.
      
ENDCASE.
    
ENDIF.
   ENDLOOP
.
ENDMODULE
.


Testing:
Go to XK03 transaction, find the button which we have created 'Vendor SAQ'.
Click on that button and you will navigate to new screen.




No comments:

Post a Comment

Custom routine creation in SAP

                              Sales order pricing   Requirement : In sales order, for one of the condition type, value is populating ...