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: 

write command

Former Member
0 Kudos

how i can use write in

event AT SELECTION-SCREEN.

5 REPLIES 5

former_member186746
Active Contributor
0 Kudos

you can't, use SELECTION-SCREEN COMMENT

also goto se38, press CTRL+F8, type in SELECTION-SCREEN and read everything you can find about selection screens in the ABAP help.

Former Member
0 Kudos

Hi,

We can not use the WRITE command in this Event

The event AT SELECTION-SCREEN is the basic form of a whole series of events that occur while the selection screen is being processed.

The standard selection screen in an executable program or in the logical database linked to it is automatically called between the INITIALIZATION and START-OF-SELECTION events. When you call the selection screen, and when users interact with it, the ABAP runtime environment generates selection screen events, which occur between INITIALIZATION and START-OF-SELECTION.

You can define event blocks for these events in your program to change the selection screen or process user input.

You can use the COMMENT to write the text in the selection screen ..

To place comments on the selection screen, you use:

SELECTION-SCREEN COMMENT [/]pos(len) comm [FOR FIELD f]

[MODIF ID key].

This statement writes the comm comment on the selection screen. For comm, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length len. The field must be filled before the selection screen is called. You must always specify the pos(len) addition. Only if there are several elements in one line can you omit pos.

The text comm will be displayed, starting in column pos, for a length of len. If you do not use a slash (/), the comment is written into the current line; otherwise a new line is created.

You use FOR FIELD f to assign a field label to the comment. f can be the name of a parameter or a selection criterion. As a result, if the user requests help on the comment on the selection screen, the help text for the assigned field f is displayed.

The MODIF ID keyaddition has the same function as for the PARAMETERS statement. You can use it to modify the comment before the selection screen is called.

Here is the exampel Program

REPORT demo_sel_screen_select_comment.

SELECTION-SCREEN COMMENT /2(50) text-001 MODIF ID sc1.

SELECTION-SCREEN SKIP 2.

SELECTION-SCREEN COMMENT /10(30) comm1.

SELECTION-SCREEN ULINE.

PARAMETERS: r1 RADIOBUTTON GROUP rad1,

r2 RADIOBUTTON GROUP rad1,

r3 RADIOBUTTON GROUP rad1.

SELECTION-SCREEN ULINE /1(50).

SELECTION-SCREEN COMMENT /10(30) comm2.

SELECTION-SCREEN ULINE.

PARAMETERS: s1 RADIOBUTTON GROUP rad2,

s2 RADIOBUTTON GROUP rad2,

s3 RADIOBUTTON GROUP rad2.

SELECTION-SCREEN ULINE /1(50).

INITIALIZATION.

COMM1 ='Radio Button Group 1'.

COMM2 ='Radio Button Group 2'.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-intensified = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards

Sudheer

Former Member
0 Kudos

u cant write any thing

Former Member
0 Kudos

You can't use WRITE statement in AT SELECTION-SCREEN event..

because in this event nothing is written on the selection-screen,

but u can use

WRITE fld1 To fld2.

Reward if useful

Regards

Pradeep

Former Member
0 Kudos

hi,

end-of-selection event after outputting basic list we ll go for at line-selection event.

in at line selection event we use two system variables sy-lsind and sy-lisel or [hide] based on our requirement.

u can use write st in at line-selection event as.

at line-selection.

case sy-lisnd.

when 'itab-matnr'.

write :/10 itab-............

...................

...................

when 'itab-mtart'.

..........................

. ........................

endcase.

if helpful reward some points.

with regards,

Suresh Aluri.