‎2007 Jul 12 5:44 PM
Hi ,
I am writing an ABAP code in an Infopackage for loading dates which are either null or between 2001 to 2004.
Can anyone Please send me the exact code.
I tried so many ways. But It didnt work. Any help will be appreciated.
Thanks
‎2007 Jul 12 7:34 PM
Hi,
Please try this perhaps it may work ...
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'CP'.
L_T_RANGE-LOW = '0000000*'.
APPEND L_T_RANGE.
OR
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'EQ'.
L_T_RANGE-LOW = '00000000'.
APPEND L_T_RANGE.
Regards,
Ferry Lianto
‎2007 Jul 12 6:07 PM
Somnething like:
IF date IS INITIAL OR
( date(4) BETWEEN '2001' AND '2004' ).
*
*Your logic here
*
ENDIF.
Rob
‎2007 Jul 12 6:07 PM
I Just write the logic here.
Data L_date type sy-datum.
If l_date is initial or
L_date+(4) = '2001' or
L_date+(4) = '2002' or
L_date+(4) = '2003' or
L_date+(4) = '2004' ).
write your own logic to trigger.
Endif.
‎2007 Jul 12 6:29 PM
Thanks a lot!!! but I am very new to ABAP...If you guys can help me some more to make it more clear that would be great. Right now I have this code but It is returning 0 records because the date field is all null.So trying to figure out How to include Null date field .
L_T_RANGE-LOW = 'SPACE'.
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'EQ'.
APPEND L_T_RANGE.
L_T_RANGE-LOW = '20040101'.
L_T_RANGE-HIGH = '20060101'.
L_T_RANGE-OPTION = 'BT'.
APPEND L_T_RANGE.
‎2007 Jul 12 6:34 PM
Do you want the range between 2001 and 2004 or between 2004 and 2006?
Your code looks ok. what's in l_t_range-high in the first case? It should be cleared out.
rob
‎2007 Jul 12 6:38 PM
‎2007 Jul 12 6:49 PM
Hi,
Please try this ...
L_T_RANGE-LOW = SPACE. "Change here
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'EQ'.
APPEND L_T_RANGE.
L_T_RANGE-LOW = '20040101'.
L_T_RANGE-HIGH = '20060101'.
L_T_RANGE-OPTION = 'BT'.
APPEND L_T_RANGE.
Regards,
Ferry Lianto
‎2007 Jul 12 6:55 PM
Ferry ,
It Did'nt work. In my tables all the dates in that specific date range have null values , so Its returning 0 records , So what I am trying to write a code for is
return null date records and between 2004 to 2006.
Thanks
‎2007 Jul 12 7:24 PM
Hi,
What is the value for your null date field?
Is it space or '00000000'?
Regards,
Ferry Lianto
‎2007 Jul 12 7:29 PM
‎2007 Jul 12 7:35 PM
When initializing fields or structures, it's better to use the CLEAR key word. that way, all fields in the structure will be initialized to their proper values. Try this:
CLEAR l_t_range.
l_t_range-sign = 'I'.
l_t_range-option = 'EQ'.
APPEND l_t_range.
CLEAR l_t_range.
l_t_range-low = '20040101'.
l_t_range-high = '20060101'.
l_t_range-option = 'BT'.
APPEND l_t_range.
Rob
‎2007 Jul 12 7:34 PM
Hi,
Please try this perhaps it may work ...
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'CP'.
L_T_RANGE-LOW = '0000000*'.
APPEND L_T_RANGE.
OR
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'EQ'.
L_T_RANGE-LOW = '00000000'.
APPEND L_T_RANGE.
Regards,
Ferry Lianto
‎2007 Jul 12 7:51 PM
Ferry ,
Thanks a lot...the second one worked.....
Thanks a lot