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

default text

Former Member
0 Likes
1,010

Hi frieds,

I have a problem. I m making module pool program. In have a a text field.

In this text field i need to give some default letters like 'MH/12345/______'.

When we run the screen this default letters should be defaultly display

and insteed of the blank place(_____)user input some value.

When user will press save button this text filed will save on database table along with default letters.

Thanks in advance.

Swapnika

8 REPLIES 8
Read only

Former Member
0 Likes
977

Hi.

do this

parameters: text(15).


initialization.

text = 'MH/12345/'.

Read only

0 Likes
977

i need to display on screen.

Read only

0 Likes
977

and for saving record and showing push button add the following code

PARAMETERS: text(15).

INITIALIZATION.
text = 'MH/12345/'.

SELECTION-SCREEN  PUSHBUTTON 65(15)  but1 USER-COMMAND save VISIBLE LENGTH 3.

AT SELECTION-SCREEN.
  CASE sy-ucomm.
    WHEN 'SAVE'.
      ztab-fieldname = text.
  ENDCASE.

Read only

0 Likes
977

PBO.

MODULE INIT.

MODULE INIT.

text = 'MH/4567/bdft'.

ENDMODULE.

Read only

Former Member
0 Likes
977

Hi,

See the below example:

DATA: str(10) type c VALUE 'MH/12345/',

str1 type string.

PARAMETER: file TYPE string DEFAULT str.

When 'SAVE'.

do ur things.

Hope this helps u.

Thanks.

Read only

Former Member
0 Likes
977

Hello ,

Use PBO event to pass the default value to your screen field.

screen field = 'XYZ' .(eg)

Praveen

Read only

Former Member
0 Likes
977

Hi panse,



 data: text type i.

INITIALIZATION.
text = 'MH/12345/'.

PBO


      ztab-fieldname = text.

Hope it will help you.

Thanks

Arun

Read only

Former Member
0 Likes
977

Hi,

You can write like:

data: text(15) type c.

Then in the Initialization Event,you can give the default value to this text declared.

Initialization.

text = 'MH/12345/'.

Hope it helps you

Regrds

Mansi