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: 

MARD-LABST shows zero

0 Kudos

When i retrieve MARD table data using direct select query through dbacockpit or HANA studio LABST(Unrestricted) always shows zero.what could be the reason.If i retrieve same through .Net select query same issue.Kindly help with a solution for the above.

14 REPLIES 14

FredericGirod
Active Contributor
0 Kudos

LABST from the SQL consol in Eclipse show result. Is it how you check it with Hana studio ?

venkateswaran_k
Active Contributor
0 Kudos

Please paste your SQL

0 Kudos

Below is my SQL and MB51 view with Query Output from HANA for same Material.

Select MATNR,WERKS,LGORT,LABST from sapabap1.MARD WHERE WERKS='1036' AND MATNR IN('ST801021', 'TR336665', 'TR662030', 'TR662031', 'TR662034', 'UT180192' )

Thanks.

0 Kudos

Hi

It is very strange,

Can you please query the same directly in SE16 in SAP table MARD. Would like to see how it is.

0 Kudos

Hi,

Output query through Se16.Is it anything related to Authorization.

venkateswaran_k
Active Contributor
0 Kudos

Hi

How many clients are there in the system.

Please do one thing.

Add MANDT in the where clause of the Query.

Select MATNR,WERKS,LGORT,LABST from sapabap1.MARD 

WHERE WERKS='1036' AND 

MATNR IN('ST801021', 'TR336665', 'TR662030', 'TR662031', 'TR662034', 'UT180192' ) AND MANDT = '999'   

Regards,

Venkat

0 Kudos

Hi,

Still same issue.Only 999 client.

0 Kudos

Please check if any column level security is there.

venkateswaran_k
Active Contributor
0 Kudos

Hi

It looks like the user sapabap1 having column level security on LABST column.

try execute the query at admin level user or grant all privileges to sababap1 and try again

venkateswaran_k
Active Contributor
0 Kudos

Hi

Please update if you find any solution

0 Kudos

In S/4HANA many tables are replaced by compatibility views to improve performance. So, if you try to execute a table directly using SQL it won't return the right values. Make sure to include the redirected Proxy object/compatibility views.

Wrong - SELECT * FROM XYZ.MARD WHERE LGORT = 'XXX' AND MATNR = 'XXX';

Right- Select * FROM

/* Redirected table: MARD */ "NSDM_V_MARD" "MARD"

WHERE

"MANDT" = ' ' AND "LGORT" = 'XXX' AND "MATNR" = 'XXX'.

TIP: You can pull the right SQL statement by executing Se16n with SQL Trace.

0 Kudos

Hi , You need just to use this view NSDM_V_MARD to check the real quantities

so your SQL Query will look like this :

select LABST from "SAPABAP1"."NSDM_V_MARD"

where "MATNR" = 'material'

and you can also make join it with MARD table

0 Kudos

Thank you Mr. Mustapha. Your answer save my life. Real quantities are correct from NSDM_V_MARD.

0 Kudos

Please check this SAP Note : 2595627 - Accessing table from SE16/SE16N shows different results to SAP HANA database.

From HANA database approaches the table is empty, or shows different value than expectation.

In S/4HANA many tables are replaced by compatibility views with same name.