2016 May 18 7:56 AM
Hi everyone,
I have to validate the entry in select-option(s_conft here) to an internal table field holding date ( detltab-conf_date_time+11(8) here) in
format e.g: 11:11 AM.
the select option field is holding the value in IEQ111100000000 format.
To achieve this functionality,i did the following coding
IF s_conft IS NOT INITIAL.
lv_tim = detltab-conf_date_time+11(8).
IF lv_tim+6(2) EQ 'PM'.
lv_hr1 = lv_tim+0(2) + 12.
ELSE.
lv_hr1 = lv_tim+0(2).
ENDIF.
lv_hr2 = lv_tim+3(2).
CONCATENATE lv_hr1 lv_hr2 INTO lv_tim_final.
IF NOT lv_tim_final IN s_conft.
DELETE detltab.
CONTINUE.
ENDIF.
ENDIF.
But this piece of code is not working.
Please help me out with this.
I need to delete entries from internal table if its date entry doesn't match the date entry in selection screen .
2016 May 18 8:19 AM
You can try like this.
if lv_tim_final ne s_conft-low.
delete detltab.
endif.
Regards
Raj
2016 May 18 8:28 AM
I think the problem with this approach would be: if the user enters high value for the select option,then that would not be validated.
Please correct me if i am wrong.
Thanks.
2016 May 18 8:41 AM
When you need to delete...
whether if low and high value is not equal then delete?
Regards
Raj
2016 May 18 8:56 AM
i need to delete the entry when the time stored in internal table does not matches the entry entered by user in select option .
2016 May 18 9:47 AM
you can do like this...
if lv_tim_final ne s_conft-low or lv_tim_final ne s_conft-high.
delete detltab.
endif.
Regards
Raj
2016 May 18 8:40 AM
Hi Roshan,
You are concatenating only 4 characters, like 1111, and comparing with 111100. You missed the seconds.
Add '00' in your concatenate.
Like:
CONCATENATE lv_hr1 lv_hr2 '00' INTO lv_tim_final
Regards.
2016 May 18 8:53 AM
Hi Richard,
When a value is provided to select option, it stores value in the following format:
s_conft-sign = I.
s_conft-option = EQ (if high value is provided it becomes BT)
s_conft-low = 111100 (last two are 0 since time is provided as 11:11:00)
s_conft-high = 000000 (0 as no value provided)
Therefore, s_conft value shows up to be IEQ111100000000.
If i am concatenating like this:
CONCATENATE lv_hr1 lv_hr2 s_conft+7(2) INTO lv_tim_final.
then ,its low value matches and program execute as pretended.
But what if user enters a high value for the select-options.
That i am unable to do.
Thanks.
2016 May 18 9:20 AM
Hi,
I think I'm not understanding well your problem...
You have a value like '11:11 AM' always without seconds, haven't you?
I think you should concatenate always the literal '00' at the end.
With the high value in the select options will still work.
2016 May 19 8:27 AM
2016 May 19 10:35 PM
I'm quite a bit confused by this post too. "11:11 AM" is the time format, not date format, so what exactly are you doing?
Kindly add more information, such as the variable definitions and some specific data examples. To be honest though I'm not sure why an answer to this can't be simply found in debugger...