Skip to Content
0
Jan 15, 2018 at 06:08 AM

Add LFA1-KTOCK field into entity and display on the screen

442 Views Last edit Jan 15, 2018 at 06:26 AM 5 rev

Hi,

Requirement: Add the LFA1-KTOCK on BP vendor screen, this field is not available in MDG standard entity.

After done some enhancement, getting the error Data was not saved and have no clue on it now.

Appreciate if anyone have any idea on this and can assist.

Below is the related thread, but don't have the exact the solution yet.

https://archive.sap.com/discussions/thread/3655039#

Steps I have done:

1) Enhance the BP_VENGEN, add ZZKTOCK field

2) Update SMT mapping

a) SUPPL_BP_VENGEN_2API -> map ZZKTOCK -> KTOCK

b) SUPPL_BP_VENGEN_2STA -> MAP KTOCK -> ZZTOCK

3) KTOCK is set to hidden at the genil. In order to bring back the field in the UI design, enhance genil BUPA_CUS and implement new handler class. Redefine attribute GET_OBJECTS_PROPS and TYPE_ALTERNATIVE(different type) methods.

METHOD GET_OBJECTS_PROPS.
CALL METHOD super->if_genil_appl_model~get_object_props
      RECEIVING
        rt_obj_props = rt_obj_props.

      READ TABLE rt_obj_props ASSIGNING FIELD-SYMBOL(<ls_obj_props>) WITH KEY object_name = 'SP_GeneralData'.
      IF sy-subrc = 0.
        READ TABLE <ls_obj_props>-attributes ASSIGNING FIELD-SYMBOL(<ls_attributes>) WITH KEY attribute_name = 'KTOCK'.
        IF sy-subrc = 0.
          <ls_attributes>-default_prop = 'N'.
        ENDIF.
      ENDIF.
ENDMETHOD.


METHOD TYPE_ALTERNATIVE.
   CASE iv_absolute_name.
    WHEN '\TYPE=Z_KTOCK_D'.
      rv_absolute_name = '\TYPE=KTOCK'.
    WHEN OTHERS.
      rv_absolute_name = super->if_bs_typecasted_map_assistant~type_alternative( iv_absolute_name ).
  ENDCASE.
ENDMETHOD.

4) Enhance UI to display KTOCK field.

Attachments

image2.png (9.0 kB)
image3.png (35.4 kB)