Skip to Content
0
Former Member
Dec 02, 2008 at 12:18 PM

Selection screen modification

67 Views

Hi Experts,

Kindly gothrough the below codes and when i click on rb2 radiobutton only that selection option must appear but it is coming when i execute the program,, can any one help to resolve this issue...,

&----


*& Report ZPROGRAM_KPI

*&

&----


*&

*&

&----


REPORT ZPROGRAM_KPI.

TYPE-POOLS SLIS.

tables : pb4000.

DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FCAT LIKE LINE OF IT_FCAT.

DATA : IT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,

WA_FCAT1 LIKE LINE OF IT_FCAT1.

data : lv_end TYPE dats,

lv_beg TYPE dats,

v type i.

data : begin of wa_pb40001,

pernr type pb4000-pernr,

SUBTY TYPE PB4000-SUBTY,

begda type pb4000-begda,

end of wa_pb40001,

it_pb40001 like table of wa_pb40001.

data : begin of wa_pb40002,

pernr type pb4000-pernr,

SUBTY TYPE PB4000-SUBTY,

begda type pb4000-begda,

end of wa_pb40002,

it_pb40002 like table of wa_pb40002.

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

parameter : rb1 radiobutton group t, rb2 radiobutton group t.

selection-screen end of block k.

if rb1 = 'X'.

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = sy-datum

IMPORTING

e_date_new = lv_end.

lv_beg = lv_end.

lv_beg+6(2) = '01'.

SELECT pernr SUBTY FROM pb4000 INTO TABLE it_pb40001 where begda BETWEEN lv_beg AND lv_end.

perform fcat using '1' 'PERNR' 'Personnel number' '20' 'C610'.

perform fcat using '1' 'SUBTY' 'Sub type' '20' 'C310'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-CPROG

I_GRID_TITLE = 'Report for displaying personnel number in previous month'

IT_FIELDCAT = IT_FCAT

TABLES

t_outtab = IT_PB40001.

.

elseif rb2 = 'X'.

select-options s_date for wa_pb40001-begda obligatory.

SELECT pernr SUBTY FROM pb4000 INTO TABLE it_pb40002 where begda in s_date.

perform fcat1 using '1' 'PERNR' 'Personnel number' '20' 'C610'.

perform fcat1 using '1' 'SUBTY' 'Sub type' '20' 'C310'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-CPROG

I_GRID_TITLE = 'Report for displaying personnel number using selection screen'

IT_FIELDCAT = IT_FCAT1

TABLES

t_outtab = IT_PB40002.

endif.

&----


*& Form FCAT

&----


  • text

----


  • -->P_0068 text

  • -->P_0069 text

  • -->P_0070 text

----


form FCAT using FP_COL_POS

FP_FIELDNAME

FP_SELTEXT_M

FP_OUTPUTLEN

FP_EMPHASIZE.

WA_FCAT-COL_POS = FP_COL_POS.

WA_FCAT-FIELDNAME = FP_FIELDNAME.

WA_FCAT-SELTEXT_M = FP_SELTEXT_M.

WA_FCAT-OUTPUTLEN = FP_OUTPUTLEN.

WA_FCAT-EMPHASIZE = FP_EMPHASIZE.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_fCAT.

endform. " FCAT

&----


*& Form FCAT

&----


  • text

----


  • -->P_0068 text

  • -->P_0069 text

  • -->P_0070 text

----


form FCAT1 using FP_COL_POS

FP_FIELDNAME

FP_SELTEXT_M

FP_OUTPUTLEN

FP_EMPHASIZE.

WA_FCAT1-COL_POS = FP_COL_POS.

WA_FCAT1-FIELDNAME = FP_FIELDNAME.

WA_FCAT1-SELTEXT_M = FP_SELTEXT_M.

WA_FCAT1-OUTPUTLEN = FP_OUTPUTLEN.

WA_FCAT1-EMPHASIZE = FP_EMPHASIZE.

APPEND WA_FCAT1 TO IT_FCAT1.

CLEAR WA_fCAT1.

endform. " FCAT

Regards,

Thiru. R