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

Drop down list

Hi all,

I am using a drop down list in a program. It has got some 10 values. How do i grab the value which user has selected and set that value to that field.

Regards,

Sunil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Posted on Jan 05, 2005 at 09:23 AM

    R u using it abap program? is it a parameter field as list box?

    Are you using FM VRM_SET_VALUES.

    Need more info to help you out.

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 09:42 AM

    Hi Raja,

    I am not using as parameter but using VRM_SET_VALUES to set the values for that particular field.The probem is how to grab the selected value?

    Regards,

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 11:22 AM

    Hi all,

    I am using function VRM_SET_VALUES to set the possible values for that particular field. Now when i select a particular value from those values i am not able to see that value rather i am seeing a blank for that field.

    Regards,

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 12:51 PM

    Hi Anand,

    I am not using any selection screen as you specified. It's a screen field and i made it as listbox.

    I have assigned values using VRM_SET_VALUES but i am unable to select the values from the list box. what ever i select i am only getting space as value for that field.

    I hope this is clear for you.

    Regards,

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Sunil,

      From your description, I suspect the problem to be with the exporting parameter VALUES of the FM VRM_SET_VALUES.

      Let us say you have a Screen Field called CARRID. and you wish to provide a dropdown with some Airline Carriers. The following code would do the trick:

      
      TYPE-POOLS VRM.
      
      DATA: NAME  TYPE VRM_ID,
            LIST  TYPE VRM_VALUES,
            VALUE LIKE LINE OF LIST.
      
        NAME = 'CARRID'.
        
        value-key = 'LH'.
        value-text = 'Lufthansa'.
        append value to list.
      
        value-key = 'IA'.
        value-text = 'Indian Airlines'.
        append value to list.
       
        CALL FUNCTION 'VRM_SET_VALUES'
             EXPORTING
                  ID              = NAME
                  VALUES          = LIST.
      
      

      Now, what the user will see on the screen in the dropdown list will be the <i>texts</i>. When the user selects, for example, Lufthansa, in the program the screen variable CARRID will contain the value 'LH'.

      Hope this is clear. Please refer to the documentation in the link that I have given in my previous post. If you are still unable to achieve the result, then please paste the code you have used for this purpose.

      Regards,

      Anand Mandalika.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 01:13 PM

    Hi Anand,

    I am able to do if that field is from dictionary.but here the field is user defined field.Pls suggest.

    Regards,

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Sunil,

      Your mention to the word dictionary raises a serious doubt here. Providing the DropDown ListBox Functionality , to my knowledge , has got nothing to do with the dictionary. Are you really trying to create a drop-doun list box ? Or are you trying to code for the F4 Functionality (Input help)?

      Please provide the code you are using .

      Regards,

      Anand Mandalika.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 01:15 PM

    Hi anand,

    For your reference i am giving the code i am using.

    REPORT z_dropdown .

    TYPE-POOLS vrm.

    DATA init.

    DATA save_ok LIKE sy-ucomm.

    DATA ok_code LIKE sy-ucomm.

    DATA:values1 TYPE vrm_values.

    *CLEAR INIT.

    CALL SCREEN 100.

    &----


    *& Module fill_list OUTPUT

    &----


    • text

    ----


    MODULE fill_list OUTPUT.

    DATA values TYPE vrm_values WITH HEADER LINE.

    IF init IS INITIAL.

    DO 10 TIMES.

    values-text = space.

    values-key = sy-index.

    APPEND values.

    ENDDO.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = 'INPUT1'

    values = values[]

    EXCEPTIONS

    id_illegal_name = 1

    OTHERS = 2.

    ENDIF.

    ENDMODULE. " fill_list OUTPUT

    &----


    *& Module STATUS_0100 OUTPUT

    &----


    • text

    ----


    MODULE status_0100 OUTPUT.

    SET PF-STATUS 'TEST'.

    ENDMODULE. " STATUS_0100 OUTPUT

    &----


    *& Module USER_COMMAND_0100 INPUT

    &----


    • text

    ----


    MODULE user_command_0100 INPUT.

    save_ok = ok_code.

    CLEAR ok_code.

    CASE save_ok.

    WHEN 'LIST'.

    CALL FUNCTION 'VRM_GET_VALUES'

    EXPORTING

    id = 'INPUT1'

    IMPORTING

    values = values1

    EXCEPTIONS

    id_not_found = 1

    OTHERS = 2.

    WHEN 'BACK'.

    LEAVE PROGRAM.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0100 INPUT

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Try this one instead -

      REPORT z_dropdown .
      
      TYPE-POOLS vrm.
      
      DATA init.
      
      DATA save_ok LIKE sy-ucomm.
      DATA ok_code LIKE sy-ucomm.
      DATA:values1 TYPE vrm_values.
      
      *CLEAR INIT.
      
      CALL SCREEN 100.
      *&---------------------------------------------------------------------*
      *& Module fill_list OUTPUT
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      MODULE fill_list OUTPUT.
      
      
      
      DATA values TYPE vrm_values WITH HEADER LINE.
      
      IF init IS INITIAL.
      DO 10 TIMES.
      values-text = sy-index.
      values-key = sy-index.
      APPEND values.
      ENDDO.
      
      CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
      id = 'INPUT1'
      values = values[]
      EXCEPTIONS
      id_illegal_name = 1
      OTHERS = 2.
      
      
      ENDIF.
      
      
      ENDMODULE. " fill_list OUTPUT
      *&---------------------------------------------------------------------*
      *& Module STATUS_0100 OUTPUT
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      MODULE status_0100 OUTPUT.
      SET PF-STATUS 'TEST'.
      
      
      ENDMODULE. " STATUS_0100 OUTPUT
      *&---------------------------------------------------------------------*
      *& Module USER_COMMAND_0100 INPUT
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      MODULE user_command_0100 INPUT.
      
      save_ok = ok_code.
      CLEAR ok_code.
      
      CASE save_ok.
      WHEN 'LIST'.
      
      
      WHEN 'BACK'.
      LEAVE PROGRAM.
      
      
      ENDCASE.
      
      
      ENDMODULE. " USER_COMMAND_0100 INPUT 
      
      

      By the way, what do you want to do with the value you have obtained in the field ? I cannot see any processing with that field.

      Did you assign the function code LIST to the dropdown listbox ?

      Regards,

      Anand Mandalika.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 01:26 PM

    Hello anand,

    I am using frop down functionality only. But tha values which i am setting are defined in ABAP program and those values are set to the use defined field using FM. I have given you the code i am using.

    Regards,

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sunil

      I haven't read all the codes you sent. However, did you set the related property of the field to get values from the flow logic of your screen?

      That is, at screen painter, at the "DATA" tabstrip of field properties section, you should set the relevant field to "A" which means the listbox will be filled via the VRM function.

      <i>And as a last thing, let me introduce you the SDN forums pointing system: You can assign points to posts you find helpful while solving your question. You can reward points by clicking the yellow star icon at header of each reply post. You can reward;

      - one 10 points (solved)

      - two 6 points (very helpful answer)

      - many 2 points (helpful answer)</i>

      Kind Regards...

      *--Serdar

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.