You are on page 1of 12

Ms

Siguiente blog

Crear un blog

SAP ABAP
W E D N E S D A Y ,3 0M A Y2 0 1 2 ABOUT ME

MODULE POOL
S I M P L EP R O G R A MO NM O D U L EP O O L S c e n a r i o:H e r ew ew o u l dd e s i g nas i n g l es c r e e n ( 9 0 0 0 )w i t ht w oi / pf i e l d s&o n eo / pf i e l d .U p o n e n t e r i n gt h ev a l u e si nt h ei / pf i e l d ,i ft h eu s e rc l i c k so nt h ea d db u t t o nt h e nt h es u mw i l lb e d i s p l a y e di nt h eo / pf i e l d . S t e p 1 .G ot oS E 8 0 .C h o o s eP r o g r a mA n dG i v eaN a m e(z m p _ t e s t 1)a n dp r e s sE n t e r .

Siva Prasad Jena

View my complete profil

BLOG ARCHIVE 2013 ( 4 3 ) 2012 ( 1 4 ) June ( 1 ) May ( 7 )

MODULE POOL EXCEPTION HANDLING OOABAP PROGRAMS FIELD SYMBOLS

Step-2. Choose Yes .


S t e p3 .U n c h e c kt h e c h e c kb o xa n dC l i c k Y e sb u t t o n .

ALV REPORTS INTERACTIVE REPORTS CLASSICAL REPORT PROGRAMS


April ( 6 )

POPULAR POSTS

S t e p 4 .S e l e c tM o d u l e P o o lF r o mt h eT y p e a n dC l i c ko nS a v e b u t t o n .

MODULE POOL OO

ALV WITH CONTAINERS INTERACTIVE REPORTS CLASSICAL REPORT PROGRAMS EXCEPTION HANDLING ABAP AND SAP MEMORY ALV REPORTS
S t e p 5 .C l i c ko nL o c a lO b j e c tT os a v ei tl o c a lp a c k a g e( $ T M P ) . S t e p 6 .D o u b l eC l i c ko nP r o g r a mN a m e&C l i c ko nC h a n g eB u t t o n .

FIELD SYMBOLS ABAP System Variables

Creation of Table Control in Module Pool Program

POPULAR POSTS

MODULE POOL OO

S t e p 7 .C r e a t eA s c r e e n-r i g h tc l i c k o nP r o g r a mN a m e> C r e a t e > S c r e e n

ALV WITH CONTAINERS INTERACTIVE REPORTS CLASSICAL REPORT PROGRAMS EXCEPTION HANDLING ABAP AND SAP MEMORY

S t e p 8 . G i v eS c r e e n n u m b e r-9 0 0 0&c l i c k o nY e sB u t t o n .

ALV REPORTS FIELD SYMBOLS ABAP System Variables

S t e p 9 .G i v eas h o r t D e s c r i p t i o n& I t ' sa n o r m a lS c r e e n .

Creation of Table Control in Module Pool Program


S t e p 1 0 .C l i c ko n l a y o u tB u t t o n&t h e S c r e e nP a i n t e rW i n d o w w i l la p p e a r.

S t e p 1 1 .C r e a t et w o i n p u tf i e l d s,o n e p u s hb u t t o n&a n o u t p u tf i e l d&a t l a s tc l i c ko nf l o w l o g i cb u t t o no nt h e t o o l b a r .

S t e p 1 2 . N o wu n c o m m e n tt h et w om o d u l e si nP B O&P A I.D o u b l ec l i c ko nt h em o d u l en a m ea n dc r e a t ei ti n m a i np r o g r a m .

S t e p 1 3 .W r i t et h e c o d ei nt h ep r o g r a m . P R O G R A M z m p _ t e s t 1 . D A T A:n u m 1T Y P Ei , n u m 2T Y P Ei , r e sT Y P Ei .

M O D U L Es t a t u s _ 9 0 0 0O U T P U T . S E TP F S T A T U S' S T A T U S ' . * S E TT I T L E B A R' x x x ' . E N D M O D U L E . "S T A T U S _ 9 0 0 0 O U T P U T

M O D U L Eu s e r _ c o m m a n d _ 9 0 0 0I N P U T . C A S Es y u c o m m . W H E N' S H O W ' . r e s=n u m 1+n u m 2 . W H E N' B A C K 'O R' E X I T 'O R' C A N C E L ' . L E A V EP R O G R A M . E N D C A S E . E N D M O D U L E . "U S E R _ C O M M A N D _ 9 0 0 0 I N P U T S t e p 1 4 .U n c o m m e n tt h eS E TP F S T A T U S' X X X X ' l i n e a n dg i v ea n yn a m e ( S T A T U S )&d o u b l ec l i c k o ni tt o c r e a t ei t .F r o mt h ep o p u pc l i c ko ny e s. S t e p 1 5 .G i v eA s h o r tt e x ta n dC l i c k o ny e sb u t t o n .

S t e p 1 6 .C l i c ko nt h e( + )B u t t o no nt h er i g h to fF u n c t i o nk e y st oe x p a n di t .G i v eS A V E ,B A C K , C A N C E Li nt h es t a n d a r dt o o l b a r&a c t i v a t ei ta n dp r e s sb a c kb u t t o nt oc o m eb a c kt ot h ep r o g r a m .

E X I T&

S t e p 1 7 .N o wc r e a t eat r a n s a c t i o nc o d ef o rt h ep r o g r a m .R i g h tc l i c ko np r o g r a mn a m e > c r e a t e > t r a n s a c t i o n .

S t e p 1 8 .G i v eaT c o d e ,s h o r t d e s c r i p t i o na n dc l i c k y e sb u t t o n .

S t e p 1 9 .G i v ep r o g r a mn a m e,s c r e e nn u m b e ra n dc l i c ko nt h et h r e ec h e c kb o x e sa n dt h e nc l i c ko ns a v e b u t t o no nt h es t a n d a r dt o o l b a r .C l i c ko nb a c kb u t t o nt oc o m et h ep r o g r a m .

S t e p 2 0 .N o w o p e nan e ws e s s i o na n dp u tt h eT c o d eo ft h ep r o g r a mi nt h eC o m m a n df i e l da n dp r e s s E n t e r .

S t e p 2 1 .F i l lt h et w oi n p u tf i e l dw i t hs o m ev a l u e sa n dt h e np r e s sA D Db u t t o n .F i n dt h eR e s u l t .

P R O G R A MD E M O N S T R A T I N G( O NI N P U T ) d a t a:N 1t y p ei . d a t a:N 2t y p ei . d a t a:o k _ c o d et y p es y u c o m m . m o d u l eS T A T U S _ 9 0 0 0o u t p u t . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' .

e n d m o d u l e .

"S T A T U S _ 9 0 0 0 O U T P U T

m o d u l eU S E R _ C O M M A N D _ 9 0 0 0i n p u t . C A S EO K _ C O D E . W H E N' S H O W ' . C A L L S C R E E N9 0 0 1 . E N D C A S E . e n d m o d u l e . m o d u l eS T A T U S _ 9 0 0 1o u t p u t . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . N 2=N 1 . e n d m o d u l e . "S T A T U S _ 9 0 0 1 O U T P U T "U S E R _ C O M M A N D _ 9 0 0 0 I N P U T

m o d u l eU S E R _ C O M M A N D _ 9 0 0 1i n p u t . C A S EO K _ C O D E . W H E N' B A C K ' . C A L LS C R E E N9 0 0 0 . E N D C A S E . e n d m o d u l e . "U S E R _ C O M M A N D _ 9 0 0 1 I N P U T

m o d u l eC H E C K _ N 1i n p u t . N 1=N 1+1 0 . e n d m o d u l e . "C H E C K _ M 1 I N P U T

F L O WL O G I CO FS C R E E N9 0 0 0
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 0 . P R O C E S SA F T E RI N P U T . F I E L DN 1M O D U L EC H E C K _ N 1O NI N P U T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 0 .

F L O WL O G I CO FS C R E E N9 0 0 1
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 1 . P R O C E S SA F T E RI N P U T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 1 .

R u nt h ep r o g r a ma n di fy o ug i v ea n yv a l u et ot h ei n p u tf i e l d( n 1 )t h e no n l y

C H E C K _ N 1 m o d u l ew i l l

e x e c u t e.p r e s sS H O W&B A C Kb u t t o nm a n yt i m e st os e et h ec h a n g e .I fi tf i n d sa n yv a l u ei nt h ei n p u t f i e l d( n 1 )t h e ne v e r yt i m e C H E C K _ N 1m o d u l ew i l le x e c u t ea n di tw i l la d du p1 0t oi t sv a l u e . P R O G R A MD E M O N S T R A T I N G( O NR E Q U E S T ) d a t a:N 1t y p ei . d a t a:N 2t y p ei . d a t a:o k _ c o d et y p es y u c o m m . m o d u l eS T A T U S _ 9 0 0 0o u t p u t . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . e n d m o d u l e . "S T A T U S _ 9 0 0 0 O U T P U T

m o d u l eU S E R _ C O M M A N D _ 9 0 0 0i n p u t . C A S EO K _ C O D E . W H E N' S H O W ' . C A L L S C R E E N9 0 0 1 . E N D C A S E . e n d m o d u l e . m o d u l eS T A T U S _ 9 0 0 1o u t p u t . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . N 2=N 1 . e n d m o d u l e . "S T A T U S _ 9 0 0 1 O U T P U T "U S E R _ C O M M A N D _ 9 0 0 0 I N P U T

m o d u l eU S E R _ C O M M A N D _ 9 0 0 1i n p u t . C A S EO K _ C O D E . W H E N' B A C K ' . C A L LS C R E E N9 0 0 0 . E N D C A S E . e n d m o d u l e . m o d u l eC H E C K _ N 1i n p u t . N 1=N 1+2 0 . e n d m o d u l e . "C K E C K _ N 1 I N P U T "U S E R _ C O M M A N D _ 9 0 0 1 I N P U T

F L O WL O G I CO FS C R E E N9 0 0 0
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 0 . * P R O C E S SA F T E RI N P U T . f i e l dN 1M O D U L EC H E C K _ N 1o nR E Q U E S T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 0 .

F L O WL O G I CO FS C R E E N9 0 0 1
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 1 . * P R O C E S SA F T E RI N P U T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 1 . R u nt h ep r o g r a ma n di fy o ug i v ea n yv a l u et ot h ei n p u tf i e l d( n 1 )t h e no n l y e x e c u t e.p r e s sS H O W&B A C Kb u t t o nm a n yt i m e st os e et h ec h a n g e . P R O G R A MD E M O N S T R A T I N G( O NC H A I N I N P U T ) D A T A:N 1T Y P Ei . D A T A:N 2T Y P Ei . D A T A:N 3T Y P Ei . D A T A:r e sT Y P Ei . D A T A:o k _ c o d eT Y P Es y u c o m m . M O D U L Es t a t u s _ 9 0 0 0O U T P U T . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . E N D M O D U L E . "S T A T U S _ 9 0 0 0 O U T P U T C H E C K _ N 1 m o d u l ew i l l

M O D U L Eu s e r _ c o m m a n d _ 9 0 0 0I N P U T . C A S Eo k _ c o d e . W H E N' A D D ' . C A L L S C R E E N9 0 0 1 .

E N D C A S E . E N D M O D U L E . M O D U L Es t a t u s _ 9 0 0 1O U T P U T . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . r e s=N 1+N 2+N 3 . E N D M O D U L E . "S T A T U S _ 9 0 0 1 O U T P U T "U S E R _ C O M M A N D _ 9 0 0 0 I N P U T

M O D U L Eu s e r _ c o m m a n d _ 9 0 0 1I N P U T . C A S Eo k _ c o d e . W H E N' B A C K ' . C A L LS C R E E N9 0 0 0 . E N D C A S E . E N D M O D U L E . "U S E R _ C O M M A N D _ 9 0 0 1 I N P U T

m o d u l eC H E C K _ T W O _ N U M B E Ri n p u t . N 1=N 1+1 0 . N 2=N 2+1 0 . e n d m o d u l e . "C K E C K _ T H R E E _ N U M B E R I N P U T

F L O WL O G I CO FS C R E E N9 0 0 0
P R O C E S SB E F O R EO U T P U T . M O D U L Es t a t u s _ 9 0 0 0 . P R O C E S SA F T E RI N P U T . C H A I N . F I E L D:N 1 , N 2 . M O D U L EC H E C K _ T W O _ N U M B E RO NC H A I N I N P U T . E N D C H A I N . M O D U L Eu s e r _ c o m m a n d _ 9 0 0 0 .

F L O WL O G I CO FS C R E E N9 0 0 1
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 1 . P R O C E S SA F T E RI N P U T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 1 .

R u nt h ep r o g r a ma n di fy o up r o v i d ea n yv a l u et oe i t h e rn 1o rn 2 o rb o t h t h e no n l y C H E C K _ T W O _ N U M B E R m o d u l ew i l le x e c u t e.p r e s sA D D&B A C Kb u t t o nm a n yt i m e st os e et h ec h a n g e . P R O G R A MD E M O N S T R A T I N G( O NC H A I N R E Q U E S T ) D A T A:N 1T Y P Ei . D A T A:N 2T Y P Ei . D A T A:N 3T Y P Ei . D A T A:r e sT Y P Ei . D A T A:o k _ c o d eT Y P Es y u c o m m . M O D U L Es t a t u s _ 9 0 0 0O U T P U T . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . E N D M O D U L E . "S T A T U S _ 9 0 0 0 O U T P U T

M O D U L Eu s e r _ c o m m a n d _ 9 0 0 0I N P U T . C A S Eo k _ c o d e . W H E N' A D D ' . C A L L S C R E E N9 0 0 1 . E N D C A S E . E N D M O D U L E . M O D U L Es t a t u s _ 9 0 0 1O U T P U T . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . r e s=N 1+N 2+N 3 . E N D M O D U L E . "S T A T U S _ 9 0 0 1 O U T P U T "U S E R _ C O M M A N D _ 9 0 0 0 I N P U T

M O D U L Eu s e r _ c o m m a n d _ 9 0 0 1I N P U T . C A S Eo k _ c o d e . W H E N' B A C K ' . C A L LS C R E E N9 0 0 0 . E N D C A S E . E N D M O D U L E . "U S E R _ C O M M A N D _ 9 0 0 1 I N P U T

m o d u l eC H E C K _ T W O _ N U M B E Ri n p u t . N 1=N 1+1 0 . N 2=N 2+1 0 . e n d m o d u l e . P R O C E S SB E F O R EO U T P U T . M O D U L Es t a t u s _ 9 0 0 0 . P R O C E S SA F T E RI N P U T . C H A I N . F I E L D:N 1 , N 2 . M O D U L EC H E C K _ T W O _ N U M B E RO NC H A I N R E Q U E S T . E N D C H A I N . M O D U L Eu s e r _ c o m m a n d _ 9 0 0 0 . "C K E C K _ T W O _ N U M B E R I N P U T

F L O WL O G I CO FS C R E E N9 0 0 0

F L O WL O G I CO FS C R E E N9 0 0 1
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 1 . P R O C E S SA F T E RI N P U T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 1 . R u nt h ep r o g r a ma n di fy o up r o v i d ea n yv a l u et oe i t h e rn 1o rn 2 o rb o t h t h e no n l y C H E C K _ T W O _ N U M B E R m o d u l ew i l le x e c u t e.p r e s sA D D&B A C Kb u t t o nm a n yt i m e st os e et h ec h a n g e . P R O G R A MD E M O N S T R A T I N G( A TE X I T C O M M A N D )

Scenario : G e n e r a l l yi fas c r e e nc o n t a i n sa n yo b l i g a t o r y ( R e q u i r e d )i n p u tf i e l d&w ee x e c u t et h eM P

p r o g r a m,t h es c r e e na p p e a r s&i fw ew a n tt oc o m eo u to ft h ep r o g r a mi tw i l ln o ta l l o wu s.W eh a v et o f i l lt h em a n d a t o r yf i e l do nt h es c r e e na n dt h e nw ec a nc o m eo u to ft h ep r o g r a mb yc l i c k i n go nt h e a p p l i c a t i o nt o o lb a rb u t t o n s .T oo v e r c o m et h i sp r o b l e m,g e n e r a l l yw eu s eA TE X I T C O M M A N Da tP A Io ft h e s c r e e nt of o r c ee x i tf r o mt h es c r e e nt h a tc o n t a i n sar e q u i r e df i e l dw i t h o u tf i l l i n ga n yv a l u et oi t . H e r ew eh a v et w os c r e e n s9 0 0 0a n d9 0 0 1 .I nt h e9 0 0 0s c r e e nw eh a v ea nr e q u i r e di / pf i e l d&as i n g l e r e c o r di sd i s p l a y e do n9 0 0 1s c r e e nb a s e do nt h ei / p . * * * * * * * *p r o g r a mo na te x i t c o m m a n d* * * * * * * * * * * * * d a t a:p _ c a r rt y p es p f l i c a r r i d , w a _ s p f l it y p es p f l i , o k _ c o d et y p es y u c o m m . m o d u l eS T A T U S _ 9 0 0 0o u t p u t . S E TP F S T A T U S' S T A T U S ' ."D O U B L EC L I C KO N' S T A T U S 'T OC R E A T EI T * S E TT I T L E B A R' x x x ' . e n d m o d u l e . m o d u l eF O R C E _ E X I Ti n p u t . C A S EO K _ C O D E . W H E N' E X I T 'O R' C A N C E L ' . L E A V EP R O G R A M . E N D C A S E . e n d m o d u l e . "F O R C E _ E X I T I N P U T "S T A T U S _ 9 0 0 0 O U T P U T

m o d u l eU S E R _ C O M M A N D _ 9 0 0 0i n p u t . c a s eo k _ c o d e . W H E N' D I S P ' . C A L LS C R E E N9 0 0 1 . W H E N' B A C K ' . L E A V EP R O G R A M . e n d c a s e . e n d m o d u l e . m o d u l eS T A T U S _ 9 0 0 1o u t p u t . * S E TP F S T A T U S' x x x x x x x x ' . * S E TT I T L E B A R' x x x ' . S E L E C TS I N G L E*F R O MS P F L II N T OW A _ S P F L IW H E R EC A R R I D=P _ C A R R . e n d m o d u l e . "S T A T U S _ 9 0 0 1 O U T P U T "U S E R _ C O M M A N D _ 9 0 0 0 I N P U T

m o d u l eU S E R _ C O M M A N D _ 9 0 0 1i n p u t . c a s eo k _ c o d e . w h e n' B A C K ' . L E A V ET OS C R E E N0 . e n d c a s e . e n d m o d u l e . "U S E R _ C O M M A N D _ 9 0 0 1 I N P U T

TO CREATE PF STATUS STEP-1 : Double click on 'STATUS' to create pf status and click on yes button.

STEP-2: Give a short description.

STEP-3: Click on the '+' button of the Function key & fill values 'BACK', 'EXIT' & 'CANCEL'.

STEP-4: Double click on 'EXIT' & the following screen will appear. Click of the value help of theFunction Type field and choose the first entry. 'E' type.

STEP-5 : Click yes to set 'E' for the EXIT and also set 'E' type also for 'CANCEL'

F L O WL O G I CO FS C R E E N9 0 0 0
P R O C E S SB E F O R EO U T P U T . M O D U L Es t a t u s _ 9 0 0 0 .

P R O C E S SA F T E RI N P U T .
M O D U L Ef o r c e _ e x i tA TE X I T C O M M A N D . M O D U L Eu s e r _ c o m m a n d _ 9 0 0 0 .

F L O WL O G I CO FS C R E E N9 0 0 1
P R O C E S SB E F O R EO U T P U T . M O D U L ES T A T U S _ 9 0 0 1 . P R O C E S SA F T E RI N P U T . M O D U L EU S E R _ C O M M A N D _ 9 0 0 1 .

OUTPUT:

P o s t e db yS i v aP r a s a dJ e n aa t1 0 : 4 9

+1 Recommend this on Google

4 comments:
alex linh 2 3D e c e m b e r2 0 1 20 2 : 2 5 How to create a status bar in module pool /user dialog abapprogramming, http://saptechnicals.blogspot.com/2012/12/module-pool-programming-create-gui.html
R e p l y

you

could

check this link

Hugo Omar Rodriguez 9 O c t o b e r2 0 1 30 8 : 4 5 GREAT JOB. !!!


R e p l y

vidya sagar 3 0O c t o b e r2 0 1 30 0 : 4 7 how to create radio buttons in module pool program


R e p l y R e p l i e s S i v aP r a s a dJ e n a 3 0O c t o b e r2 0 1 30 5 : 2 7

C r e a t e a v a r i a b l el i k e d a t a : r b 1 t y p e c .a n d t a k e i t t o t h em o d u l e p o o l s c r e e n . T h e n r i g h tc l i c ko nt h ee l e m e n to nt h es c r e e nt oc o n v e r t ti tt oar a d i ob u t t o no rc h e c kb o x a n df o l l o wt h ep a t h :T r a n s f o r m R a d i o b u t t o n L e f tb u t t o n / R i g h tb u t t o n . R e p l y

Enter your comment...

Comment as:

Google Account

Publish

Preview

N e w e rP o s t

Home

O l d e rP o s t

Subscribe to: Post Comments (Atom)


DOCUMENT CATAGORIES :

1. S i m p l eA B A PP r o g r a m s

Picture Window template. Template images by Zemdega. Powered by Blogger.