Skip to Content
avatar image
Former Member

Derivation not working- SAP MDG for Supplier

Hi Experts,

In my current project we are using SAP MDG 8 and we are implementing supplier governance.

I am experiencing a strange issue regarding a simple derivation. I have a business rule which says that in the "Create Vendor" page whatever the user enters in the Name1 field , the first 10chars has to copied to the "Search Terms" field ( BP_CENTRL-BU_SORT1). So I am using the below code in my handler class derive method but still the field remains blank.

Any ideas?

CALL METHOD io_changed_data->read_data
EXPORTING
i_entity = 'BP_CENTRL'
IMPORTING
er_t_data_mod = lr_mod.

IF lr_mod IS BOUND.
UNASSIGN: <lt_mod> , <ls_mod>.
ASSIGN lr_mod->* TO <lt_mod>.
IF <lt_mod> IS ASSIGNED AND <lt_mod> IS NOT INITIAL.
READ TABLE <lt_mod> ASSIGNING <ls_mod> INDEX 1.
IF <ls_mod> IS ASSIGNED AND <ls_mod> IS NOT INITIAL.
ASSIGN COMPONENT 'NAME_ORG1' OF STRUCTURE <ls_mod> TO <lfs_name_org1>.
ASSIGN COMPONENT 'BU_SORT1' OF STRUCTURE <ls_mod> TO <lfs_bu_sort1>.
ENDIF.

IF <lfs_name_org1> IS ASSIGNED AND <lfs_name_org1> IS NOT INITIAL.
<lfs_bu_sort1> = <lfs_name_org1>+0(10).
TRANSLATE <lfs_bu_sort1> TO UPPER CASE.

REFRESH lt_attrib.
CLEAR comp_name.
comp_name = 'BU_SORT1'.
INSERT comp_name INTO TABLE lt_attrib.
TRY.
IF <lfs_bu_sort1> IS ASSIGNED AND
<lfs_bu_sort1> IS NOT INITIAL.

CALL METHOD io_write_data->write_data
EXPORTING
i_entity = 'BP_CENTRL'
it_attribute = lt_attrib
it_data = <lt_mod>.
ENDIF.
CATCH cx_usmd_write_error.
ENDTRY.
ENDIF.
ENDIF.
ENDIF.

many thanks in advance.

Saikat

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 01, 2016 at 11:18 PM

    Have you tried this solution in BADI: USMD_RULE_SERVICE_CROSS_ET ??

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 08, 2016 at 03:58 PM

    Check Rule based Badi's

    Add comment
    10|10000 characters needed characters exceeded