‎2007 Apr 27 11:34 AM
Hello everyone,
I'm having some trouble handling the values of a select-option. I have this code on my report:
SELECT-OPTIONS: s_cycle FOR t811k-cycle NO INTERVALS.Then i use this on value-request:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_cycle-low.
CLEAR sel_cycle.
CALL FUNCTION 'RK_F4_ALLOCATION_CYCLE'
EXPORTING
alart = 'P'
appl = 'S'
fix_group = 'X'
group = p_kokrs
ipknz = 'I'
seg_revers = '-'
choosen = 'SHOW_SEL_CYCLE'
IMPORTING
ex_cycle = sel_cycle
sdate = sel_sdate
EXCEPTIONS
no_cycle = 1
nothing_selected = 2.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
s_cycle-sign = 'I'.
s_cycle-option = 'EQ'.
s_cycle-low = sel_cycle.
APPEND s_cycle.
ENDIF.
The problem is, when i first press F4 and select one cycle, my s_cycle table has the right value, but if i choose a second one, the first one is "smashed" by the second one, and the table now has two rows with the same second cycle i choose.
What am i doing wrong ? Thank you in advance for any help.
‎2007 Apr 27 11:37 AM
Hi,
Use 'Refresh sel_cycle' along with the clear statement.
Regards,
Himanshu.
Message was edited by:
Himanshu Aggarwal
‎2007 Apr 27 11:37 AM
Hi,
Use 'Refresh sel_cycle' along with the clear statement.
Regards,
Himanshu.
Message was edited by:
Himanshu Aggarwal
‎2007 Apr 27 11:45 AM
Hello Himanshu,
I didn't understand. My variable sel_cycle is not a table, it returns only one value.
If i do REFRESH s_cycle, i loose all the entries that i selected earlier, and i don't want that to happen. I need to have a final table s_cycle with all values, say:
sign option low
I EQ ABC
I EQ DEF
I EQ HIJ
The problem right now is, when i go check the values, the table is like that:
sign option low
I EQ HIJ
I EQ DEF
I EQ HIJ
‎2007 Apr 27 11:48 AM
Hi,
Sort s_cycle by sign option low.
delete adjacent duplicates from s_cycle comparing sign option low.
santhosh
Message was edited by:
Kaluvala Santhosh
‎2007 Apr 27 12:17 PM