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

Parameter default value

Former Member
0 Likes
1,023

Hello,

I have a parameter and i want to assign a default value into this. But this default value is a variable.

where should i define this variable?

ex:


selection-screen begin of block bl with frame title text-001.

parameters : P_SPMON LIKE AYLAR-AY_ADI  DEFAULT GV_AY,

selection-screen end of block bl.

i want to calculate gv_ay outside of selection screen. Where is the appropriate place to calculate it?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
986

Hi,

Please see the SCN Rules before Posting.

Refer help.sap.com or google or search the SCN before Posting.

With Regards,

Sumodh.P

6 REPLIES 6
Read only

Former Member
0 Likes
986

You cannot assign a dynamic variable as a default value in the parameter statement. Assign the required variable to the parameter in the INITIALIZATION event.

Vikranth

Read only

0 Likes
986

I tried it but although i fill my value (gv_ay) in initialization part i cannot still see it in my parameter.

Read only

0 Likes
986

Can you show us the code which you are trying?

Read only

0 Likes
986

parameters : P_SPMON LIKE AYLAR-AY_ADI DEFAULT GV_AY,

remove the comma at end from the above statement and try it once.

data:gv type c value 'A'.

parameters : P_SPMON type c .

INITIALIZATION.

p_spmon = gv.

Read only

Former Member
0 Likes
987

Hi,

Please see the SCN Rules before Posting.

Refer help.sap.com or google or search the SCN before Posting.

With Regards,

Sumodh.P

Read only

Former Member
0 Likes
986

Moderator message - Please do not ask or answer basic questions - Points reassigned and thread locked