Skip to Content
0
Former Member
Mar 14, 2007 at 02:25 AM

Print icon not working

43 Views

Hi All,

I have developed a program to display two alv reports. The program when executed displays the first report and on the click of a push button it wud display the second report. The standard icons are all working in the first report but few icons like print, local file save are not working in the second screen. Can anyone help me on this?

REPORT ZMY20FCORD MESSAGE-ID 8I.

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

  • ALV

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

TYPE-POOLS: SLIS.

DATA: TXT_REPORT LIKE DOKHL-OBJECT. "Reportname für Erläuterungsaufruf

DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

GT_EVENTS TYPE SLIS_T_EVENT,

GT_SORT TYPE SLIS_T_SORTINFO_ALV,

GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,

GS_LAYOUT TYPE SLIS_LAYOUT_ALV.

*----


*

  • TABLES ABAP Internal Table definitions

*----


*

TABLES : T001, T001W, T005, TVST, ZMY20PROD, ZMY20WKFC, TVKO, ZMY20RMRK,

ZMY20FCVER, ZMY20GP, VBAK, VBAP, VBEP, VBPA, KNA1.

*----


*

  • INTERNAL TABLES (i_): ABAP Internal Internal Table definitions

*----


*

DATA: I_ZMY20WKFC LIKE ZMY20WKFC OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF I_VBAK OCCURS 0,

VBELN LIKE VBAK-VBELN,

KUNNR LIKE VBAK-KUNNR, " Sold-to-Party

END OF I_VBAK.

DATA: BEGIN OF I_ORDER OCCURS 0,

VBELN LIKE VBAK-VBELN,

POSNR LIKE VBAP-POSNR,

ETENR LIKE VBEP-ETENR,

KUNNR LIKE VBAK-KUNNR, " Sold-to-Party

MATNR LIKE VBAP-MATNR,

WERKS LIKE VBAP-WERKS,

VSTEL LIKE VBAP-VSTEL,

WMENG LIKE VBEP-WMENG,

VRKME LIKE VBEP-VRKME,

LDDAT LIKE VBEP-LDDAT,

SHIPTO LIKE VBPA-KUNNR,

SOLDCN LIKE KNA1-LAND1,

SHIPCN LIKE KNA1-LAND1,

PRODUCT LIKE ZMY20PROD-PRODUCT,

STCSTP LIKE ZMY20WKFC-STCSTP,

SPMON LIKE ZMY20WKFC-SPMON,

WEEK LIKE SCAL-WEEK,

UPDFLG(1) TYPE C,

END OF I_ORDER.

DATA: BEGIN OF I_SHIPTO OCCURS 0,

CUSTOMER(20) TYPE C,

SHIPTO LIKE VBPA-KUNNR,

END OF I_SHIPTO.

DATA: BEGIN OF I_OUTPUT OCCURS 0,

SORTKEY(1) TYPE C,

STCSTP LIKE ZMY20WKFC-STCSTP,

WERKS LIKE ZMY20WKFC-WERKS,

SHPPOINT LIKE ZMY20WKFC-SHPPOINT,

PRODUCT LIKE ZMY20WKFC-PRODUCT,

MAKTX LIKE ZMY20PROD-MAKTX,

QTY01 LIKE ZMY20WKFC-QTY01,

ORD01 LIKE ZMY20WKFC-QTY01,

QTY02 LIKE ZMY20WKFC-QTY01,

ORD02 LIKE ZMY20WKFC-QTY01,

QTY03 LIKE ZMY20WKFC-QTY01,

ORD03 LIKE ZMY20WKFC-QTY01,

QTY04 LIKE ZMY20WKFC-QTY01,

ORD04 LIKE ZMY20WKFC-QTY01,

QTY05 LIKE ZMY20WKFC-QTY01,

ORD05 LIKE ZMY20WKFC-QTY01,

QTY06 LIKE ZMY20WKFC-QTY01,

ORD06 LIKE ZMY20WKFC-QTY01,

TOTFC1 LIKE ZMY20WKFC-QTY01,

TOTORD1 LIKE ZMY20WKFC-QTY01,

FCORD1(5) TYPE P DECIMALS 2,

QTY07 LIKE ZMY20WKFC-QTY01,

ORD07 LIKE ZMY20WKFC-QTY01,

QTY08 LIKE ZMY20WKFC-QTY01,

ORD08 LIKE ZMY20WKFC-QTY01,

QTY09 LIKE ZMY20WKFC-QTY01,

ORD09 LIKE ZMY20WKFC-QTY01,

QTY10 LIKE ZMY20WKFC-QTY01,

ORD10 LIKE ZMY20WKFC-QTY01,

QTY11 LIKE ZMY20WKFC-QTY01,

ORD11 LIKE ZMY20WKFC-QTY01,

QTY12 LIKE ZMY20WKFC-QTY01,

ORD12 LIKE ZMY20WKFC-QTY01,

TOTFC2 LIKE ZMY20WKFC-QTY01,

TOTORD2 LIKE ZMY20WKFC-QTY01,

FCORD2(5) TYPE P DECIMALS 2,

CELLCOLOR TYPE SLIS_T_SPECIALCOL_ALV,

DUMMY(1) TYPE C,

END OF I_OUTPUT.

DATA: I_COLOUR TYPE LVC_T_SCOL WITH HEADER LINE.

DATA: BEGIN OF I_PRDWISE OCCURS 0,

SORTKEY(1) TYPE C,

STCSTP LIKE ZMY20WKFC-STCSTP,

PRODUCT LIKE ZMY20WKFC-PRODUCT,

MAKTX LIKE ZMY20PROD-MAKTX,

TOTFC1 LIKE ZMY20WKFC-QTY01,

TOTORD1 LIKE ZMY20WKFC-QTY01,

FCORD1(5) TYPE P DECIMALS 2,

DIFF1 LIKE ZMY20WKFC-QTY01,

TOTFC2 LIKE ZMY20WKFC-QTY01,

TOTORD2 LIKE ZMY20WKFC-QTY01,

FCORD2(5) TYPE P DECIMALS 2,

DIFF2 LIKE ZMY20WKFC-QTY01,

END OF I_PRDWISE.

DATA: BEGIN OF I_TVST OCCURS 0,

VSTEL LIKE TVST-VSTEL,

END OF I_TVST.

DATA: BEGIN OF T_STCP OCCURS 0,

SORTKEY(1) TYPE C,

STCSTP LIKE ZMY20WKFC-STCSTP,

END OF T_STCP.

DATA: BEGIN OF T_PROD OCCURS 0,

PRODUCT LIKE ZMY20PROD-PRODUCT,

MAKTX LIKE ZMY20PROD-MAKTX,

END OF T_PROD.

DATA: BEGIN OF T_USER OCCURS 0,

UNAME LIKE SY-UNAME,

END OF T_USER.

DATA: I_FIELDS LIKE SVAL OCCURS 0 WITH HEADER LINE.

*----


*

  • VARIABLES (v_): ABAP Internal Variables definitions

*----


*

DATA : V_ENDMTH LIKE S125-SPMON,

V_STRDT1 LIKE SY-DATUM,

V_STRDT2 LIKE SY-DATUM,

V_ENDDT1 LIKE SY-DATUM,

V_ENDDT2 LIKE SY-DATUM,

V_STRWK1 LIKE SCAL-WEEK,

V_STRWK2 LIKE SCAL-WEEK,

V_ENDWK1 LIKE SCAL-WEEK,

V_ENDWK2 LIKE SCAL-WEEK,

V_STRMTH LIKE S125-SPMON. " Only for Report Header

DATA : BEGIN OF I_WEEKS OCCURS 0,

SLNO TYPE I,

WEEKS LIKE SCAL-WEEK,

MONTH(2) TYPE C,

HDRWK(13) TYPE C,

END OF I_WEEKS.

DATA : V_TABIX LIKE SY-TABIX,

V_VERSN LIKE ZMY20WKFC-VERSN,

V_VKORG LIKE TVKO-VKORG.

DATA : V_REMARK1 LIKE ZMY20RMRK-REMARK1,

V_REMARK2 LIKE ZMY20RMRK-REMARK2,

V_RETCODE TYPE C,

V_FNAME(30) TYPE C,

V_UPDFLAG(1) TYPE C.

*----


*

  • WORKING VARIABLES (w_): ABAP Internal Working Variables definitions

*----


*

DATA: W_TOT(5) TYPE N,

W_SLNO TYPE I.

DATA: W_WEEKS LIKE SCAL-WEEK.

DATA: W_WKHDR01(13) TYPE C,

W_WKHDR02(13) TYPE C,

W_WKHDR03(13) TYPE C,

W_WKHDR04(13) TYPE C,

W_WKHDR05(13) TYPE C,

W_WKHDR06(13) TYPE C,

W_WKHDR07(13) TYPE C,

W_WKHDR08(13) TYPE C,

W_WKHDR09(13) TYPE C,

W_WKHDR10(13) TYPE C,

W_WKHDR11(13) TYPE C,

W_WKHDR12(13) TYPE C.

DATA: W_FCHDR01(13) TYPE C,

W_FCHDR02(13) TYPE C,

W_FCHDR03(13) TYPE C,

W_FCHDR04(13) TYPE C,

W_FCHDR05(13) TYPE C,

W_FCHDR06(13) TYPE C,

W_FCHDR07(13) TYPE C,

W_FCHDR08(13) TYPE C,

W_FCHDR09(13) TYPE C,

W_FCHDR10(13) TYPE C,

W_FCHDR11(13) TYPE C,

W_FCHDR12(13) TYPE C,

W_FCHDRT1(13) TYPE C,

W_FCHDRT2(13) TYPE C,

W_ORHDR01(13) TYPE C,

W_ORHDR02(13) TYPE C,

W_ORHDR03(13) TYPE C,

W_ORHDR04(13) TYPE C,

W_ORHDR05(13) TYPE C,

W_ORHDR06(13) TYPE C,

W_ORHDR07(13) TYPE C,

W_ORHDR08(13) TYPE C,

W_ORHDR09(13) TYPE C,

W_ORHDR10(13) TYPE C,

W_ORHDR11(13) TYPE C,

W_ORHDR12(13) TYPE C,

W_ORHDRT1(13) TYPE C,

W_ORHDRT2(13) TYPE C,

W_HDR%1(13) TYPE C,

W_HDR%2(13) TYPE C,

W_DIFF1(13) TYPE C,

W_DIFF2(13) TYPE C.

DATA: W_WKTBL01 LIKE SCAL-WEEK,

W_WKTBL02 LIKE SCAL-WEEK,

W_WKTBL03 LIKE SCAL-WEEK,

W_WKTBL04 LIKE SCAL-WEEK,

W_WKTBL05 LIKE SCAL-WEEK,

W_WKTBL06 LIKE SCAL-WEEK,

W_WKTBL07 LIKE SCAL-WEEK,

W_WKTBL08 LIKE SCAL-WEEK,

W_WKTBL09 LIKE SCAL-WEEK,

W_WKTBL10 LIKE SCAL-WEEK,

W_WKTBL11 LIKE SCAL-WEEK,

W_WKTBL12 LIKE SCAL-WEEK.

DATA: W_SHIPTO LIKE VBPA-KUNNR,

W_SOLDCN LIKE KNA1-LAND1,

W_SHIPCN LIKE KNA1-LAND1,

W_PRODUCT LIKE ZMY20PROD-PRODUCT.

DATA: W_ORD01 LIKE ZMY20WKFC-QTY01,

W_ORD02 LIKE ZMY20WKFC-QTY01,

W_ORD03 LIKE ZMY20WKFC-QTY01,

W_ORD04 LIKE ZMY20WKFC-QTY01,

W_ORD05 LIKE ZMY20WKFC-QTY01,

W_ORD06 LIKE ZMY20WKFC-QTY01,

W_ORD07 LIKE ZMY20WKFC-QTY01,

W_ORD08 LIKE ZMY20WKFC-QTY01,

W_ORD09 LIKE ZMY20WKFC-QTY01,

W_ORD10 LIKE ZMY20WKFC-QTY01,

W_ORD11 LIKE ZMY20WKFC-QTY01,

W_ORD12 LIKE ZMY20WKFC-QTY01,

W_ORDT1 LIKE ZMY20WKFC-QTY01,

W_ORDT2 LIKE ZMY20WKFC-QTY01.

*----


*

  • SELECTION SCREEN DATA : ABAP Internal Select Options&Parameters

  • SELECT-OPTIONS (s_) definitions

  • PARAMETERS (p_)

*----


*

SELECTION-SCREEN BEGIN OF BLOCK MYSEL1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_BUKRS LIKE T001-BUKRS OBLIGATORY DEFAULT 'MY20',

P_STRMTH LIKE S125-SPMON OBLIGATORY DEFAULT '200608'.

SELECT-OPTIONS : S_STCSTP FOR ZMY20WKFC-STCSTP,

S_WERKS FOR T001W-WERKS,

S_PROD FOR ZMY20PROD-PRODUCT,

S_SHP FOR VBAP-VSTEL.

SELECTION-SCREEN END OF BLOCK MYSEL1.

SELECTION-SCREEN BEGIN OF BLOCK MYSEL2 WITH FRAME.

PARAMETER : P_ZERO AS CHECKBOX.

SELECTION-SCREEN END OF BLOCK MYSEL2.

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

  • AT SELECTION-SCREEN

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

  • Begin of Addition by T.Karthikeyan - UIS on 18/01/2007 - Req No - BA3K986971

AT SELECTION-SCREEN ON P_BUKRS.

AUTHORITY-CHECK OBJECT 'Z_BASF_SD'

ID 'BUKRS' FIELD P_BUKRS

ID 'VKORG' DUMMY

ID 'ZZ_UB' DUMMY

ID 'ZZ_SBU' DUMMY

ID 'WERKS' DUMMY

ID 'ZZ_PROG' FIELD SY-CPROG.

IF SY-SUBRC NE 0.

MESSAGE ID 'SD' TYPE 'E' NUMBER '836' WITH

TEXT-E02 SY-CPROG.

RETURN.

ENDIF.

  • End of Addition by T.Karthikeyan - UIS on 18/01/2007 - Req No - BA3K986971

  • At selection screen F4 help

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_STCSTP-LOW.

PERFORM F4_HELP_STCSTP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_STCSTP-HIGH.

PERFORM F4_HELP_STCSTP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PROD-LOW.

PERFORM F4_HELP_PRODUCT.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PROD-HIGH.

PERFORM F4_HELP_PRODUCT.

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

  • START-OF-SELECTION

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

START-OF-SELECTION.

PERFORM 1000_GET_WEEK_DETAILS.

PERFORM 1500_GET_SHIPTO_CUSTOMER.

PERFORM 2000_GET_FORECAST_DATA.

PERFORM 3000_GET_ORDER_DATA.

PERFORM 4000_CONSOLIDATE_DATA.

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

  • END-OF-SELECTION

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

END-OF-SELECTION.

REFRESH : GT_FIELDCAT, GT_LIST_TOP_OF_PAGE, GT_EVENTS, GT_SORT.

PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].

PERFORM LAYOUT_INIT USING GS_LAYOUT.

PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].

PERFORM EVENTTAB_BUILD USING GT_EVENTS[].

PERFORM SORT_BUILD USING GT_SORT[].

PERFORM MAIN.

*&----


*

*& Form 1000_GET_WEEK_DETAILS

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM 1000_GET_WEEK_DETAILS .

REFRESH : I_WEEKS.

V_STRMTH = P_STRMTH.

V_ENDMTH = P_STRMTH + 1.

IF V_ENDMTH+4(2) GT '12'.

MOVE '01' TO V_ENDMTH+4(2).

ADD 1 TO V_ENDMTH+0(4).

ENDIF.

CONCATENATE P_STRMTH0(4) P_STRMTH4(2) '01' INTO V_STRDT1.

CONCATENATE V_ENDMTH0(4) V_ENDMTH4(2) '01' INTO V_ENDDT1.

CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'

EXPORTING

I_DATE = V_STRDT1

IMPORTING

E_DATE = V_STRDT2.

CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'

EXPORTING

I_DATE = V_ENDDT1

IMPORTING

E_DATE = V_ENDDT2.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

DATE = V_STRDT1

IMPORTING

WEEK = V_STRWK1.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

DATE = V_STRDT2

IMPORTING

WEEK = V_STRWK2.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

DATE = V_ENDDT1

IMPORTING

WEEK = V_ENDWK1.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

DATE = V_ENDDT2

IMPORTING

WEEK = V_ENDWK2.

CLEAR : W_WEEKS, W_SLNO.

MOVE V_STRWK1 TO W_WEEKS.

MOVE '1' TO W_SLNO.

DO.

CLEAR : I_WEEKS.

MOVE W_SLNO TO I_WEEKS-SLNO.

MOVE W_WEEKS TO I_WEEKS-WEEKS.

MOVE P_STRMTH+4(2) TO I_WEEKS-MONTH.

CONCATENATE I_WEEKS-MONTH '-' W_WEEKS+4(2) INTO I_WEEKS-HDRWK.

APPEND I_WEEKS.

ADD 1 TO W_SLNO.

CALL FUNCTION 'NEXT_WEEK'

EXPORTING

CURRENT_WEEK = W_WEEKS

IMPORTING

NEXT_WEEK = W_WEEKS.

IF W_WEEKS GT V_STRWK2.

EXIT.

ENDIF.

ENDDO.

CLEAR : W_WEEKS, W_SLNO.

MOVE V_ENDWK1 TO W_WEEKS.

MOVE '7' TO W_SLNO.

DO.

CLEAR : I_WEEKS.

MOVE W_SLNO TO I_WEEKS-SLNO.

MOVE W_WEEKS TO I_WEEKS-WEEKS.

MOVE V_ENDMTH+4(2) TO I_WEEKS-MONTH.

CONCATENATE I_WEEKS-MONTH '-' W_WEEKS+4(2) INTO I_WEEKS-HDRWK.

APPEND I_WEEKS.

ADD 1 TO W_SLNO.

CALL FUNCTION 'NEXT_WEEK'

EXPORTING

CURRENT_WEEK = W_WEEKS

IMPORTING

NEXT_WEEK = W_WEEKS.

IF W_WEEKS GT V_ENDWK2.

EXIT.

ENDIF.

ENDDO.

LOOP AT I_WEEKS.

IF I_WEEKS-SLNO = '1'.

MOVE I_WEEKS-HDRWK TO W_WKHDR01.

MOVE I_WEEKS-WEEKS TO W_WKTBL01.

ELSEIF I_WEEKS-SLNO = '2'.

MOVE I_WEEKS-HDRWK TO W_WKHDR02.

MOVE I_WEEKS-WEEKS TO W_WKTBL02.

ELSEIF I_WEEKS-SLNO = '3'.

MOVE I_WEEKS-HDRWK TO W_WKHDR03.

MOVE I_WEEKS-WEEKS TO W_WKTBL03.

ELSEIF I_WEEKS-SLNO = '4'.

MOVE I_WEEKS-HDRWK TO W_WKHDR04.

MOVE I_WEEKS-WEEKS TO W_WKTBL04.

ELSEIF I_WEEKS-SLNO = '5'.

MOVE I_WEEKS-HDRWK TO W_WKHDR05.

MOVE I_WEEKS-WEEKS TO W_WKTBL05.

ELSEIF I_WEEKS-SLNO = '6'.

MOVE I_WEEKS-HDRWK TO W_WKHDR06.

MOVE I_WEEKS-WEEKS TO W_WKTBL06.

ELSEIF I_WEEKS-SLNO = '7'.

MOVE I_WEEKS-HDRWK TO W_WKHDR07.

MOVE I_WEEKS-WEEKS TO W_WKTBL07.

ELSEIF I_WEEKS-SLNO = '8'.

MOVE I_WEEKS-HDRWK TO W_WKHDR08.

MOVE I_WEEKS-WEEKS TO W_WKTBL08.

ELSEIF I_WEEKS-SLNO = '9'.

MOVE I_WEEKS-HDRWK TO W_WKHDR09.

MOVE I_WEEKS-WEEKS TO W_WKTBL09.

ELSEIF I_WEEKS-SLNO = '10'.

MOVE I_WEEKS-HDRWK TO W_WKHDR10.

MOVE I_WEEKS-WEEKS TO W_WKTBL10.

ELSEIF I_WEEKS-SLNO = '11'.

MOVE I_WEEKS-HDRWK TO W_WKHDR11.

MOVE I_WEEKS-WEEKS TO W_WKTBL11.

ELSEIF I_WEEKS-SLNO = '12'.

MOVE I_WEEKS-HDRWK TO W_WKHDR12.

MOVE I_WEEKS-WEEKS TO W_WKTBL12.

ENDIF.

ENDLOOP.

CONCATENATE W_WKHDR01 'F' INTO W_FCHDR01.

CONCATENATE W_WKHDR02 'F' INTO W_FCHDR02.

CONCATENATE W_WKHDR03 'F' INTO W_FCHDR03.

CONCATENATE W_WKHDR04 'F' INTO W_FCHDR04.

CONCATENATE W_WKHDR05 'F' INTO W_FCHDR05.

CONCATENATE W_WKHDR06 'F' INTO W_FCHDR06.

CONCATENATE W_WKHDR07 'F' INTO W_FCHDR07.

CONCATENATE W_WKHDR08 'F' INTO W_FCHDR08.

CONCATENATE W_WKHDR09 'F' INTO W_FCHDR09.

CONCATENATE W_WKHDR10 'F' INTO W_FCHDR10.

CONCATENATE W_WKHDR11 'F' INTO W_FCHDR11.

CONCATENATE W_WKHDR12 'F' INTO W_FCHDR12.

CONCATENATE W_WKHDR01 'O' INTO W_ORHDR01.

CONCATENATE W_WKHDR02 'O' INTO W_ORHDR02.

CONCATENATE W_WKHDR03 'O' INTO W_ORHDR03.

CONCATENATE W_WKHDR04 'O' INTO W_ORHDR04.

CONCATENATE W_WKHDR05 'O' INTO W_ORHDR05.

CONCATENATE W_WKHDR06 'O' INTO W_ORHDR06.

CONCATENATE W_WKHDR07 'O' INTO W_ORHDR07.

CONCATENATE W_WKHDR08 'O' INTO W_ORHDR08.

CONCATENATE W_WKHDR09 'O' INTO W_ORHDR09.

CONCATENATE W_WKHDR10 'O' INTO W_ORHDR10.

CONCATENATE W_WKHDR11 'O' INTO W_ORHDR11.

CONCATENATE W_WKHDR12 'O' INTO W_ORHDR12.

CONCATENATE P_STRMTH4(2) '/' P_STRMTH0(4) 'F-TOT' INTO W_FCHDRT1.

CONCATENATE V_ENDMTH4(2) '/' V_ENDMTH0(4) 'F-TOT' INTO W_FCHDRT2.

CONCATENATE P_STRMTH4(2) '/' P_STRMTH0(4) 'O-TOT' INTO W_ORHDRT1.

CONCATENATE V_ENDMTH4(2) '/' V_ENDMTH0(4) 'O-TOT' INTO W_ORHDRT2.

CONCATENATE P_STRMTH4(2) '/' P_STRMTH0(4) '-%' INTO W_HDR%1.

CONCATENATE V_ENDMTH4(2) '/' V_ENDMTH0(4) '-%' INTO W_HDR%2.

CONCATENATE P_STRMTH4(2) '/' P_STRMTH0(4) '-DIFF' INTO W_DIFF1.

CONCATENATE V_ENDMTH4(2) '/' V_ENDMTH0(4) '-DIFF' INTO W_DIFF2.

ENDFORM. " 1000_GET_WEEK_DETAILS

*&----


*

*& Form 1500_GET_SHIPTO_CUSTOMER

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM 1500_GET_SHIPTO_CUSTOMER .

REFRESH : I_SHIPTO.

SELECT * FROM ZMY20GP WHERE ZZKEY1 = 'ZMY20FCUP'

AND ZZKEY3 = 'SHIPTOCUST'.

CLEAR : I_SHIPTO.

MOVE ZMY20GP-ZZKEY2 TO I_SHIPTO-CUSTOMER.

IF ZMY20GP-ZZVAL1 NE SPACE.

MOVE ZMY20GP-ZZVAL1+0(10) TO I_SHIPTO-SHIPTO.

APPEND I_SHIPTO.

ENDIF.

IF ZMY20GP-ZZVAL2 NE SPACE.

MOVE ZMY20GP-ZZVAL2+0(10) TO I_SHIPTO-SHIPTO.

APPEND I_SHIPTO.

ENDIF.

IF ZMY20GP-ZZVAL3 NE SPACE.

MOVE ZMY20GP-ZZVAL3+0(10) TO I_SHIPTO-SHIPTO.

APPEND I_SHIPTO.

ENDIF.

IF ZMY20GP-ZZVAL4 NE SPACE.

MOVE ZMY20GP-ZZVAL4+0(10) TO I_SHIPTO-SHIPTO.

APPEND I_SHIPTO.

ENDIF.

ENDSELECT.

PERFORM GET_REMARKENTRY_USER.

ENDFORM. " 1500_GET_SHIPTO_CUSTOMER

*&----


*

*& Form 2000_GET_FORECAST_DATA

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM 2000_GET_FORECAST_DATA .

  • Get the Forecast data for the give input

REFRESH : I_ZMY20WKFC.

SELECT * INTO CORRESPONDING FIELDS OF TABLE I_ZMY20WKFC FROM ZMY20WKFC

WHERE BUKRS EQ P_BUKRS

AND STCSTP IN S_STCSTP

AND WERKS IN S_WERKS

AND PRODUCT IN S_PROD

AND SHPPOINT IN S_SHP

AND SPMON GE P_STRMTH

AND SPMON LE V_ENDMTH.

  • Filter the final version of the forecast data

LOOP AT I_ZMY20WKFC.

V_TABIX = SY-TABIX.

SELECT SINGLE VERSN INTO V_VERSN FROM ZMY20FCVER

WHERE BUKRS EQ I_ZMY20WKFC-BUKRS

AND STCSTP EQ I_ZMY20WKFC-STCSTP

AND WERKS EQ I_ZMY20WKFC-WERKS

AND SPMON EQ I_ZMY20WKFC-SPMON.

IF I_ZMY20WKFC-VERSN EQ V_VERSN.

ELSE.

DELETE I_ZMY20WKFC INDEX V_TABIX.

ENDIF.

ENDLOOP.

ENDFORM. " 2000_GET_FORECAST_DATA

*&----


*

*& Form 3000_GET_ORDER_DATA

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM 3000_GET_ORDER_DATA .

REFRESH : I_VBAK, I_ORDER.

CLEAR : V_VKORG.

SELECT SINGLE VKORG INTO V_VKORG FROM TVKO WHERE BUKRS EQ P_BUKRS.

SELECT VBELN KUNNR INTO CORRESPONDING FIELDS OF TABLE I_VBAK FROM VBAK

WHERE VKORG EQ V_VKORG

AND AUART EQ 'TA' "Type OR

AND BUKRS_VF EQ P_BUKRS.

SORT I_VBAK BY VBELN.

LOOP AT I_VBAK.

CLEAR : W_SHIPTO, W_SOLDCN, W_SHIPCN.

SELECT SINGLE KUNNR INTO W_SHIPTO FROM VBPA WHERE VBELN EQ I_VBAK-VBELN

AND PARVW EQ 'WE'.

SELECT SINGLE LAND1 INTO W_SOLDCN FROM KNA1 WHERE KUNNR EQ I_VBAK-KUNNR.

SELECT SINGLE LAND1 INTO W_SHIPCN FROM KNA1 WHERE KUNNR EQ W_SHIPTO.

SELECT * FROM VBAP WHERE VBELN EQ I_VBAK-VBELN AND WERKS IN S_WERKS

AND ABGRU EQ SPACE

AND VSTEL IN S_SHP.

CLEAR : W_PRODUCT.

SELECT SINGLE PRODUCT INTO W_PRODUCT FROM ZMY20PROD WHERE SAPMATL EQ VBAP-MATNR.

SELECT * FROM VBEP WHERE VBELN EQ I_VBAK-VBELN

AND POSNR EQ VBAP-POSNR

AND LDDAT GE V_STRDT1

AND LDDAT LE V_ENDDT2

AND WMENG GT 0.

CLEAR : I_ORDER.

MOVE I_VBAK-VBELN TO I_ORDER-VBELN.

MOVE I_VBAK-KUNNR TO I_ORDER-KUNNR.

MOVE W_SHIPTO TO I_ORDER-SHIPTO.

MOVE W_SOLDCN TO I_ORDER-SOLDCN.

MOVE VBAP-POSNR TO I_ORDER-POSNR.

MOVE VBAP-MATNR TO I_ORDER-MATNR.

MOVE VBAP-WERKS TO I_ORDER-WERKS.

MOVE VBAP-VSTEL TO I_ORDER-VSTEL.

MOVE W_PRODUCT TO I_ORDER-PRODUCT.

MOVE VBEP-ETENR TO I_ORDER-ETENR.

MOVE VBEP-LDDAT+0(6) TO I_ORDER-SPMON.

MOVE VBEP-WMENG TO I_ORDER-WMENG.

MOVE VBEP-VRKME TO I_ORDER-VRKME.

MOVE VBEP-LDDAT TO I_ORDER-LDDAT.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

DATE = VBEP-LDDAT

IMPORTING

WEEK = I_ORDER-WEEK.

READ TABLE I_SHIPTO WITH KEY SHIPTO = I_ORDER-SHIPTO.

IF SY-SUBRC EQ 0.

MOVE I_SHIPTO-CUSTOMER TO I_ORDER-STCSTP.

ELSE.

MOVE I_ORDER-SOLDCN TO I_ORDER-STCSTP.

ENDIF.

IF W_SOLDCN = 'CN' OR W_SOLDCN = 'HK'.

MOVE 'CN&HK' TO I_ORDER-STCSTP.

ENDIF.

IF I_ORDER-STCSTP IN S_STCSTP AND I_ORDER-PRODUCT IN S_PROD.

APPEND I_ORDER.

ENDIF.

ENDSELECT.

ENDSELECT.

ENDLOOP.

ENDFORM. " 3000_GET_ORDER_DATA

*&----


*

*& Form 4000_CONSOLIDATE_DATA

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM 4000_CONSOLIDATE_DATA .

REFRESH : I_OUTPUT, I_PRDWISE.

LOOP AT I_ZMY20WKFC.

CLEAR : W_ORD01, W_ORD02, W_ORD03, W_ORD04, W_ORD05, W_ORD06,

W_ORD07, W_ORD08, W_ORD09, W_ORD10, W_ORD11, W_ORD12,

W_ORDT1, W_ORDT2.

LOOP AT I_ORDER WHERE STCSTP EQ I_ZMY20WKFC-STCSTP

AND WERKS EQ I_ZMY20WKFC-WERKS

AND PRODUCT EQ I_ZMY20WKFC-PRODUCT

AND SPMON EQ I_ZMY20WKFC-SPMON.

*BEGIN OF CHANGES BY FAIZAL ON 26/01/07 TR# BA3K987278

  • IF I_ORDER-VSTEL CA I_ZMY20WKFC-SHPPOINT.

IF I_ZMY20WKFC-SHPPOINT CS I_ORDER-VSTEL.

*END OF CHANGES BY FAIZAL ON 26/01/2007 TR# BA3K987278

ELSE.

CONTINUE.

ENDIF.

IF I_ORDER-SPMON EQ P_STRMTH.

IF I_ORDER-WEEK EQ W_WKTBL01.

W_ORD01 = W_ORD01 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL02.

W_ORD02 = W_ORD02 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL03.

W_ORD03 = W_ORD03 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL04.

W_ORD04 = W_ORD04 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL05.

W_ORD05 = W_ORD05 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL06.

W_ORD06 = W_ORD06 + I_ORDER-WMENG.

ENDIF.

W_ORDT1 = W_ORDT1 + I_ORDER-WMENG.

ELSE.

IF I_ORDER-WEEK EQ W_WKTBL07.

W_ORD07 = W_ORD07 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL08.

W_ORD08 = W_ORD08 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL09.

W_ORD09 = W_ORD09 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL10.

W_ORD10 = W_ORD10 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL11.

W_ORD11 = W_ORD11 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL12.

W_ORD12 = W_ORD12 + I_ORDER-WMENG.

ENDIF.

W_ORDT2 = W_ORDT2 + I_ORDER-WMENG.

ENDIF.

MOVE 'X' TO I_ORDER-UPDFLG.

MODIFY I_ORDER INDEX SY-TABIX.

ENDLOOP.

READ TABLE I_OUTPUT WITH KEY STCSTP = I_ZMY20WKFC-STCSTP

WERKS = I_ZMY20WKFC-WERKS

PRODUCT = I_ZMY20WKFC-PRODUCT

SHPPOINT = I_ZMY20WKFC-SHPPOINT.

IF SY-SUBRC EQ 0.

IF I_ZMY20WKFC-SPMON EQ P_STRMTH.

MOVE I_ZMY20WKFC-QTY01 TO I_OUTPUT-QTY01.

MOVE I_ZMY20WKFC-QTY02 TO I_OUTPUT-QTY02.

MOVE I_ZMY20WKFC-QTY03 TO I_OUTPUT-QTY03.

MOVE I_ZMY20WKFC-QTY04 TO I_OUTPUT-QTY04.

MOVE I_ZMY20WKFC-QTY05 TO I_OUTPUT-QTY05.

MOVE I_ZMY20WKFC-QTY06 TO I_OUTPUT-QTY06.

MOVE I_ZMY20WKFC-TOTQTY TO I_OUTPUT-TOTFC1.

MOVE W_ORD01 TO I_OUTPUT-ORD01.

MOVE W_ORD02 TO I_OUTPUT-ORD02.

MOVE W_ORD03 TO I_OUTPUT-ORD03.

MOVE W_ORD04 TO I_OUTPUT-ORD04.

MOVE W_ORD05 TO I_OUTPUT-ORD05.

MOVE W_ORD06 TO I_OUTPUT-ORD06.

MOVE W_ORDT1 TO I_OUTPUT-TOTORD1.

ELSE.

MOVE I_ZMY20WKFC-QTY01 TO I_OUTPUT-QTY07.

MOVE I_ZMY20WKFC-QTY02 TO I_OUTPUT-QTY08.

MOVE I_ZMY20WKFC-QTY03 TO I_OUTPUT-QTY09.

MOVE I_ZMY20WKFC-QTY04 TO I_OUTPUT-QTY10.

MOVE I_ZMY20WKFC-QTY05 TO I_OUTPUT-QTY11.

MOVE I_ZMY20WKFC-QTY06 TO I_OUTPUT-QTY12.

MOVE I_ZMY20WKFC-TOTQTY TO I_OUTPUT-TOTFC2.

MOVE W_ORD07 TO I_OUTPUT-ORD07.

MOVE W_ORD08 TO I_OUTPUT-ORD08.

MOVE W_ORD09 TO I_OUTPUT-ORD09.

MOVE W_ORD10 TO I_OUTPUT-ORD10.

MOVE W_ORD11 TO I_OUTPUT-ORD11.

MOVE W_ORD12 TO I_OUTPUT-ORD12.

MOVE W_ORDT2 TO I_OUTPUT-TOTORD2.

ENDIF.

MODIFY I_OUTPUT INDEX SY-TABIX.

ELSE.

CLEAR : I_OUTPUT.

MOVE I_ZMY20WKFC-STCSTP TO I_OUTPUT-STCSTP.

MOVE I_ZMY20WKFC-WERKS TO I_OUTPUT-WERKS.

MOVE I_ZMY20WKFC-PRODUCT TO I_OUTPUT-PRODUCT.

MOVE I_ZMY20WKFC-SHPPOINT TO I_OUTPUT-SHPPOINT.

IF I_ZMY20WKFC-SPMON EQ P_STRMTH.

MOVE I_ZMY20WKFC-QTY01 TO I_OUTPUT-QTY01.

MOVE I_ZMY20WKFC-QTY02 TO I_OUTPUT-QTY02.

MOVE I_ZMY20WKFC-QTY03 TO I_OUTPUT-QTY03.

MOVE I_ZMY20WKFC-QTY04 TO I_OUTPUT-QTY04.

MOVE I_ZMY20WKFC-QTY05 TO I_OUTPUT-QTY05.

MOVE I_ZMY20WKFC-QTY06 TO I_OUTPUT-QTY06.

MOVE I_ZMY20WKFC-TOTQTY TO I_OUTPUT-TOTFC1.

MOVE W_ORD01 TO I_OUTPUT-ORD01.

MOVE W_ORD02 TO I_OUTPUT-ORD02.

MOVE W_ORD03 TO I_OUTPUT-ORD03.

MOVE W_ORD04 TO I_OUTPUT-ORD04.

MOVE W_ORD05 TO I_OUTPUT-ORD05.

MOVE W_ORD06 TO I_OUTPUT-ORD06.

MOVE W_ORDT1 TO I_OUTPUT-TOTORD1.

ELSE.

MOVE I_ZMY20WKFC-QTY01 TO I_OUTPUT-QTY07.

MOVE I_ZMY20WKFC-QTY02 TO I_OUTPUT-QTY08.

MOVE I_ZMY20WKFC-QTY03 TO I_OUTPUT-QTY09.

MOVE I_ZMY20WKFC-QTY04 TO I_OUTPUT-QTY10.

MOVE I_ZMY20WKFC-QTY05 TO I_OUTPUT-QTY11.

MOVE I_ZMY20WKFC-QTY06 TO I_OUTPUT-QTY12.

MOVE I_ZMY20WKFC-TOTQTY TO I_OUTPUT-TOTFC2.

MOVE W_ORD07 TO I_OUTPUT-ORD07.

MOVE W_ORD08 TO I_OUTPUT-ORD08.

MOVE W_ORD09 TO I_OUTPUT-ORD09.

MOVE W_ORD10 TO I_OUTPUT-ORD10.

MOVE W_ORD11 TO I_OUTPUT-ORD11.

MOVE W_ORD12 TO I_OUTPUT-ORD12.

MOVE W_ORDT2 TO I_OUTPUT-TOTORD2.

ENDIF.

APPEND I_OUTPUT.

ENDIF.

ENDLOOP.

  • Process the Order data which Forecast not available

LOOP AT I_ORDER WHERE UPDFLG NE 'X'.

READ TABLE I_OUTPUT WITH KEY STCSTP = I_ORDER-STCSTP

WERKS = I_ORDER-WERKS

PRODUCT = I_ORDER-PRODUCT

SHPPOINT = I_ORDER-VSTEL.

IF SY-SUBRC EQ 0.

IF I_ORDER-SPMON EQ P_STRMTH.

IF I_ORDER-WEEK EQ W_WKTBL01.

I_OUTPUT-ORD01 = I_OUTPUT-ORD01 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL02.

I_OUTPUT-ORD02 = I_OUTPUT-ORD02 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL03.

I_OUTPUT-ORD03 = I_OUTPUT-ORD03 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL04.

I_OUTPUT-ORD04 = I_OUTPUT-ORD04 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL05.

I_OUTPUT-ORD05 = I_OUTPUT-ORD05 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL06.

I_OUTPUT-ORD06 = I_OUTPUT-ORD06 + I_ORDER-WMENG.

ENDIF.

I_OUTPUT-TOTORD1 = I_OUTPUT-TOTORD1 + I_ORDER-WMENG.

ELSE.

IF I_ORDER-WEEK EQ W_WKTBL07.

I_OUTPUT-ORD07 = I_OUTPUT-ORD07 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL08.

I_OUTPUT-ORD08 = I_OUTPUT-ORD08 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL09.

I_OUTPUT-ORD09 = I_OUTPUT-ORD09 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL10.

I_OUTPUT-ORD10 = I_OUTPUT-ORD10 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL11.

I_OUTPUT-ORD11 = I_OUTPUT-ORD11 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL12.

I_OUTPUT-ORD12 = I_OUTPUT-ORD12 + I_ORDER-WMENG.

ENDIF.

I_OUTPUT-TOTORD2 = I_OUTPUT-TOTORD2 + I_ORDER-WMENG.

ENDIF.

MODIFY I_OUTPUT INDEX SY-TABIX.

ELSE.

CLEAR : I_OUTPUT.

MOVE I_ORDER-STCSTP TO I_OUTPUT-STCSTP.

MOVE I_ORDER-WERKS TO I_OUTPUT-WERKS.

MOVE I_ORDER-PRODUCT TO I_OUTPUT-PRODUCT.

MOVE I_ORDER-VSTEL TO I_OUTPUT-SHPPOINT.

IF I_ORDER-SPMON EQ P_STRMTH.

IF I_ORDER-WEEK EQ W_WKTBL01.

I_OUTPUT-ORD01 = I_OUTPUT-ORD01 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL02.

I_OUTPUT-ORD02 = I_OUTPUT-ORD02 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL03.

I_OUTPUT-ORD03 = I_OUTPUT-ORD03 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL04.

I_OUTPUT-ORD04 = I_OUTPUT-ORD04 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL05.

I_OUTPUT-ORD05 = I_OUTPUT-ORD05 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL06.

I_OUTPUT-ORD06 = I_OUTPUT-ORD06 + I_ORDER-WMENG.

ENDIF.

I_OUTPUT-TOTORD1 = I_OUTPUT-TOTORD1 + I_ORDER-WMENG.

ELSE.

IF I_ORDER-WEEK EQ W_WKTBL07.

I_OUTPUT-ORD07 = I_OUTPUT-ORD07 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL08.

I_OUTPUT-ORD08 = I_OUTPUT-ORD08 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL09.

I_OUTPUT-ORD09 = I_OUTPUT-ORD09 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL10.

I_OUTPUT-ORD10 = I_OUTPUT-ORD10 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL11.

I_OUTPUT-ORD11 = I_OUTPUT-ORD11 + I_ORDER-WMENG.

ELSEIF I_ORDER-WEEK EQ W_WKTBL12.

I_OUTPUT-ORD12 = I_OUTPUT-ORD12 + I_ORDER-WMENG.

ENDIF.

I_OUTPUT-TOTORD2 = I_OUTPUT-TOTORD2 + I_ORDER-WMENG.

ENDIF.

APPEND I_OUTPUT.

ENDIF.

ENDLOOP.

  • Convert the Order Qty from KG to MT and calculate the %

LOOP AT I_OUTPUT.

V_TABIX = SY-TABIX.

SELECT SINGLE MAKTX INTO I_OUTPUT-MAKTX FROM ZMY20PROD WHERE PRODUCT EQ I_OUTPUT-PRODUCT.

I_OUTPUT-ORD01 = I_OUTPUT-ORD01 / 1000.

I_OUTPUT-ORD02 = I_OUTPUT-ORD02 / 1000.

I_OUTPUT-ORD03 = I_OUTPUT-ORD03 / 1000.

I_OUTPUT-ORD04 = I_OUTPUT-ORD04 / 1000.

I_OUTPUT-ORD05 = I_OUTPUT-ORD05 / 1000.

I_OUTPUT-ORD06 = I_OUTPUT-ORD06 / 1000.

I_OUTPUT-ORD07 = I_OUTPUT-ORD07 / 1000.

I_OUTPUT-ORD08 = I_OUTPUT-ORD08 / 1000.

I_OUTPUT-ORD09 = I_OUTPUT-ORD09 / 1000.

I_OUTPUT-ORD10 = I_OUTPUT-ORD10 / 1000.

I_OUTPUT-ORD11 = I_OUTPUT-ORD11 / 1000.

I_OUTPUT-ORD12 = I_OUTPUT-ORD12 / 1000.

I_OUTPUT-TOTORD1 = I_OUTPUT-TOTORD1 / 1000.

I_OUTPUT-TOTORD2 = I_OUTPUT-TOTORD2 / 1000.

IF I_OUTPUT-TOTFC1 GT 0.

I_OUTPUT-FCORD1 = I_OUTPUT-TOTORD1 / I_OUTPUT-TOTFC1 * 100.

ENDIF.

IF I_OUTPUT-TOTFC2 GT 0.

I_OUTPUT-FCORD2 = I_OUTPUT-TOTORD2 / I_OUTPUT-TOTFC2 * 100.

ENDIF.

MOVE '1' TO I_OUTPUT-SORTKEY.

SELECT SINGLE * FROM ZMY20GP WHERE ZZKEY1 EQ 'ZMY20FCUP'

AND ZZKEY2 EQ I_OUTPUT-STCSTP

AND ZZKEY3 EQ 'SHIPTOCUST'.

IF SY-SUBRC EQ 0.

MOVE '2' TO I_OUTPUT-SORTKEY.

ENDIF.

MODIFY I_OUTPUT INDEX SY-TABIX.

ENDLOOP.

LOOP AT I_OUTPUT.

READ TABLE I_PRDWISE WITH KEY SORTKEY = I_OUTPUT-SORTKEY

STCSTP = I_OUTPUT-STCSTP

PRODUCT = I_OUTPUT-PRODUCT.

IF SY-SUBRC EQ 0.

I_PRDWISE-TOTFC1 = I_PRDWISE-TOTFC1 + I_OUTPUT-TOTFC1.

I_PRDWISE-TOTORD1 = I_PRDWISE-TOTORD1 + I_OUTPUT-TOTORD1.

I_PRDWISE-TOTFC2 = I_PRDWISE-TOTFC2 + I_OUTPUT-TOTFC2.

I_PRDWISE-TOTORD2 = I_PRDWISE-TOTORD2 + I_OUTPUT-TOTORD2.

MODIFY I_PRDWISE INDEX SY-TABIX.

ELSE.

CLEAR : I_PRDWISE.

MOVE I_OUTPUT-SORTKEY TO I_PRDWISE-SORTKEY.

MOVE I_OUTPUT-STCSTP TO I_PRDWISE-STCSTP.

MOVE I_OUTPUT-PRODUCT TO I_PRDWISE-PRODUCT.

MOVE I_OUTPUT-MAKTX TO I_PRDWISE-MAKTX.

I_PRDWISE-TOTFC1 = I_PRDWISE-TOTFC1 + I_OUTPUT-TOTFC1.

I_PRDWISE-TOTORD1 = I_PRDWISE-TOTORD1 + I_OUTPUT-TOTORD1.

I_PRDWISE-TOTFC2 = I_PRDWISE-TOTFC2 + I_OUTPUT-TOTFC2.

I_PRDWISE-TOTORD2 = I_PRDWISE-TOTORD2 + I_OUTPUT-TOTORD2.

APPEND I_PRDWISE.

ENDIF.

ENDLOOP.

LOOP AT I_PRDWISE.

IF I_PRDWISE-TOTFC1 GT 0.

I_PRDWISE-FCORD1 = I_PRDWISE-TOTORD1 / I_PRDWISE-TOTFC1 * 100.

ENDIF.

IF I_PRDWISE-TOTFC2 GT 0.

I_PRDWISE-FCORD2 = I_PRDWISE-TOTORD2 / I_PRDWISE-TOTFC2 * 100.

ENDIF.

I_PRDWISE-DIFF1 = I_PRDWISE-TOTORD1 - I_PRDWISE-TOTFC1.

I_PRDWISE-DIFF2 = I_PRDWISE-TOTORD2 - I_PRDWISE-TOTFC2.

MODIFY I_PRDWISE INDEX SY-TABIX.

ENDLOOP.

SORT I_OUTPUT BY SORTKEY STCSTP WERKS PRODUCT.

  • Begin of Changes by Karthikeyan on 09/03/2007 - Req No -BA3K988704

  • SORT I_PRDWISE BY SORTKEY STCSTP PRODUCT.

SORT I_PRDWISE BY PRODUCT STCSTP.

  • End of Changes by Karthikeyan on 09/03/2007 - Req No -BA3K988704

IF P_ZERO = 'X'.

DELETE I_OUTPUT WHERE TOTFC1 EQ 0

AND TOTORD1 EQ 0

AND TOTFC2 EQ 0

AND TOTORD2 EQ 0.

DELETE I_PRDWISE WHERE TOTFC1 EQ 0

AND TOTORD1 EQ 0

AND TOTFC2 EQ 0

AND TOTORD2 EQ 0.

ENDIF.

  • Set Cell colour for Remark entries

LOOP AT I_OUTPUT.

V_TABIX = SY-TABIX.

SELECT * FROM ZMY20RMRK WHERE BUKRS EQ P_BUKRS

AND STCSTP EQ I_OUTPUT-STCSTP

AND WERKS EQ I_OUTPUT-WERKS

AND SHPPOINT EQ I_OUTPUT-SHPPOINT

AND PRODUCT EQ I_OUTPUT-PRODUCT.

CLEAR : V_FNAME.

IF ZMY20RMRK-SPMON = P_STRMTH.

READ TABLE I_WEEKS WITH KEY WEEKS = ZMY20RMRK-WEEK

MONTH = P_STRMTH+4(2).

IF I_WEEKS-SLNO = '1'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY01' TO V_FNAME.

ELSE.

MOVE 'ORD01' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '2'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY02' TO V_FNAME.

ELSE.

MOVE 'ORD02' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '3'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY03' TO V_FNAME.

ELSE.

MOVE 'ORD03' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '4'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY04' TO V_FNAME.

ELSE.

MOVE 'ORD04' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '5'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY05' TO V_FNAME.

ELSE.

MOVE 'ORD05' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '6'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY06' TO V_FNAME.

ELSE.

MOVE 'ORD06' TO V_FNAME.

ENDIF.

ENDIF.

ELSEIF ZMY20RMRK-SPMON = V_ENDMTH.

READ TABLE I_WEEKS WITH KEY WEEKS = ZMY20RMRK-WEEK

MONTH = V_ENDMTH+4(2).

IF I_WEEKS-SLNO = '7'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY07' TO V_FNAME.

ELSE.

MOVE 'ORD07' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '8'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY08' TO V_FNAME.

ELSE.

MOVE 'ORD08' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '9'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY09' TO V_FNAME.

ELSE.

MOVE 'ORD09' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '10'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY10' TO V_FNAME.

ELSE.

MOVE 'ORD10' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '11'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY11' TO V_FNAME.

ELSE.

MOVE 'ORD11' TO V_FNAME.

ENDIF.

ELSEIF I_WEEKS-SLNO = '12'.

IF ZMY20RMRK-FC_ORDER = 'FC'.

MOVE 'QTY12' TO V_FNAME.

ELSE.

MOVE 'ORD12' TO V_FNAME.

ENDIF.

ENDIF.

ENDIF.

IF V_FNAME NE SPACE.

PERFORM ALV_COLOR USING V_FNAME 6 0 0 CHANGING I_OUTPUT-CELLCOLOR.

ENDIF.

ENDSELECT.

MODIFY I_OUTPUT INDEX V_TABIX.

ENDLOOP.

ENDFORM. " 4000_CONSOLIDATE_DATA

*&----


*

*& Form f4_help_stcstp

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM F4_HELP_STCSTP.

*Initialize screen values

DATA: PROGNAME LIKE SY-REPID,

DYNNUM LIKE SY-DYNNR.

PROGNAME = SY-REPID.

DYNNUM = SY-DYNNR.

CLEAR : T_STCP.

REFRESH : T_STCP.

SELECT * FROM T005 WHERE LAND1 NE SPACE.

CLEAR : T_STCP.

MOVE T005-LAND1 TO T_STCP-STCSTP.

MOVE '1' TO T_STCP-SORTKEY.

APPEND T_STCP.

ENDSELECT.

SELECT * FROM ZMY20GP WHERE ZZKEY1 = 'ZMY20FCUP'

AND ZZKEY3 = 'SHIPTOCUST'.

CLEAR : T_STCP.

MOVE ZMY20GP-ZZKEY2 TO T_STCP-STCSTP.

MOVE '2' TO T_STCP-SORTKEY.

APPEND T_STCP.

ENDSELECT.

SORT T_STCP BY SORTKEY STCSTP.

DELETE ADJACENT DUPLICATES FROM T_STCP COMPARING SORTKEY STCSTP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'STCSTP'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'S_STCSTP'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = T_STCP.

ENDFORM. " f4_help_stcstp

*&----


*

*& Form f4_help_product

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM F4_HELP_PRODUCT.

*Initialize screen values

DATA: PROGNAME LIKE SY-REPID,

DYNNUM LIKE SY-DYNNR.

PROGNAME = SY-REPID.

DYNNUM = SY-DYNNR.

CLEAR : T_PROD.

REFRESH : T_PROD.

SELECT * INTO CORRESPONDING FIELDS OF TABLE T_PROD FROM ZMY20PROD

WHERE PRODUCT NE SPACE.

SORT T_PROD BY PRODUCT.

DELETE ADJACENT DUPLICATES FROM T_PROD COMPARING PRODUCT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'PRODUCT'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'S_PROD'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = T_PROD.

ENDFORM. " f4_help_product

*&----


*

*& Form GET_REMARKENTRY_USER

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM GET_REMARKENTRY_USER.

REFRESH : T_USER.

SELECT * FROM ZMY20GP WHERE ZZKEY1 = 'ZMY20FCUP'

AND ZZKEY2 = 'REMARKENTRY'

AND ZZKEY3 = 'USER'.

CLEAR : T_USER.

IF ZMY20GP-ZZVAL1 NE SPACE.

MOVE ZMY20GP-ZZVAL1 TO T_USER-UNAME.

APPEND T_USER.

ENDIF.

IF ZMY20GP-ZZVAL2 NE SPACE.

MOVE ZMY20GP-ZZVAL2 TO T_USER-UNAME.

APPEND T_USER.

ENDIF.

IF ZMY20GP-ZZVAL3 NE SPACE.

MOVE ZMY20GP-ZZVAL3 TO T_USER-UNAME.

APPEND T_USER.

ENDIF.

IF ZMY20GP-ZZVAL4 NE SPACE.

MOVE ZMY20GP-ZZVAL4 TO T_USER-UNAME.

APPEND T_USER.

ENDIF.

ENDSELECT.

ENDFORM. " GET_REMARKENTRY_USER

  • ALV Form Routines ******************************

*----


*

  • FORM MAIN *

*----


*

  • Main output routine *

*----


*

FORM MAIN.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'ZMY20FCORD'

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME = ' '

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE = 'WEEKLY FORECAST VS ORDER REPORT'

  • I_GRID_SETTINGS =

IS_LAYOUT = GS_LAYOUT

IT_FIELDCAT = GT_FIELDCAT[]

  • IT_EXCLUDING = ' '

  • IT_SPECIAL_GROUPS =

IT_SORT = GT_SORT

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = GT_EVENTS[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = I_OUTPUT

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "main

*&----


*

*& Form fieldcat_init

*&----


*

  • text

*----


*

  • -->P_GT_FIELDCAT[] text

*----


*

FORM FIELDCAT_INIT USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV..

DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'SORTKEY'.

LS_FIELDCAT-NO_OUT = 'X'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'STCSTP'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U01.

LS_FIELDCAT-SELTEXT_M = TEXT-U01.

LS_FIELDCAT-SELTEXT_S = TEXT-U01.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U01.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'WERKS'.

LS_FIELDCAT-OUTPUTLEN = '06'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U02.

LS_FIELDCAT-SELTEXT_M = TEXT-U02.

LS_FIELDCAT-SELTEXT_S = TEXT-U02.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U02.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'PRODUCT'.

LS_FIELDCAT-OUTPUTLEN = '18'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U04.

LS_FIELDCAT-SELTEXT_M = TEXT-U04.

LS_FIELDCAT-SELTEXT_S = TEXT-U04.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U04.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'MAKTX'.

LS_FIELDCAT-OUTPUTLEN = '40'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-NO_OUT = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U05.

LS_FIELDCAT-SELTEXT_M = TEXT-U05.

LS_FIELDCAT-SELTEXT_S = TEXT-U05.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U05.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'SHPPOINT'.

LS_FIELDCAT-OUTPUTLEN = '20'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U03.

LS_FIELDCAT-SELTEXT_M = TEXT-U03.

LS_FIELDCAT-SELTEXT_S = TEXT-U03.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U03.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY01'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR01.

LS_FIELDCAT-SELTEXT_M = W_FCHDR01.

LS_FIELDCAT-SELTEXT_S = W_FCHDR01.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR01.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD01'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR01.

LS_FIELDCAT-SELTEXT_M = W_ORHDR01.

LS_FIELDCAT-SELTEXT_S = W_ORHDR01.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR01.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY02'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR02.

LS_FIELDCAT-SELTEXT_M = W_FCHDR02.

LS_FIELDCAT-SELTEXT_S = W_FCHDR02.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR02.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD02'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR02.

LS_FIELDCAT-SELTEXT_M = W_ORHDR02.

LS_FIELDCAT-SELTEXT_S = W_ORHDR02.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR02.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY03'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR03.

LS_FIELDCAT-SELTEXT_M = W_FCHDR03.

LS_FIELDCAT-SELTEXT_S = W_FCHDR03.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR03.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD03'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR03.

LS_FIELDCAT-SELTEXT_M = W_ORHDR03.

LS_FIELDCAT-SELTEXT_S = W_ORHDR03.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR03.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY04'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR04.

LS_FIELDCAT-SELTEXT_M = W_FCHDR04.

LS_FIELDCAT-SELTEXT_S = W_FCHDR04.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR04.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD04'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR04.

LS_FIELDCAT-SELTEXT_M = W_ORHDR04.

LS_FIELDCAT-SELTEXT_S = W_ORHDR04.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR04.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY05'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR05.

LS_FIELDCAT-SELTEXT_M = W_FCHDR05.

LS_FIELDCAT-SELTEXT_S = W_FCHDR05.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR05.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD05'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR05.

LS_FIELDCAT-SELTEXT_M = W_ORHDR05.

LS_FIELDCAT-SELTEXT_S = W_ORHDR05.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR05.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY06'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR06.

LS_FIELDCAT-SELTEXT_M = W_FCHDR06.

LS_FIELDCAT-SELTEXT_S = W_FCHDR06.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR06.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD06'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR06.

LS_FIELDCAT-SELTEXT_M = W_ORHDR06.

LS_FIELDCAT-SELTEXT_S = W_ORHDR06.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR06.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTFC1'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDRT1.

LS_FIELDCAT-SELTEXT_M = W_FCHDRT1.

LS_FIELDCAT-SELTEXT_S = W_FCHDRT1.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDRT1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTORD1'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDRT1.

LS_FIELDCAT-SELTEXT_M = W_ORHDRT1.

LS_FIELDCAT-SELTEXT_S = W_ORHDRT1.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDRT1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'FCORD1'.

LS_FIELDCAT-DATATYPE = 'CURR'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_HDR%1.

LS_FIELDCAT-SELTEXT_M = W_HDR%1.

LS_FIELDCAT-SELTEXT_S = W_HDR%1.

LS_FIELDCAT-REPTEXT_DDIC = W_HDR%1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY07'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR07.

LS_FIELDCAT-SELTEXT_M = W_FCHDR07.

LS_FIELDCAT-SELTEXT_S = W_FCHDR07.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR07.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD07'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR07.

LS_FIELDCAT-SELTEXT_M = W_ORHDR07.

LS_FIELDCAT-SELTEXT_S = W_ORHDR07.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR07.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY08'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR08.

LS_FIELDCAT-SELTEXT_M = W_FCHDR08.

LS_FIELDCAT-SELTEXT_S = W_FCHDR08.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR08.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD08'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR08.

LS_FIELDCAT-SELTEXT_M = W_ORHDR08.

LS_FIELDCAT-SELTEXT_S = W_ORHDR08.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR08.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY09'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR09.

LS_FIELDCAT-SELTEXT_M = W_FCHDR09.

LS_FIELDCAT-SELTEXT_S = W_FCHDR09.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR09.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD09'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR09.

LS_FIELDCAT-SELTEXT_M = W_ORHDR09.

LS_FIELDCAT-SELTEXT_S = W_ORHDR09.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR09.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY10'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR10.

LS_FIELDCAT-SELTEXT_M = W_FCHDR10.

LS_FIELDCAT-SELTEXT_S = W_FCHDR10.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR10.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD10'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR10.

LS_FIELDCAT-SELTEXT_M = W_ORHDR10.

LS_FIELDCAT-SELTEXT_S = W_ORHDR10.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR10.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY11'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR11.

LS_FIELDCAT-SELTEXT_M = W_FCHDR11.

LS_FIELDCAT-SELTEXT_S = W_FCHDR11.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR11.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD11'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR11.

LS_FIELDCAT-SELTEXT_M = W_ORHDR11.

LS_FIELDCAT-SELTEXT_S = W_ORHDR11.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR11.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'QTY12'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_FCHDR12.

LS_FIELDCAT-SELTEXT_M = W_FCHDR12.

LS_FIELDCAT-SELTEXT_S = W_FCHDR12.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDR12.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'ORD12'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-SELTEXT_L = W_ORHDR12.

LS_FIELDCAT-SELTEXT_M = W_ORHDR12.

LS_FIELDCAT-SELTEXT_S = W_ORHDR12.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDR12.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTFC2'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDRT2.

LS_FIELDCAT-SELTEXT_M = W_FCHDRT2.

LS_FIELDCAT-SELTEXT_S = W_FCHDRT2.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDRT2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTORD2'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDRT2.

LS_FIELDCAT-SELTEXT_M = W_ORHDRT2.

LS_FIELDCAT-SELTEXT_S = W_ORHDRT2.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDRT2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'FCORD2'.

LS_FIELDCAT-DATATYPE = 'CURR'.

LS_FIELDCAT-OUTPUTLEN = '11'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_HDR%2.

LS_FIELDCAT-SELTEXT_M = W_HDR%2.

LS_FIELDCAT-SELTEXT_S = W_HDR%2.

LS_FIELDCAT-REPTEXT_DDIC = W_HDR%2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

ENDFORM. " fieldcat_init

*----


*

  • FORM layout_init *

*----


*

  • ........ *

*----


*

  • --> LS_LAYOUT *

*----


*

FORM LAYOUT_INIT USING LS_LAYOUT TYPE SLIS_LAYOUT_ALV.

  • LS_LAYOUT-ZEBRA = 'X'.

LS_LAYOUT-COLTAB_FIELDNAME = 'CELLCOLOR'.

ENDFORM. "layout_init

*----


*

  • FORM EVENTTAB_BUILD *

*----


*

  • ........ *

*----


*

  • --> LT_EVENTS *

*----


*

FORM EVENTTAB_BUILD USING LT_EVENTS TYPE SLIS_T_EVENT.

DATA: LS_EVENT TYPE SLIS_ALV_EVENT.

MOVE 'PF_STATUS_SET' TO LS_EVENT-NAME.

MOVE 'ZMY20FCORD' TO LS_EVENT-FORM.

APPEND LS_EVENT TO LT_EVENTS.

CLEAR LS_EVENT.

MOVE 'USER_COMMAND' TO LS_EVENT-NAME.

MOVE 'USER_COMMAND' TO LS_EVENT-FORM.

APPEND LS_EVENT TO LT_EVENTS.

CLEAR LS_EVENT.

ENDFORM. "eventtab_build

*----

-


  • FORM PF_STATUS_SET

*----

-


FORM ZMY20FCORD USING EXTAB TYPE SLIS_T_EXTAB. "#EC CALLED

  • Begin of Changes of the PF Status as per Naming Convension

  • - by Karthikeyan on 22/01/2007 - Req No -BA3K987088

  • SET PF-STATUS 'Z16FCUP' EXCLUDING EXTAB.

SET PF-STATUS 'ZMY20FCORD' EXCLUDING EXTAB.

  • End of Changes of the PF Status as per Naming Convension

  • - by Karthikeyan on 22/01/2007 - Req No -BA3K987088

ENDFORM. "ZMY20FCORD

*----


*

  • FORM user_command *

*----


*

  • ........ *

*----


*

  • --> RF_UCOMM *

  • --> RS_SELFIELD *

*----


*

FORM USER_COMMAND USING RF_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD. "#EC CALLED

CASE RF_UCOMM.

WHEN 'PRODUCT'.

PERFORM MAIN_PROD.

WHEN '&IC1'.

IF RS_SELFIELD-TABINDEX IS INITIAL OR RS_SELFIELD-FIELDNAME IS INITIAL.

MESSAGE E000 WITH TEXT-E01.

ENDIF.

READ TABLE I_OUTPUT INDEX RS_SELFIELD-TABINDEX.

V_TABIX = SY-TABIX.

CASE RS_SELFIELD-FIELDNAME.

WHEN 'QTY01'.

READ TABLE I_WEEKS WITH KEY SLNO = '1'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD01'.

READ TABLE I_WEEKS WITH KEY SLNO = '1'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY02'.

READ TABLE I_WEEKS WITH KEY SLNO = '2'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD02'.

READ TABLE I_WEEKS WITH KEY SLNO = '2'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY03'.

READ TABLE I_WEEKS WITH KEY SLNO = '3'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD03'.

READ TABLE I_WEEKS WITH KEY SLNO = '3'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY04'.

READ TABLE I_WEEKS WITH KEY SLNO = '4'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD04'.

READ TABLE I_WEEKS WITH KEY SLNO = '4'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY05'.

READ TABLE I_WEEKS WITH KEY SLNO = '5'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD05'.

READ TABLE I_WEEKS WITH KEY SLNO = '5'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY06'.

READ TABLE I_WEEKS WITH KEY SLNO = '6'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD06'.

READ TABLE I_WEEKS WITH KEY SLNO = '6'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME P_STRMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY07'.

READ TABLE I_WEEKS WITH KEY SLNO = '7'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD07'.

READ TABLE I_WEEKS WITH KEY SLNO = '7'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY08'.

READ TABLE I_WEEKS WITH KEY SLNO = '8'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD08'.

READ TABLE I_WEEKS WITH KEY SLNO = '8'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY09'.

READ TABLE I_WEEKS WITH KEY SLNO = '9'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD09'.

READ TABLE I_WEEKS WITH KEY SLNO = '9'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY10'.

READ TABLE I_WEEKS WITH KEY SLNO = '10'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD10'.

READ TABLE I_WEEKS WITH KEY SLNO = '10'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY11'.

READ TABLE I_WEEKS WITH KEY SLNO = '11'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD11'.

READ TABLE I_WEEKS WITH KEY SLNO = '11'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'QTY12'.

READ TABLE I_WEEKS WITH KEY SLNO = '12'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'FC'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

WHEN 'ORD12'.

READ TABLE I_WEEKS WITH KEY SLNO = '12'.

PERFORM POPUP_FUNCTION_CALL USING RS_SELFIELD-FIELDNAME V_ENDMTH I_WEEKS-WEEKS 'OR'.

IF V_UPDFLAG = 'X'.

MODIFY I_OUTPUT INDEX V_TABIX.

PERFORM MAIN.

ENDIF.

ENDCASE.

WHEN '&F03' OR '&F15' OR '&F12'.

LEAVE PROGRAM.

WHEN 'BACK' OR 'EXIT' OR 'CANC'.

LEAVE PROGRAM.

WHEN 'CLOSE'.

LEAVE PROGRAM.

ENDCASE.

CLEAR : RF_UCOMM.

ENDFORM. "user_command

*&----


*

*& Form POPUP_FUNCTION_CALL

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM POPUP_FUNCTION_CALL USING PF_FNAME PF_SPMON PF_WEEKS PF_FC.

CLEAR : V_REMARK1, V_REMARK2, I_FIELDS, V_UPDFLAG.

REFRESH : I_FIELDS.

SELECT SINGLE REMARK1 REMARK2 INTO (V_REMARK1, V_REMARK2) FROM ZMY20RMRK

WHERE BUKRS EQ P_BUKRS

AND STCSTP EQ I_OUTPUT-STCSTP

AND WERKS EQ I_OUTPUT-WERKS

AND SHPPOINT EQ I_OUTPUT-SHPPOINT

AND PRODUCT EQ I_OUTPUT-PRODUCT

AND SPMON EQ PF_SPMON

AND WEEK EQ PF_WEEKS

AND FC_ORDER EQ PF_FC.

IF SY-SUBRC NE 0.

MOVE 'ZMY20RMRK' TO I_FIELDS-TABNAME.

MOVE 'REMARK1' TO I_FIELDS-FIELDNAME.

MOVE SPACE TO I_FIELDS-VALUE.

APPEND I_FIELDS.

MOVE 'ZMY20RMRK' TO I_FIELDS-TABNAME.

MOVE 'REMARK2' TO I_FIELDS-FIELDNAME.

MOVE SPACE TO I_FIELDS-VALUE.

APPEND I_FIELDS.

ELSE.

MOVE 'ZMY20RMRK' TO I_FIELDS-TABNAME.

MOVE 'REMARK1' TO I_FIELDS-FIELDNAME.

MOVE V_REMARK1 TO I_FIELDS-VALUE.

APPEND I_FIELDS.

MOVE 'ZMY20RMRK' TO I_FIELDS-TABNAME.

MOVE 'REMARK2' TO I_FIELDS-FIELDNAME.

MOVE V_REMARK2 TO I_FIELDS-VALUE.

APPEND I_FIELDS.

ENDIF.

READ TABLE T_USER WITH KEY UNAME = SY-UNAME.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

POPUP_TITLE = TEXT-R01

START_COLUMN = '70'

START_ROW = '3'

IMPORTING

RETURNCODE = V_RETCODE

TABLES

FIELDS = I_FIELDS

EXCEPTIONS

ERROR_IN_FIELDS = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF V_RETCODE EQ SPACE.

CLEAR : ZMY20RMRK.

MOVE P_BUKRS TO ZMY20RMRK-BUKRS.

MOVE I_OUTPUT-STCSTP TO ZMY20RMRK-STCSTP.

MOVE I_OUTPUT-WERKS TO ZMY20RMRK-WERKS.

MOVE I_OUTPUT-SHPPOINT TO ZMY20RMRK-SHPPOINT.

MOVE I_OUTPUT-PRODUCT TO ZMY20RMRK-PRODUCT.

MOVE PF_SPMON TO ZMY20RMRK-SPMON.

MOVE PF_WEEKS TO ZMY20RMRK-WEEK.

MOVE PF_FC TO ZMY20RMRK-FC_ORDER.

READ TABLE I_FIELDS WITH KEY TABNAME = 'ZMY20RMRK'

FIELDNAME = 'REMARK1'.

MOVE I_FIELDS-VALUE TO ZMY20RMRK-REMARK1.

READ TABLE I_FIELDS WITH KEY TABNAME = 'ZMY20RMRK'

FIELDNAME = 'REMARK2'.

MOVE I_FIELDS-VALUE TO ZMY20RMRK-REMARK2.

  • Begin of Addition by T.Karthikeyan - UIS on 18/01/2007 - Req No - BA3K987022

IF ZMY20RMRK-REMARK1 NE SPACE OR ZMY20RMRK-REMARK2 NE SPACE.

  • End of Addition by T.Karthikeyan - UIS on 18/01/2007 - Req No - BA3K987022

MODIFY ZMY20RMRK.

PERFORM ALV_COLOR USING PF_FNAME 6 0 0 CHANGING I_OUTPUT-CELLCOLOR.

MOVE 'X' TO V_UPDFLAG.

ENDIF.

ENDIF.

ELSE.

IF V_REMARK1 NE SPACE AND V_REMARK2 NE SPACE.

CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

EXPORTING

TITEL = TEXT-R02

TEXTLINE1 = V_REMARK1

TEXTLINE2 = V_REMARK2

START_COLUMN = '70'

START_ROW = '3'.

ENDIF.

ENDIF.

ENDFORM. " POPUP_FUNCTION_CALL

*&----


*

*& Form alv_color

*&----


*

  • set field color

*----


*

FORM ALV_COLOR USING PV_FIELDNAME TYPE FIELDNAME

PV_COLOR TYPE I

PV_INTENSIFY TYPE I

PV_INVERSE TYPE I

CHANGING PT_COLORS TYPE SLIS_T_SPECIALCOL_ALV.

DATA: LS_COLORS TYPE LINE OF SLIS_T_SPECIALCOL_ALV.

LS_COLORS-FIELDNAME = PV_FIELDNAME.

LS_COLORS-COLOR-COL = PV_COLOR.

LS_COLORS-COLOR-INT = PV_INTENSIFY.

LS_COLORS-COLOR-INV = PV_INVERSE.

APPEND LS_COLORS TO PT_COLORS.

ENDFORM. " alv_color

*----


*

  • FORM SORT_BUILD *

*----


*

FORM SORT_BUILD USING LT_SORT TYPE SLIS_T_SORTINFO_ALV.

DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.

*

LS_SORT-FIELDNAME = 'SORTKEY'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

LS_SORT-FIELDNAME = 'STCSTP'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

LS_SORT-FIELDNAME = 'WERKS'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

LS_SORT-FIELDNAME = 'PRODUCT'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

LS_SORT-FIELDNAME = 'SHPPOINT'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

ENDFORM. "sort_build

*----


*

  • FORM TOP_OF_PAGE *

*----


*

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'ZBPC_LOGO'

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM. "top_of_page

*----


*

  • FORM COMMENT_BUILD *

*----


*

  • ........ *

*----


*

  • --> LT_TOP_OF_PAGE *

*----


*

FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE

SLIS_T_LISTHEADER.

FIELD-SYMBOLS: .

DATA: LS_LINE TYPE SLIS_LISTHEADER.

DATA: I_SEL LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.

*

READ TEXTPOOL SY-REPID INTO I_SEL LANGUAGE SY-LANGU.

DELETE I_SEL WHERE ID NE 'S'.

  • LIST HEADING LINE: TYPE H

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = TEXT-005.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

LOOP AT I_SEL WHERE KEY NE 'P_STRMTH'.

ASSIGN (I_SEL-KEY) TO .

IF LS_LINE-INFO+0(3) EQ 'IEQ'.

MOVE ' ' TO LS_LINE-INFO+0(3).

CONDENSE LS_LINE-INFO.

ELSEIF LS_LINE-INFO+0(3) EQ 'IBT'.

MOVE 'BT-' TO LS_LINE-INFO+0(3).

ENDIF.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDLOOP.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-008.

WRITE V_STRMTH TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-009.

WRITE V_ENDMTH TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-003.

WRITE SY-DATUM TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-004.

WRITE SY-UZEIT TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM. "comment_build

*----


*

  • FORM MAIN_PROD *

*----


*

  • Main output routine *

*----


*

FORM MAIN_PROD.

REFRESH : GT_FIELDCAT, GT_LIST_TOP_OF_PAGE, GT_EVENTS, GT_SORT.

PERFORM FIELDCAT_INIT_PROD USING GT_FIELDCAT[].

PERFORM LAYOUT_INIT_PROD USING GS_LAYOUT.

PERFORM COMMENT_BUILD_PROD USING GT_LIST_TOP_OF_PAGE[].

PERFORM EVENTTAB_BUILD_PROD USING GT_EVENTS[].

PERFORM SORT_BUILD_PROD USING GT_SORT[].

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'ZMY20FCORD'

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME = ' '

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE = 'WEEKLY FORECAST VS ORDER SUMMARY'

  • I_GRID_SETTINGS =

IS_LAYOUT = GS_LAYOUT

IT_FIELDCAT = GT_FIELDCAT[]

  • IT_EXCLUDING = ' '

  • IT_SPECIAL_GROUPS =

IT_SORT = GT_SORT

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = GT_EVENTS[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = I_PRDWISE

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "main_prod

*&----


*

*& Form fieldcat_init_prod

*&----


*

  • text

*----


*

  • -->P_GT_FIELDCAT[] text

*----


*

FORM FIELDCAT_INIT_PROD USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV..

DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

REFRESH : LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'SORTKEY'.

LS_FIELDCAT-NO_OUT = 'X'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

  • Begin of Changes by Karthikeyan on 09/03/2007 - Req No -BA3K988704

  • LS_FIELDCAT-FIELDNAME = 'STCSTP'.

  • LS_FIELDCAT-OUTPUTLEN = '15'.

  • LS_FIELDCAT-FIX_COLUMN = 'X'.

  • LS_FIELDCAT-KEY = 'X'.

  • LS_FIELDCAT-SELTEXT_L = TEXT-U01.

  • LS_FIELDCAT-SELTEXT_M = TEXT-U01.

  • LS_FIELDCAT-SELTEXT_S = TEXT-U01.

  • LS_FIELDCAT-REPTEXT_DDIC = TEXT-U01.

  • APPEND LS_FIELDCAT TO LT_FIELDCAT.

  • CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'PRODUCT'.

LS_FIELDCAT-OUTPUTLEN = '18'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U04.

LS_FIELDCAT-SELTEXT_M = TEXT-U04.

LS_FIELDCAT-SELTEXT_S = TEXT-U04.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U04.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'STCSTP'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-FIX_COLUMN = 'X'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = TEXT-U01.

LS_FIELDCAT-SELTEXT_M = TEXT-U01.

LS_FIELDCAT-SELTEXT_S = TEXT-U01.

LS_FIELDCAT-REPTEXT_DDIC = TEXT-U01.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

  • LS_FIELDCAT-FIELDNAME = 'MAKTX'.

  • LS_FIELDCAT-OUTPUTLEN = '40'.

  • LS_FIELDCAT-FIX_COLUMN = 'X'.

  • LS_FIELDCAT-KEY = 'X'.

  • LS_FIELDCAT-SELTEXT_L = TEXT-U05.

  • LS_FIELDCAT-SELTEXT_M = TEXT-U05.

  • LS_FIELDCAT-SELTEXT_S = TEXT-U05.

  • LS_FIELDCAT-REPTEXT_DDIC = TEXT-U05.

  • APPEND LS_FIELDCAT TO LT_FIELDCAT.

  • CLEAR LS_FIELDCAT.

  • End of Changes by Karthikeyan on 09/03/2007 - Req No -BA3K988704

LS_FIELDCAT-FIELDNAME = 'TOTFC1'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-SELTEXT_L = W_FCHDRT1.

LS_FIELDCAT-SELTEXT_M = W_FCHDRT1.

LS_FIELDCAT-SELTEXT_S = W_FCHDRT1.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDRT1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTORD1'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-SELTEXT_L = W_ORHDRT1.

LS_FIELDCAT-SELTEXT_M = W_ORHDRT1.

LS_FIELDCAT-SELTEXT_S = W_ORHDRT1.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDRT1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'FCORD1'.

LS_FIELDCAT-DATATYPE = 'CURR'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-SELTEXT_L = W_HDR%1.

LS_FIELDCAT-SELTEXT_M = W_HDR%1.

LS_FIELDCAT-SELTEXT_S = W_HDR%1.

LS_FIELDCAT-REPTEXT_DDIC = W_HDR%1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'DIFF1'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-SELTEXT_L = W_DIFF1.

LS_FIELDCAT-SELTEXT_M = W_DIFF1.

LS_FIELDCAT-SELTEXT_S = W_DIFF1.

LS_FIELDCAT-REPTEXT_DDIC = W_DIFF1.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTFC2'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_FCHDRT2.

LS_FIELDCAT-SELTEXT_M = W_FCHDRT2.

LS_FIELDCAT-SELTEXT_S = W_FCHDRT2.

LS_FIELDCAT-REPTEXT_DDIC = W_FCHDRT2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'TOTORD2'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_ORHDRT2.

LS_FIELDCAT-SELTEXT_M = W_ORHDRT2.

LS_FIELDCAT-SELTEXT_S = W_ORHDRT2.

LS_FIELDCAT-REPTEXT_DDIC = W_ORHDRT2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'FCORD2'.

LS_FIELDCAT-DATATYPE = 'CURR'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_HDR%2.

LS_FIELDCAT-SELTEXT_M = W_HDR%2.

LS_FIELDCAT-SELTEXT_S = W_HDR%2.

LS_FIELDCAT-REPTEXT_DDIC = W_HDR%2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'DIFF2'.

LS_FIELDCAT-DATATYPE = 'QUAN'.

LS_FIELDCAT-OUTPUTLEN = '15'.

LS_FIELDCAT-KEY = 'X'.

LS_FIELDCAT-SELTEXT_L = W_DIFF2.

LS_FIELDCAT-SELTEXT_M = W_DIFF2.

LS_FIELDCAT-SELTEXT_S = W_DIFF2.

LS_FIELDCAT-REPTEXT_DDIC = W_DIFF2.

APPEND LS_FIELDCAT TO LT_FIELDCAT.

CLEAR LS_FIELDCAT.

ENDFORM. " fieldcat_init_prod

*----


*

  • FORM EVENTTAB_BUILD_PROD *

*----


*

  • ........ *

*----


*

  • --> LT_EVENTS *

*----


*

FORM EVENTTAB_BUILD_PROD USING LT_EVENTS TYPE SLIS_T_EVENT.

REFRESH : LT_EVENTS.

DATA: LS_EVENT TYPE SLIS_ALV_EVENT.

MOVE 'PF_STATUS_SET' TO LS_EVENT-NAME.

MOVE 'ZMY20FCORDP' TO LS_EVENT-FORM.

APPEND LS_EVENT TO LT_EVENTS.

CLEAR LS_EVENT.

MOVE 'USER_COMMAND' TO LS_EVENT-NAME.

MOVE 'USER_COMMAND_P' TO LS_EVENT-FORM.

APPEND LS_EVENT TO LT_EVENTS.

CLEAR LS_EVENT.

ENDFORM. "eventtab_build_prod

*----

-


  • FORM PF_STATUS_SET

*----

-


FORM ZMY20FCORDP USING EXTAB TYPE SLIS_T_EXTAB. "#EC CALLED

DATA: LS_EXTAB TYPE SLIS_EXTAB.

MOVE 'PRODUCT' TO LS_EXTAB-FCODE.

APPEND LS_EXTAB TO EXTAB.

MOVE 'CLOSE' TO LS_EXTAB-FCODE.

APPEND LS_EXTAB TO EXTAB.

  • Begin of Changes of the PF Status as per Naming Convension

  • - by Karthikeyan on 22/01/2007 - Req No -BA3K987088

  • SET PF-STATUS 'Z16FCUP' EXCLUDING EXTAB.

SET PF-STATUS 'ZMY20FCORD' EXCLUDING EXTAB.

  • End of Changes of the PF Status as per Naming Convension

  • - by Karthikeyan on 22/01/2007 - Req No -BA3K987088

ENDFORM. "ZMY20FCORDP

*----


*

  • FORM user_command_p *

*----


*

  • ........ *

*----


*

  • --> RF_UCOMM *

  • --> RS_SELFIELD *

*----


*

FORM USER_COMMAND_P USING RFP_UCOMM LIKE SY-UCOMM

RSP_SELFIELD TYPE SLIS_SELFIELD. "#EC CALLED

CASE RFP_UCOMM.

WHEN '&F03' OR '&F15' OR '&F12'.

REFRESH : GT_FIELDCAT, GT_LIST_TOP_OF_PAGE, GT_EVENTS, GT_SORT.

PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].

PERFORM LAYOUT_INIT USING GS_LAYOUT.

PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].

PERFORM EVENTTAB_BUILD USING GT_EVENTS[].

PERFORM SORT_BUILD USING GT_SORT[].

PERFORM MAIN.

WHEN 'BACK' OR 'EXIT' OR 'CANC'.

REFRESH : GT_FIELDCAT, GT_LIST_TOP_OF_PAGE, GT_EVENTS, GT_SORT.

PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].

PERFORM LAYOUT_INIT USING GS_LAYOUT.

PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].

  • PERFORM COMMENT_BUILD_PROD USING GT_LIST_TOP_OF_PAGE[].

PERFORM EVENTTAB_BUILD USING GT_EVENTS[].

PERFORM SORT_BUILD USING GT_SORT[].

PERFORM MAIN.

ENDCASE.

CLEAR : RFP_UCOMM.

ENDFORM. "user_command

*----


*

  • FORM SORT_BUILD_PROD *

*----


*

FORM SORT_BUILD_PROD USING LT_SORT TYPE SLIS_T_SORTINFO_ALV.

DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.

REFRESH : LT_SORT.

CLEAR : LS_SORT.

  • Begin of Changes by Karthikeyan on 09/03/2007 - Req No -BA3K988704

  • LS_SORT-FIELDNAME = 'SORTKEY'.

  • LS_SORT-UP = 'X'.

  • APPEND LS_SORT TO LT_SORT.

  • CLEAR LS_SORT.

  • LS_SORT-FIELDNAME = 'STCSTP'.

  • LS_SORT-UP = 'X'.

  • APPEND LS_SORT TO LT_SORT.

  • CLEAR LS_SORT.

LS_SORT-FIELDNAME = 'PRODUCT'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

LS_SORT-FIELDNAME = 'STCSTP'.

LS_SORT-UP = 'X'.

APPEND LS_SORT TO LT_SORT.

CLEAR LS_SORT.

  • End of Changes by Karthikeyan on 09/03/2007 - Req No -BA3K988704

ENDFORM. "sort_build_prod

*----


*

  • FORM COMMENT_BUILD_PROD *

*----


*

  • ........ *

*----


*

  • --> LT_TOP_OF_PAGE *

*----


*

FORM COMMENT_BUILD_PROD USING LT_TOP_OF_PAGE TYPE

SLIS_T_LISTHEADER.

FIELD-SYMBOLS: .

DATA: LS_LINE TYPE SLIS_LISTHEADER.

DATA: I_SEL LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.

REFRESH LT_TOP_OF_PAGE.

*

READ TEXTPOOL SY-REPID INTO I_SEL LANGUAGE SY-LANGU.

DELETE I_SEL WHERE ID NE 'S'.

  • LIST HEADING LINE: TYPE H

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = TEXT-006.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

LOOP AT I_SEL WHERE KEY NE 'P_STRMTH'.

ASSIGN (I_SEL-KEY) TO .

IF LS_LINE-INFO+0(3) EQ 'IEQ'.

MOVE ' ' TO LS_LINE-INFO+0(3).

CONDENSE LS_LINE-INFO.

ELSEIF LS_LINE-INFO+0(3) EQ 'IBT'.

MOVE 'BT-' TO LS_LINE-INFO+0(3).

ENDIF.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDLOOP.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-008.

WRITE V_STRMTH TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-009.

WRITE V_ENDMTH TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-003.

WRITE SY-DATUM TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-004.

WRITE SY-UZEIT TO LS_LINE-INFO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM. "comment_build_prod

*&----


*

*& Form LAYOUT_INIT_PROD

*&----


*

  • text

*----


*

  • -->P_GS_LAYOUT text

*----


*

FORM LAYOUT_INIT_PROD USING P_GS_LAYOUT TYPE SLIS_LAYOUT_ALV.

GS_LAYOUT-COLTAB_FIELDNAME = 'CELLCOLOR'.

ENDFORM. " LAYOUT_INIT_PROD

Thanks,

Karthik