Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Interactive ALV Report

Dear All,

i herewith attached my codings, in this i need when i click in previous week 30 it must display all the 30 list from standard report 'S_L9C_94000095'. and when i click on other kpi's urrentweek and previous week it must call the standard report 'S_AHR_61015512'. .... for that how can i modify the below report

Thanks,

Thiru.

&----


*& REPORT zkpi_1.

*&

&----


&----


*& Author Thirukumaran. R

*& Date written 04/10/2008

*& Specification Id <Specification Id>

*& Transport request < >

&----


&----


*&

*& *

*& *

*& *

&----


REPORT zkpi_1.

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

**DECLARATIONS**

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

TYPE-POOLS slis.

TABLES : pa0000 , pb4000.

DATA : gd_repid TYPE sy-repid.

DATA : ld_color(10) TYPE n.

DATA : gd_tab_group TYPE slis_t_sp_group_alv.

DATA : cweekfirst TYPE string.

DATA: is_fieldcat TYPE slis_fieldcat_alv.

DATA : gd_layout TYPE slis_layout_alv.

DATA : r_ucomm TYPE sy-ucomm.

DATA : field5 TYPE string,

value5(200).

DATA : wa_bdcdata LIKE bdcdata,

it_bdcdata LIKE TABLE OF wa_bdcdata.

DATA : datep TYPE dats.

DATA : datel TYPE dats.

DATA : outputt TYPE dats.

DATA : output TYPE dats.

DATA : outputa TYPE dats.

DATA : week11a TYPE scal-week.

DATA : cota TYPE scal-week.

DATA : date11a TYPE scal-date.

DATA : date21a TYPE dats.

DATA : datehc TYPE dats.

DATA : datehc1 TYPE dats.

DATA : it_fcat TYPE slis_t_fieldcat_alv,

wa_fcat LIKE LINE OF it_fcat.

DATA : it_events TYPE slis_t_event,

wa_events LIKE LINE OF it_events.

wa_events-form = 'HEADER'.

wa_events-name = 'TOP_OF_PAGE'.

APPEND wa_events TO it_events.

*PERFORM header.

DATA : date1 TYPE scal-date.

DATA : date1a TYPE scal-date.

DATA : date1t TYPE scal-date.

DATA : cot TYPE scal-week.

DATA : date2 TYPE dats.

DATA : date2a TYPE dats.

DATA : date2t TYPE dats.

DATA : week1 TYPE scal-week.

DATA : week1a TYPE scal-week.

DATA : week1t TYPE scal-week.

DATA : date11 TYPE scal-date.

DATA : date21 TYPE dats.

DATA : week11 TYPE scal-week.

DATA : week11z TYPE scal-week.

DATA : cotz TYPE scal-week.

DATA : date11z TYPE scal-date.

DATA : date21z TYPE dats.

DATA : week11b TYPE scal-week.

DATA : cotb TYPE scal-week.

DATA : date11b TYPE scal-date.

DATA : date21b TYPE dats.

DATA : week1b TYPE scal-week.

DATA : date1b TYPE scal-date.

DATA : date2b TYPE dats.

DATA : outputb TYPE dats.

DATA : dateap TYPE dats.

DATA : dateap1 TYPE dats.

DATA : value(2) , value1(2), value2(2) , value3(2) , value4(2) TYPE n.

DATA : row, row1, row2 , row3 TYPE i.

DATA : t , t1, t2 , t3 TYPE i.

DATA : c TYPE i.

DATA : c1 , c2 , c3 TYPE i.

DATA : datecc TYPE dats.

DATA : datecc1 TYPE dats.

*DATA : BEGIN OF wa_pa0000,

  • pernr TYPE pa0000-pernr,

  • massn TYPE pa0000-massn,

  • END OF wa_pa0000,

  • it_pa0000 LIKE TABLE OF wa_pa0000.

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

**DECLARATIONS OF INTERNAL TABLES AND WORK AREAS**

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

**FOR HEADCOUNT**

DATA : BEGIN OF wa_pa00001,

pernr TYPE pa0000-pernr,

massn TYPE pa0000-massn,

END OF wa_pa00001,

it_pa00001 LIKE TABLE OF wa_pa00001.

DATA : BEGIN OF wa_pa00002,

pernr TYPE pa0000-pernr,

massn TYPE pa0000-massn,

END OF wa_pa00002,

it_pa00002 LIKE TABLE OF wa_pa00002.

DATA : BEGIN OF wa_pa00003,

pernr TYPE pa0000-pernr,

massn TYPE pa0000-massn,

END OF wa_pa00003,

it_pa00003 LIKE TABLE OF wa_pa00003.

DATA : BEGIN OF wa_pa00004,

pernr TYPE pa0000-pernr,

massn TYPE pa0000-massn,

END OF wa_pa00004,

it_pa00004 LIKE TABLE OF wa_pa00004.

**FOR ASSESSMENT PROGRAMS COMPLETED**

DATA : BEGIN OF wa_pb4000,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000,

it_pb4000 LIKE TABLE OF wa_pb4000.

DATA : BEGIN OF wa_pb40001,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb40001,

it_pb40001 LIKE TABLE OF wa_pb40001.

DATA : BEGIN OF wa_pb40003,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb40003,

it_pb40003 LIKE TABLE OF wa_pb40003.

DATA : BEGIN OF wa_pb40002,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb40002,

it_pb40002 LIKE TABLE OF wa_pb40002.

**FOR EMPLOYEMENT CONTRACT OFFERED**

DATA : BEGIN OF wa_pb4000t,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000t,

it_pb4000t LIKE TABLE OF wa_pb4000t.

DATA : BEGIN OF wa_pb4000t1,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000t1,

it_pb4000t1 LIKE TABLE OF wa_pb4000t1.

DATA : BEGIN OF wa_pb4000t3,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000t3,

it_pb4000t3 LIKE TABLE OF wa_pb4000t3.

DATA : BEGIN OF wa_pb4000t2,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000t2,

it_pb4000t2 LIKE TABLE OF wa_pb4000t2.

**FOR EMPLOYEMENT INTERVIEW APPLICATIONS**

DATA : BEGIN OF wa_pb4000r,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000r,

it_pb4000r LIKE TABLE OF wa_pb4000r.

DATA : BEGIN OF wa_pb4000r1,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000r1,

it_pb4000r1 LIKE TABLE OF wa_pb4000r1.

DATA : BEGIN OF wa_pb4000r2,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000r2,

it_pb4000r2 LIKE TABLE OF wa_pb4000r2.

DATA : BEGIN OF wa_pb4000r3,

pernr TYPE pb4000-pernr,

massn TYPE pb4000-massn,

END OF wa_pb4000r3,

it_pb4000r3 LIKE TABLE OF wa_pb4000r3.

**FOR OUTPUT**

DATA :BEGIN OF wa_output,

slno TYPE i,

kpi TYPE string,

pweek TYPE i,

cweek(5) TYPE c,

month(5) TYPE c,

pmonth TYPE i,

line_color(2) TYPE c,

END OF wa_output,

it_output LIKE TABLE OF wa_output.

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

*FOR PERFORMING FIRST ROW. i.e.,FOR HEAD COUNT...

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

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

*FOR PREVIOUS WEEK...first row

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

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week11.

CALL FUNCTION 'LAST_WEEK'

EXPORTING

current_week = week11

IMPORTING

last_week = cot.

  • MONDAY =

  • SUNDAY =

.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = cot

IMPORTING

date = date11.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date11

IMPORTING

result_date = date21.

SELECT DISTINCT pernr INTO TABLE it_pa00001 FROM pa0000 WHERE stat2 <> 0 AND begda <= date11 AND endda >= date21.

DESCRIBE TABLE it_pa00001 LINES value1.

MOVE value1 TO wa_output-pweek.

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

*FOR CURENT WEEK...first row

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

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week1.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = week1

IMPORTING

date = date1.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date1

IMPORTING

result_date = date2.

.

DATA : e TYPE i.

SELECT DISTINCT pernr INTO TABLE it_pa00002 FROM pa0000 WHERE stat2 <> 0 AND begda <= date1 AND endda >= date2.

DESCRIBE TABLE it_pa00002 LINES value2.

MOVE sy-fdayw TO e.

MOVE value2 TO wa_output-cweek.

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

  • FOR MONTH TO AS ON DATE......first row

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

CALL FUNCTION 'RE_BE_CALC_START_DATE'

EXPORTING

id_daberi = sy-datum

IMPORTING

ed_date_cor = output.

.

SELECT DISTINCT pernr INTO TABLE it_pa00003 FROM pa0000 WHERE stat2 <> 0 AND begda <= date1 AND endda >= date2.

DESCRIBE TABLE it_pa00003 LINES value3.

MOVE value3 TO wa_output-month.

****for previous month*****

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = sy-datum

IMPORTING

e_date_new = datehc.

datehc1 = datehc.

datehc1+6(2) = '01'.

SELECT DISTINCT pernr FROM pa0000 INTO TABLE it_pa00004 WHERE stat2 <> 0 AND begda <= date1 AND endda >= date2.

DESCRIBE TABLE it_pa00004 LINES value4.

MOVE value4 TO wa_output-pmonth.

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

*FOR PERFORMING THIRD ROW.. assessment programs

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

*FOR THIRD ROW previous WEEK.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week11a.

CALL FUNCTION 'LAST_WEEK'

EXPORTING

current_week = week11a

IMPORTING

last_week = cota.

  • MONDAY =

  • SUNDAY =

.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = cota

IMPORTING

date = date11a.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date11a

IMPORTING

result_date = date21a.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000 WHERE massn = '42' AND begda BETWEEN date11a AND date21a.

DESCRIBE TABLE it_pb4000 LINES row.

MOVE row TO wa_output-pweek.

*modify it_output from wa_output.

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

*FOR CURENT WEEK...THIRD row

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

*For current week

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week1a.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = week1a

IMPORTING

date = date1a.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date1a

IMPORTING

result_date = date2a.

SELECT pernr FROM pb4000 INTO TABLE it_pb40001 WHERE massn = '42' AND begda BETWEEN date1a AND date2a.

DESCRIBE TABLE it_pb40001 LINES row1.

MOVE row1 TO wa_output-cweek.

*modify it_output from wa_output.

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

*For month to as on date....THIRD

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

CALL FUNCTION 'RE_BE_CALC_START_DATE'

EXPORTING

id_daberi = sy-datum

IMPORTING

ed_date_cor = outputa.

.

SELECT pernr FROM pb4000 INTO TABLE it_pb40002 WHERE massn = '42' AND begda BETWEEN outputa AND sy-datum.

DESCRIBE TABLE it_pb40002 LINES row2.

MOVE row2 TO wa_output-month.

**********previous month*****THIRD

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = sy-datum

IMPORTING

e_date_new = dateap.

dateap1 = dateap.

datecc1+6(2) = '01'.

SELECT pernr FROM pb4000 INTO TABLE it_pb40003 WHERE massn = '42' AND begda BETWEEN dateap1 AND dateap.

DESCRIBE TABLE it_pb40003 LINES row3.

MOVE row3 TO wa_output-pmonth.

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

*For FOURTH row contract offered...EMPLOYEMENT CONTRACT OFFERED...

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

  • for previous week

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week11b.

CALL FUNCTION 'LAST_WEEK'

EXPORTING

current_week = week11b

IMPORTING

last_week = cotb.

  • MONDAY =

  • SUNDAY =

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = cotb

IMPORTING

date = date11b.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date11b

IMPORTING

result_date = date21b.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000t WHERE massn = '04' AND begda BETWEEN date11b AND date21b.

DESCRIBE TABLE it_pb4000t LINES c.

MOVE c TO wa_output-pweek.

*modify it_output from wa_output.

*************for current weeek*********FOURTH

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week1b.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = week1b

IMPORTING

date = date1b.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date1b

IMPORTING

result_date = date2b.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000t1 WHERE massn = '04' AND begda BETWEEN date1b AND date2b.

DESCRIBE TABLE it_pb4000t1 LINES c1.

MOVE c1 TO wa_output-cweek.

*modify it_output from wa_output.

*******for month to as on date******FOURTH

CALL FUNCTION 'RE_BE_CALC_START_DATE'

EXPORTING

id_daberi = sy-datum

IMPORTING

ed_date_cor = outputb.

.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000t2 WHERE massn = '04' AND begda BETWEEN outputb AND sy-datum..

DESCRIBE TABLE it_pb4000t2 LINES c2.

MOVE row TO wa_output-month.

*******for previous month*******FOURTH

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = sy-datum

IMPORTING

e_date_new = datecc.

datecc1 = datecc.

datecc1+6(2) = '01'.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000t3 WHERE massn = '04' AND begda BETWEEN datecc1 AND datecc.

DESCRIBE TABLE it_pb4000t3 LINES c3.

MOVE c3 TO wa_output-pmonth.

*modify it_output from wa_output.

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

******************FOR SECOND ROW************EMPLOYEMENT INTERVIEW APPLICATIONS

******FOR PREVIOUS WEEK**********

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

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week11z.

CALL FUNCTION 'LAST_WEEK'

EXPORTING

current_week = week11z

IMPORTING

last_week = cotz.

  • MONDAY =

  • SUNDAY =

.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = cotz

IMPORTING

date = date11z.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date11z

IMPORTING

result_date = date21z.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000r WHERE massn IN ('40','41') AND begda BETWEEN date11z AND date21z.

DESCRIBE TABLE it_pb4000r LINES t.

MOVE t TO wa_output-pweek.

*modify it_output from wa_output.

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

******for Current Week****SECOND ROW

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

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = sy-datum

IMPORTING

week = week1t.

CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

week = week1t

IMPORTING

date = date1t.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

days = '6'

  • MONTHS = '0'

start_date = date1t

IMPORTING

result_date = date2t.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000r1 WHERE massn IN ('40','41') AND begda BETWEEN date1t AND date2t.

DESCRIBE TABLE it_pb4000r1 LINES t1.

MOVE t1 TO wa_output-cweek.

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

********for month to as on date******SEDOND ROW

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

CALL FUNCTION 'RE_BE_CALC_START_DATE'

EXPORTING

id_daberi = sy-datum

IMPORTING

ed_date_cor = outputt.

.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000r2 WHERE massn IN ('40','41') AND begda BETWEEN outputt AND sy-datum.

DESCRIBE TABLE it_pb4000r2 LINES t2.

MOVE t2 TO wa_output-month.

***********SECOND ROW

****FOR PREVIOUS MONTH*******

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = sy-datum

IMPORTING

e_date_new = datep.

datel = datep.

datel+6(2) = '01'.

SELECT pernr FROM pb4000 INTO TABLE it_pb4000r3 WHERE massn IN ('40','41') AND begda BETWEEN datel AND datep.

DESCRIBE TABLE it_pb4000r3 LINES t3.

MOVE t3 TO wa_output-pmonth.

***********************FOR DISPLAYING THE OUTPUT***********

wa_output-slno = 1.

wa_output-kpi = 'Head Count'.

wa_output-pweek = value1.

wa_output-cweek = value2.

wa_output-month = value3.

wa_output-pmonth = value4.

APPEND wa_output TO it_output.

CLEAR : wa_output , value1 , value2, value3 .

wa_output-slno = 2.

wa_output-kpi = 'Employement Interview Applications'.

wa_output-pweek = t.

wa_output-cweek = t1.

wa_output-month = t2.

wa_output-pmonth = t3.

APPEND wa_output TO it_output.

CLEAR : wa_output , t , t1 , t2 , t3.

wa_output-slno = 3.

wa_output-kpi = 'Assesment Program Completed'.

wa_output-pweek = row.

wa_output-cweek = row1.

wa_output-month = row2.

wa_output-pmonth = row3.

APPEND wa_output TO it_output.

CLEAR : wa_output , row , row1 , row2.

wa_output-slno = 4.

wa_output-kpi = 'Employement Contract Offered'.

wa_output-pweek = c.

wa_output-cweek = c1.

wa_output-month = c2.

wa_output-pmonth = c3.

APPEND wa_output TO it_output.

CLEAR : wa_output , c , c1 , c2.

PERFORM layout.

*PERFORM fcat USING '1' 'SLNO' 'Serial Number'.

*PERFORM fcat USING '2' 'KPI' 'Kpi'.

*PERFORM fcat USING '3' 'PWEEK' 'Previousweek'.

*PERFORM fcat USING '4' 'CWEEK' 'Currentweek'.

*PERFORM fcat USING '5' 'MONTH' 'Monthtoasondate'.

DEFINE m_fieldcat.

is_fieldcat-fieldname = &1.

is_fieldcat-hotspot = &2.

is_fieldcat-seltext_m = &3.

is_fieldcat-col_pos = &4.

is_fieldcat-outputlen = &5.

append is_fieldcat to it_fcat.

clear is_fieldcat.

END-OF-DEFINITION.

m_fieldcat 'SLNO' '' text-112 '1' '6' .

m_fieldcat 'KPI' '' text-110 '2' '32' .

m_fieldcat 'PWEEK' 'X' text-109 '3' '14'.

m_fieldcat 'CWEEK' 'X' text-111 '4' '13' .

m_fieldcat 'MONTH' 'X' text-122 '5' '18' .

m_fieldcat 'PMONTH' 'X' text-132 '6' '18' .

*perform pfstatus.

LOOP AT it_output INTO wa_output.

ld_color = 2.

ld_color = ld_color + 1.

IF ld_color = 8.

ld_color = 1.

ENDIF.

CONCATENATE 'C' '3' '11' INTO wa_output-line_color . "='C410'.

MODIFY it_output FROM wa_output.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-cprog

i_callback_pf_status_set = 'PFSTATUS'

i_grid_title = 'Report'

i_callback_user_command = 'USER_COMMAND'

is_layout = gd_layout

it_fieldcat = it_fcat

it_events = it_events

TABLES

t_outtab = it_output.

  • PERFORM USER_COMMAND.

&----


*& Form FCAT

&----


  • text

----


  • -->P_0070 text

  • -->P_0071 text

  • -->P_0072 text

----


*FORM fcat USING fp_col_pos

  • fp_fieldname

  • fp_seltext_m.

  • wa_fcat-col_pos = fp_col_pos.

  • wa_fcat-fieldname = fp_fieldname.

  • wa_fcat-seltext_m = fp_seltext_m.

  • APPEND wa_fcat TO it_fcat.

*ENDFORM. " FCAT

&----


*& Form HEADER

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM header .

DATA : it_header TYPE slis_t_listheader,

wa_header LIKE LINE OF it_header.

wa_header-typ = 'H'.

wa_header-info = 'Human Resource Team KPI'.

APPEND wa_header TO it_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_header.

  • I_LOGO =

  • I_END_OF_LIST_GRID =

  • I_ALV_FORM =.

CLEAR : it_header[], wa_header.

ENDFORM. " HEADER

&----


*& Form LAYOUT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM layout .

gd_layout-no_input = ''.

gd_layout-colwidth_optimize = ''.

gd_layout-totals_text = 'TOTALS'(201).

gd_layout-info_fieldname = 'LINE_COLOR'.

ENDFORM. " LAYOUT

data : stat2 type pa0000-stat2.

&----


*& Form USER_COMMAND

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM user_command USING u_ucomm TYPE sy-ucomm

us_self_field TYPE slis_selfield.

CASE u_ucomm.

  • when '&IC1'.

*Read table it_ekko into wa_ekko index ws_selfield-tabindex.

*if sy-subrc eq 0.

*set parameter id 'BES' field wa_ekko-ebeln.

*GET PARAMETER ID 'BES' FIELD lv_ebeln .

*READ TABLE ITAB_CURRENTWEEK INTO WA_ CURRENTWEEK WITH KEY CURRENTWEEK = LV_EBELN.

*if sy-subrc eq 0

*Call Transaction wa_currentweek-tcode.

WHEN '&IC1'.

READ TABLE it_OUTPUT INTO wa_OUTPUT INDEX us_self_field-tabindex.

CASE us_self_field-fieldname.

WHEN 'CWEEK'.

IF us_self_field-value > 25.

CALL TRANSACTION 'S_L9C_94000095' AND SKIP FIRST SCREEN.

ELSE.

CALL TRANSACTION 'S_AHR_61015512' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

CASE us_self_field-fieldname.

WHEN 'PWEEK'.

IF us_self_field-value > 25.

CALL TRANSACTION 'S_L9C_94000095' AND SKIP FIRST SCREEN.

ELSE.

CALL TRANSACTION 'S_AHR_61015512' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

CASE us_self_field-fieldname.

WHEN 'MONTH'.

IF us_self_field-value > 25.

CALL TRANSACTION 'S_L9C_94000095' AND SKIP FIRST SCREEN.

ELSE.

CALL TRANSACTION 'S_AHR_61015512' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

CASE us_self_field-fieldname.

WHEN 'PMONTH'.

IF us_self_field-value > 25.

CALL TRANSACTION 'S_L9C_94000095' AND SKIP FIRST SCREEN.

ELSE.

CALL TRANSACTION 'S_AHR_61015512' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDCASE.

ENDFORM. "USER_COMMAND_ALV

************Form statements**********

FORM pfstatus USING ut_extab TYPE slis_t_extab.

SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.

ENDFORM. " USER_COMMAND

Edited by: thirukumaran rajendran on Oct 10, 2008 8:53 AM

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question