Go on link..

link us with ...

Tuesday, December 21, 2010

Online Rejection Report of the R.M./P.M. rejected * * during on-line inspection/usage during manufacture of soap/b

REPORT ZVVF_CR_003_REJREP no standard page heading line-size 160.
*---------------------------------------------------------------------*
* *
* MODULE : Production Planning *
* *
*---------------------------------------------------------------------*
* Objective : Online Rejection Report of the R.M./P.M. rejected *
* during on-line inspection/usage during manufacture of*
* soap/bulk manufacturing or packing of pharma & pcpd *
* products. *
* Program : Update Tables ( ) Download Data ( ) Outputs List (X)*
* Technical Specs No : *
* LDB : *
* *
*---------------------------------------------------------------------*

*---------------------------------------------------------------------*
* Tables *
*---------------------------------------------------------------------*
TABLES :MSEG, "Document Segment Material: Item Data
MKPF, "Material Document: Header Data
MAKT, "Material Descriptions
LFA1, "Vendor Master
T157E. "Text Table: Reason for Movement

*----------------------------------------------------------------------*
* INTERNAL TABLES: Begin with IT_ *
*----------------------------------------------------------------------*
DATA: it_plant type standard table of zty_plant with header line,
it_plant1 type standard table of zty_plant with header line,
it_lfa1 type sorted table of zty_plant with header line
with non-unique key lifnr,
it_matl type sorted table of zty_plant with header line with
non-unique key matnr,
it_grund type sorted table of t157e with header line with
non-unique key bwart grund.

*----------------------------------------------------------------------*
* STRUCTURES : Begin with WA_ *
*----------------------------------------------------------------------*
DATA : wa_plant type zty_plant.

*----------------------------------------------------------------------*
* DATA: Begin with W_ *
*----------------------------------------------------------------------*
DATA : w_lifnr type ELIFN,
w_name1 type NAME1_GP,
w_ebeln type BSTNR,
w_srno type i,
w_numlin type i,
w_name type t001w-name1.

*----------------------------------------------------------------------*
* CONSTANTS: Begin with C_ *
*----------------------------------------------------------------------*
CONSTANTS : C_BWART(3) TYPE C VALUE '101',
C_BLART(2) TYPE C VALUE 'WA'.

*----------------------------------------------------------------------*
* SELECTION SCREEN *
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK RejMat WITH FRAME TITLE TEXT-004.
*----------------------------------------------------------------------*
* PARAMETERS: Begin with PR_ *
*----------------------------------------------------------------------*
PARAMETERS : pr_werks LIKE MSEG-WERKS OBLIGATORY. "Plant Code

*----------------------------------------------------------------------*
* SELECT-OPTIONS: Begin with SO_ *
*----------------------------------------------------------------------*
SELECT-OPTIONS: so_lgort FOR MSEG-LGORT . "Storage Location
SELECT-OPTIONS: so_bwart FOR MSEG-BWART OBLIGATORY. "Movenment Type
SELECT-OPTIONS: so_usnam FOR MKPF-USNAM. "UserName
SELECT-OPTIONS: so_budat FOR MKPF-BUDAT. "Posting Date
SELECTION-SCREEN END OF BLOCK RejMat.

*----------------------------------------------------------------------*
* START-OF-SELECTION *
*----------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM f001_fill_itab.

*----------------------------------------------------------------------*
* END-OF-SELECTION *
*----------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM f002_DISPLAY_DATA.
FORMAT RESET.
WRITE : /1(210) text-001 CENTERED.

*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
TOP-OF-PAGE.
PERFORM f003_header.

*&---------------------------------------------------------------------*
*& Form f001_fill_itab *
*&---------------------------------------------------------------------*
FORM f001_fill_itab .

* QUERY THE MSEG TABLE

SELECT distinct a~werks a~matnr a~mblnr a~charg a~menge a~meins
a~grund b~budat a~bwart
INTO corresponding fields of TABLE it_plant
FROM MSEG as a inner join MKPF as b
on a~mblnr = b~mblnr and a~mjahr = b~mjahr
WHERE b~budat IN so_budat
AND b~blart = c_blart
AND a~werks = pr_werks
AND a~lgort IN so_lgort
AND a~bwart IN so_bwart
AND b~usnam IN so_usnam.

select single name1 into w_name
from t001w where werks = pr_werks.

IF SY-SUBRC NE '0'.
MESSAGE E000(ZPP).
ELSE.
select mblnr lifnr ebeln matnr werks charg bwart
into corresponding fields of table it_plant1
from mseg
for all entries in it_plant
where matnr = it_plant-matnr
and werks = it_plant-werks
and charg = it_plant-charg
and bwart = c_bwart.

SORT it_plant BY matnr ASCENDING.

select lifnr name1
from lfa1
into corresponding fields of table it_lfa1
for all entries in it_plant1
where lifnr = it_plant1-lifnr.

if sy-subrc ne 0.
endif.

select matnr maktx
from makt
into corresponding fields of table it_matl
for all entries in it_plant
where matnr = it_plant-matnr .

if sy-subrc ne 0.
endif.

SELECT bwart grund grtxt
from t157e
into corresponding fields of table it_grund
for all entries in it_plant
WHERE bwart = it_plant-bwart and grund = it_plant-grund
and spras = sy-langu.

if sy-subrc ne 0.
endif.

loop at it_plant into wa_plant.
read table it_matl with key matnr = wa_plant-matnr binary search.
read table it_grund with key grund = wa_plant-grund .
read table it_plant1 with key matnr = wa_plant-matnr werks =
wa_plant-werks charg = wa_plant-charg bwart = c_bwart.
wa_plant-lifnr = it_plant1-lifnr.
wa_plant-ebeln = it_plant1-ebeln.
read table it_lfa1 with key lifnr = wa_plant-lifnr.
wa_plant-name1 = it_lfa1-name1.
wa_plant-grtxt = it_grund-grtxt.
wa_plant-maktx = it_matl-maktx.
modify it_plant from wa_plant.
endloop.

ENDIF.
ENDFORM. " f001_fill_itab
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA *
*&---------------------------------------------------------------------*
FORM f002_DISPLAY_DATA .

DESCRIBE TABLE IT_PLANT LINES W_NUMLIN.

if W_NUMLIN > 0.
w_srno = 0.
loop at it_plant.
w_srno = w_srno + 1.
WRITE : /1 sy-vline, 2(6) w_srno CENTERED,
sy-vline, 10(10) it_plant-matnr,
sy-vline, 22(20) it_plant-maktx,
sy-vline, 44(10) it_plant-charg,
sy-vline, 56(13) it_plant-menge right-justified,
sy-vline, 71(4) it_plant-meins,
sy-vline, 77(15) it_plant-grtxt,
sy-vline, 94(10) it_plant-ebeln,
sy-vline, 106(10) it_plant-lifnr,
sy-vline, 118(15) it_plant-name1,
sy-vline, 135(24) ' ',
sy-vline.

if it_plant-maktx+20(20) NE '' or it_plant-name1+15(15) ne ''.
WRITE : /1 sy-vline,
9 sy-vline,
21 sy-vline, 22(15) it_plant-maktx+20(20),
43 sy-vline,
55 sy-vline,
70 sy-vline,
76 sy-vline,
93 sy-vline,
105 sy-vline,
117 sy-vline, 118(15) it_plant-name1+15(15),
134 sy-vline,
160 sy-vline.
endif.
endloop.
else.
write :/1 sy-vline, 2(160) text-002 centered, 160
sy-vline.
endif.

ULINE.

ENDFORM. " DISPLAY_DATA
*&---------------------------------------------------------------------*
*& Form header *
*&---------------------------------------------------------------------*
FORM f003_header .
FORMAT COLOR 1 INTENSIFIED OFF.
ULINE.
IF PR_WERKS = 'P071'.
WRITE : /1 sy-vline, 2(160) text-023 CENTERED, 160
sy-vline.
ELSE.
WRITE : /1 sy-vline, 2(160) text-003 CENTERED, 160 sy-vline.
ENDIF.
WRITE : /1 sy-vline, 2(160) text-004 CENTERED, 160 sy-vline.

FORMAT COLOR 1 INVERSE ON.

write : /1 sy-vline, 3(8) text-005, 10(4) pr_werks, 140(6) text-006,
148(10) sy-datum, 160 sy-vline.

write : /1 sy-vline, 3(12) text-024, 16(30) w_name, 160 sy-vline.

write : /1 sy-vline, 3(8) text-007, 10(10) text-009, 160 sy-vline.

write : /1 sy-vline, 3(8) text-008, 10(6) text-010, 160 sy-vline.

FORMAT RESET.
FORMAT COLOR 1 INTENSIFIED ON.
ULINE.
WRITE : /1 sy-vline, 2(6) text-011 CENTERED,
sy-vline, 10(10) text-012,
sy-vline, 22(20) text-013,
sy-vline, 44(10) text-014,
sy-vline, 56(13) text-015,
sy-vline, 71(4) text-016,
sy-vline, 77(15) text-017,
sy-vline, 94(10) text-018,
sy-vline, 106(10) text-019,
sy-vline, 118(15) text-020,
sy-vline, 135(24) text-021,
sy-vline.
ULINE.
ENDFORM. " header

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)