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: 

at selection-screen on end of

Former Member
0 Kudos

hi to all pls tellabt the event at selection-screen on end of and at selection-on block

plsa give some sample coding on theese points will be rewarded

4 REPLIES 4

Former Member
0 Kudos

Hi

You are mixing up the things

You need to know separately about At selection-screen and its events

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

select-options:s_bukrs for t001-bukrs no intervals no-extension

obligatory,

s_vkorg for tvko-vkorg no intervals no-extension,

s_vtweg for tvtw-vtweg no intervals no-extension,

s_spart for tspa-spart no intervals no-extension,

s_werks for t001w-werks no intervals no-extension,

s_kunag for kna1-kunnr,

s_vbeln for vbuk-vbeln,

s_fkart for tvfk-fkart,

s_fkdat for vbrk-fkdat obligatory.

selection-screen begin of line.

selection-screen comment 1(20) text-008.

selection-screen end of line.

selection-screen begin of line.

parameters p_cust type c radiobutton group cust.

selection-screen comment 3(20) text-004 for field p_cust.

selection-screen end of line.

selection-screen begin of line.

parameters p_mode type c radiobutton group cust.

selection-screen comment 3(20) text-006 for field p_mode.

selection-screen end of line.

selection-screen begin of line.

parameters p_dens type c radiobutton group cust.

selection-screen comment 3(20) text-007 for field p_dens.

selection-screen end of line.

selection-screen: end of block b1.

And the Events related to Internal table like AT NEW and AT END OF

All this AT NEW, AT FIRST, AT END OF and AT LAST are called control break statements of Internal tables and are used to calculate the TOTALS based on sertain key fields in that internal table

FIrst to use these statements the ITAB has to be sorted by the key fields on whcih you need the SUM of the fields.

Some time you will get * when mopving data from this int table to other table using these commands

so you have to use

READ TABLE ITAB INDEX SY-TABIX in AT..ENDAT..if you are using other fields between them

DATA: sflight_tab TYPE SORTED TABLE OF sflight

WITH UNIQUE KEY carrid connid fldate,

sflight_wa LIKE LINE OF sflight_tab.

SELECT *

FROM sflight

INTO TABLE sflight_tab.

LOOP AT sflight_tab INTO sflight_wa.

AT NEW connid.

WRITE: / sflight_wa-carrid,

sflight_wa-connid.

ULINE.

ENDAT.

WRITE: / sflight_wa-fldate,

sflight_wa-seatsocc.

AT END OF connid.

SUM.

ULINE.

WRITE: / 'Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

SKIP.

ENDAT.

AT END OF carrid.

SUM.

ULINE.

WRITE: / 'Carrier Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

NEW-PAGE.

ENDAT.

AT LAST.

SUM.

WRITE: / 'Overall Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

ENDAT.

ENDLOOP.

Reward points for useful Answers

Regards

Anji

former_member208856
Active Contributor
0 Kudos

Hi,

Check this code :

tables : lfa1, bseg, ekko, eket.

SELECTION-SCREEN BEGIN OF BLOCK purchase WITH FRAME TITLE text-001.

SELECT-OPTIONS : so_v_no FOR lfa1-lifnr,

so_c_cod FOR bseg-bukrs,

so_p_typ FOR ekko-bsart,

so_qt_op FOR eket-wemng.

SELECTION-SCREEN END OF BLOCK purchase.

Reward, if helpful,

Sandeep Kaushik

Former Member
0 Kudos

AT for Control Levels

Control level change when you process extracts and internal tables in a loop.

Syntax

AT NEW <f>.

AT END OF <f>.

AT FIRST.

AT LAST.

AT <fg>.

These statements are used in control level processing with extract datasets or internal tables. Each introduces a statement block that you must conclude with the ENDAT statement. The statements between AT and ENDAT are executed whenever the corresponding control level change occurs.

for more info go to SDN library.

Former Member
0 Kudos

Hi,

At selection screen event is used to change the properties of selection screen dynamically.

There are variations for this event.they are

at selection screen on field

at selection screen on block

at selection screen on value-request

at selection screen on help-request

but there is no event at selection screen on end of.