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

identifying blank field

Former Member
0 Likes
675

i want to extract blank field form the database table :

DATA: BEGIN OF IT_YCSTK OCCURS 0 ,

MATNR LIKE YCSTK-MATNR,

WERKS LIKE YCSTK-WERKS,

CHARG LIKE MSEG-CHARG,

GKAHR LIKE YCSTK-GKAHR,

FLD2 LIKE YCSTK-FLD2,

END OF IT_YCSTK.

SELECT MATNR WERKS CHARG GKAHR

FROM YCSTK

INTO CORRESPONDING FIELDS OF TABLE IT_YCSTK

WHERE FLD2 = SPACE.

BUT SY-SUBRC IS ZERO...y???????

HERE FLD2 IS A DATE TYPE FIELD...

Edited by: Mathew Parera on Aug 21, 2008 9:28 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
600

Hi

Sy-subrc will be zero if your select query enables to retrieve any data with all the conditions satisfied.

Check on debugger i am sure that ITAB must contain some data.

Thanks and Regards

Aditya

i want to extract blank field form the database table :

DATA: BEGIN OF IT_YCSTK OCCURS 0 ,

MATNR LIKE YCSTK-MATNR,

WERKS LIKE YCSTK-WERKS,

CHARG LIKE MSEG-CHARG,

GKAHR LIKE YCSTK-GKAHR,

FLD2 LIKE YCSTK-FLD2,

END OF IT_YCSTK.

SELECT MATNR WERKS CHARG GKAHR

FROM YCSTK

INTO CORRESPONDING FIELDS OF TABLE IT_YCSTK

WHERE FLD2 = SPACE.

BUT SY-SUBRC IS ZERO...y???????

HERE FLD2 IS A DATE TYPE FIELD...

Edited by: Mathew Parera on Aug 21, 2008 9:28 AM

3 REPLIES 3
Read only

Former Member
0 Likes
601

Hi

Sy-subrc will be zero if your select query enables to retrieve any data with all the conditions satisfied.

Check on debugger i am sure that ITAB must contain some data.

Thanks and Regards

Aditya

Read only

Former Member
0 Likes
600

Hi,

SY-SUBRC will be zero, if select query is a success.

If its not fetching values pertaining to FLD2 = SPACE.

Try select..

where FLD2 is null.

Regards,

Read only

Former Member
0 Likes
600

hi,

The reason the SY_SUBRC = 0 is that it has fetched the records from the table with the conditions that you have put,because the conditions put have been satisfied and data exists in th etable for the conditions..

Hope this hepls.

Thanks,

Rashmi.