cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member230136
Contributor
0 Kudos

Hi Ching,

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

Thanks,

Rohit

Former Member
0 Kudos

Hi Rohit,

Thanks for the reply. It works now, seem like SAP standard logic requires the entity and the LFA1/genil have the same data element.

Just another quick question, is there a way there we can have different data element between entity and genil? I have performed the mapping at the handler class method TYPE_ALTERNATIVE, seem that does not work until I change to have the same data elements.

Thanks.

former_member230136
Contributor
0 Kudos

Hi Ching,

Having different data element for single attribute, I highly doubt that will work. Although there is an option provided by SAP in method TYPE_ALTERNATIVE. I still think MDG is not matured enough. In the backed CVI integration, if you look closely there are still lot of statements written which does MOVE-CORRESPONDING, even though the type is same but because the data element is different that is why the value is not retained in the standard structures.

We were having issues just because of this in MDG v7.0 & I still think that v9.1 is not different at all.

Cheers,

Rohit

Former Member
0 Kudos

Hi Rohit,

Actually I am using TYPE_ALTERNATIVE and but still getting the error. Only able to fix the error after update to use the same data elements. Btw, the current system I am investigating is version 9. Appreciate your assistance on this. Thanks

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.
former_member230136
Contributor
0 Kudos

Hi Ching,

I have never implemented TYPE_ALTERNATIVE method for my requirements as I always use same data elements for the attributes in the Data Model. If you have already achieved it by using same data element than why you are trying to implement this method.

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

michael_theis
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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".