Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection parameters

Former Member
0 Likes
730

Hi All,

I have to assign default values to selection screen parameters based on tcode,

How can i do that.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
707

HI,

write like this.

INITIALIZATION.

CASE SY-TCODE.

WHEN 'TCODE1'.

<PARAMETER NAME> = 'UR TEXT'.

WHEN 'TCODE2'.

<PARAMETER NAME> = 'UR TEXT'.

ENDCASE.

rgds,

bharat.

5 REPLIES 5
Read only

Former Member
0 Likes
707

Hi Sai,

U can do this in "INITIALIZATION".

Regards,

Ranjit Thakur.

<b>Please Mark The Helpful Answer.</b>

Read only

Former Member
0 Likes
707

Hi

Declare the parameters:

p_field like vbak-vbeln.

in the start-of-selection

assign the default values based on the Tcode

if sy-tcode = 'VA01'.

p_field = <default value>

elseif sy-tcode = 'VA02'.

p_field = <default value>

endif.

And use this field parameter in the where condn of the select Statement

Reward points if useful

Regards

Anji

.

Read only

Former Member
0 Likes
708

HI,

write like this.

INITIALIZATION.

CASE SY-TCODE.

WHEN 'TCODE1'.

<PARAMETER NAME> = 'UR TEXT'.

WHEN 'TCODE2'.

<PARAMETER NAME> = 'UR TEXT'.

ENDCASE.

rgds,

bharat.

Read only

Former Member
0 Likes
707

hi,

case sy-tcode.

when tcode1.

p_val = '1234'.

when tcode2.

p_val = '3456'.

endcase.

Reward with points if helpful.

Read only

graghavendra_sharma
Contributor
0 Likes
707

Hi

What do you mean by "based on Tcode".

Can you pls elaborate?