Skip to Content

Master Data update

Hi experts,

I have a master data as follwing (simplified version)

Field1

Field2

Field3

A

B

Y

A

B

Y

A

E

Z

A

E

Z

A

E

Z

A

M

V

I need to update field3 of the master data as following:

-The same combination of field1 and Field2 needs to have the field3 filled only one time, so what I expect at the end of treatment is the following:

Field1

Field2

Field3

A

B

Y

A

B

A

E

Z

A

E

A

E

A

M

V

To do so, I tought a bout creating a transformation from to master data to itself and do in the end routine the following:

Sort Result package by Field1 Field2.

Loop at result package into wa.

Concatenate wa-field1 wa-field2 into var1

If wa-field3 is not initial.

Concatenate wa-field1 wa-field2 into var2.

Endif.

If var1 ne var2.

Clear wa-field3.

Endif.

Endloop.

What do you think?

Is there any other ways to do it?

Thanks for your support.

Amine

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 11, 2014 at 07:05 PM

    Hi Amine,

    Apply below logic, it will work as per exactly you want:

    Lets take 2 variables: var1, var2.

    and fields f1, f2, f3.

    SORT result_package BY f1 f2.

    CLEAR: var1.

    LOOP AT result_package ASSIGNING <result_fields>.

    CONCATENATE <result_fields>-f1 <result_fields>-f2 INTO var2.

    IF var1 EQ var2.

    CLEAR: <result_fields>-f3.

    ENDIF.

    CONCATENATE <result_fields>-f1 <result_fields>-f2 INTO var1.

    ENDLOOP.

    Please let me know how it goes.

    Thanks

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 11, 2014 at 04:48 PM

    Hi,

    The logic which you are applying is it working ?

    Did you test it ?

    Loop at result package into wa.

    Concatenate wa-field1 wa-field2 into var1

    If wa-field3 is not initial.

    Concatenate wa-field1 wa-field2 into var2.

    Endif.

    According to this logic

    var1 will hold AB

    Var2 will also have AB

    Please check and suggest whether my understanding is correct or not.

    Regards,

    AL

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 11, 2014 at 05:43 PM

    Hi,

    amine.

    The code which you have written may not work.

    Because you are saying

    If var1 ne var2.

    Clear wa-field3.

    But in above case var1 is always equal to var2. So it will not clear field3.

    And their is no reason if you want to see data at Master data level.

    You can only see the data as you desired at reporting level, by placing that field3 on top of the rows in query designer level.

    Regards,

    Upender.

    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.