Skip to Content
0
Former Member
Dec 13, 2011 at 08:43 AM

Select on MARA resulting into # values in internal table for one field

829 Views

Hi Team,

I have written a SELECT statement on MARA table as below.

TRY.

SELECT matnr zzwftag FROM mara CLIENT SPECIFIED

INTO CORRESPONDING FIELDS OF TABLE gt_mara WHERE

mandt = sy-mandt AND

zzwftag NE space

AND zzwftag IS NOT NULL

AND zzwftag NE '#'

AND zzwftag NE '%#%'

AND zzwftag NE ' '

AND zzwftag NOT LIKE '%/%'(012).

CATCH cx_sy_dynamic_osql_error.

MESSAGE 'Error While Fetching Data from MARA'(044) TYPE 'S'(040) DISPLAY LIKE 'W'(041).

ENDTRY.

IF NOT gt_mara[] IS INITIAL.

DELETE gt_mara[] WHERE zzwftag EQ '#'

OR zzwftag IS INITIAL

OR zzwftag EQ space

OR zzwftag EQ ' '.

ENDIF.

Observations: 1. In

the resulting internal table I am seeing '#' values for fields zzwftag which are actually empty when I see the record in SE11 in MARA(ALV display). It shows '#' in it in SE16 display(We can choose User parameters and hence mode of display in SE11)

The requirement is to avoid those records where zzwftag is initial i.e. blank. I tried to delete invalid records but to no avail.

Please suggest any way where I can get the Select correct.

Regards,

Amit