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

doubt with selection screen

Former Member
0 Likes
647

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
618

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.

4 REPLIES 4
Read only

Former Member
0 Likes
618

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

Read only

0 Likes
618

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

Read only

Former Member
0 Likes
619

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.

Read only

0 Likes
618

Thank you Jose.It's working.