Application Development 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: 

Duplicate(double) values in Database view

former_member194739
Active Participant

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

Former Member

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

rosenberg_eitan
Active Contributor
0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

Hi Syed,

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

Regards,

Sudeesh Soni

0 Kudos

Dear Sudeesh,

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

Regards,

Abbas.

rosenberg_eitan
Active Contributor
0 Kudos

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.

Former Member

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

0 Kudos

Der Sudeesh.

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

Thanks,

Abbas.

0 Kudos

Great Abbas.

Cheers

former_member339717
Active Participant
0 Kudos

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.

0 Kudos

w/salam,

I have not required BAPI. Thanks your assistance.

Regards,

Abbas.

Former Member
0 Kudos

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

0 Kudos

Hi,

I have the feeling that you are right...

Regards.