Kishore Thutaram
SAP Solution Architect | 16+ Years' Experience in SAP | Sharing Practical SAP Knowledge | Engineering Graduate with Expertise in SAP Architecture
https://fiowelt.comBusiness Scenario:
“In the S/4 HANA system, when we create the custom fields from the CFL app and add them at the screen level, we may need to control the properties like enable/disable the fields.”
Note: At this point of time, no standard BADI is available to achieve this requirement.
Steps: Implement the enhancement point in the method below.
Class: CL_CFD_SAP_GUI_CONTROLLER
Method: IF_CFD_SAP_GUI_CONTROLLER~PBO_SUBSCREEN
Implement the code below
METHOD if_cfd_sap_gui_controller~pbo_subscreen.
ENHANCEMENT 1 ZEI_BILLING_FLDS_DISABLE. "active version
LOOP AT mt_context_fields ASSIGNING FIELD-SYMBOL()
WHERE business_context = 'SD_BILLINGDOCITEM' OR
business_context = 'SD_BILLINGDOC'.
*--*Disable Custom fields on screen, only for the billing document
*--* These field values will be populated from Sales order via data transfer routine
IF -persistence_field_name CP 'ZZ1*'.
-is_read_only = abap_true.
ENDIF.
ENDLOOP.
ENDENHANCEMENT.
SAP Solution Architect | 16+ Years' Experience in SAP | Sharing Practical SAP Knowledge | Engineering Graduate with Expertise in SAP Architecture
https://fiowelt.com