Skip to Content
-1

ABAP CDS VIEW - Data Inconsistency

Hello All,

I have created a simple CDS view with a select on MARD.

define view zmat_stk_view
  as select from mard
{
  matnr      as material_no,
  werks      as plant,
  lgort      as sloc,
  labst      as un_stk
}
where
  matnr = 'X00088337'

When I execute this CDS, the data I get is as following. Please see the highlighted unrestricted stock(un_stk) for storage location(sloc) = 1000.

When I see in se16n, labst value = 100 for for sloc = 100.

Has any one else face this issue? Any suggestions/guidance is much appreciated.

cds.png (5.4 kB)
cds-output.png (6.6 kB)
se16n-data.png (15.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Dec 29, 2017 at 09:14 AM

    Seems that there is a replacement object defined in SE11 for MARD.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 28, 2017 at 08:58 AM
    -1

    Try below.

    define view zmat_stk_view

    as select from mard {

    Key matnr as material_no,

    Key werks as plant,

    Key lgort as sloc,

    labst as un_stk

    }

    where matnr ='X00088337'

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 28, 2017 at 09:28 AM

    Are you sure that you work with the same client?

    What is the result when you access the CDS view with Open SQL and the table with an equivalent Open SQL SELECT in an ABAP program?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 09 at 09:03 AM

    Check Below code

    define view zmat_stk_view
      as select from nsdm_e_mard
    {
      matnr      as material_no,
      werks      as plant,
      lgort      as sloc,
      labst      as un_stk
    }
    where   matnr = 'X00088337'

    Add comment
    10|10000 characters needed characters exceeded