Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Duplicate(double) values in Database view

former_member194739
Active Participant
6,721

Dear Experts,

I have created Database view with two tables like MARA and MAKT. Key field-MATNR. Based on MATNR i collected MARA and MAKTX values. I got double(one duplicate) values in this view. How to approach single values.

I attached screen shots. Kindly give me suggestions for removing duplicate value.

Regards,

Abbas.

1 ACCEPTED SOLUTION
Read only

Former Member
4,533

Hi Syed,

Can you add MANDT(Client) as well in Table join condition on 1st row and then MATNR(2nd row) and recheck it?

Regards,

Sudeesh Soni

13 REPLIES 13
Read only

rosenberg_eitan
Active Contributor
0 Likes
4,533

Hi,

MAKT have extra key for language

Actually I am quite sure that there is such a view already.

Use "where use" on MAKT.

Use the "selection" compare sy-langu

Regards.

Read only

0 Likes
4,532

Dear Eitan,

I am added above query in selection conditions tab, error display:

'Join for field MAKT-SPRAS uses an SY field'

Added screenshot.

Regards,

Abbas.

Read only

0 Likes
4,532

Hi Abbas,

You cannot Use System field in Database View .

But if you try same in Maintenance View it will work.SO try creating MAINTENANCE VIEW.

or else assign this system field value to a variable before the condition and use that variable in the condition.


Hope it will resolve your queries.


Regards,

Kannan.

Read only

Former Member
0 Likes
4,532

Hi Syed,

Can you give comparison value equal to 'E' inplace of SY-LANGU and recheck it?

Regards,

Sudeesh Soni

Read only

0 Likes
4,532

Dear Sudeesh,

If i replace 'E' in place of SY-LANGU, activated but values are getting duplicate. If 'EN' no values(0).

Regards,

Abbas.

Read only

rosenberg_eitan
Active Contributor
0 Likes
4,532

Hi,

What is the purpose of this view ?

If it is a for search help please look at Elementary srch hlp MAT0M

We can see that SPRAS is suplied as parameter:


Regards.

Read only

Former Member
4,534

Hi Syed,

Can you add MANDT(Client) as well in Table join condition on 1st row and then MATNR(2nd row) and recheck it?

Regards,

Sudeesh Soni

Read only

0 Likes
4,532

Der Sudeesh.

Thank you very much. I added MANDT field in both join condition and view fields. Now values are no duplicates.

Thanks,

Abbas.

Read only

0 Likes
4,532

Great Abbas.

Cheers

Read only

Former Member
0 Likes
4,532

Salam Aleem,

use this bapi it will resolve your problem you need the material description.

PARAMETERS:MATERIAL LIKE  BAPIMATDET-MATERIAL.

DATA: MATERIAL_GENERAL_DATA  LIKE  BAPIMATDOA,

       RETURN LIKE  BAPIRETURN .

CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'

   EXPORTING

     MATERIAL                    = MATERIAL

*   PLANT                       =

*   VALUATIONAREA               =

*   VALUATIONTYPE               =

*   MATERIAL_EVG                =

  IMPORTING

    MATERIAL_GENERAL_DATA       = MATERIAL_GENERAL_DATA

    RETURN                      RETURN

*   MATERIALPLANTDATA           =

*   MATERIALVALUATIONDATA       =

           .

IF RETURN-TYPE NE 'E' OR RETURN-TYPE NE 'A'.

   WRITE: MATERIAL_GENERAL_DATA-MATL_DESC.

   ENDIF.

Read only

0 Likes
4,532

w/salam,

I have not required BAPI. Thanks your assistance.

Regards,

Abbas.

Read only

Former Member
0 Likes
4,532

I thing the duplication is due to the language.

You probably have the same text in both languages.

Try adding field spras to the view...

Read only

0 Likes
4,532

Hi,

I have the feeling that you are right...

Regards.