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

default value in list box

hi,

i need to know how to set default value for a list box in selection screen.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 01:01 PM

    Parameters: P_BUKRS Type T001-BUKRS As Listbox visible length 10 default '1'.

    santhosh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 01:02 PM

    Hi

    check this code

    at selection-screen output.

    name = 'P_DATE'.

    value-key = '1'.

    value-text = 'Today'.

    append value to list.

    value-key = '2'.

    value-text = 'Last 7 days'.

    append value to list.

    value-key = '3'.

    value-text = 'Last 30 days'.

    append value to list.

    value-key = '4'.

    value-text = 'Last 90 days'.

    append value to list.

    value-key = '5'.

    value-text = 'Last year'.

    append value to list.

    • Call the ''VRM_SET_VALUES' to display the values in Listbox

    call function 'VRM_SET_VALUES'

    exporting

    id = name

    values = list.

    at selection-screen.

    if sy-ucomm = 'CLI1'.

    sscrfields-ucomm = 'ONLI'(001).

    endif.

    if p_date = '1'.

    p_date11 = sy-datum .

    elseif p_date = '2'.

    p_date11 = ( sy-datum - 7 ).

    elseif p_date = '3'.

    p_date11 = ( sy-datum - 30 ).

    elseif p_date = '4'.

    p_date11 = ( sy-datum - 90 ).

    elseif p_date = '5'.

    p_date11 = ( sy-datum - 365 ).

    endif.

    Reward points if useful...

    Regards

    Sreenivas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 01:04 PM

    Hi,

    Do like this

    example code

    Parameters:  p_region TYPE ztps_regions-zregion    " Region
                     AS LISTBOX
                     VISIBLE LENGTH 15
                     DEFAULT 'EAST',

    Reward Points if this helps,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 12:57 PM

    Hi

    Check this code...

    TYPE-POOLS: vrm.
    
    DATA: name TYPE vrm_id,
          list TYPE vrm_values,
          value LIKE LINE OF list.
    PARAMETERS : p_frwd(10) as listbox visible length 10 DEFAULT '6 weeks'.
    AT SELECTION-SCREEN OUTPUT.
      name = 'P_FRWD'.
      value-text = '7 weeks'.
      APPEND value TO list.
      value-key = '06'.
      value-text = '6 weeks'.
      APPEND value TO list.
      value-key = '05'.
      value-text = '5 weeks'.
      APPEND value TO list.
      value-key = '04'.
      value-text = '4 weeks'.
      APPEND value TO list.
      value-key = '03'.
      value-text = '3 weeks'.
      APPEND value TO list.
      value-key = '02'.
      value-text = '2 weeks'.
      APPEND value TO list.
      value-key = '01'.
      value-text = '1 week'.
      APPEND value TO list.
    
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID     = name
          VALUES = list.
    
    

    Message was edited by:

    Perez C

    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.