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: 

When selected any item in listbox, my screen objects will be refreshed

acamli
Explorer
0 Kudos

Hi everyone,

I have one program about screen and dynamically changed objects.

If I select any value in listbox, my screen will be refreshed and my listbox items will duplicated.

How can I fix that?

Thanks.

REPORT  zmp_auto_material_number.

TABLES: zmp_auto_mat.

TYPE-POOLS: vrm.

DATA: hane1_name TYPE vrm_id,
hane1_list TYPE vrm_values,
hane1_value LIKE LINE OF hane1_list.

DATA: hane2_name TYPE vrm_id,
hane2_list TYPE vrm_values,
hane2_value LIKE LINE OF hane2_list.

DATA: lt_automat TYPE zmp_auto_mat.


*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
SET TITLEBAR 'TITLE_0100'.

hane1_name = 'SO_HANE1'.
SELECT * FROM zmp_auto_mat WHERE hane EQ 1.
hane1_value-key = zmp_auto_mat-hkey.
hane1_value-text = zmp_auto_mat-tanim.
APPEND hane1_value TO hane1_list.
ENDSELECT.

CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = hane1_name
values = hane1_list.


ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

CASE sy-ucomm.
WHEN '&BACK'.
LEAVE TO SCREEN 0.
WHEN '&HANE1'.
hane2_name = 'SO_HANE2'.
hane2_value-key = '1'.
hane2_value-text = 'Text 1'.
APPEND hane2_value TO hane2_list.

hane2_value-key = '2'.
hane2_value-text = 'Text 2'.
APPEND hane2_value TO hane2_list.

hane2_value-key = '3'.
hane2_value-text = 'Text 3'.
APPEND hane2_value TO hane2_list.

CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = hane2_name
values = hane2_list.
WHEN OTHERS.
ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT


START-OF-SELECTION.

CALL SCREEN 0100.
3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

Where did you refresh internal table hane2_list?

acamli
Explorer
0 Kudos

hane2_list is not important me. IF I select any value in hane1_list, hane2_list show demo data for me.

But when i select a data in hane1_list, my screen will be refreshed, my selected value will be nulled and hane1_list values will be duplicated.

Sandra_Rossi
Active Contributor
0 Kudos

I don't understand your exact situation, also possibly you have assigned an incorrect data type to your dynpro field.

As you say that "hane1_list values will be duplicated.", sorry to insist, but where did your clear your internal table hane1_list? (logical sequel to Raymond question)