‎2008 Jul 24 6:00 AM
hai friends,
i have designed a selection-screen with the date range, bcz user wants to select the data pertaining to the given dates. so for this plz refer my code as follows.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
SELECT-OPTIONS : s_date FOR ztbukxxin003-z_manufdate.
SELECTION-SCREEN END OF BLOCK blk1.
CLEAR : tab_ztbukxxin003.
SELECT z_manufdate z_thonum z_ndsnum z_digicard
FROM ztbukxxin003
INTO TABLE tab_ztbukxxin003.
WHERE z_manufdate IN s_date.
IF syst-subrc = 0.
SORT tab_ztbukxxin003 BY z_manufdate z_thonum z_ndsnum.
ENDIF.
so in this the issue is when i am not using where clause in my select query i am getting the records but not according to the given dates(i.e.i am getting the records beyond the dates even).and when i write the select query with where clause i am not getting the records into the internal table itself.of-course i have the records pertaining to the date range in my database table.
can anybody give the solution for this.
‎2008 Jul 24 6:06 AM
HI
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
SELECT-OPTIONS : s_date FOR ztbukxxin003-z_manufdate.
SELECTION-SCREEN END OF BLOCK blk1.
CLEAR : tab_ztbukxxin003.
SELECT z_manufdate z_thonum z_ndsnum z_digicard
FROM ztbukxxin003
INTO TABLE tab_ztbukxxin003
WHERE z_manufdate IN s_date.
IF syst-subrc = 0.
SORT tab_ztbukxxin003 BY z_manufdate z_thonum z_ndsnum.
ENDIF.u r table z_manufdate z_thonum z_ndsnum z_digicard has only those four fields if so it will work for sure
‎2008 Jul 24 6:06 AM
HI
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
SELECT-OPTIONS : s_date FOR ztbukxxin003-z_manufdate.
SELECTION-SCREEN END OF BLOCK blk1.
CLEAR : tab_ztbukxxin003.
SELECT z_manufdate z_thonum z_ndsnum z_digicard
FROM ztbukxxin003
INTO TABLE tab_ztbukxxin003
WHERE z_manufdate IN s_date.
IF syst-subrc = 0.
SORT tab_ztbukxxin003 BY z_manufdate z_thonum z_ndsnum.
ENDIF.u r table z_manufdate z_thonum z_ndsnum z_digicard has only those four fields if so it will work for sure
‎2008 Jul 24 7:03 AM
hi sunil,
no my table has 24 fields.in that i have taken only four fields as per the technical specification. so in this case what i have to do.should i use into corresponding fields in select quert or anything else.
‎2008 Jul 24 6:09 AM
SELECT z_manufdate z_thonum z_ndsnum z_digicard
FROM ztbukxxin003
INTO TABLE tab_ztbukxxin003.
WHERE z_manufdate GE s_date-low
and z_manufdate LE s_date-high.
try the above query..
‎2008 Jul 24 6:13 AM
Hi Mahesh,
check the date format in debug mode... i guess it is not the same format as in the database.
regards
padma
‎2008 Jul 24 7:04 AM
hi padma,
that is not the reason.bcz if i comment the where clause then i am getting the records.
‎2008 Jul 24 7:19 AM
Hi,
Try this...
SELECT z_manufdate z_thonum z_ndsnum z_digicard
FROM ztbukxxin003
INTO CORRESPONDING FIELDS OF TABLE tab_ztbukxxin003
WHERE z_manufdate IN s_date.
Regards,
Sathish.
‎2008 Jul 24 1:50 PM
Hi,
If you comment the where clause you will definitely get all the values from database.
What i want you to check is the internal date format into which the system is converting may be different... so i wanted you to check in debug mode at the time of comparision of dates.
regards
padma