Ansicht
Dokumentation

WCB_CC_UI_VM1 - BAdI: Display Customer-Specific Fields in the Condition Contract Header

WCB_CC_UI_VM1 - BAdI: Display Customer-Specific Fields in the Condition Contract Header

CL_GUI_FRONTEND_SERVICES - Frontend Services   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in Condition Contract Management. You can use this BAdI to display fields that you have added to the condition contract header, on a special tab page in the condition contract.

The BAdI is not designed for multiple use and does not depend on a filter.

BAdI method documentation:

For information about the implementation of BAdIs in the context of the Enhancement Concept, see SAP Library for SAP NetWeaver under BAdIs - Embedding in the Enhancement Framework.

The following example explains the steps that you must carry out to display new fields. In this example, the zzadd_curr field is added to database table WCOCOH:

  • Create an append for database table WCOCOH that contains the ZZADD_CURR field.
  • Create a new function group (in this example, ZAPPEND)

Create the following variables in the top include of the function group:

DATA: ,,a_field_modificator TYPE REF TO if_wcb_header_field_modify,
at_changed_field TYPE wcb_changed_fields_stab.
TABLES: komwcocoh.

  • Create three function modules in the function group that are used to execute a data transfer between the BAdI and the display data:

,,FUNCTION ZGET_KOMWCOCOH.

,,*"----------------------------------------------------------------------

,,*"*"Local interface:

,,*" EXPORTING

,,*" REFERENCE(E_KOMWCOCOH) TYPE KOMWCOCOH

,,*" REFERENCE(ET_CHANGED_FIELD) TYPE WCB_CHANGED_FIELDS_STAB

,,*"----------------------------------------------------------------------

,, e_komwcocoh = komwcocoh.

,, et_changed_field = at_changed_field.

,,ENDFUNCTION.

,,

,,FUNCTION ZSET_FIELD_MODIFICATOR .

,,*"----------------------------------------------------------------------

,,*"*"Local interface:

,,*" IMPORTING

,,*" REFERENCE(I_FIELD_MODIFICATOR) TYPE REF TO

,,*" IF_WCB_HEADER_FIELD_MODIFY

,,*"----------------------------------------------------------------------

,, a_field_modificator = i_field_modificator.

,,ENDFUNCTION.

,,FUNCTION zset_komwcocoh.

,,*"----------------------------------------------------------------------

,,*"*"Local interface:

,,*" IMPORTING

,,*" REFERENCE(I_KOMWCOCOH) TYPE KOMWCOCOH

,,*"----------------------------------------------------------------------

,, komwcocoh = i_komwcocoh.

,,ENDFUNCTION.

Create a subscreen in this function group. The maximum size is:
Height 5 Length 194 or
Height 33 Length 194.
If the height is set to 33, the BAdI method "is_double_space_needed" must return the value 'X'. On this screen, you must create the add-on field ZZADD_CURR. In modification group 1, the value 'H_I' must be assigned to this field. The flow logic of this screen is:

,,PROCESS BEFORE OUTPUT.

,, MODULE modify_field.

,,*

,,PROCESS AFTER INPUT.

,, FIELD komwcocoh-zzadd_curr MODULE zaddcurr ON REQUEST.

,,with:

,,MODULE modify_field OUTPUT.

,, a_field_modificator->modify_fields( 'SAPLZAPPEND' ).

,,ENDMODULE. " modify_field OUTPUT

and

,,MODULE zaddcurr INPUT.

,, DATA: l_changed_field TYPE wcb_changed_fields.

,, l_changed_field-tabname = 'WCOCOH'.

,, l_changed_field-fieldname = 'ZZADD_CURR'.

,, insert l_changed_field into table at_changed_field.

,,ENDMODULE.

  • The BADI implementation is:


,,METHOD if_wcb_header_data_tab_badi~pbo.

,, CALL FUNCTION 'ZSET_KOMWCOCOH'

,, EXPORTING

,, i_komwcocoh = i_komwcocoh.

,,ENDMETHOD.

,,METHOD if_wcb_header_data_tab_badi~pai.

,, CALL FUNCTION 'ZGET_KOMWCOCOH'

,, IMPORTING

,, e_komwcocoh = e_komwcocoh

,, et_changed_field = et_changed_field.

,,ENDMETHOD.

,,METHOD if_wcb_header_data_tab_badi~set_field_modificator.

,, CALL FUNCTION 'ZSET_FIELD_MODIFICATOR'

,, EXPORTING

,, i_field_modificator = i_modificator.

,,ENDMETHOD.

,,METHOD if_wcb_header_data_tab_badi~get_fields.

,, DATA: l_field TYPE wcb_field.

,, l_field = 'ZZADD_CURR'.

,, INSERT l_field INTO TABLE et_field.

,,ENDMETHOD.






General Data in Customer Master   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 6203 Date: 20240523 Time: 205340     sap01-206 ( 126 ms )