‎2008 Feb 09 4:24 AM
Hi all!
I have to show the inspection lot details (QA32) as per the requirements given in the selection screen.
In my selection screen , I should have select option for Inspection lot created date(QALS-ENSTEHDAT) and lot created time (QALS-ENTSTEZEIT). I would like to know the lots created from yesterday evening till today morning.
When I give the values 09.02.2008 to 10.02.2008 for date and 17:30:00 to 10:00:00 for time , it'll obviously intimate that 'From- time is greater than To- time'.Is there any way to relate the From-date to From-time and To-date to To-time in the selection screen , so that my problem will be solved.Please help with possible code.
Edited by: Jayasri P. on Feb 9, 2008 5:55 AM
‎2008 Feb 09 5:43 AM
Hi,
try this.........
TABLES qals.
DATA it_qals TYPE TABLE OF qals WITH HEADER LINE.
SELECT-OPTIONS s_date FOR qals-enstehdat NO-EXTENSION.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN comment (10) for field p_timel.
SELECTION-SCREEN POSITION 35.
PARAMETERS p_timel LIKE qals-entstezeit.
SELECTION-SCREEN comment 54(2) for field p_timeh.
SELECTION-SCREEN POSITION 60.
PARAMETERS p_timeh LIKE qals-entstezeit.
SELECTION-SCREEN END OF LINE.
SELECT *
FROM qals
INTO TABLE it_qals
WHERE enstehdat IN s_date.
IF sy-subrc IS INITIAL.
SORT it_qals BY enstehdat entstezeit.
LOOP AT it_qals WHERE enstehdat EQ s_date-low
OR enstehdat EQ s_date-high.
CASE it_qals-enstehdat.
WHEN s_date-low.
IF it_qals-entstezeit LT p_timel.
DELETE it_qals.
ENDIF.
WHEN s_date-high.
IF it_qals-entstezeit GT p_timeh.
DELETE it_qals.
ENDIF.
ENDCASE.
ENDLOOP.
ENDIF.
LOOP AT it_qals.
WRITE : / it_qals-enstehdat ,it_qals-entstezeit.
ENDLOOP.also goto selection text and give descriptionas below..
P_TIMEH to
P_TIMEL Time
S_DATE Date
Cheers,
jose.
‎2008 Feb 09 4:44 AM
Hi,
Other wise you will give time in 24 hr format.
if that is also not valid then you have to follow the below code.
selection-screen : begin of block b1 frame title text-001.
select-options : s_matnr for mara-matnr.
select-options : s_date for sy-datum.
selection-screen :end of block b1.
initialaization.
s_date-low = yesturdays date.
s_date-high = todays date.
s_date-sign = 'BT'.
s_date-option = 'I'.
under that you have to code select statement as usual.
i think it will help you.
regards,
swami
‎2008 Feb 09 4:50 AM
Hi !
How to specify the parameter and it's values for time relating to date?
Edited by: Jayasri P. on Feb 9, 2008 5:51 AM
‎2008 Feb 09 5:43 AM
Hi,
try this.........
TABLES qals.
DATA it_qals TYPE TABLE OF qals WITH HEADER LINE.
SELECT-OPTIONS s_date FOR qals-enstehdat NO-EXTENSION.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN comment (10) for field p_timel.
SELECTION-SCREEN POSITION 35.
PARAMETERS p_timel LIKE qals-entstezeit.
SELECTION-SCREEN comment 54(2) for field p_timeh.
SELECTION-SCREEN POSITION 60.
PARAMETERS p_timeh LIKE qals-entstezeit.
SELECTION-SCREEN END OF LINE.
SELECT *
FROM qals
INTO TABLE it_qals
WHERE enstehdat IN s_date.
IF sy-subrc IS INITIAL.
SORT it_qals BY enstehdat entstezeit.
LOOP AT it_qals WHERE enstehdat EQ s_date-low
OR enstehdat EQ s_date-high.
CASE it_qals-enstehdat.
WHEN s_date-low.
IF it_qals-entstezeit LT p_timel.
DELETE it_qals.
ENDIF.
WHEN s_date-high.
IF it_qals-entstezeit GT p_timeh.
DELETE it_qals.
ENDIF.
ENDCASE.
ENDLOOP.
ENDIF.
LOOP AT it_qals.
WRITE : / it_qals-enstehdat ,it_qals-entstezeit.
ENDLOOP.also goto selection text and give descriptionas below..
P_TIMEH to
P_TIMEL Time
S_DATE Date
Cheers,
jose.
‎2008 Feb 09 9:28 AM