Application Development and Automation 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: 
Read only

Selection screen problem in Payroll

Former Member
0 Likes
1,512

Hi All..

Right now i m designing selection screen for payroll. I have a small requirement which is after payroll area field i have two radio buttons such as

1. current period and

2. other period

My requirement is to get to text boxes in front of other period.

For example run this tcode which is indian payroll driver tcode and view the screen which is similar to my requirement so that u can understand easily.

T.code: Pc00_m40_calc

Pls help me asap.

Regards

Sudha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,252

Hi Sudha,

Copy the below code into your program and check.

tables: t549q, t549a, t569v.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(15) text-zpa

FOR FIELD p_xabkr.

SELECTION-SCREEN POSITION 31 .

PARAMETERS: p_xabkr LIKE qppnp-xabkr OBLIGATORY

MODIF ID zb1.

PARAMETERS: p_begda TYPE d , p_endda TYPE d.

SELECTION-SCREEN END OF LINE.

      • current period

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_timr9 LIKE qppnp-timr9 RADIOBUTTON GROUP $zbp

MODIF ID zb1.

SELECTION-SCREEN COMMENT 04(20) text-zp1

FOR FIELD p_timr9 MODIF ID zb1.

SELECTION-SCREEN POSITION 31 .

PARAMETERS: p_dispp LIKE qppnp-pabrp

MODIF ID ds1.

SELECTION-SCREEN POSITION 34 .

PARAMETERS: p_dispj LIKE qppnp-pabrj

MODIF ID ds1.

SELECTION-SCREEN END OF LINE.

      • other period

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_timra LIKE qppnp-timra RADIOBUTTON GROUP $zbp

MODIF ID zb1.

SELECTION-SCREEN COMMENT 04(20) text-zp2

FOR FIELD p_timra MODIF ID zb1.

SELECTION-SCREEN POSITION 31 .

PARAMETERS: p_pabrp LIKE qppnp-pabrp

MODIF ID zb1.

SELECTION-SCREEN POSITION 34 .

PARAMETERS: p_pabrj LIKE qppnp-pabrj

MODIF ID zb1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

************************************************************************

  • INITIALIZATION *

************************************************************************

INITIALIZATION.

PERFORM init_param_values.

***********************************************************************

  • A T S E L E C T I O N S C R E E N

***********************************************************************

AT SELECTION-SCREEN.

IF NOT p_timr9 IS INITIAL.

IF NOT p_pabrp IS INITIAL OR NOT p_pabrj IS INITIAL.

    • check value entered

MESSAGE e000(zz) WITH 'Current period is selected.'

'Do not enter payroll period'.

ENDIF.

ENDIF.

IF NOT p_timra IS INITIAL.

IF p_pabrp IS INITIAL OR p_pabrj IS INITIAL.

    • check value entered

MESSAGE e000(zz) WITH 'Other period is selected.'

'Enter payroll period'.

ELSE.

    • check value valid

SELECT SINGLE * FROM t549a WHERE abkrs = p_xabkr.

IF NOT p_timra IS INITIAL.

SELECT SINGLE * FROM t549q

WHERE permo = t549a-permo

AND pabrp = p_pabrp

AND pabrj = p_pabrj.

IF sy-subrc NE 0.

MESSAGE e000(zz) WITH 'Enter valid payroll period'.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

PERFORM init_param_values.

************************************************************************

  • AT SELECTION SCREEN OUTPUT *

************************************************************************

AT SELECTION-SCREEN OUTPUT.

PERFORM init_param_values.

&----


*& Form init_param_values

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM init_param_values.

    • current period...get value and set display mode only

LOOP AT SCREEN.

IF screen-name CS 'P_DISPP'

OR screen-name CS 'P_DISPJ'

OR screen-name CS 'P_BEGDA'

OR screen-name CS 'P_ENDDA'.

screen-input = 0.

IF p_dispp IS INITIAL OR p_dispj IS INITIAL.

screen-invisible = 1.

ELSE.

screen-invisible = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

      • get period given payarea

SELECT SINGLE * FROM t549a WHERE abkrs = p_xabkr.

IF NOT p_timr9 IS INITIAL.

SELECT SINGLE pabrp pabrj INTO (p_dispp,p_dispj) FROM t569v

WHERE abkrs = p_xabkr.

ENDIF.

PERFORM get_dates.

ENDFORM. " init_param_values

----


  • FORM get_dates *

----


  • ........ *

----


FORM get_dates.

      • get dates given payarea period

SELECT SINGLE * FROM t549a WHERE abkrs = p_xabkr.

        • for current period, get period from t569v

SELECT SINGLE * FROM t569v WHERE abkrs = p_xabkr.

IF NOT p_timr9 IS INITIAL.

SELECT SINGLE begda endda INTO (p_begda,p_endda) FROM t549q

WHERE permo = t549a-permo

AND pabrp = t569v-pabrp

AND pabrj = t569v-pabrj.

ENDIF.

IF NOT p_timra IS INITIAL.

SELECT SINGLE begda endda INTO (p_begda,p_endda) FROM t549q

WHERE permo = t549a-permo

AND pabrp = p_pabrp

AND pabrj = p_pabrj.

ENDIF.

ENDFORM.

*----


*Enter payroll area and select the current period radi *button and press <b>ENTER</b> then you will get the *dates on the screen.

*----


*For text-elements:

*002 Payroll period

*ZP1 Current Period

*ZP2 Other Period

*ZPA Payroll Area

-


Message was edited by:

Velangini Showry Maria Kumar Bandanadham

7 REPLIES 7
Read only

franois_henrotte
Active Contributor
0 Likes
1,252

you should assign a report category where payroll area is present but not the payroll period (for example the program you give uses __M00001)

then you add your own parameters to select on payroll period : this way you arrange parameters as you wish

Read only

Former Member
0 Likes
1,252

hi sudha,

you can do this by specifying the position of the text box which u are trying to put in the selection screen design using

SELECTION-SCREEN BEGIN OF LINE.

...

[SELECTION-SCREEN POSITION pos [ldb_additions]].

...

SELECTION-SCREEN END OF LINE.

statements.

<b>Reward points if useful</b>

Cheers,

Chandra

Read only

former_member188827
Active Contributor
0 Likes
1,252

PARAMETERS: zr1 RADIOBUTTON GROUP r1.

SELECTION-SCREEN BEGIN OF LINE.

SELECTion-SCREEN POSITION 1.

PARAMETERS : zr2 RADIOBUTTON GROUP r1.

PARAMETERS zc1(10) type c.

SELECTION-SCREEN END OF LINE.

Read only

Former Member
0 Likes
1,253

Hi Sudha,

Copy the below code into your program and check.

tables: t549q, t549a, t569v.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(15) text-zpa

FOR FIELD p_xabkr.

SELECTION-SCREEN POSITION 31 .

PARAMETERS: p_xabkr LIKE qppnp-xabkr OBLIGATORY

MODIF ID zb1.

PARAMETERS: p_begda TYPE d , p_endda TYPE d.

SELECTION-SCREEN END OF LINE.

      • current period

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_timr9 LIKE qppnp-timr9 RADIOBUTTON GROUP $zbp

MODIF ID zb1.

SELECTION-SCREEN COMMENT 04(20) text-zp1

FOR FIELD p_timr9 MODIF ID zb1.

SELECTION-SCREEN POSITION 31 .

PARAMETERS: p_dispp LIKE qppnp-pabrp

MODIF ID ds1.

SELECTION-SCREEN POSITION 34 .

PARAMETERS: p_dispj LIKE qppnp-pabrj

MODIF ID ds1.

SELECTION-SCREEN END OF LINE.

      • other period

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_timra LIKE qppnp-timra RADIOBUTTON GROUP $zbp

MODIF ID zb1.

SELECTION-SCREEN COMMENT 04(20) text-zp2

FOR FIELD p_timra MODIF ID zb1.

SELECTION-SCREEN POSITION 31 .

PARAMETERS: p_pabrp LIKE qppnp-pabrp

MODIF ID zb1.

SELECTION-SCREEN POSITION 34 .

PARAMETERS: p_pabrj LIKE qppnp-pabrj

MODIF ID zb1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

************************************************************************

  • INITIALIZATION *

************************************************************************

INITIALIZATION.

PERFORM init_param_values.

***********************************************************************

  • A T S E L E C T I O N S C R E E N

***********************************************************************

AT SELECTION-SCREEN.

IF NOT p_timr9 IS INITIAL.

IF NOT p_pabrp IS INITIAL OR NOT p_pabrj IS INITIAL.

    • check value entered

MESSAGE e000(zz) WITH 'Current period is selected.'

'Do not enter payroll period'.

ENDIF.

ENDIF.

IF NOT p_timra IS INITIAL.

IF p_pabrp IS INITIAL OR p_pabrj IS INITIAL.

    • check value entered

MESSAGE e000(zz) WITH 'Other period is selected.'

'Enter payroll period'.

ELSE.

    • check value valid

SELECT SINGLE * FROM t549a WHERE abkrs = p_xabkr.

IF NOT p_timra IS INITIAL.

SELECT SINGLE * FROM t549q

WHERE permo = t549a-permo

AND pabrp = p_pabrp

AND pabrj = p_pabrj.

IF sy-subrc NE 0.

MESSAGE e000(zz) WITH 'Enter valid payroll period'.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

PERFORM init_param_values.

************************************************************************

  • AT SELECTION SCREEN OUTPUT *

************************************************************************

AT SELECTION-SCREEN OUTPUT.

PERFORM init_param_values.

&----


*& Form init_param_values

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM init_param_values.

    • current period...get value and set display mode only

LOOP AT SCREEN.

IF screen-name CS 'P_DISPP'

OR screen-name CS 'P_DISPJ'

OR screen-name CS 'P_BEGDA'

OR screen-name CS 'P_ENDDA'.

screen-input = 0.

IF p_dispp IS INITIAL OR p_dispj IS INITIAL.

screen-invisible = 1.

ELSE.

screen-invisible = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

      • get period given payarea

SELECT SINGLE * FROM t549a WHERE abkrs = p_xabkr.

IF NOT p_timr9 IS INITIAL.

SELECT SINGLE pabrp pabrj INTO (p_dispp,p_dispj) FROM t569v

WHERE abkrs = p_xabkr.

ENDIF.

PERFORM get_dates.

ENDFORM. " init_param_values

----


  • FORM get_dates *

----


  • ........ *

----


FORM get_dates.

      • get dates given payarea period

SELECT SINGLE * FROM t549a WHERE abkrs = p_xabkr.

        • for current period, get period from t569v

SELECT SINGLE * FROM t569v WHERE abkrs = p_xabkr.

IF NOT p_timr9 IS INITIAL.

SELECT SINGLE begda endda INTO (p_begda,p_endda) FROM t549q

WHERE permo = t549a-permo

AND pabrp = t569v-pabrp

AND pabrj = t569v-pabrj.

ENDIF.

IF NOT p_timra IS INITIAL.

SELECT SINGLE begda endda INTO (p_begda,p_endda) FROM t549q

WHERE permo = t549a-permo

AND pabrp = p_pabrp

AND pabrj = p_pabrj.

ENDIF.

ENDFORM.

*----


*Enter payroll area and select the current period radi *button and press <b>ENTER</b> then you will get the *dates on the screen.

*----


*For text-elements:

*002 Payroll period

*ZP1 Current Period

*ZP2 Other Period

*ZPA Payroll Area

-


Message was edited by:

Velangini Showry Maria Kumar Bandanadham

Read only

0 Likes
1,252

Thank u so much. Problem is solved. But my requirement is to do the report with out using LDB's. For the requirement with out using LDB's can we use the logic given by u for builidng current and other periods? pls respond soon. waiting for reply.

Regards

Sudha

Read only

0 Likes
1,252

Hi Sudha,

Yes. You can use that logic in any system.

Read only

former_member189631
Active Contributor
0 Likes
1,252

Sudha,

Use this declaration to get the screen,

TABLES : pyorgscreen, pytimescreen.

Regards,

RAM.