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

ragarding select-options

Former Member
0 Likes
891

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
864

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

7 REPLIES 7
Read only

Former Member
0 Likes
865

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

Read only

0 Likes
864

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.

Read only

former_member195383
Active Contributor
0 Likes
864

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..

Read only

Former Member
0 Likes
864

Hi Mahesh,

check the date format in debug mode... i guess it is not the same format as in the database.

regards

padma

Read only

0 Likes
864

hi padma,

that is not the reason.bcz if i comment the where clause then i am getting the records.

Read only

0 Likes
864

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.

Read only

0 Likes
864

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