Skip to Content
0
Former Member
Apr 26, 2016 at 06:30 AM

Listbox after selection, no value

1139 Views

Hi All,

I am using ABAP Listbox with VRM to set the dropdown.

I am able to set the dropdown, but the user selected value doesnot appear in the parameter specified.

I have tried using VRM_GET_VALUES but the same didnt work.

Please guide.

Below is my code:

REPORT zbw_mosl_file_upd.

TYPE-POOLS: vrm, slis.

TYPES: BEGIN OF ty_retailer,

/bic/zcretalr TYPE /bic/oizcretalr,

END OF ty_retailer.

TYPES: BEGIN OF ty_pzcfilenm2,

checkbox TYPE xfeld,

/bic/zcfilenm TYPE /bic/oizcfilenm,

objvers TYPE rsobjvers,

changed TYPE rsrchangeflag,

/bic/zcstat TYPE /bic/oizcstat,

/bic/zcretalr TYPE /bic/oizcretalr,

END OF ty_pzcfilenm2.

DATA: lt_retailer TYPE TABLE OF ty_retailer,

ls_retailer TYPE ty_retailer.

DATA: lt_pzcfilenm TYPE TABLE OF /bic/pzcfilenm,

ls_pzcfilenm LIKE LINE OF lt_pzcfilenm.

DATA: lt_pzcfilenm2 TYPE TABLE OF ty_pzcfilenm2,

ls_pzcfilenm2 LIKE LINE OF lt_pzcfilenm2.

DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,

ls_fieldcat TYPE slis_fieldcat_alv.

DATA: name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list,

lv_records TYPE i,

lv_message TYPE string.

DATA: lv_repid TYPE sy-repid VALUE sy-repid.

DATA lr_grid TYPE REF TO cl_gui_alv_grid.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_retail LIKE /bic/pzcfilenm-/bic/zcretalr AS LISTBOX VISIBLE LENGTH 30.

SELECTION-SCREEN: END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

SELECT /bic/zcretalr

FROM /bic/pzcfilenm

INTO TABLE lt_retailer

WHERE /bic/zcretalr IS NOT NULL.

IF sy-subrc NE 0.

MESSAGE e000(zbw_mosl_file_upd) WITH 'Error'.

EXIT.

ELSE.

SORT lt_retailer.

DELETE ADJACENT DUPLICATES FROM lt_retailer.

LOOP AT lt_retailer INTO ls_retailer.

value-key = sy-tabix.

value-text = ls_retailer-/bic/zcretalr.

APPEND value TO list.

ENDLOOP.

name = 'P_RETAIL'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

ENDIF.

AT SELECTION-SCREEN.

"Fetch all the Filenames which have Loaded status for the selected retailer

* PERFORM fetch_loaded.

CALL FUNCTION 'VRM_GET_VALUES'

EXPORTING

id = name

IMPORTING

values = list.