Application Development 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: 
SAP Community Downtime Scheduled for This Weekend

T056P-DATA as filter got ignored

Former Member
0 Kudos
362

Hi,

I defined a SELECT-OPTIONS field as:

"SELECT-OPTIONS : so_tqdat FOR T056P-DATAB."

In the SELECT statement below I used so_tqdat as filter, but not sure why the filter keep getting ignored.

SELECT REFERENZ DATAB ZSOLL      

        FROM T056P INTO TABLE t_t056p      

        FOR ALL ENTRIES IN t_ref       

        where REFERENZ = t_ref-REFERENZ        

        and ( DATAB > so_tqdat-low and DATAB < so_tqdat-high ).

Not sure if I am missing anything and just wondering if you can see what did I do wrong? Thanks

Really appreciate your input

4 REPLIES 4

Former Member
0 Kudos
188

Hi,

In the table the date field is in character format. I think better to do this way.

SELECT REFERENZ DATAB ZSOLL
         FROM T056P INTO TABLE t_t056p
         where REFERENZ = p_REF .
        
* you have to convert the date field as below.

        
  loop at t_t056p.
   convert inverted-date T_t056p-datab into date val_date.
    if val_date between so_tqdat-low and so_tqdat-high.


*    APPEnD THE DATA INTO ANOTHER INTERNAL TABLE


    endif.
ENDLOOP.

Thanks,

Kiran

Former Member
0 Kudos
188

Hi

Change select query as below...

SELECT REFERENZ DATAB ZSOLL      

        FROM T056P INTO TABLE t_t056p      

        FOR ALL ENTRIES IN t_ref       

        where REFERENZ = t_ref-REFERENZ        

        and DATAB  in so_tqdat.

nabheetscn
Active Contributor
0 Kudos
188

use as follow. SO_TQDAT enter the from and to date. In your case you are comparing the work area of the select option which is blank.. Select option is an internal table with header line.

Use this

SELECT REFERENZ DATAB ZSOLL      

        FROM T056P INTO TABLE t_t056p      

        FOR ALL ENTRIES IN t_ref       

        where REFERENZ = t_ref-REFERENZ        

        and DATAB in so_tqdat.

0 Kudos
188

Hi,

in T056p -DATAB is a character field(8), not the date field. Have to convert the date by using conversion exit.  CONVERSION_EXIT_INVDT_***

Thanks,

Kiran.