Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Dec 01, 2016 at 11:18 PM

    Have you tried this solution in BADI: USMD_RULE_SERVICE_CROSS_ET ??

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 08, 2016 at 03:58 PM

    Check Rule based Badi's

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.