Skip to Content
author's profile photo Former Member
Former Member

How to get a selected field from a list box in selection screen !!

Hi,

I have selection screen with two list boxes.

I am populating the second based on the selection in the first one.

But, when I'm selecting a value from the second one, it is not reflected in the program, it means it value is blank.

Please go thro' the following code, n give ur suggestions.

IF list IS INITIAL.

  • Retrive Remarks from ZLOT007

SELECT remarks bukrs FROM zlot007 INTO TABLE it_ftp_tar.

name = 'FTP_TAR'.

count = 1.

  • Populating list box 1

LOOP AT it_ftp_tar.

value-text = it_ftp_tar-remarks.

value-key = count.

APPEND value TO list.

count = count + 1.

ENDLOOP.

  • Function to load data into list box

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

ENDIF.

  • If FTP setting field is not initial

IF ftp_tar IS NOT INITIAL AND list1 IS INITIAL.

READ TABLE it_ftp_tar INDEX ftp_tar.

CONDENSE it_ftp_tar-bukrs.

l_bukrs = it_ftp_tar-bukrs.

  • Fetching Plant belongs to the Company code

SELECT bukrs bwkey FROM t001k INTO TABLE it_werks

WHERE bukrs = l_bukrs.

name = 'P_WERKS'.

count = 1.

  • Populating list box 2 for Plant

LOOP AT it_werks.

value-text = it_werks-werks.

value-key = count.

APPEND value TO list1.

count = count + 1.

ENDLOOP.

  • function to load data into list box

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list1.

ENDIF.

  • CLEAR it_werks.

CONDENSE p_werks.

<i>READ TABLE it_werks INDEX p_werks.

CONDENSE it_werks-werks.

l_werks = it_werks-werks.</i>

Thanks,

Senthil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 18, 2005 at 04:07 AM

    Hi Senthilkumar,

    Have a look at demo program DEMO_DROPDOWN_LIST_BOX.

    Thanks

    Lakshman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 18, 2005 at 04:12 AM

    Hi,

    Here is the sample code.

    TYPE-POOLS: vrm.

    DATA: name TYPE vrm_id,

    list TYPE vrm_values,

    value LIKE LINE OF list.

    PARAMETERS: ps_parm(10) AS LISTBOX VISIBLE LENGTH 10.

    AT SELECTION-SCREEN OUTPUT.

    name = 'PS_PARM'.

    value-key = 'Line 1'.

    value-text = 'Line 1'.

    APPEND value TO list.

    value-key = 'Line 2'.

    value-text = 'Line 2'.

    APPEND value TO list.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING id = name

    values = list.

    START-OF-SELECTION.

    WRITE: / 'Parameter selected in List box:', ps_parm.

    Kindly reward points if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 18, 2005 at 08:01 AM

    When Ever u select u will have only one value.

    U can directly use the field name and get the value.

    Regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.