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
Go on link..
link us with ...
Thursday, December 30, 2010
Report for Printing the PO's whose Gr block Qty has not been released
REPORT ZVVF_MR055_GRNOTRELEASED .
*---------------------------------------------------------------------*
* REPORT ZVVF_MR055_GRNOTRELEASED *
* *
*---------------------------------------------------------------------*
* *
* MODULE : Material Managenment *
* *
*---------------------------------------------------------------------*
* Objective : Report for Printing the PO's whose Gr block Qty has *
* not been released *
* *
* Program : Update Tables( ) Download Data( ) Outputs List (X) *
* Technical Specs No : *
* Date Created : *
* Author : *
* Location : *
* LDB : *
*---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Type-pools
*----------------------------------------------------------------------*
TYPE-POOLS : SLIS.
*---------------------------------------------------------------------*
* Tables *
*---------------------------------------------------------------------*
TABLES: MSEG,
MKPF.
*----------------------------------------------------------------------*
* Types Begin with TY_ *
*----------------------------------------------------------------------*
TYPES : BEGIN OF TY_DATA,
EBELN LIKE MSEG-EBELN,
EBELP LIKE MSEG-EBELP,
BWART LIKE MSEG-BWART,
WERKS LIKE MSEG-WERKS,
MBLNR LIKE MSEG-MBLNR,
ERFMG LIKE MSEG-ERFMG,
ERFME LIKE MSEG-ERFME,
BUDAT LIKE MKPF-BUDAT,
END OF TY_DATA.
TYPES : BEGIN OF TY_DATA1,
MBLNR LIKE MSEG-MBLNR,
EBELN LIKE MSEG-EBELN,
EBELP LIKE MSEG-EBELP,
BWART LIKE MSEG-BWART,
WERKS LIKE MSEG-WERKS,
LFBNR LIKE MSEG-LFBNR,
ERFMG LIKE MSEG-ERFMG,
ERFME LIKE MSEG-ERFME,
BUDAT LIKE MKPF-BUDAT,
END OF TY_DATA1.
TYPES : BEGIN OF TY_DATA2,
EBELN LIKE MSEG-EBELN,
EBELP LIKE MSEG-EBELP,
BWART LIKE MSEG-BWART,
WERKS LIKE MSEG-WERKS,
SMBLN LIKE MSEG-SMBLN,
ERFMG LIKE MSEG-ERFMG,
ERFME LIKE MSEG-ERFME,
BUDAT LIKE MKPF-BUDAT,
END OF TY_DATA2.
*---------------------------------------------------------------------*
* INTERNAL TABLE Begin with IT_ *
*---------------------------------------------------------------------*
DATA : IT_DATA TYPE STANDARD TABLE OF TY_DATA WITH HEADER LINE.
DATA : IT_DATA1 TYPE STANDARD TABLE OF TY_DATA1 WITH HEADER LINE.
DATA : IT_DATA2 TYPE STANDARD TABLE OF TY_DATA2 WITH HEADER LINE.
DATA : IT_DATA3 TYPE STANDARD TABLE OF TY_DATA2 WITH HEADER LINE.
*---------------------------------------------------------------------*
* WORK AREAS Begin with WA_ *
*---------------------------------------------------------------------*
.
*----------------------------------------------------------------------*
* Constants Begin with C_ *
*----------------------------------------------------------------------*
*---------------------------------------------------------------------*
* Data Variables Begin with W_ *
*---------------------------------------------------------------------*
*--------FOR ALV
DATA : W_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
W_LISTHEADER TYPE SLIS_T_LISTHEADER,
W_EVENTS TYPE SLIS_T_EVENT,
W_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
W_REPID TYPE SY-REPID.
DATA : W_INFO(75) TYPE C VALUE 'POs for which GR blocked stock is
Pending for Release',
W_INFO_1(75) TYPE C,
W_INFO1(65) TYPE C.
*---------------------------------------------------------------------*
* parameters Begin with PR_ *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* Select-options Begin with SO_ *
*---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : SO_WERKS FOR MSEG-WERKS OBLIGATORY,
SO_EBELN FOR MSEG-EBELN,
SO_BUDAT FOR MKPF-BUDAT.
SKIP 1.
SELECTION-SCREEN END OF BLOCK B1.
*---------------------------------------------------------------------*
* INITIALIZATION *
*---------------------------------------------------------------------*
INITIALIZATION.
W_REPID = SY-REPID.
REFRESH : IT_DATA.
PERFORM F003_EVENTTAB_BUILD_TEMP USING W_EVENTS[].
*---------------------------------------------------------------------*
* AT SELECTION-SCREEN ON VALUE REQUEST .
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* AT SELECTION-SCREEN output.
*---------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
*---------------------------------------------------------------------*
* At selection screen *
*---------------------------------------------------------------------*
AT SELECTION-SCREEN.
PERFORM F001_VALIDATE.
*---------------------------------------------------------------------*
* START-OF-SELECTION *
*---------------------------------------------------------------------*
START-OF-SELECTION .
PERFORM F004_FIELDCAT_INIT.
PERFORM GET_DATA.
PERFORM F005_DISPLAY_DATA USING W_LISTHEADER[].
*---------------------------------------------------------------------*
* END-OF-SELECTION *
*---------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM F006_DISPLAY_LIST.
*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
TOP-OF-PAGE.
*----------------------------------------------------------------------*
* END-OF-PAGE *
*----------------------------------------------------------------------*
END-OF-PAGE.
*&---------------------------------------------------------------------*
*& Form F001_VALIDATE
*&---------------------------------------------------------------------*
FORM F001_VALIDATE .
SELECT MS~EBELN MS~EBELP MS~BWART MS~WERKS MS~MBLNR MS~ERFMG MS~ERFME
MK~BUDAT
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
FROM MSEG AS MS INNER JOIN
MKPF AS MK
ON MS~MBLNR = MK~MBLNR
WHERE MS~BWART EQ '103' AND
MS~WERKS IN SO_WERKS AND
MS~EBELN IN SO_EBELN AND
MK~BUDAT IN SO_BUDAT.
SELECT MS~MBLNR MS~EBELN MS~EBELP MS~BWART MS~WERKS MS~LFBNR MS~ERFMG
MS~ERFME
MK~BUDAT
INTO CORRESPONDING FIELDS OF TABLE IT_DATA1
FROM MSEG AS MS INNER JOIN
MKPF AS MK
ON MS~MBLNR = MK~MBLNR
WHERE MS~BWART EQ '105' AND
MS~WERKS IN SO_WERKS AND
MS~EBELN IN SO_EBELN AND
MK~BUDAT IN SO_BUDAT.
SELECT MS~EBELN MS~EBELP MS~BWART MS~WERKS MS~SMBLN MS~ERFMG MS~ERFME
MK~BUDAT
INTO CORRESPONDING FIELDS OF TABLE IT_DATA2
FROM MSEG AS MS INNER JOIN
MKPF AS MK
ON MS~MBLNR = MK~MBLNR
WHERE MS~BWART EQ '104' AND
MS~WERKS IN SO_WERKS AND
MS~EBELN IN SO_EBELN AND
MK~BUDAT IN SO_BUDAT.
SELECT MS~EBELN MS~EBELP MS~BWART MS~WERKS MS~SMBLN MS~ERFMG MS~ERFME
MK~BUDAT
INTO CORRESPONDING FIELDS OF TABLE IT_DATA3
FROM MSEG AS MS INNER JOIN
MKPF AS MK
ON MS~MBLNR = MK~MBLNR
WHERE MS~BWART EQ '106' AND
MS~WERKS IN SO_WERKS AND
MS~EBELN IN SO_EBELN AND
MK~BUDAT IN SO_BUDAT.
ENDFORM. " F001_VALIDATE
*&---------------------------------------------------------------------*
*& Form F003_EVENTTAB_BUILD_TEMP
*&---------------------------------------------------------------------*
FORM F003_EVENTTAB_BUILD_TEMP USING RT_EVENTS TYPE SLIS_T_EVENT.
DATA : LW_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = RT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE RT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LW_EVENT
.
IF SY-SUBRC = 0.
MOVE W_TOP_OF_PAGE TO LW_EVENT-FORM.
APPEND LW_EVENT TO RT_EVENTS.
ENDIF.
ENDFORM. " F003_EVENTTAB_BUILD_TEMP
*&---------------------------------------------------------------------*
*& Form F005_DISPLAY_DATA
*&---------------------------------------------------------------------*
FORM F005_DISPLAY_DATA USING GT_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA : LW_LISTHEADER TYPE SLIS_LISTHEADER.
CLEAR LW_LISTHEADER.
LW_LISTHEADER-TYP = 'H'.
LW_LISTHEADER-INFO = W_INFO.
APPEND LW_LISTHEADER TO GT_LISTHEADER.
ENDFORM. " F005_DISPLAY_DATA
*&---------------------------------------------------------------------*
*& Form F006_DISPLAY_LIST
*&---------------------------------------------------------------------*
FORM F006_DISPLAY_LIST .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
* 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 = 'ALV_BACKGROUND'
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = W_FIELDCATALOG[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = W_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 =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_DATA
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. " F006_DISPLAY_LIST
*&--------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&--------------------------------------------------------------------*
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = W_LISTHEADER
I_LOGO = ' '.
ENDFORM. "top_of_page_db
*&---------------------------------------------------------------------*
*& Form F004_FIELDCAT_INIT
*&---------------------------------------------------------------------*
FORM F004_FIELDCAT_INIT .
DATA : LW_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'EBELN'.
LW_FIELDCAT-SELTEXT_M = 'PO Number'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'EBELP'.
LW_FIELDCAT-SELTEXT_M = 'Line Item'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'BWART'.
LW_FIELDCAT-SELTEXT_M = 'Movement Type'.
LW_FIELDCAT-OUTPUTLEN = 14.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'WERKS'.
LW_FIELDCAT-SELTEXT_M = 'Plant'.
LW_FIELDCAT-OUTPUTLEN = 8.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MBLNR'.
LW_FIELDCAT-SELTEXT_M = 'Matl Doc Number'.
LW_FIELDCAT-OUTPUTLEN = 14.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'BUDAT'.
LW_FIELDCAT-SELTEXT_M = 'Posting Date'.
LW_FIELDCAT-OUTPUTLEN = 14.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'ERFMG'.
LW_FIELDCAT-SELTEXT_M = 'Quantity'.
LW_FIELDCAT-OUTPUTLEN = 14.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'ERFME'.
LW_FIELDCAT-SELTEXT_M = 'UOM'.
LW_FIELDCAT-OUTPUTLEN = 5.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
ENDFORM. " F004_FIELDCAT_INIT
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
FORM GET_DATA .
LOOP AT IT_DATA1.
READ TABLE IT_DATA3 WITH KEY SMBLN = IT_DATA1-MBLNR.
IF SY-SUBRC = 0.
DELETE IT_DATA1.
ENDIF.
ENDLOOP.
LOOP AT IT_DATA.
READ TABLE IT_DATA1 WITH KEY LFBNR = IT_DATA-MBLNR.
IF SY-SUBRC = 0.
DELETE IT_DATA.
ENDIF.
READ TABLE IT_DATA2 WITH KEY SMBLN = IT_DATA-MBLNR.
IF SY-SUBRC = 0.
DELETE IT_DATA.
ENDIF.
ENDLOOP.
SORT IT_DATA BY BUDAT EBELN EBELP.
ENDFORM. " GET_DATA
Labels:
MM Reports
Subscribe to:
Post Comments (Atom)
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)
email-id :- avinashkr_raj@yahoo.com(any email)
email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)
No comments:
Post a Comment