Application Development and Automation 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: 
Read only

Select-option problem on value request

Former Member
0 Likes
642

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
573

Hi,

Use 'Refresh sel_cycle' along with the clear statement.

Regards,

Himanshu.

Message was edited by:

Himanshu Aggarwal

4 REPLIES 4
Read only

Former Member
0 Likes
574

Hi,

Use 'Refresh sel_cycle' along with the clear statement.

Regards,

Himanshu.

Message was edited by:

Himanshu Aggarwal

Read only

0 Likes
573

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

Read only

0 Likes
573

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

Read only

0 Likes
573

Thank you all. Problem solved