Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Selection screen field not working in Query

Hi Gurus!

I have a small problem with one of my query that I just created for finding status of our customers. I have a code section which handles it all . The problem is that I ahve a user field called "Check date" which I ahve used in selection screen as well as the layout, when I put a value in this field in the selection screen the report dosent give any output " NO data to display" but when I leave it open it does give me the out put with the saem check date as I ahd entered earlier in my selection screen.

I am not sure where my selection code is working wrong . Could anyone please help me out please.

DATA: ls_vakpa LIKE vakpa.
DATA old_date LIKE sy-datum.
old_date = key_date - num_days.
status = 'ACTIVE'.
check_date = old_date.
* (If I entere this field (check_date) with any date
*  and run it does not give me output and without 
* entry it dioes give output.
  SELECT SINGLE * FROM vakpa INTO ls_vakpa
      WHERE kunde = kna1-kunnr
   AND audat > old_date.
      IF sy-subrc <> 0.
    SELECT SINGLE * FROM vakpa INTO ls_vakpa
        WHERE kunde = kna1-kunnr
      AND audat < old_date.
      IF sy-subrc = 0.
      ls_audat = ls_vakpa-audat.
      ls_vbeln = ls_vakpa-vbeln.
    ELSE.
      CLEAR ls_audat.
      clear ls_vbeln.
    ENDIF.
    status = 'INACTIVE'.
  ELSE.
    ls_audat = ls_vakpa-audat.
    ls_vbeln = ls_vakpa-vbeln.
  ENDIF.

Edited by: Rob Burbank on Apr 7, 2010 12:08 PM

Former Member
Not what you were looking for? View more on this topic or Ask a question