Anda di halaman 1dari 6

11/07/13

Row selection of ALV grid

Tweet

Share

Row selection of ALV grid


The follow abap program demonstrates how to capture which rows of the ALV grid the user has selected. Changes required from a basic ALV grid include adding a new field to ALV grid data table(it_ekko-sel) and adding an entry to the layout control table (gd_layout-box_fieldname = 'SEL'). Please note you need to use the SHIFT and CONTROL keys to select multiple rows!

SAP Jobs - Post a Job SAP Security Analyst


30/6/2013 10:44:56

SAP Security Analyst(Job Number: INF0005IY) JOIN US AS AN ANALYST (SAP Security), SAP Center of Excellence Similar Industry ... Sr Project Manager - SAP Release Management
12/6/2013 09:28:13

Sr Project Manager - SAP Release Management(Job Number: INF00052J) JOIN US AS A SENIOR PROJECT MANAGER Similar Industry ...

View more Jobs

Join the Mailing List Enter your name and email address below: Name: Email: Subscribe Unsubscribe

GO
Get your Free Mailing List
by Brav enet.com

www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm

1/6

11/07/13

Row selection of ALV grid

* & * * &R e p o r t Z D E M O _ A L V G R I D _ S E L R O W * * & * * & * * & * * &E x a m p l eo fas i m p l eA L VG r i dR e p o r t * * &. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * * & * * &T h eb a s i cA L Vg r i d ,E n h a n c e dt od i s p l a yc a p t u r ee a c hr o wa * * &u s e rh a ss e l e c t e d * * & * R E P O R T z d e m o _ a l v g r i d _ s e l r o w T A B L E S : e k k o . " A L VD e c l a r a t i o n s .

t y p e p o o l s :s l i s . * D a t aD e c l a r a t i o n * T Y P E S :B E G I NO Ft _ e k k o , S E l , e b e l nT Y P Ee k p o e b e l n , e b e l pT Y P Ee k p o e b e l p , s t a t uT Y P Ee k p o s t a t u , a e d a tT Y P Ee k p o a e d a t , m a t n rT Y P Ee k p o m a t n r , m e n g eT Y P Ee k p o m e n g e , m e i n sT Y P Ee k p o m e i n s , n e t p rT Y P Ee k p o n e t p r , p e i n hT Y P Ee k p o p e i n h , E N DO Ft _ e k k o .

" s t o r e sw h i c hr o wu s e rh a ss e l e c t e d

D A T A :i t _ e k k oT Y P ES T A N D A R DT A B L EO Ft _ e k k oI N I T I A LS I Z E0 ,

www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm

2/6

11/07/13
w a _ e k k oT Y P Et _ e k k o .

Row selection of ALV grid

* A L Vd a t ad e c l a r a t i o n s d a t a :f i e l d c a t a l o gt y p es l i s _ t _ f i e l d c a t _ a l vw i t hh e a d e rl i n e , g d _ t a b _ g r o u pt y p es l i s _ t _ s p _ g r o u p _ a l v , g d _ l a y o u t t y p es l i s _ l a y o u t _ a l v , g d _ r e p i d l i k es y r e p i d . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * S t a r t o f s e l e c t i o n . S T A R T O F S E L E C T I O N . p e r f o r md a t a _ r e t r i e v a l . p e r f o r mb u i l d _ f i e l d c a t a l o g . p e r f o r mb u i l d _ l a y o u t . p e r f o r md i s p l a y _ a l v _ r e p o r t . * & * * & F o r m B U I L D _ F I E L D C A T A L O G * & * * B u i l dF i e l d c a t a l o gf o rA L VR e p o r t * * f o r mb u i l d _ f i e l d c a t a l o g . *T h e r ea r ean u m b e ro fw a y st oc r e a t eaf i e l d c a t . *F o rt h ep u r p o s eo ft h i se x a m p l eiw i l lb u i l dt h ef i e l d c a t a l o gm a n u a l y *b yp o p u l a t i n gt h ei n t e r n a lt a b l ef i e l d si n d i v i d u a l l ya n dt h e n *a p p e n d i n gt h er o w s .T h i sm e t h o dc a nb et h em o s tt i m ec o n s u m i n gb u tc a n *a l s oa l l o wy o u m o r ec o n t r o lo ft h ef i n a lp r o d u c t . *B e w a r et h o u g h ,y o un e e dt oe n s u r et h a ta l lf i e l d sr e q u i r e da r e *p o p u l a t e d .W h e nu s i n gs o m eo ff u n c t i o n a l i t ya v a i l a b l ev i aA L V ,s u c ha s *t o t a l .Y o um a yn e e dt op r o v i d em o r ei n f o r m a t i o nt h a ni fy o uw e r e *s i m p l yd i s p l a y i n gt h er e s u l t * I . e .F i e l dt y p em a yb er e q u i r e di n o r d e rf o r * t h e' T O T A L 'f u n c t i o nt ow o r k . f i e l d c a t a l o g f i e l d n a m e =' E B E L N ' . f i e l d c a t a l o g s e l t e x t _ m =' P u r c h a s eO r d e r ' . f i e l d c a t a l o g c o l _ p o s =0 . f i e l d c a t a l o g o u t p u t l e n =1 0 . f i e l d c a t a l o g e m p h a s i z e =' X ' . f i e l d c a t a l o g k e y =' X ' . * f i e l d c a t a l o g d o _ s u m =' X ' . * f i e l d c a t a l o g n o _ z e r o =' X ' . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' E B E L P ' . f i e l d c a t a l o g s e l t e x t _ m =' P OI t e m ' . f i e l d c a t a l o g c o l _ p o s =1 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' S T A T U ' . f i e l d c a t a l o g s e l t e x t _ m =' S t a t u s ' . f i e l d c a t a l o g c o l _ p o s =2 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' A E D A T ' . f i e l d c a t a l o g s e l t e x t _ m =' I t e mc h a n g ed a t e ' . f i e l d c a t a l o g c o l _ p o s =3 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' M A T N R ' . f i e l d c a t a l o g s e l t e x t _ m =' M a t e r i a lN u m b e r ' . f i e l d c a t a l o g c o l _ p o s =4 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' M E N G E ' . f i e l d c a t a l o g s e l t e x t _ m =' P Oq u a n t i t y ' . f i e l d c a t a l o g c o l _ p o s =5 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g .

www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm

3/6

11/07/13

Row selection of ALV grid


f i e l d c a t a l o g f i e l d n a m e =' M E I N S ' . f i e l d c a t a l o g s e l t e x t _ m =' O r d e rU n i t ' . f i e l d c a t a l o g c o l _ p o s =6 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' N E T P R ' . f i e l d c a t a l o g s e l t e x t _ m =' N e tP r i c e ' . f i e l d c a t a l o g c o l _ p o s =7 . f i e l d c a t a l o g o u t p u t l e n =1 5 . f i e l d c a t a l o g d o _ s u m =' X ' . " D i s p l a yc o l u m nt o t a l f i e l d c a t a l o g d a t a t y p e =' C U R R ' . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . f i e l d c a t a l o g f i e l d n a m e =' P E I N H ' . f i e l d c a t a l o g s e l t e x t _ m =' P r i c eU n i t ' . f i e l d c a t a l o g c o l _ p o s =8 . a p p e n df i e l d c a t a l o gt of i e l d c a t a l o g . c l e a r f i e l d c a t a l o g . e n d f o r m . "B U I L D _ F I E L D C A T A L O G * & * * & F o r m B U I L D _ L A Y O U T * & * * B u i l dl a y o u tf o rA L Vg r i dr e p o r t * * f o r mb u i l d _ l a y o u t . g d _ l a y o u t b o x _ f i e l d n a m e =' S E L ' . " s e tf i e l dn a m et os t o r er o ws e l e c t i o n g d _ l a y o u t e d i t =' X ' ." m a k e sw h o l eA L Vt a b l ee d i t a b l e g d _ l a y o u t z e b r a =' X ' . e n d f o r m . "B U I L D _ L A Y O U T * & * * & F o r m D I S P L A Y _ A L V _ R E P O R T * & * * D i s p l a yr e p o r tu s i n gA L Vg r i d * * f o r md i s p l a y _ a l v _ r e p o r t . g d _ r e p i d=s y r e p i d . c a l lf u n c t i o n' R E U S E _ A L V _ G R I D _ D I S P L A Y ' e x p o r t i n g i _ c a l l b a c k _ p r o g r a m =g d _ r e p i d * i _ c a l l b a c k _ t o p _ o f _ p a g e =' T O P O F P A G E ' " s e eF O R M i _ c a l l b a c k _ u s e r _ c o m m a n d=' U S E R _ C O M M A N D ' * i _ g r i d _ t i t l e =o u t t e x t i s _ l a y o u t =g d _ l a y o u t i t _ f i e l d c a t =f i e l d c a t a l o g [ ] * i t _ s p e c i a l _ g r o u p s =g d _ t a b g r o u p * I T _ E V E N T S =G T _ X E V E N T S i _ s a v e =' X ' * i s _ v a r i a n t =z _ t e m p l a t e t a b l e s t _ o u t t a b =i t _ e k k o e x c e p t i o n s p r o g r a m _ e r r o r =1 o t h e r s =2 . i fs y s u b r c< >0 . *M E S S A G EI DS Y M S G I DT Y P ES Y M S G T YN U M B E RS Y M S G N O * W I T HS Y M S G V 1S Y M S G V 2S Y M S G V 3S Y M S G V 4 . e n d i f . e n d f o r m . "D I S P L A Y _ A L V _ R E P O R T * & * * & F o r m D A T A _ R E T R I E V A L * & * * R e t r i e v ed a t af o r mE K P Ot a b l ea n dp o p u l a t ei t a bi t _ e k k o * * f o r md a t a _ r e t r i e v a l . s e l e c te b e l ne b e l ps t a t ua e d a tm a t n rm e n g em e i n sn e t p rp e i n h u pt o1 0r o w s f r o me k p o

www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm

4/6

11/07/13

Row selection of ALV grid


i n t oc o r r e s p o n d i n gf i e l d so ft a b l ei t _ e k k o . e n d f o r m . "D A T A _ R E T R I E V A L * * * F O R MU S E R _ C O M M A N D * * * * >R _ U C O M M * * >R S _ S E L F I E L D * * * F O R Mu s e r _ c o m m a n dU S I N Gr _ u c o m mL I K Es y u c o m m r s _ s e l f i e l dT Y P Es l i s _ s e l f i e l d . *C h e c kf u n c t i o nc o d e C A S Er _ u c o m m . W H E N' & I C 1 ' . * C h e c kf i e l dc l i c k e do nw i t h i nA L V g r i dr e p o r t I Fr s _ s e l f i e l d f i e l d n a m e=' E B E L N ' . * R e a dd a t at a b l e ,u s i n gi n d e xo fr o wu s e rc l i c k e do n R E A DT A B L Ei t _ e k k oI N T Ow a _ e k k oI N D E Xr s _ s e l f i e l d t a b i n d e x . * S e tp a r a m e t e rI Df o rt r a n s a c t i o ns c r e e nf i e l d S E TP A R A M E T E RI D' B E S 'F I E L Dw a _ e k k o e b e l n . * S x e c u t et r a n s a c t i o nM E 2 3 N ,a n ds k i pi n i t i a ld a t ae n t r ys c r e e n C A L LT R A N S A C T I O N' M E 2 3 N 'A N DS K I PF I R S TS C R E E N . E N D I F . W H E N' & D A T A _ S A V E ' . " u s e rp r e s s e sS A V E l o o pa ti t _ e k k oi n t ow a _ e k k o . i fw a _ e k k o s e lE Q' X ' . * P r o c e s sr e c o r d st h a th a v eb e e ns e l e c t e d e n d i f . e n d l o o p . E N D C A S E . E N D F O R M .

Comment (1)
Sort by: Date Rating Last Activity Sidd 112 weeks ago Nice informative article.. Reply 0

Login

Report

Post a new comment


Enter text right here!

Comment as a Guest, or login: Name Email Website (optional)


If you have a website, link to it here.

Displayed next to your comments. Not displayed publicly.

Subscribe to None SAP Development Help

Submit Comment

www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm

5/6

11/07/13

Row selection of ALV grid

SAP Development ABAP SAP Reporting Progress Indicator Selection Screen Send Emails ALV Reports

Search

Jobs from Indeed


What: title, keyw ords Where: city, state, or zip

Find Jobs

jobs by

Contact Us

Partners

Terms of Service

Privacy Policy

Advertise

www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm

6/6

Anda mungkin juga menyukai