Business Scenario:

Users are able to change the accounting fields (e.g. cost center) after invoicing or confirmation of a PO which is not a correct process. So we need to disable the accounting fields and related buttons of a purchase order when a Follow-on document (confirmation or invoice) exists.

Dynpro Component:

Go to the web application and right click->more field help to get the application component and view.

/wp-content/uploads/2014/04/2_443878.png

Application:                                    

                 /SAPSRM/WDA_L_FPM_OIF

Web Dynpro Component:

                 /SAPSRM/WDC_UI_DO_ACC

Window Information:

                 IV_L_FPC_CA_DETAILS

View Information:

                 V_DO_ACCOUNT_DETAIL

Configuration ID:

                /SAPSRM/WDCC_UI_DO_ACC

Enhancement using SPRO Configuration:

1. Configuration for Input Fields:

First we need to check the standard SAP SRM metadata for fields at substructure level. These entries are relevant as we are planning to define our own metadata for standard fields. We can only restrict metadata provided in standard tables. Go to the below Path:

SPRO->SAP SRM->SRM Server->Cross-Application Basic Settings->Extensions and Field Control (Personalization) ->configure field control->Display Standard Metadata Tables for Substructure Fields

         /wp-content/uploads/2014/04/4_443882.png

Here we are having all the entries of maintenance view /SAPSRM/V_MDFSBY (Customer Configuration Table for Metadata of Set Fields). Set type 31 is related to Account assignment fields.

/wp-content/uploads/2014/04/5_443883.png


Now we need to customize the above standard field’s properties. Here we are changing the property of cost center field (COST_CTR). Open the below SPRO path:

SPRO->SAP SRM->SRM Server->Cross-Application Basic Settings->Extensions and Field Control (Personalization) ->configure field control->Configure Control for Fields of Substructures Or we can Use transaction SM30 and ‘/SAPSRM/V_MDFSBC’ as the maintenance view.

/wp-content/uploads/2014/04/6_443887.png


In this maintenance view add one new entry with the below inputs:

Object Set Type                            31(Account assignment)

Structure Field Name                    ACC_CAT

Object Type                                 BUS2201(Purchase Order)

Set Level                                     ITEM  

Field Visible                                 X(checked)

Field Enable                                X(checked)

Dyn Customer Class                    Z-class (first create one class as shown in the next step)

Dyn Customer Method                 relevant method of Z-class

/wp-content/uploads/2014/04/7_443895.png

In the same way we can create an entry for other fields (e.g. G_L_ACCT, ASSET_NO etc.).

2. Configuration for Buttons:


As we did for account assignment fields, in the same way we can configure Button’s properties too. Go to the below path:

SPRO->SAP SRM->SRM Server->Cross-Application Basic Settings->Extensions and Field Control (Personalization) ->control actions-> Display Standard Metadata for Actions on Substructure Level

Standard buttons are listed there. Object type 31 is relevant to account assignment section

/wp-content/uploads/2014/04/8_443900.png

Open the below path or maintenance view ‘/SAPSRM/V_MDASBC’ to change the configuration of buttons:


SPRO->SAP SRM->SRM Server->Cross-Application Basic Settings->Extensions and Field Control (Personalization) ->control actions-> Configure Control of Actions on Substructure Level

Add an entry in the view with below properties:

Object Set Type                       31(Account assignment)

PDO Action Type                     ADD_ACC_LINE

Object Type                             BUS2201 (Purchase Order)

Process Mode                         EDIT

Set Level                                 ITEM

PDO Action Enabled                 X

Customer Class                        Z-class (first create one class as shown in the next step)

Customer Method                     relevant method of Z-class

/wp-content/uploads/2014/04/9_443902.png

Create an entry for other buttons too (e.g. COST_DISTRIBUTION, DELETE_ACC_LINE)

Creation of Dynamic Customer Class:

This class contains the logic to decide the properties dynamically of the account assignment fields/buttons. Go to SE80 or SE24 and create one Z class (e.g. ZCLG_META_FIELD_CUST).  Add two Public Static methods (e.g. ACC_FIELD_DISPLAY and ACC_ACTION_DISPLAY) to this class.

/wp-content/uploads/2014/04/10_443906.png

Add the following parameters to the method ACC_FIELD_DISPLAY

/wp-content/uploads/2014/04/11_443907.png

Write the logic to change the property of fields based on different conditions:


/wp-content/uploads/2014/04/12_443908.png


Add the following parameters to the method ACC_ACTION_DISPLAY


/wp-content/uploads/2014/04/13_443909.png


Write the logic to change the property of buttons based on different conditions:


/wp-content/uploads/2014/04/14_443910.png

Based on your condition given in customer class, fields of account assignment will be displayed. In the same way you can set Visible and Enable propeties of different UI elements dynamically.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply