Application Development 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: 

default text

Former Member
0 Kudos
173

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

Former Member
0 Kudos
140

Hi.

do this

parameters: text(15).


initialization.

text = 'MH/12345/'.

0 Kudos
140

i need to display on screen.

0 Kudos
140

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.

0 Kudos
140

PBO.

MODULE INIT.

MODULE INIT.

text = 'MH/4567/bdft'.

ENDMODULE.

Former Member
0 Kudos
140

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.

Former Member
0 Kudos
140

Hello ,

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

screen field = 'XYZ' .(eg)

Praveen

Former Member
0 Kudos
140

Hi panse,



 data: text type i.

INITIALIZATION.
text = 'MH/12345/'.

PBO


      ztab-fieldname = text.

Hope it will help you.

Thanks

Arun

Former Member
0 Kudos
140

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