Skip to Content
avatar image
Former Member

Parameters Issue

Hi All,

How we can set default values in PARAMETER Like

PARAMETER: P like Ztable-gendre.

When user put the cursor on the selection Box it Should get MALE

FEMALE.

Regards

Vikas

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

8 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 20, 2008 at 06:55 AM

    you just paste code REPORT ZTESTRE.

    TYPE-POOLS : vrm.

    DATA : it_vrm TYPE vrm_values,

    x_vrm like line of it_vrm.

    PARAMETER: P(10) as listbox visible length 10."Ztable-gendre

    INITIALIZATION.

    x_vrm-key = '1'.

    x_vrm-text = 'MALE'.

    APPEND x_vrm TO it_vrm.

    x_vrm-key = '2'.

    x_vrm-text = 'FEMALE'.

    APPEND x_vrm TO it_vrm.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = 'P'

    values = it_vrm

    EXCEPTIONS

    id_illegal_name = 1

    OTHERS = 2.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 06:32 AM

    Search SDN for function module 'VRM_SET_VALUES' for example codes.

    ~Eswar

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2008 at 06:33 AM

    hi Vikas,

    In SE11, declare a new data element and assign the allowable values as

    M = Male

    F = Female

    then, use your new data element for Ztable-gendre.

    regards,

    Peter

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 06:31 AM

    Hi,

    You can add a search help to the parameter, either by using

    1. Function module :

    F4IF_INT_TABLE_VALUE_REQUEST

    (Check the FM documentation for how to use it), call this FM under event

    at selection-screen on value request of p_parameter

    2. Or by attaching a search help.

    Thanks & Regards,

    Navneeth K.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2008 at 06:32 AM

    Refer:

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 06:32 AM

    Hello,

    Try in this way it is working fine i have test it.

    PARAMETER: s_matnr TYPE mara-matnr.

    AT SELECTION-SCREEN OUTPUT.

    s_matnr = '94000000001'.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2008 at 06:33 AM

    Hi,

    You can do with the help of LISTBOX.

    For more details

    Goto SE38 , type listbox and press F1

    Thanks & Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 06:40 AM

    Hi Vikas,

    Check the below code and do the modification according to your issue.

    Copy paste and execute the code you can understand.

    Type-pools: vrm.

    Data: param type vrm_id,

    values type vrm_values,

    value like line of values.

    parameters: p1 as listbox visible length 20 modif id one.

    at selection-screen output.

    param = 'p1'.

    value-key = '1'.

    value-text = 'male'.

    append value to values.

    value-key = '1'.

    value-text = 'female'.

    append value to values.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    ID = PARAM

    VALUES = VALUES

    EXCEPTIONS

    ID_ILLEGAL_NAME = 1

    OTHERS = 2

    .

    IF SY-SUBRC <> 0.

    ENDIF.

    Cheers!!

    Balu

    Add comment
    10|10000 characters needed characters exceeded