Creating Z report for material stock (plant maintenance module)
hello,
we are implemented Plant maintenance module (SAP PM) in our organization.
our requirement is to create a stock report which will incldue
followings:-
1)material number
2)plant number
3) storage location
4) material type
5)valuation type
6)Opening Stock
7) OpValue
8)Received Stock
9) ReceiptValue
10) Issue Stock
11) IssueValue
12) Closing Stock
13) Closing Value
we want above details in ALV grid format.
to gert all the details for perticular material, we calcute closing stock and closing value in following manner:-
opening stock + received stock - issue stock = closing stock
opening value + recipt value - issue value = closing value
we are unable to find table name for accessing opening stock, received stock , issue stock & opening value ,recipt value , issue value from system. please suggest table name information for getting above details for creating Z report
Dear friend,
Before to make a decision to bulid a custom report make sure you have checked out the following standard transactions:
MB5T Stock in Transit
MMBE Stock Overview
MD04 Stock/Reqs list
MB53 Plant Stock Availability
MB52 Warehouse Stock
MB5M Expiration Date list
MB5B Stock for Posting Date
MB5T Stock in Transit
MBBS Valuated Special Stock
MBLB Stock with Subcontractor
The possible tables are:
MARA, MARD, MARC, VBEP, VBAK(VBAP), EKKO(EKPO), EKBE, EBAN, EBEW, MSEG, MKPF,...
Good luck!
Similar Messages
-
Dear Members,
Greetings for the day!
I am working on NWBC for HTML in Plant Maintenance module.
We have configured some changes in SPRO for customizing the UI elements( like visibility, mandatory ) like tabs and fields in transactions like IW21( Create Notification).
As of now separate parallel configuration needs to be carried out in NWBC for HTML in PM module to achieve the same UI features for creating notifications and this is time consuming.
Is there any way to read the configuration done in SPRO for the SAP GUI's and leverage the same in NWBC for HTML.
Appreciate your time in responding to this.
Thanks & Regards,
Ram.>
<IfModule mod_weblogic.c>
WebLogicCluster 127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7003,127.0.0.1:7103,127.0.0.1:7104
MatchExpression /app1
</IfModule>
<Location /weblogic>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
DebugConfigInfo ON
PathTrim /weblogic
</Location>
<IfModule mod_weblogic.c>
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
MatchExpression /app2
</IfModule>
<Location /weblogic>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
DebugConfigInfo ON
PathTrim /weblogic
</Location>
>
This configuration is weird little bit. There is MatchExpression /app1 and MatchExpression /app2 and at the same time two <Location /weblogic> sections. Are you sure you understand what that configuration stands for?
Try something like this ...
<Location /app1>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
DebugConfigInfo ON
</Location>
<Location /app2>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
DebugConfigInfo ON
</Location>
where /app1 and /app2 are contexts of your weblogic applications.
http://download.oracle.com/docs/cd/E11035_01/wls100/plugins/apache.html
http://httpd.apache.org/docs/2.0/mod/core.html#location -
hi,
i want a material list for which if i specify a period i will get materials with
a)No goods reciept
b)No stock or material movement(issue/transfer posting etc).
c)no sales or shipping.
should have happened for the materials for that period.
if no standard report exists can you tell me the algoritthm.
urgent: satisfying answers will be awarded full pointsRajkiran,
am sure you will never setisfy even we send you number of report because you have to chenge according to your requirement.dont expect spoon feeding.
*& Object Id : &*
*& Object Name : ZMM_STO_REGISTER &*
*& Function Module Name : MM &*
*& Transaction Code : ZMMSTO &*
*& Author : Amit&*
*& Module Name : MATERIAL MANAGEMENT &*
*& Sub-Module : &*
*& Program Type : Report &*
*& Create Date : 28.03.2007 &*
*& Completion Date : 30.03.2007 &*
*& SAP Release : &*
*& Description : STO REGISTER &*
*& MODIFICATION LOG : MODIFIED AT 30.04.2007 adding new field &*
*& chapter-id by chakrapani mishra &*
REPORT zmm_sto_register.
* TABLES USED *
TABLES :vbrk, "Billing Document: Header Data
vbrp, "Billing Document: Item Data
mara, "General Material Data
konv, "Conditions (Transaction Data)
t023t, "Material Group Descriptions
ekko, "Purchasing Document Header
likp, "SD Document: Delivery Header Data
mvke, "Sales Data for Material
t001w, "Plants/Branches
marm, "Units of Measure for Material
j_1imtchid, "Combination of Material Number and Chapter ID
mseg,
mkpf,
j_1iexchdr.
TYPE-POOLS : slis. "TYPE POOL SLIS
* INTERNAL TABLES *
DATA: BEGIN OF t_vbrp OCCURS 0, "INTERNAL TABLE FOR VBRP
vbeln LIKE vbrp-vbeln, "Billing Document
vstel LIKE vbrp-vstel, "Shipping Point/Receiving Point
vgbel LIKE vbrp-vgbel, "Document number of the reference document
aubel LIKE vbrp-aubel, "Sales Document
matnr LIKE vbrp-matnr, "Material Number
arktx LIKE vbrp-arktx, "Short text for sales order item
matkl LIKE vbrp-matkl, "Material Group
fkimg LIKE vbrp-fkimg, "Actual Invoiced Quantity
werks LIKE vbrp-werks, "Plant
posnr LIKE vbrp-posnr, " Billing item
vrkme LIKE vbrp-vrkme, " Sales unit
vgbel1 LIKE mkpf-xblnr,
END OF t_vbrp.
DATA: BEGIN OF t_vbrk OCCURS 0, "INTERNAL TABLE FOR VBRK
kunag LIKE vbrk-kunag, "Sold-to party
vbeln LIKE vbrk-vbeln, "Billing Document
fkdat LIKE vbrk-fkdat, "Billing date for billing index and printout
knumv LIKE vbrk-knumv, "Number of the document condition
fkart LIKE vbrk-fkart, "Billing Type
vtweg LIKE vbrk-vtweg, "Distribution Channel
vkorg LIKE vbrk-vkorg, "Sales Organization
erzet LIKE vbrk-erzet,
w_flag TYPE c,
l_tabix TYPE sy-tabix,
END OF t_vbrk.
DATA: BEGIN OF t_temp1 OCCURS 0, "INTERNAL TABLE FOR VBRK
vbeln LIKE vbrp-vbeln, "Billing Document
fkart LIKE vbrk-fkart,
fkdat LIKE vbrk-fkdat,
vgbel LIKE vbrp-vgbel, "Document number of the reference document
werks LIKE vbrp-werks,
w_flag TYPE c,
END OF t_temp1.
DATA: BEGIN OF t_mara OCCURS 0, "INTERNAL TABLE FOR MARA
matnr LIKE mara-matnr, "Material Number
mtart LIKE mara-mtart, "Material Type
wrkst LIKE mara-wrkst, "Finish
extwg LIKE mara-extwg, "Design
labor LIKE mara-labor, "Grade/Category No.
normt LIKE mara-normt, "Thickness in mm
bismt LIKE mara-bismt, "Size (L*B) in mm
matkl LIKE mara-matkl,
spart LIKE mara-spart,
meins LIKE mara-meins,
END OF t_mara.
DATA : BEGIN OF t_konv OCCURS 0, "INTERNAL TABLE FOR KONV
knumv LIKE konv-knumv, "Number of the document condition
kposn LIKE konv-kposn, "Condition item number
kschl LIKE konv-kschl, "Condition type
kwert LIKE konv-kwert, "Condition value
kbetr LIKE konv-kbetr, "Condition rate
END OF t_konv.
DATA : BEGIN OF t_likp OCCURS 0, "INTERNAL TABLE FOR LIKP
vbeln LIKE likp-vbeln, "Delivery
lfdat LIKE likp-lfdat, "Delivery Date
kunnr LIKE likp-kunnr,
bldat LIKE likp-bldat, " document date
vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
END OF t_likp.
DATA : BEGIN OF t_t023t OCCURS 0, "INTERNAL TABLE FOR T023T
matkl LIKE t023t-matkl, "Material Group
wgbez LIKE t023t-wgbez, "Material Group Description
spras LIKE t023t-spras, "Language Key
END OF t_t023t.
DATA : BEGIN OF t_ekko OCCURS 0, "INTERNAL TABLE FOR EKKO
ebeln LIKE ekko-ebeln, "Purchasing Document Number
bsart LIKE ekko-bsart, "Purchasing Document Type
aedat LIKE ekko-aedat, "Date on Which Record Was Created
knumv LIKE ekko-knumv, "Number of the document condition
END OF t_ekko.
DATA : BEGIN OF t_ekpo OCCURS 0, "INTERNAL TABLE FOR EKKO
ebeln LIKE ekko-ebeln, "Purchasing Document Number
loekz LIKE ekko-loekz, "Purchasing Document Type
END OF t_ekpo.
DATA : BEGIN OF t_mvke OCCURS 0,
matnr LIKE mvke-matnr,
mvgr1 LIKE mvke-mvgr1,
END OF t_mvke.
DATA : BEGIN OF t_t001w OCCURS 0, "INTERNAL TABLE FOR KONV
werks LIKE t001w-werks, "Number of the document condition
name1 LIKE t001w-name1, "Condition type
kunnr LIKE t001w-kunnr, "Condition value
name2 LIKE t001w-name2, "Condition item number
END OF t_t001w.
DATA : BEGIN OF t_t001w2 OCCURS 0, "INTERNAL TABLE FOR KONV
werks LIKE t001w-werks, "Number of the document condition
name1 LIKE t001w-name1, "Condition type
kunnr LIKE t001w-kunnr, "Condition value
name2 LIKE t001w-name2, "Condition item number
END OF t_t001w2.
DATA : BEGIN OF t_marm OCCURS 0,
matnr LIKE marm-matnr,
meinh LIKE marm-meinh,
umrez LIKE marm-umrez,
umren LIKE marm-umren,
END OF t_marm.
DATA : BEGIN OF t_tvm1t OCCURS 0,
mvgr1 LIKE tvm1t-mvgr1,
bezie LIKE tvm1t-bezei,
END OF t_tvm1t.
**********************modification additioon of chapter ID 30.04.2007
DATA : BEGIN OF t_j_1imtchid OCCURS 0, "INTERNAL TABLE FOR j_1imtchid
matnr LIKE j_1imtchid-matnr, "Material Number
j_1ichid LIKE j_1imtchid-j_1ichid, "Chapter ID
END OF t_j_1imtchid.
DATA : BEGIN OF t_j_1iexchdr OCCURS 0, "INTERNAL TABLE FOR j_1imtchid
exnum LIKE j_1iexchdr-exnum, "Material Number
exdat LIKE j_1iexchdr-exdat, "Chapter ID
rdoc LIKE j_1iexchdr-rdoc,
werks LIKE j_1iexchdr-werks,
status LIKE j_1iexchdr-status,
trntyp LIKE j_1iexchdr-trntyp,
END OF t_j_1iexchdr.
**********************modification additioon of chapter ID 30.04.2007
DATA: BEGIN OF t_final OCCURS 0, "INTERNAL TABLE T_FINAL
fkart LIKE vbrk-fkart,
kunag LIKE vbrk-kunag,
vbeln_k LIKE vbrk-vbeln,
fkdat LIKE vbrk-fkdat,
knumv LIKE vbrk-knumv,
fkart1 LIKE vbrk-fkart,
vtweg LIKE vbrk-vtweg,
vkorg LIKE vbrk-vkorg,
vbeln LIKE likp-vbeln, "Delivery
vbeln_p LIKE vbrp-vbeln,
vstel LIKE vbrp-vstel,
"vgbel like mkpf-xblnr,
vgbel LIKE vbrp-vgbel,
aubel LIKE vbrp-aubel,
matnr LIKE vbrp-matnr,
arktx LIKE vbrp-arktx,
matkl LIKE vbrp-matkl,
fkimg LIKE vbrp-fkimg,
posnr LIKE vbrp-posnr,
vrkme LIKE vbrp-vrkme,
matnr_m LIKE mara-matnr,
mtart LIKE mara-mtart,
wrkst LIKE mara-wrkst,
extwg LIKE mara-extwg,
labor LIKE mara-labor,
normt LIKE mara-normt,
bismt LIKE mara-bismt,
spart LIKE mara-spart,
meins LIKE mara-meins,
kposn LIKE konv-kposn,
kschl LIKE konv-kschl,
kwert LIKE konv-kwert,
kwert1 LIKE konv-kwert,
kwert2 LIKE konv-kwert,
kwert3 LIKE konv-kwert,
kwert4 LIKE konv-kwert,
kwert5 LIKE konv-kwert,
kbetr LIKE konv-kbetr,
vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
lfdat LIKE likp-lfdat,
wgbez LIKE t023t-wgbez,
spras LIKE t023t-spras,
bsart LIKE ekko-bsart,
aedat LIKE ekko-aedat,
**********************modification additioon of chapter ID 30.04.2007
j_1ichid LIKE j_1imtchid-j_1ichid ,
**********************modification additioon of chapter ID 30.04.2007
total TYPE p DECIMALS 2,
mvgr1 LIKE mvke-mvgr1,
werks LIKE t001w-werks, "Number of the document condition
kunnr LIKE t001w-kunnr, "Condition value
name1 LIKE t001w-name1, "Condition type
name2 LIKE t001w-name2, "Condition item number
werks1 LIKE t001w-werks, "Number of the document condition
kunnr1 LIKE t001w-kunnr, "Condition value
name11 LIKE t001w-name1, "Condition type
name21 LIKE t001w-name2,
exnum LIKE j_1iexchdr-exnum, "Material Number
exdat LIKE j_1iexchdr-exdat, "Chapter ID
rdoc LIKE j_1iexchdr-rdoc,
bom TYPE p DECIMALS 4,
mult TYPE p DECIMALS 4,
bezie LIKE tvm1t-bezei,
length(5) TYPE n,
breath(5) TYPE n,
bldat LIKE likp-bldat, " document date
size(15) TYPE p DECIMALS 2,
area(15) TYPE p DECIMALS 2,
mblnr TYPE mseg-mblnr, "Number of Material Document
mjahr TYPE mseg-mjahr, "Material Document Year
budat TYPE mkpf-budat, "Posting period
w_flag TYPE c,
flag TYPE c,
END OF t_final.
DATA : BEGIN OF t_temp OCCURS 0,
kunag LIKE vbrk-kunag,
vbeln_k LIKE vbrk-vbeln,
fkdat LIKE vbrk-fkdat,
knumv LIKE vbrk-knumv,
fkart LIKE vbrk-fkart,
vtweg LIKE vbrk-vtweg,
vkorg LIKE vbrk-vkorg,
vbeln LIKE likp-vbeln, "Delivery
vbeln_p LIKE vbrp-vbeln,
vstel LIKE vbrp-vstel,
"vgbel like mkpf-xblnr,
vgbel LIKE vbrp-vgbel,
aubel LIKE vbrp-aubel,
matnr LIKE vbrp-matnr,
arktx LIKE vbrp-arktx,
matkl LIKE vbrp-matkl,
fkimg LIKE vbrp-fkimg,
posnr LIKE vbrp-posnr,
vrkme LIKE vbrp-vrkme,
matnr_m LIKE mara-matnr,
mtart LIKE mara-mtart,
wrkst LIKE mara-wrkst,
extwg LIKE mara-extwg,
labor LIKE mara-labor,
normt LIKE mara-normt,
bismt LIKE mara-bismt,
spart LIKE mara-spart,
meins LIKE mara-meins,
kposn LIKE konv-kposn,
kschl LIKE konv-kschl,
kwert LIKE konv-kwert,
kwert1 LIKE konv-kwert,
kwert2 LIKE konv-kwert,
kwert3 LIKE konv-kwert,
kwert4 LIKE konv-kwert,
kwert5 LIKE konv-kwert,
kbetr LIKE konv-kbetr,
vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
lfdat LIKE likp-lfdat,
wgbez LIKE t023t-wgbez,
spras LIKE t023t-spras,
bsart LIKE ekko-bsart,
aedat LIKE ekko-aedat,
**********************modification additioon of chapter ID 30.04.2007
j_1ichid LIKE j_1imtchid-j_1ichid ,
**********************modification additioon of chapter ID 30.04.2007
total TYPE p DECIMALS 2,
mvgr1 LIKE mvke-mvgr1,
werks LIKE t001w-werks, "Number of the document condition
kunnr LIKE t001w-kunnr, "Condition value
name1 LIKE t001w-name1, "Condition type
name2 LIKE t001w-name2, "Condition item number
werks1 LIKE t001w-werks, "Number of the document condition
kunnr1 LIKE t001w-kunnr, "Condition value
name11 LIKE t001w-name1, "Condition type
name21 LIKE t001w-name2,
exnum LIKE j_1iexchdr-exnum, "Material Number
exdat LIKE j_1iexchdr-exdat, "Chapter ID
rdoc LIKE j_1iexchdr-rdoc,
bom TYPE p DECIMALS 4,
mult TYPE p DECIMALS 4,
bezie LIKE tvm1t-bezei,
length(5) TYPE n,
breath(5) TYPE n,
size(15) TYPE p DECIMALS 2,
area(15) TYPE p DECIMALS 2,
mblnr TYPE mseg-mblnr, "Number of Material Document
mjahr TYPE mseg-mjahr, "Material Document Year
budat TYPE mkpf-budat, "Posting period
END OF t_temp.
DATA : BEGIN OF it_mseg OCCURS 0,
werks LIKE mseg-werks,
matnr LIKE mseg-matnr,
ebeln LIKE mseg-ebeln,
mblnr TYPE mseg-mblnr, "Number of Material Document
mjahr TYPE mseg-mjahr, "Material Document Year
END OF it_mseg.
DATA : BEGIN OF it_mkpf OCCURS 0,
budat TYPE mkpf-budat,
mblnr TYPE mkpf-mblnr,
tcode2 LIKE mkpf-tcode2,
" xblnr(10) TYPE C,
xblnr LIKE likp-vbeln, "Delivery
END OF it_mkpf.
DATA : BEGIN OF it_vbuk OCCURS 0,
vbeln LIKE vbuk-vbeln,
wbstk LIKE vbuk-wbstk,
END OF it_vbuk.
DATA : it_vbrk LIKE t_vbrk OCCURS 0 WITH HEADER LINE.
DATA : it_vbrp LIKE t_vbrp OCCURS 0 WITH HEADER LINE.
DATA : it_mara LIKE t_mara OCCURS 0 WITH HEADER LINE.
TYPES : w_str TYPE string,
str TYPE string.
* WORK AREAS *
DATA: wa_vbrk LIKE t_vbrk. "WORK AREA FOR VBRK
DATA: wa_vbrp LIKE t_vbrp. "WORK AREA FOR VBRP
DATA: wa_mara LIKE t_mara. "WORK AREA FOR MARA
DATA: wa_sfinal LIKE t_temp. "WORK AREA FOR T_FINAL
DATA: wa_sfinal1 LIKE t_final. "WORK AREA FOR T_FINAL
DATA: wa_mseg LIKE it_mseg. "Workarea for internal table mseg
DATA : wa_vbeln LIKE t_vbrk-vbeln.
DATA: wa_mkpf LIKE it_mkpf. "Workarea for internal table mkpf
* ALV *
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
it_top_of_page TYPE slis_t_listheader,
ls_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event.
* SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK detail WITH FRAME TITLE text-000.
SELECT-OPTIONS: supp_pnt FOR vbrp-vstel OBLIGATORY. "SUPPLYING PLANT
SELECT-OPTIONS: recv_pnt FOR vbrk-kunag OBLIGATORY. "RECEIVING PLANT
SELECT-OPTIONS: period FOR vbrk-fkdat OBLIGATORY. "PERIOD
SELECT-OPTIONS: budat FOR mkpf-budat. " MIGO DATE
SELECTION-SCREEN END OF BLOCK detail.
* START-OF-SELECTION *
***********************************POPULATING DATA
PERFORM populating_data.
**********************************MOVE DATA
PERFORM move_data.
*********************************DATA- FETCHING
PERFORM data_fetching.
*********************************GET ALV DATA
PERFORM alv_get_data.
*********************************ALV GRID DATA
PERFORM alv_grid.
*********************************TOP OF PAGE
PERFORM top_of_page.
* VALIDATION OF SELECTION SCREEN *
AT SELECTION-SCREEN ON period.
IF period-high IS INITIAL.
MESSAGE e001(zamit).
ENDIF.
* SELECTION OF DATA *
FORM populating_data.
*************POPULATING DATA FROM VBRK
CLEAR t_vbrk.
REFRESH t_vbrk.
SELECT kunag
vbeln
fkdat
knumv
fkart
vtweg
vkorg
erzet
FROM vbrk INTO TABLE t_vbrk
WHERE kunag IN recv_pnt AND
fkdat IN period AND
fkart = 'JEX' OR
fkart = 'F8' AND
vtweg = '10' AND
vkorg = '1000'.
DELETE t_vbrk[] WHERE fkdat = '' .
DELETE t_vbrk[] WHERE fkdat NOT IN period.
DELETE t_vbrk[] WHERE kunag NOT IN recv_pnt.
IF t_vbrk[] IS INITIAL.
MESSAGE i002(zamit).
LEAVE LIST-PROCESSING.
ENDIF.
DELETE t_vbrk WHERE fkdat NOT IN period.
*DATA: l_tabix TYPE sy-tabix. " declare the sy-tabix as local variable
*DATA: l_lines TYPE sy-tabix.
*DATA: l_index TYPE sy-tabix.
*"SORT T_VBRK DESCENDING BY vbeln.
*SORT T_VBRK ASCENDING BY vbeln fkart .
*DESCRIBE TABLE t_vbrk LINES l_lines . "The current number of table rows of the internal table itab is determined and is assigned to the data object lin
*CHECK l_lines > 1. " check lines are greater than 1
*LOOP AT t_vbrk.
* l_tabix = sy-tabix. " assine Index of Internal Tables into local var l_tabix
* l_index = l_tabix + 1.
* IF t_vbrk-fkart = 'F8'. " loop on the temp table
*READ TABLE t_vbrk INTO wa_vbrk INDEX l_index. " read the temp table with index l_index
*IF sy-subrc = 0.
*CHECK t_vbrk-vbeln < wa_vbrk-vbeln .
* if sy-subrc = 0.
* t_vbrk-W_FLAG = 'X'.
* MODIFY t_vbrk TRANSPORTING W_FLAG.
*endif.
* endif.
*else.
* exit.
*endif.
*endloop.
*LOOP at t_vbrk.
*DELETE t_vbrk WHERE w_flag = 'X' .
*endloop.
*" change by kalika dated 28.06.2007
**" change by kalika dated 28.06.2007
*************POPULATING DATA FROM VBRP
IF t_vbrk[] IS NOT INITIAL.
CLEAR t_vbrp.
REFRESH t_vbrp.
SELECT vbeln
vstel
vgbel
aubel
matnr
arktx
matkl
fkimg
werks
posnr
vrkme
FROM vbrp INTO TABLE t_vbrp
FOR ALL ENTRIES IN t_vbrk
WHERE vbeln = t_vbrk-vbeln
AND vstel IN supp_pnt .
ENDIF.
IF sy-subrc <> 0.
MESSAGE i000(zamit).
LEAVE LIST-PROCESSING.
ENDIF.
IF t_vbrp[] IS NOT INITIAL.
SELECT vbeln wbstk FROM vbuk
INTO TABLE it_vbuk FOR ALL ENTRIES IN
t_vbrp WHERE vbeln = t_vbrp-vgbel.
ENDIF.
"DELETE t_vbrp[] WHERE vstel NOT in supp_pnt. " by kalika
*************POPULATING DATA FROM MARA
it_vbrp[] = t_vbrp[].
" it_vbrp-vgbel1 = t_vbrp-vgbel.
"SORT it_vbrp BY matnr.
SORT t_vbrp BY vbeln.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING matnr . by kalika
* IF t_vbrp IS NOT INITIAL.
CLEAR t_mara.
REFRESH t_mara.
SELECT matnr
mtart
wrkst
extwg
labor
normt
bismt
matkl
spart
meins
FROM mara INTO TABLE t_mara
FOR ALL ENTRIES IN it_vbrp WHERE
matnr = it_vbrp-matnr .
* ENDIF.
*************POPULATING DATA FROM KONV
it_vbrk[] = t_vbrk[].
SORT it_vbrk BY knumv .
DELETE ADJACENT DUPLICATES FROM it_vbrk COMPARING knumv .
CLEAR t_konv.
REFRESH t_konv.
SELECT knumv
kposn
kschl
kwert
kbetr
FROM konv INTO TABLE t_konv
FOR ALL ENTRIES IN it_vbrk
WHERE knumv = it_vbrk-knumv.
DELETE t_konv WHERE
kschl <> 'ZR02'
AND kschl <> 'JEXP'
AND kschl <> 'JECS'
AND kschl <> 'DIFF'.
*************POPULATING DATA FROM LIKP
it_vbrp[] = t_vbrp[].
SORT it_vbrp BY vgbel.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING vgbel . by kalika
CLEAR t_likp.
REFRESH t_likp.
SELECT vbeln
lfdat
bldat " NEW CHANGE
FROM likp INTO CORRESPONDING FIELDS OF TABLE t_likp
FOR ALL ENTRIES IN it_vbrp
WHERE vbeln = it_vbrp-vgbel.
*************POPULATING DATA FROM T023T
it_mara[] = t_mara[].
SORT it_mara BY matkl .
DELETE ADJACENT DUPLICATES FROM it_mara COMPARING matkl.
CLEAR t_t023t.
REFRESH t_t023t.
IF t_mara[] IS NOT INITIAL.
SELECT matkl
wgbez
spras
FROM t023t INTO TABLE t_t023t
FOR ALL ENTRIES IN it_mara
WHERE matkl = it_mara-matkl AND
spras = sy-langu.
ENDIF.
*************POPULATING DATA FROM EKKO
it_vbrp[] = t_vbrp[].
SORT it_vbrp BY aubel.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING aubel. by kalika
CLEAR t_ekko.
REFRESH t_ekko.
SELECT ebeln
bsart
aedat
knumv
FROM ekko
INTO TABLE t_ekko
FOR ALL ENTRIES IN it_vbrp
WHERE ebeln = it_vbrp-aubel
AND bsart LIKE 'U%'.
************************delete invoice where it is being deleted from the system
*SELECT ebeln loekz
* FROM ekpo
* INTO CORRESPONDING FIELDS OF TABLE t_ekpo
* FOR ALL ENTRIES IN t_ekko
* WHERE ebeln = t_ekko-ebeln.
*DELETE t_ekpo WHERE loekz = 'L'.
*************POPULATING DATA FROM t001w
it_vbrp[] = t_vbrp[].
SORT it_vbrp BY werks.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING werks . by kalika
CLEAR t_t001w.
REFRESH t_t001w.
SELECT werks
name1
kunnr
name2
FROM t001w INTO TABLE t_t001w
FOR ALL ENTRIES IN it_vbrp
WHERE werks = it_vbrp-werks .
it_vbrk[] = t_vbrk[].
SORT it_vbrk BY kunag.
DELETE ADJACENT DUPLICATES FROM it_vbrk COMPARING kunag .
CLEAR t_t001w2.
REFRESH t_t001w2.
SELECT werks
name1
kunnr
name2
FROM t001w INTO TABLE t_t001w2
FOR ALL ENTRIES IN it_vbrk
WHERE kunnr = it_vbrk-kunag .
*--------POPULATING DATA FROM MARM
SELECT matnr
meinh
umrez
umren FROM marm INTO TABLE t_marm
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr.
*********************POPULATING DATA FROM MVKE
CLEAR t_mvke.
REFRESH t_mvke.
SELECT matnr
mvgr1
FROM mvke INTO TABLE t_mvke
FOR ALL ENTRIES IN t_vbrp
WHERE matnr = t_vbrp-matnr .
*-----------------POPULATING DATA FROM TVM1T.
SELECT
mvgr1 bezei FROM tvm1t
INTO TABLE t_tvm1t FOR ALL ENTRIES IN t_mvke
WHERE mvgr1 = t_mvke-mvgr1.
**********************modification additioon of chapter ID 30.04.2007
*-----------------POPULATING DATA FROM j_1imtchid.
CLEAR t_j_1imtchid.
REFRESH t_j_1imtchid.
SELECT matnr
j_1ichid
FROM j_1imtchid INTO TABLE t_j_1imtchid
FOR ALL ENTRIES IN t_vbrp
WHERE matnr = t_vbrp-matnr .
*-----------------POPULATING DATA FROM j_1iexchdr.
CLEAR t_j_1iexchdr.
REFRESH t_j_1iexchdr.
SELECT exnum
exdat
rdoc
werks
trntyp
status
FROM j_1iexchdr INTO TABLE t_j_1iexchdr
FOR ALL ENTRIES IN t_vbrp
WHERE rdoc = t_vbrp-vbeln
AND werks = t_vbrp-werks
AND trntyp = 'DLFC' . " by kalika
DELETE t_j_1iexchdr WHERE status = 'R' . " by kalika
DELETE t_j_1iexchdr WHERE status = 'B' . " by kalika
SORT t_j_1iexchdr BY rdoc.
***************end of modification additioon of chapter ID 30.04.2007
******* start of modification kalika dated 19.06.2007
LOOP AT t_likp.
t_likp-vbeln_kp = t_likp-vbeln.
MODIFY t_likp.
ENDLOOP.
* SELECT budat mblnr xblnr tcode2
* FROM mkpf
* INTO CORRESPONDING FIELDS OF TABLE it_mkpf
* FOR ALL ENTRIES IN t_likp
* WHERE xblnr = t_likp-vbeln_kp
* AND tcode2 LIKE 'MIGO_GR'
* AND budat IN budat. "26.07.2007
SELECT ebeln mblnr FROM mseg
INTO CORRESPONDING FIELDS OF TABLE it_mseg
FOR ALL ENTRIES IN t_vbrp
WHERE ebeln = t_vbrp-aubel AND mblnr LIKE '5%'.
SELECT budat mblnr tcode2
FROM mkpf
INTO CORRESPONDING FIELDS OF TABLE it_mkpf
FOR ALL ENTRIES IN it_mseg
WHERE mblnr = it_mseg-mblnr
AND tcode2 LIKE 'MIGO_GR'
AND budat IN budat. "26.07.2007
*loop at it_mkpf.
*DELETE it_mkpf WHERE mblnr = '4'.
*MODIFY it_mkpf.
*ENDLOOP.
ENDFORM. "populating_data
* FORM MOVE_DATA. *
FORM move_data.
CLEAR t_final.
REFRESH t_final.
SORT : t_vbrp BY vbeln,
t_vbrk BY vbeln,
t_mara BY matnr,
t_likp BY vbeln,
t_ekko BY ebeln,
t_t023t BY matkl,
t_konv BY knumv,
t_mvke BY matnr,
t_t001w BY werks,
t_t001w2 BY kunnr,
t_tvm1t BY mvgr1,
t_j_1iexchdr BY rdoc,
t_j_1imtchid BY matnr,
t_j_1iexchdr BY rdoc werks,
" it_mkpf by mblnr,
it_mseg BY mblnr,
it_mkpf BY mblnr,
it_vbuk BY vbeln.
CLEAR t_vbrp.
LOOP AT t_vbrp.
t_final-vstel = t_vbrp-vstel.
t_final-vgbel = t_vbrp-vgbel.
t_final-aubel = t_vbrp-aubel.
t_final-matnr = t_vbrp-matnr.
t_final-arktx = t_vbrp-arktx.
t_final-matkl = t_vbrp-matkl.
t_final-fkimg = t_vbrp-fkimg.
t_final-posnr = t_vbrp-posnr.
t_final-vrkme = t_vbrp-vrkme.
" t_vbrp-vgbel1 = t_vbrp-vgbel.
READ TABLE it_vbuk WITH KEY vbeln = t_vbrp-vgbel BINARY SEARCH.
IF sy-subrc = 0.
t_final-flag = it_vbuk-wbstk.
ENDIF.
CLEAR t_vbrk.
READ TABLE t_vbrk WITH KEY vbeln = t_vbrp-vbeln
BINARY SEARCH.
IF sy-subrc = 0.
t_final-kunag = t_vbrk-kunag.
t_final-vbeln_k = t_vbrk-vbeln.
t_final-fkdat = t_vbrk-fkdat.
t_final-fkart = t_vbrk-fkart.
t_final-knumv = t_vbrk-knumv.
ENDIF.
CLEAR t_mara.
READ TABLE t_mara WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
IF sy-subrc = 0.
t_final-mtart = t_mara-mtart.
t_final-wrkst = t_mara-wrkst.
t_final-extwg = t_mara-extwg.
t_final-labor = t_mara-labor.
t_final-normt = t_mara-normt.
t_final-bismt = t_mara-bismt.
t_final-spart = t_mara-spart.
t_final-meins = t_mara-meins.
SPLIT t_final-bismt AT '*' INTO t_final-length t_final-breath.
IF t_final-bismt = ''.
t_final-size = ''.
ELSE.
t_final-size = t_vbrp-fkimg * ( t_final-length * t_final-breath ) / 1000000.
ENDIF.
ENDIF.
CLEAR t_konv.
READ TABLE t_konv WITH KEY knumv = t_vbrk-knumv BINARY SEARCH.
IF sy-subrc = 0.
t_final-kschl = t_konv-kschl.
ENDIF.
CLEAR t_likp.
READ TABLE t_likp WITH KEY vbeln = t_vbrp-vgbel BINARY SEARCH.
IF sy-subrc = 0.
t_final-lfdat = t_likp-lfdat.
t_final-bldat = t_likp-bldat. " NEW CHANGE
t_final-vbeln_kp = t_likp-vbeln.
ENDIF.
CLEAR t_ekko.
READ TABLE t_ekko WITH KEY ebeln = t_vbrp-aubel BINARY SEARCH.
IF sy-subrc = 0.
t_final-aedat = t_ekko-aedat.
ENDIF.
CLEAR t_t023t.
READ TABLE t_t023t WITH KEY matkl = t_vbrp-matkl BINARY SEARCH.
IF sy-subrc = 0.
t_final-wgbez = t_t023t-wgbez.
ENDIF.
CLEAR t_t001w.
READ TABLE t_t001w WITH KEY werks = t_vbrp-werks BINARY SEARCH.
IF sy-subrc = 0.
t_final-name1 = t_t001w-name1.
ENDIF.
CLEAR t_t001w2.
READ TABLE t_t001w2 WITH KEY kunnr = t_vbrk-kunag BINARY SEARCH.
IF sy-subrc = 0.
t_final-name21 = t_t001w2-name2.
ENDIF.
READ TABLE t_mvke WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
IF sy-subrc = 0.
t_final-mvgr1 = t_mvke-mvgr1.
ENDIF.
READ TABLE t_tvm1t WITH KEY mvgr1 = t_mvke-mvgr1 BINARY SEARCH.
IF sy-subrc = 0.
t_final-bezie = t_tvm1t-bezie.
ENDIF.
**********************modification additioon of chapter ID 30.04.2007
READ TABLE t_j_1imtchid WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
IF sy-subrc = 0.
t_final-j_1ichid = t_j_1imtchid-j_1ichid.
ENDIF.
READ TABLE t_j_1iexchdr WITH KEY rdoc = t_vbrp-vbeln
werks = t_vbrp-werks
BINARY SEARCH.
IF sy-subrc = 0.
t_final-exnum = t_j_1iexchdr-exnum.
t_final-exdat = t_j_1iexchdr-exdat.
t_final-rdoc = t_j_1iexchdr-rdoc.
t_final-werks = t_j_1iexchdr-werks.
ENDIF.
**************end of modification additioon of chapter ID 30.04.2007
"******** START OF MODIFICATION KALIKA 26.07.2007.
READ TABLE it_mseg INTO wa_mseg WITH KEY ebeln = t_vbrp-aubel.
IF sy-subrc = 0.
t_final-mblnr = wa_mseg-mblnr.
ENDIF.
"INTO wa_mkpf
READ TABLE it_mkpf WITH KEY mblnr = t_final-mblnr
tcode2 = 'MIGO_GR'.
IF sy-subrc = 0.
t_final-budat = it_mkpf-budat.
ENDIF.
APPEND t_final.
CLEAR t_final.
ENDLOOP.
DELETE t_final[] WHERE flag = 'A' OR flag = ''. "change by amit for reverse deliveries as rkp.
DELETE t_final WHERE fkdat = ' ' .
DELETE t_final[] WHERE kunag NOT IN recv_pnt.
DELETE t_final[] WHERE vstel NOT IN supp_pnt.
DELETE t_final[] WHERE fkart = 'JEX' AND exnum = ' '. " CHANGE BY KALIKA
" FOR INVOICE WHOSE EXCISE NOT MAINTAINED
IF t_final[] IS INITIAL.
MESSAGE i002(zamit).
LEAVE LIST-PROCESSING.
ENDIF.
*---------------MARM CALCULATION
SORT t_marm BY matnr meinh.
DELETE t_marm WHERE meinh = 'M2'.
SORT t_marm BY matnr.
LOOP AT t_final.
READ TABLE t_marm WITH KEY matnr = t_final-matnr." T_MARM-MEINH <> 'M2'.
t_final-bom = ( t_marm-umrez / t_marm-umren ).
MODIFY t_final TRANSPORTING bom.
t_final-mult = t_final-bom * t_final-fkimg.
MODIFY t_final TRANSPORTING mult.
CLEAR t_final.
ENDLOOP.
*--------------------delivery no.
*-------------------beginning of adding na*******
LOOP AT t_final.
" *** change by kalika
IF t_final-matkl EQ 'BWGRBBD'
OR t_final-matkl = 'BWGRBPD'
OR t_final-matkl = 'BWGRCLB'
OR t_final-matkl = 'BWGRCMD'
OR t_final-matkl = 'BWGRGFB'
OR t_final-matkl = 'BWGRGFC'
OR t_final-matkl = 'BWGRGFO'
OR t_final-matkl = 'GRNLAM'
OR t_final-matkl = 'DVNRTKBB'
OR t_final-matkl = 'MRETBBD'
OR t_final-matkl = 'MRGRBBD'
OR t_final-matkl = 'MRGRCMD'
OR t_final-matkl = 'MRRBBD'
OR t_final-matkl = 'PLAMGBSD'
OR t_final-matkl = 'BWETBBD'
OR t_final-matkl = 'PLAMGOSD'.
* "LOOP AT t_final WHERE matkl = 'BWGRBBD'
*OR matkl = 'BWGRBPD'
*OR matkl = 'BWGRCLB'
*OR matkl = 'BWGRCMD'
*OR matkl = 'BWGRGFB'
*OR matkl = 'BWGRGFC'
*OR matkl = 'BWGRGFO'
*OR matkl = 'GRNLAM'
*OR matkl = 'DVNRTKBB'
*OR matkl = 'MRETBBD'
*OR matkl = 'MRGRBBD'
*OR matkl = 'MRGRCMD'
*OR matkl = 'MRRBBD'
*OR matkl = 'PLAMGBSD'
*OR matkl = 'BWETBBD'
*OR matkl = 'PLAMGOSD'.
*** change by kalika
t_final-area = ( t_final-size * 15 ) / 10 .
MODIFY t_final TRANSPORTING area.
ELSE.
t_final-area = ( t_final-normt * t_final-size ) / 4. "t_final-bom
MODIFY t_final TRANSPORTING area.
ENDIF.
ENDLOOP.
"*** change by kalika
" ** start Division Specific FA & NA to be displayed by kalika
LOOP AT t_final.
IF t_final-spart = 'LM' .
t_final-area = space.
ENDIF.
IF t_final-spart = 'DD'.
t_final-area = space.
ENDIF.
MODIFY t_final.
ENDLOOP.
* " ** end Division Specific FA & NA to be displayed by kalika
* LOOP AT t_final WHERE matkl = 'BWETPLY'
* OR matkl = 'BWGRCHQ'
* OR matkl = 'BWGRCLP'
* OR matkl = 'BWGRCMG'
* OR matkl = 'BWGRFLX'
* OR matkl = 'BWGRFRP'
* OR matkl = 'BWGRGCP'
* OR matkl = 'BWGRPCT'
* OR matkl = 'BWGRPLY'
* OR matkl = 'BWGRSHT'
* OR matkl = 'MRGRPLY'
* OR matkl = 'MRTPLY'.
* t_final-area = ( t_final-normt * t_final-bom ) / 4.
* MODIFY t_final.
* ENDLOOP.
*-------------------ending of adding na**********
ENDFORM. " move_data.
* data_fetching *
FORM data_fetching.
*------ASSESSIBLE VALUE
SORT t_final BY knumv.
SORT t_konv BY knumv kposn.
CLEAR t_final.
CLEAR t_konv.
LOOP AT t_konv.
IF t_konv-kschl = 'ZR02'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert1 = t_konv-kwert.
t_final-kbetr = t_konv-kbetr.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert1 kbetr.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
*-----EXICESE
IF t_konv-kschl = 'JEXP'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert2 = t_konv-kwert.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert2.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
*-------CESS
IF t_konv-kschl = 'JECS'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert3 = t_konv-kwert.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert3.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
*-----ROUNDING
IF t_konv-kschl = 'DIFF'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert4 = t_konv-kwert.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert4.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
ENDLOOP.
****************TOTAL OF ALL VALUES
LOOP AT t_final.
t_final-total = t_final-kwert1 + t_final-kwert2 + t_final-kwert3 + t_final-kwert4.
MODIFY t_final INDEX sy-tabix TRANSPORTING total .
CLEAR t_final.
ENDLOOP.
*--------------delivery calculation.
" start change by kalika
DELETE t_final WHERE total = ' '. " BY KALIKA
" end change by kalika
LOOP AT t_final.
t_temp-vbeln_k = t_final-vbeln_k.
t_temp-vgbel = t_final-vgbel.
t_temp-fkart = t_final-fkart.
t_temp-kunag = t_final-kunag.
APPEND t_temp.
CLEAR t_temp.
ENDLOOP.
SORT t_temp DESCENDING BY vbeln_k .
SORT t_temp BY vgbel.
LOOP AT t_final.
READ TABLE t_temp WITH KEY vgbel = t_final-vgbel.
t_final-vbeln_k = t_temp-vbeln_k.
*---change by amit for validating migi date by amit
if t_final-budat = 0.
t_final-mblnr = ''.
endif.
*---change by amit for validating migi date by amit
MODIFY t_final TRANSPORTING vbeln_k mblnr.
CLEAR t_final.
ENDLOOP.
" start KALIKA 30.06.2007.
"SORT t_final STABLE DESCENDING by fkart fkdat. "plz kalika do not forbid stable even it doent any effect this case but in future when large amount of data in production it will works.
SORT t_final STABLE ASCENDING BY fkart fkdat. "plz kalika do not forbid stable even it doent any effect this case but in future when large amount of data in production it will works.
DATA: l_tabix TYPE sy-tabix. " declare the sy-tabix as local variable
DATA: l_lines TYPE sy-tabix.
DATA: l_index TYPE sy-tabix.
DESCRIBE TABLE t_final LINES l_lines . "The current number of table rows of the internal table itab is determined and is assigned to the data object lin
CHECK l_lines > 1. " check lines are greater than 1
LOOP AT t_final WHERE fkart = 'F8'.
l_tabix = sy-tabix. " assine Index of Internal Tables into local var l_tabix
l_index = l_tabix + 1.
READ TABLE t_final INTO wa_sfinal1 INDEX l_index. " read the temp table with index l_index
IF sy-subrc = 0.
CHECK t_final-vgbel = wa_sfinal1-vgbel AND t_final-knumv NE wa_sfinal1-knumv.
IF sy-subrc = 0.
t_final-w_flag = 'X'.
MODIFY t_final TRANSPORTING w_flag.
ENDIF.
ENDIF.
ENDLOOP.
"DELETE ADJACENT DUPLICATES FROM t_final[] COMPARING fkart
DELETE t_final[] WHERE w_flag = 'X'.
" end KALIKA 30.06.2007.
*--change by amit for performa invoice deletion
DELETE t_final[] WHERE aedat = 0.
ENDFORM. " sub_CAL
* FORM ALV GET DATA FOR NOTIONAL AREA *
FORM alv_get_data .
CLEAR it_fieldcat.
***************** SUPPLYING PLANT
* wa_fieldcat-col_pos = '1'. " ALV O/P COL-1
wa_fieldcat-fieldname = 'VSTEL'.
wa_fieldcat-seltext_m = 'SUPPLYING PLANT'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
wa_fieldcat-tabname = 'T_FINAL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************** SUPPLYING PLANT
* wa_fieldcat-col_pos = '2'. " ALV O/P COL-1
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-seltext_m = 'SUPP PLANT DESCRTN'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 20.
wa_fieldcat-tabname = 'T_FINAL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************** RECEIVING PLANT
* wa_fieldcat-col_pos = '3'. " ALV O/P COL-2
wa_fieldcat-fieldname = 'KUNAG'.
wa_fieldcat-seltext_m = 'RECEIVING PLANT'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************** RECEIVING PLANT
* wa_fieldcat-col_pos = '4'. " ALV O/P COL-2
wa_fieldcat-fieldname = 'NAME21'.
wa_fieldcat-seltext_m = 'RECE PLNT DESCRTN'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************** BILL NUMBER
* wa_fieldcat-col_pos = '5'. " ALV O/P COL-3
wa_fieldcat-fieldname = 'VBELN_K'.
wa_fieldcat-seltext_m = 'BILL NUMBER'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*******************BILL DATE
* wa_fieldcat-col_pos = '6'. " ALV O/P COL-4
wa_fieldcat-fieldname = 'FKDAT'.
wa_fieldcat-seltext_m = 'BILL DATE'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** OUT BOUND DELIVERY NO
* wa_fieldcat-col_pos = '7'. " ALV O/P COL-5
wa_fieldcat-fieldname = 'VGBEL'.
wa_fieldcat-seltext_m = 'OUT BOUND DELIVERY NO'.
wa_fieldcat-just = 'L'.
* wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** OUT BOUND DELIVERY DATE
** wa_fieldcat-col_pos = '8'. " ALV O/P COL-6
* wa_fieldcat-fieldname = 'LFDAT'.
* wa_fieldcat-seltext_m = 'OUT BOUND DELIVERY DATE'.
* wa_fieldcat-just = 'L'.
* wa_fieldcat-tabname = 'T_FINAL'.
* wa_fieldcat-outputlen = 15.
* APPEND wa_fieldcat TO it_fieldcat.
* CLEAR wa_fieldcat.
" * wa_fieldcat-col_pos = '8'. " ALV O/P COL-6
wa_fieldcat-fieldname = 'BLDAT'.
wa_fieldcat-seltext_m = 'DELIVERY DOC DATE'. " NEW CHANGE
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************* S.T.O. NO.
* wa_fieldcat-col_pos = '9'. " ALV O/P COL-6
wa_fieldcat-fieldname = 'AUBEL'.
wa_fieldcat-seltext_m = 'S.T.O. NO.'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** S.T.O. DATE
* wa_fieldcat-col_pos = '10'. " ALV O/P COL-6
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-seltext_m = 'S.T.O. DATE'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************ DIVISION
* wa_fieldcat-col_pos = '11'. " ALV O/P COL-7
wa_fieldcat-fieldname = 'SPART'.
wa_fieldcat-seltext_m = 'DIVISION'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
********** MATERIAL CODE
* wa_fieldcat-col_pos = '12'. " ALV O/P COL-9
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = 'MATERIAL CODE'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************ DESCRIPTION
* wa_fieldcat-col_pos = '13'. " ALV O/P COL-10
wa_fieldcat-fieldname = 'ARKTX'.
wa_fieldcat-seltext_m = 'DESCRIPTION'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************MATERIAL TYPE
* wa_fieldcat-col_pos = '14'. " ALV O/P COL-11
wa_fieldcat-fieldname = 'MTART'.
wa_fieldcat-seltext_m = 'MATERIAL TYPE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************MATERIAL GROUP
* wa_fieldcat-col_pos = '15'. " ALV O/P COL-13
wa_fieldcat-fieldname = 'MATKL'.
wa_fieldcat-seltext_m = 'MATERIAL GROUP'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*******************modification additioon of chapter ID 30.04.2007
******************chapterID
* wa_fieldcat-col_pos = '32'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'J_1ICHID'.
wa_fieldcat-seltext_m = 'CHAPTER-ID'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
* wa_fieldcat-col_pos = '33'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'EXNUM'.
wa_fieldcat-seltext_m = 'EXCISE DOC.NO.'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
* wa_fieldcat-col_pos = '34'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'EXDAT'.
wa_fieldcat-seltext_m = 'EXCISE DOC.DATE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************end of modification additioon of chapter ID 30.04.2007
*********SUB GROUP
* wa_fieldcat-col_pos = '16'. " ALV O/P COL-13
wa_fieldcat-fieldname = 'MVGR1'.
wa_fieldcat-seltext_m = 'SUB GROUP'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
* wa_fieldcat-col_pos = '16'. " ALV O/P COL-13
wa_fieldcat-fieldname = 'BEZIE'.
wa_fieldcat-seltext_m = 'SUB GROUP DISCRP'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************GROUP DISCRIPTION
* wa_fieldcat-col_pos = '17'. " ALV O/P COL-14
wa_fieldcat-fieldname = 'WGBEZ'.
wa_fieldcat-seltext_m = 'GROUP DISCRIPTION'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************FINISH
* wa_fieldcat-col_pos = '18'. " ALV O/P COL-15
wa_fieldcat-fieldname = 'WRKST'.
wa_fieldcat-seltext_m = 'FINISH'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************sale u o m
* wa_fieldcat-col_pos = '19'. " ALV O/P COL-15
wa_fieldcat-fieldname = 'VRKME'.
wa_fieldcat-seltext_m = 'SALE U O M'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************BASE u o m
* wa_fieldcat-col_pos = '19'. " ALV O/P COL-15
wa_fieldcat-fieldname = 'MEINS'.
wa_fieldcat-seltext_m = 'BASE U O M'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************DESIGN NO.
* wa_fieldcat-col_pos = '20'. " ALV O/P COL-17
wa_fieldcat-fieldname = 'EXTWG'.
wa_fieldcat-seltext_m = 'DESIGN NO.'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************CATEGORY
* wa_fieldcat-col_pos = '21'. " ALV O/P COL-18
wa_fieldcat-fieldname = 'LABOR'.
wa_fieldcat-seltext_m = 'CATEGORY'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************THICKNESS
* wa_fieldcat-col_pos = '22'. " ALV O/P COL-19.
wa_fieldcat-fieldname = 'NORMT'.
wa_fieldcat-seltext_m = 'THICKNESS'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************SIZE
* wa_fieldcat-col_pos = '23'. " ALV O/P COL-20.
wa_fieldcat-fieldname = 'BISMT'.
wa_fieldcat-seltext_m = 'SIZE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
****************BILLED QTY
* wa_fieldcat-col_pos = '24'. " ALV O/P COL-21.
wa_fieldcat-fieldname = 'FKIMG'.
wa_fieldcat-seltext_m = 'BILLED QTY'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************RETE
* wa_fieldcat-col_pos = '26'. " ALV O/P COL-21.
wa_fieldcat-fieldname = 'BOM'.
wa_fieldcat-seltext_m = 'CONVERSION RATE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************MULT
* wa_fieldcat-col_pos = '32'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'MULT'.
wa_fieldcat-seltext_m = 'BILLED QTY IN BUM'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************RETE
* wa_fieldcat-col_pos = '25'. " ALV O/P COL-21.
wa_fieldcat-fieldname = 'KBETR'.
wa_fieldcat-seltext_m = 'RATE / BASE UOM'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************ASSESSIBLE VALUE
* wa_fieldcat-col_pos = '27'. " ALV O/P COL-22.
wa_fieldcat-fieldname = 'KWERT1'.
wa_fieldcat-seltext_m = 'ASSESSIBLE VALUE'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
****************EXCISE
* wa_fieldcat-col_pos = '28'. " ALV O/P COL-23.
wa_fieldcat-fieldname = 'KWERT2'.
wa_fieldcat-seltext_m = 'EXCISE'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************CESS
* wa_fieldcat-col_pos = '29'. " ALV O/P COL-24.
wa_fieldcat-fieldname = 'KWERT3'.
wa_fieldcat-seltext_m = 'CESS'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************ROUNDING
* wa_fieldcat-col_pos = '30'. " ALV O/P COL-26.
wa_fieldcat-fieldname = 'KWERT4'.
wa_fieldcat-seltext_m = 'ROUNDING'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************TOTAL
* wa_fieldcat-col_pos = '31'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-seltext_m = 'TOTAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AREA'.
wa_fieldcat-seltext_m = 'NA'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MBLNR'.
wa_fieldcat-seltext_m = 'MIGO NO'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'BUDAT'.
wa_fieldcat-seltext_m = 'MIGO DATE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " ALV_GET_DATA
* FORM ALV_GRID *
FORM alv_grid .
PERFORM fill_list_header USING it_top_of_page[].
PERFORM event-build USING gt_events[].
PERFORM fill_layout USING ls_layout.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ls_layout
it_fieldcat = it_fieldcat
it_events = gt_events[]
i_save = 'A'
TABLES
t_outtab -
Report for material which not consumed during C015
HI ALL,
"I required a report for material which material are not
consumed at C015 production confirmation time against actual consumation (order wise , part no wise & date wise )"
its v urgent
good suggesstion reward with valuable points.Amit,
I think your problem is that you want to monitor when users are deleting the goods issue while confirmation. So you would have to know if for a confirmation qty of 100, the planned consumption should have been 100 but the actual consuption is 50.
So you would want to relate the confirmation qty with the planned and actual consumption.
In COOIS Remt, qty and Withdrawal qty will show the total reqmt and actual withdrwal. Hope this will not be helpful if I understand correctly.
You have to create a simple query joining tables AFVV with RESB. Calculate the planned consuption for the confirmation qty. This along with the actual consuption will help to give what you are looking for.
I am right ?
Ram -
Inventory Report For Special Stock (Project Stock)
Dear Sir,
We are in Make -To - Order scenario and procure the material against the WBS element . For getting the Inventory List , we use MBBS tcode but it has following limitation :
a) It give the Stock Status as on date basis . While we need Stock Inventory on a cut off date , say on
31/Jan/2007 .
b) We are not able to get the Inventory Report , Material Group wise
I request to kindly guide me , as how to take the Inventory Report for Project Stock .
Regards
B MittalHi Shailesh,
Is there any way we can include some extra fields into this MC.9 report - i tried but could not find anything. Can you please help.
Regards,
Laxmi -
Need detailed report for Material wise cost components??
HI
I can only view one material at a time for the ck80_99 cost component report. Is there a way to view more materials from the same report. we have a option to give multiple material numbers but its not executing the report at that point, it first display all the materials with the costing variant when we further execute the reprt it is generating for only one material. Please help me on its urgent.
If standard report is not available, can we go customized report for this?
Thanks,HI Siva,
Thanks for quick reply. Yeah, in S_ALR_87013047 i can compare only two materials. but i am looking for a report for group of materials for forecasting. Can we create acustomised report for this.
Please let me know.
Thanks
vamshi -
How to create a report for open sales orde documents which are not invoiced
Hi Experts this is urgent,
+pls give the Logic for document flow+
My requirement is create a report for sales orders which are not invoiced using the following table.
VBAK : sales order header
VBAP : sales order item
VBFA : sales document flow
VBUK for processing status
KOMV for duties value and sales order value
LIKP : delivery not header
LIPS :delivery note item
For information : In the header level the processing Status is indicated in the table VBUK field LFSTK for one sales order number. A,B , C are the possible entries.
Case A : When a sales order is invoiced we can display information on the header status :
Overall status : Completed and display a invoice number in the document flow. When the items of the sales orders are invoiced the process status is the following : Overall status Completed
Delivery status Fully delivered
Case B : An open sales order not delivered and not invoiced will have overall status : Open on the header and item level and will not have subsequent documents.
Case C :
When the items for the sales order are delivered but not invoiced the status will be u201Cfully deliveredu201D
And the subsequent documents will be delivery notes and good issue if the delivery note is issued.
With regards
ravi
Edited by: ravik ravik on Jun 25, 2008 3:29 PMHello Ravi,
U neednot develop any report..
there is std report with txn V.02
or copy this and make necessary changes.
Reward, if helpful.
Rgds,
Raghu. -
Report for material with sloc,qty available, and production order
hi friends, i need advice on getting this report for material with qty and specific sloc with the corresponding Prodn order numbers. in mb51 i could get all these details except the prodn order no. could you advice me please?
to make sure you know how to do this.
In the material document list, hit "Ctrl+F8" on your keyboard.
A window will pop up. Click on the button position and look for "order" in the list of available fields. That should do it.
Rgds. -
Report for shedule vs supply and report for opening stock at back date.
Dear All Guru,
please can anybody reply me is there any standard report is available for
1) Report for shedule vs supply
2) and report for opening stock at back date.(ex- opening stock at last month 16th july or two months back on 10th may
pl suggest if any standard report is available or how we can data for this
Regards,
VimleshHi,
To see the opening stock at a particular date use T.Code: MB5B,
To see the scheduled quantity & delivered quantity use table EKET with the filed names MENGE & WEMNG.
Regards,
Prabu -
Report for material gr/ir clearing account display differences
report for material gr/ir clearing account display differences
hi salsa,
There is no such report for the datails of material gr/ir ......
but T code J1ILN and select
Indirect taxes -
> Register -
> Excise tax -
> In J1IN Update Excise register RG23a -
> then Extract rg23a----- > PRint utility program Rg23a
here u can extract all the invoices gr/ir
Through
T code J1I5
J2I5
J2I6
if useful assign points...
regards,
santoshkumar -
Time Out error problem when i run the report for the whole plant
Dear all,
pls find the below coding, when i execute this report for the whole plant , it gives me time out error since it has to process huge database. pls suggest me in which part of my below coding i can improvise or any other better way to fetch the same result.
pls note that
i m using Views for querying.pls also note the comments given in Bold to understand the reason behind the coding.
Views used in are - ZVPOD and ZVPRDCONF.
START-OF-SELECTION.
Data: zstat type jest-stat.
data: stklocaf type mska-lgort.
data: stklocas type mska-lgort.
<u><b>To collect the status of the production order by joining the ZVPOD and JEST table.</b></u>
CLEAR it_ZVPRODDET.
SELECT DISTINCT ZVPOD~bukrs ZVPOD~aufnr ZVPOD~objnr
jest~stat ZVPOD~werks ZVPOD~arbpl ZVPOD~J_3AKORD2
FROM ZVPOD
INNER JOIN jest ON ZVPOD~objnr = jest~objnr
INTO CORRESPONDING FIELDS OF wa_ZVPRODDET where
plnbez in FGM and arbpl in wc and werks in plant
and SSAVD in eldate
and J_3AKORD2 in cups and jest~inact ne 'X'.
APPEND wa_ZVPRODDET TO it_ZVPRODDET.
ENDSELECT.
SORT it_ZVPRODDET BY aufnr stat.
<u><b>Loop thru Itab to check and delete the records from itab for the specified status.</b></u>
LOOP AT it_ZVPRODDET INTO wa_ZVPRODDET.
IF wa_ZVPRODDET-stat = 'I0045' . " TECO - compl
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
ELSEIF wa_ZVPRODDET-stat = 'I0009' . " CNF - Confirmed
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
ELSEIF wa_ZVPRODDET-stat = 'I0012' . " DLV - Delivered
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
ELSEIF wa_ZVPRODDET-stat = 'I0046' . " CLSD - Closed
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
ELSEIF wa_ZVPRODDET-stat = 'I0076' . " DLFL - Del Flag
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
ELSEIF wa_ZVPRODDET-stat = 'E0003' . " SCLS - Short Close
CLEAR tj30t.
SELECT SINGLE txt04
FROM tj30t INTO tj30t-txt04
WHERE stsma = 'PRDHOLD' AND
estat = 'E0003' AND
txt04 = 'SCLS' AND
spras = 'EN'.
IF sy-subrc = 0.
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
ENDIF.
ENDIF.
* Condition for Prod Order released - REL
IF wa_ZVPRODDET-stat = 'I0002'.
mreleased = 'Y'.
else.
mreleased = 'N'.
endif.
zstat = wa_ZVPRODDET-stat.
IF mreleased = 'N'.
DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr
and stat = zstat.
ENDIF.
ENDLOOP.
<u><b>Loop thru the filtered ITAB to get all the production order details for the production order number specified in the where clause( zaufnr ) and populate another internal table.</b></u>
LOOP AT it_ZVPRODDET INTO wa_ZVPRODDET.
zaufnr = wa_zvproddet-aufnr.
zarbid = wa_zvproddet-arbid.
at new aufnr.
SELECT DISTINCT * INTO CORRESPONDING FIELDS OF walnpln
FROM zvpod where plnbez in FGM and arbpl in wc and SSAVD in
eldate and werks in plant and J_3AKORD2 in cups and aufnr = zaufnr.
APPEND walnpln TO itablnpln.
endselect.
endat.
endloop.
clear walnpln.
<u><b>
Looping thru Internal table and performs all the following calculations and inner loop
and also relevant querying.</b></u>
<u><b>Assume that ITABLNPLN holds appox. 8000 records.</b></u>
LOOP AT itablnpln INTO walnpln.
contot = 0.
SELECT distinct * INTO CORRESPONDING FIELDS OF TABLE itablnp
FROM zvprdconf where aufnr = walnpln-aufnr and
j_3asize = walnpln-j_3akordx and stzhl ne '2' and stokz ne 'X'.
clear zvprdconf.
SELECT single isdd
FROM zvprdconf into zvprdconf-isdd
where aufnr = walnpln-aufnr and
j_3asize = walnpln-j_3akordx and stzhl ne '2' and stokz ne 'X'.
SELECT single isdz
FROM zvprdconf into zvprdconf-isdz
where aufnr = walnpln-aufnr and
j_3asize = walnpln-j_3akordx and stzhl ne '2' and stokz ne 'X'.
IF sy-subrc EQ 0.
<u><b>Assume that ITABLNP holds appox. 30 records.</b></u>
loop at itablnp into walnp.
contot = contot + walnp-J_3ALMNGA.
move walnp-J_3ASIZE to walnpln-J_3ASIZE.
move zvprdconf-isdd to walnpln-zdate.
move zvprdconf-isdz to walnpln-ztime.
endloop.
walnpln-output = contot.
endif.
walnpln-wip = walnpln-menge - contot.
if walnpln-werks = '1000'.
stklocaf = '1050'.
stklocas = '1060'.
elseif walnpln-werks = '2000'.
stklocaf = '2150'.
stklocas = '2160'.
endif.
select single kunnr into walnpln-ship from vbpa where
vbeln = walnpln-KDAUF and PARVW = 'WE'.
zship = walnpln-ship.
move zship to walnpln-ship.
select single kalab into walnpln-zactqty from mska
where matnr = walnpln-plnbez
and j_3asize = walnpln-J_3AKORDX and LGORT = stklocaf.
condense walnpln-kdauf.
zsales = walnpln-kdauf.
concatenate zsales 'S' into zso.
select single kalab into walnpln-zsndqty from mska
where matnr = walnpln-plnbez
and j_3asize = walnpln-J_3AKORDX and LGORT = stklocas
and J_4KSCAT = zso.
zmatn = walnpln-plnbez.
zsale = walnpln-KDAUF.
walnpln-kdauf = zsale.
walnpln-plnbez = zmatn.
zcust = walnpln-kunnr.
walnpln-kunnr = zcust.
select single bezei into walnpln-season from TVV2T where
kvgr2 = walnpln-kvgr2 and SPRAS = 'E'.
select single bezei into walnpln-shipmode from T173T where
vsart = walnpln-vsart and SPRAS = 'E'.
STRL = strlen( walnpln-j_3akord2 ).
if strl = 4.
move walnpln-j_3akord2 to walnpln-j_3akord3.
clear walnpln-j_3akord2.
endif.
move zremk to walnpln-remk.
MODIFY itablnpln FROM walnpln.
contot = 0.
clear itablnp.
ENDLOOP.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.Hi raja,
Plese go through the suggessitions.
1.avoide the select ...endselect. write the below select
CLEAR IT_ZVPRODDET.
SELECT DISTINCT
ZVPOD~BUKRS
ZVPOD~AUFNR
ZVPOD~OBJNR
JEST~STAT
ZVPOD~WERKS
ZVPOD~ARBPL
ZVPOD~J_3AKORD2
FROM ZVPOD
INNER JOIN JEST ON ZVPOD~OBJNR = JEST~OBJNR
INTO CORRESPONDING FIELDS TABLE IT_ZVPRODDET
WHERE PLNBEZ IN FGM AND
ARBPL IN WC AND
WERKS IN PLANT AND
SSAVD IN ELDATE AND
J_3AKORD2 IN CUPS AND
JEST~INACT NE 'X'.
IF SY-SUBRC = 0.
SORT TABLE IT_ZVPRODDET.
ENDIF.
2..first of all dont delete a record inside the loop. instead use the Field symobols.
have u obsereved you code in the loop!!!!. wht u r doing..
u r removing the same record which u in the loop..
If u wanto delete the entires with check to<b> stat</b>... <b>then.. why dont u put the STAT field in Wher e condition..?</b> by this you reduce the data base select time..
Now the select query is like the below....
CLEAR IT_ZVPRODDET.
SELECT DISTINCT
ZVPOD~BUKRS
ZVPOD~AUFNR
ZVPOD~OBJNR
JEST~STAT
ZVPOD~WERKS
ZVPOD~ARBPL
ZVPOD~J_3AKORD2
FROM ZVPOD
INNER JOIN JEST ON ZVPOD~OBJNR = JEST~OBJNR
INTO CORRESPONDING FIELDS TABLE IT_ZVPRODDET
WHERE PLNBEZ IN FGM AND
ARBPL IN WC AND
WERKS IN PLANT AND
SSAVD IN ELDATE AND
J_3AKORD2 IN CUPS AND
JEST~INACT NE 'X' AND
( STAT <> 'I0045' AND
STAT <> 'I0045' AND
STAT <> 'I0009' AND
STAT <> 'I0012' AND
STAT <> 'I0046' AND
STAT <> 'I0076' AND
STAT <> 'E0003' ).
IF SY-SUBRC = 0.
SORT TABLE IT_ZVPRODDET.
ENDIF.
<b>3.</b> WHT IS MEANING OF THE SELECT
<b> CLEAR TJ30T.
SELECT SINGLE TXT04
FROM TJ30T INTO TJ30T-TXT04
WHERE STSMA = 'PRDHOLD' AND
ESTAT = 'E0003' AND
TXT04 = 'SCLS' AND
SPRAS = 'EN'.
IF SY-SUBRC = 0.
DELETE IT_ZVPRODDET WHERE AUFNR = WA_ZVPRODDET-AUFNR.
ENDIF.</b>....... IN WHERE CONDION U R GIven all are constant values right?..
why u need select it inside the loop.. u can write before the SELECT from ZVPOD..
that why first checke this field then go for fur thure selects..
<b>now u r code looks like this....</b>
CLEAR TJ30T.
SELECT SINGLE TXT04
FROM TJ30T INTO TJ30T-TXT04
WHERE STSMA = 'PRDHOLD' AND
ESTAT = 'E0003' AND
TXT04 = 'SCLS' AND
SPRAS = 'EN'.
IF SY-SUBRC = 0.
CLEAR IT_ZVPRODDET.
SELECT DISTINCT
ZVPOD~BUKRS
ZVPOD~AUFNR
ZVPOD~OBJNR
JEST~STAT
ZVPOD~WERKS
ZVPOD~ARBPL
ZVPOD~J_3AKORD2
FROM ZVPOD
INNER JOIN JEST ON ZVPOD~OBJNR = JEST~OBJNR
INTO CORRESPONDING FIELDS TABLE IT_ZVPRODDET
WHERE PLNBEZ IN FGM AND
ARBPL IN WC AND
WERKS IN PLANT AND
SSAVD IN ELDATE AND
J_3AKORD2 IN CUPS AND
JEST~INACT NE 'X' AND
JEST~STAT <> 'I0045' AND
JEST~STAT <> 'I0045' AND
JEST~STAT <> 'I0009' AND
JEST~STAT <> 'I0012' AND
JEST~STAT <> 'I0046' AND
JEST~STAT <> 'I0076' AND
JEST~STAT <> 'E0003' ).
IF SY-SUBRC = 0.
SORT TABLE IT_ZVPRODDET.
ENDIF.
ENDIF.
there are so many select inside the loop...... please Delete all of them.... write them be for the loop.......using the FOR ALL ENTRIES.....
THEN LOOP THE TABLE USING THE WHERE CONDITIONS.
<b>Plese write u updated code here again</b>.. -
Create transfer order for material document - 4.6C system
Hi Gurus
Can any one provide me the function module or BAPI to create transfer for material document in 4.6c system. I have to give input as supply storage type and bin and destination storage type and bin while execting the function module.
Thank you in advance
Regards
SarathSarath,
Thanks for responding, I finally found my answere via Thread: create transfer order for material document - 4.6C system
Thanks again. -
How to create new version for material
Hi expert,
Can anyone please guide me step by step on how to create new version for material and vendor? Please also mention transaction and details step by step.
ThanksHI,
Do you mean to have version management for purchasing documents?.
Best Regards,
Arminda Jack -
Creating MDM repository for Material Master Data
Hello MDM Gurus,
I am new to SAP MDM. I want to create MDM repository for Material Master. What I unddertand is, I can create repository using Bussiness Content shiped with MDM software. I will copy *.a2a file to archive folder of MDM server and unarchive repository. I have following question for you.
1. HOw do I use export maps and import maps which I found in Busines contenst\Material folder?
2. How do I use MDM Lookup Tables which is xml document in Busines contenst\Material folder?
3. Why is the use of MDMGX_55520_Material.txt file which I found in Busines contenst\Material folder?
4. What is the use of *.xsd files and how can I use them?
Thanks,
BhupeshHi Bhupesh
1. HOw do I use export maps and import maps which I found in Busines contenst\Material folder?
save all the map files on your loacl machine. open import manager and select file-> Import, browse to the .map file and save the map with a meaningful name. now next time connect to the source file you want to import and OPEN the map saved.
2. How do I use MDM Lookup Tables which is xml document in Busines contenst\Material folder?
Businees content contains the standard ECC refernce tables like countries, regions etc which can be refreshed from ECC. for this you have to configure MDMGX, defining all the ports in MDM and in ECC the tables from which data has to be refreshed. refer to below threads for details.
Extract Data usnig MDMGX
How to Export Materials from ERP to MDM 7.1 via MDMGX?
3. Why is the use of MDMGX_55520_Material.txt file which I found in Busines contenst\Material folder?
This helps us in configuring the table extraction from ECC, refer to thread-> Extract Data usnig MDMGX
4. What is the use of *.xsd files and how can I use them?
Schema files are used for syndicating the records from MDM to source system. Say we want to syndicate material master from MDM to ECC and in ECC they will be posted via MATMAS05 IDoc. these schemas are the structure of IDoc which will contain the values which will be syndicated from MDM.
Let me know if you know some more details.
regards
Ravi -
How to create classification view for material?
HI All,
How to create classification view for material? is there any function module?
pls let me know.
Bandicheck the standard include "LCLBPAU14" this is using the following F.M
call function 'BAPI_OBJCL_CREATE'
exporting
objectkeynew = l_object
objecttablenew = l_objecttable
classnumnew = classnum_new
classtypenew = l_classtype
status = status
standardclass = standardclass
changenumber = changenumber
keydate = keydate
no_default_values = no_default_values
importing
classif_status = classif_status
tables
allocvaluesnum = allocvaluesnum
allocvalueschar = allocvalueschar
allocvaluescurr = allocvaluescurr
return = return.
Maybe you are looking for
-
Internal error Occoured while posting A/P Invoice
Hi Experts, While posting A/P Invoice. I am getting the following error message and I am unable to add the document. "Internal Error (512) Occoured [Message 131-183] Please do the needfull. Thanks & Regards, Srikanth.
-
Need some urgent support from you guys! [iPad3 Display]
I have an event on April 20th that I need to show off phase 1 of an app we're working on. I really want to show it on the new iPad. I'm working in Flash Pro 5.5 ... Can someone please tell me how to compile my app to work on the iPad High Res d
-
Ipod wont Update in Itunes. HELP!!!!!!
Heya guys. After installing Itune 6.0, I seem to be having problems with my Itunes recognizing my Ipod. Its plugged in and charging on a USB 2.0 cable, but when I use Itunes, I cant seem to have Itunes even recognize that my Ipod is plugged in and ch
-
SAP Enterprise Connector and JCo
Hello All, I have a question. I wánt to know regarding --> SAP Connector & JCo. Are both of them same ? Regards, Deepu.K
-
Why am I no longer getting the student creative cloud rate?
Up to August of 2014 I was paying the student creative cloud rate of 19.99/month. When I renewed, I began getting charged 29.99/month and I am still a student. Why is this? And I know to some it's only 10.00 but that is a lot for me right now.