Skip to Content

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

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.

image2.png (9.0 kB)
image3.png (35.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 17 at 05:18 AM

    Hi Ching,

    Use the standard data element in for the custom attribute and it should work.

    Thanks,

    Rohit

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rohit, I implemented TYPE_ALTERNATIVE before use the same data element. And also assume it will work after implementing TYPE_ALTERNATIVE, however, seem like MDG requires both entity and Genil use the same data elements. Unless I have miss out something.

      I have removed TYPE_ALTERNATIVE implementation now as no longer required anymore after update to use same data element.

  • Jan 15 at 09:39 AM

    Hi,

    the field is disabled in the standard delivery since it does not make sense to use MDG for One-Time Vendor / Customer Accounts. Those accounts are used usually once. So where's the business reason to put those records under governance?

    Best regards

    Michael

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Michael,

      Thanks for the reply.

      Based on the data model, yes, this field KTOCK is not supported by MDG.

      However, in the current design, the business might looking to have all the supplier under governance in MDG including one-time vendor. From technical point of view at this stage, we are studying the technical feasibility and getting the error which I mentioned above. Appreciate if you can share your view if you have any idea on the error message "Data was not saved".