Subcontract PO's in PPV report
Hi,
I have a question in SAP ECC Product Costing PPV reports.
Question is how to identify subcontract PO's in PPV report.
Thanks in advance for your valuable response.
Regards,
Maahi.
Hi,
Introduce a field called no of documents in your cube. Map it to constant 1. This will give you a count of no of items.
The number of PO's can be done directly in the Query by creating a calculated key figure = 1.
Shedule lines have a field called counter.
Hope this helps
Similar Messages
-
PPV report or functional Specification
Dear Friends,
I tried but did not find any standard Purchase Price variance report. My client's report requirement is :
PO, Mateial, Std Price, Std Cost , Actual Price, Actual Qty, Actual Cost, Batch, Vendor..............
All information I collected to develop a report except actual Price and Actual Cost.
My client is Indian and we are using CIN. In PO there is basic rate/cost but final/other rate are deriving from MM condition i.e frieght/insurance, excise etc.....
I am not able to find field/fields from where I can get final actual cost of PO or final actual price.
Although in table KONV I can total value of PO but how can be linked , i dont know.
Requesting you please provide me your guidance or if any body has functinal specification and can send to me, please send (my id is in my profile).
It would be great help.
Thanks
RaviFo actual PPV, we wrote our PPV report based on the PPV account.
Report selects and entry for the PPV account and then brings information like PO number, material number, vendor, Inventory value postes, GRIR amount posted. -
It is massive program, but both Finance and Purchasing use it to review and explain PPV -
How can I get the freight/duty for a PPV report?
Hi all,
I am making a PPV(Purchase Price Variance) report, which I could get the amount of the variance from Prime Conversion G/L account. But currently all the freight/duty/inland cost are all posted to one single G/L account, like 221020 for raws. If I want to get the freight/duty variance, what shall I do? Get from table of PO/Invoice?
Thank you very much~!Hi,
Did you resolve this issue? Can you please share your thoughts on this.
Thanks,
Sr -
Dear Friends,
I tried but did not find any standard Purchase Price variance report. My client's report requirement is :
PO, Mateial, Std Price, Std Cost , Actual Price, Actual Qty, Actual Cost, Batch, Vendor..............
All information I collected to develop a report except actual Price and Actual Cost.
My client is Indian and we are using CIN. In PO there is basic rate/cost but final/other rate are deriving from MM condition i.e frieght/insurance, excise etc.....
I am not able to find field/fields from where I can get final actual cost of PO or final actual price.
Although in table KONV I can total value of PO but how can be linked , i dont know.
Requesting you please provide me your guidance or if any body has functinal specification and can send to me, please send (my id is in my profile).
It would be great help.
Thanks
Ravino reply
-
i have attached the source code i have written, could you please tell me why matnr number purchase order and item (matnr, ebeln, eblep) , but i am geeting all other fields ine the output it_final but i am getting in it_po but not in it_final,
please treat this as very urgent.
T-CODE: *
PROG : ZFAP_PPV *
USE : PPV Report *
DEV BY: SUBBARAO *
TIME : 2008-JUNE-27 *
INDEX CHANGE DATE WHO REMARKS *
REPORT zfap_ppv NO STANDARD PAGE HEADING LINE-SIZE 300 LINE-COUNT 20(3) .
TABLES: ekko,ekpo,mseg,bkpf,bseg,t001.
*Data Declaration
DATA :BEGIN OF ty_bkpf,
bukrs TYPE bukrs, "company code
blart TYPE blart, "Doc type
belnr TYPE belnr_d, "Accounting Document Number
xblnr TYPE xblnr, "Ref doc number
budat TYPE budat, "Posting Date in the Document
END OF ty_bkpf.
DATA : BEGIN OF ty_bseg,
bukrs TYPE bukrs, "company code
belnr TYPE belnr_d, "Accounting Document Number
buzei TYPE buzei, "Number of Line Item Within Accounting Document
prctr TYPE prctr, "Profit center
zuonr TYPE dzuonr, "Assignment number
wrbtr TYPE wrbtr, "Amount in document currency
dmbtr TYPE dmbtr, "Amount in local currency
END OF ty_bseg.
DATA : BEGIN OF ty_po,
ebeln TYPE ebeln, "PO number
ebelp TYPE ebelp, "PO Item
matnr TYPE matnr, " Part number
END OF ty_po.
*Final output for the report display
DATA : BEGIN OF ty_final,
bukrs TYPE bukrs, "company code
blart TYPE blart, "Doc type
xblnr TYPE xblnr, "Ref doc number
belnr TYPE belnr_d, "Accounting Document Number
buzei TYPE buzei, "Number of Line Item Within Acc Doc
prctr TYPE prctr, "Profit center
zuonr TYPE dzuonr, "Assignment number
bldat TYPE bldat, "Doc Date
budat TYPE budat, "Posting Date in the Document
wrbtr TYPE wrbtr, "Amount in document currency
dmbtr TYPE dmbtr, "Amount in local currency
ebeln TYPE ebeln, "PO number
ebelp TYPE ebelp , "PO Item
matnr TYPE matnr, "Part number
END OF ty_final.
DATA : it_bseg LIKE STANDARD TABLE OF ty_bseg,
it_bkpf LIKE STANDARD TABLE OF ty_bkpf,
it_final LIKE STANDARD TABLE OF ty_final,
it_po LIKE STANDARD TABLE OF ty_po.
*Variables declartion
DATA : v_bukrs TYPE bukrs.
Selection Screen ***************************
SELECTION-SCREEN:BEGIN OF BLOCK zkongl WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE bkpf-bukrs. " OBLIGATORY.
SELECT-OPTIONS: s_bldat FOR bkpf-bldat,
s_matnr FOR ekpo-matnr.
SELECTION-SCREEN END OF BLOCK zkongl.
SELECTION-SCREEN:BEGIN OF BLOCK block4 WITH FRAME TITLE text-004.
*PARAMETERS: pa_view RADIOBUTTON GROUP rad5.
*PARAMETERS: pa_dload RADIOBUTTON GROUP rad5,
pa_path LIKE rlgrap-filename .
SELECTION-SCREEN END OF BLOCK block4.
End of Selection Screen ********************
TOP-OF-PAGE
*TOP-OF-PAGE.
*WRITE:/5 'CoCode',
17 'DocType',
21 'ReferNo',
32 'DocuNumber',
43 'Item',
50 'ProfitCtr',
60 'Assignment',
74 'DocDate',
86 'PostgDate',
97 'Amt In Doc.Curr',
104 'Currency',
111 'Amt In local.Curr',
120 'Currency',
130 'Purch Order',
142 'Freight diff(USD) FX',
156 'Net mat.cost diff(USD)',
172 'PPV due to I/C variation',
184 'Comment',
197 'Total PPV inventory sold curmonth',
212 'Total PPV remained in inventory'.
ULINE.
AT SELECTION-SCREEN
*at selection-screen on s_bukrs.
select bukrs into v_bukrs from t001 where bukrs in s_bukrs.
endselect.
if sy-subrc <> 0.
write : / 'Invalid company code'.
endif.
START-OF-SELECTION
START-OF-SELECTION.
refresh: it_po,it_bseg,it_bkpf.
clear: it_po,it_bseg,it_bkpf.
*Getting data from Account doc header table
SELECT bukrs blart belnr xblnr budat FROM bkpf
INTO TABLE it_bkpf
WHERE bukrs EQ p_bukrs AND bldat IN s_bldat.
IF NOT it_bkpf[] IS INITIAL.
*Getting data from Account Document index
SELECT bukrs belnr buzei prctr zuonr wrbtr dmbtr
FROM bseg INTO TABLE it_bseg
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-belnr.
ENDIF.
SORT it_bkpf.
LOOP AT it_bseg INTO ty_bseg.
MOVE-CORRESPONDING : ty_bseg TO ty_final.
READ TABLE it_bkpf INTO ty_bkpf WITH KEY bukrs = ty_final-bukrs
belnr = ty_final-belnr.
IF sy-subrc EQ 0.
MOVE : ty_bkpf-xblnr TO ty_final-xblnr,
ty_bkpf-budat TO ty_final-budat,
ty_bkpf-blart TO ty_final-blart.
ENDIF.
SELECT ekko~ebeln ekpo~ebelp ekpo~matnr
INTO TABLE it_po
FROM ekko INNER JOIN ekpo
ON ekko~ebeln = ekpo~ebeln
WHERE ekpo~bukrs EQ p_bukrs.
loop at it_po into ty_po.
move: ty_po-ebeln to ty_final-ebeln,
ty_po-ebelp to ty_final-ebelp,
ty_po-matnr to ty_final-matnr.
APPEND ty_final TO it_final.
CLEAR ty_final.
endloop.
endloop.
ULINE (300).
FORMAT COLOR 4.
WRITE:/3'CoCode',10'DocType',19'ReferNo',
30'DocuNumber',43'Item',50'ProfitCtr',
60'AccAssgntNo',74'DocDate',86'PostgDate',
97'AmtInlocal.Curr',115'Curr',
124'Amt In Doc.Curr',142'Curr',
148'PurchOrder',161'Item',169'PartNo',
184'Action', 195'Frtdiff(USD)FX',216'Netmat.cost(USD)',
235'PPV I/C variation',255'Comment',263'TotPPV Inv sold',
280'TotPPV Inv Remain'.
ULINE (300).
IF sy-subrc EQ 0.
LOOP AT it_final INTO ty_final.
WRITE :/ sy-vline,ty_final-bukrs UNDER 'CoCode',
ty_final-blart UNDER 'DocType',
ty_final-xblnr UNDER 'ReferNo',
ty_final-belnr UNDER 'DocuNumber',
ty_final-buzei UNDER 'Item',
ty_final-prctr UNDER 'ProfitCtr',
ty_final-zuonr UNDER 'AccAssgntNo',
ty_final-bldat UNDER 'DocDate',
ty_final-budat UNDER 'PostgDate',
ty_final-dmbtr UNDER 'AmtInlocal.Curr' RIGHT-JUSTIFIED,
ty_final-wrbtr UNDER 'Amt In Doc.Curr' RIGHT-JUSTIFIED,
ty_final-ebeln UNDER 'PurchOrder',
ty_final-ebelp UNDER 'Item',
ty_final-matnr UNDER 'PartNo',
sy-vline.
ENDLOOP.
ENDIF.
please tell where i have change the source code so that i get all the fields in it_final wher my final report displaysHi,
Looking at your code, you wont get the Purchase Order Number, its item and Material Number for the data you enetered in the selection screen.
If you could see the code, you are just selecting all the po's, its items and matnr's just on the basis of BURKS (Company Code).
You should select the related PO number based on the Additional Document Number in EKKO, which is same as Reference Document Number in BKPF.
So once you get the relevant order based on the input, you select the reference doc nos (XBLNR) for the relevant BELNR, and then using XBLNR, pass this value to ADDNR in EKKO, you will get relevant PO. Using PO from EKKO, you retrieve the corresponding items and matnr's from EKPO.
Hope this helps you
Harish Kalla -
Hard to believe: missing report on purchase order price variances ...
dear all-
Happy New Year to you all and all the best for this new 2008!
Traditionally the procurement to pay process is an area that really can benefit from automation. However more important than automation (efficiency), tools that support a process have to be effective first! And provide good understanding of business process at hand by providing information on essential key-figures of the process at hand.
That brings me to the topic of this post: purchase price variance. In my opinion the SAP functionality effectively handles PPV (purchase price variances): variance between purchase price and standard cost (let's call this one PPV1) and the variance between the invoice price and the purchase price (let's call this one PPV2). A good understanding of both PPV1 and PPV2 are useful for potential process improvements ... PPV1 relates more to the efforts of the purchasing deparment and/or determination of pricing in purchase orders while PPV2 brings in the efforts of the vendor.
Anyways, in order to obtain understanding of the variances mentioned, information is needed. E.g. a purchase price variance report or -analysis. I can't find such a report!
I did look on various forums and when I find something that relates to a PPV-report or -analysis, people are discussing ways to create an ABAP-report or query ... Much to my surprise: no clear answers. It looks that such a report even does not exist! That's what I find hard to believe!
Does anyone of you know about a report or analysis-tool on purchase price variances? Or is it really true that such a report is just not there!
thanks,
BenHello Ben,
i have been checking the whole Forum and also asked around collegues and it seems that it is really still true there is no simple report that is showing PPV details (PO price, Invoice price, Standard price and the quantities and values)
I think the solution to get such a report is to programm it Starting point would be the line items on PPV account.
To get such a report with connection between Delivery and Invoice, GR based IV is helpful.
It is unbelivable that this never has been setup !
We are currently using FBL3N on the PPV accounts by current monthe with 2 variants subtotalling on matarial and sorting by high value
Let me know if anybody find a report
Cheers
Tim -
Purchase Price Variance Report - incorrect calculation
Good afternoon all,
As a relative new comer to Oracle I'm after some help/advice.
When running a PPV report I'm not convinced the report is returning the correct answer. The report seems to be calculating the PPV as Qty x PO Price. It should be Qty x (PO price - Standard Cost).
How can I find out if this is a bug / determining whether there is already a solution to the issue? Version R12.
Thanks
JonYou should log a service request with Oracle Support on this. Oracle documentation says that the PPV calculation should be just like you say it should be. So if the report is not doing that calculation, sounds like a program problem that needs to be identified and fixed. If there is a fix already, support will tell you what it is.
John Dickey
Edited by: John Dickey, McCarthy on May 11, 2010 2:57 PM -
Hi,
Could some one give me a step by step data flow for a PPV report. I understand thats its a custom report. Im looking for a generic sample.
Thanks
Edited by: TEE JAY on Feb 22, 2008 6:59 PMCheck this if it helps:
Purchase Price Variance
Purchase price variance -
Purchase Price Variance (Standard Costing) with Intercompany
We are missing Intercompany transactions in Purchase price variance report. Is there a setup which let's us include these transactions to be captured by PPV report
We do have standard costing in all OrganizationsFinally got this answered from Oracle Support below is what they said. Does not make sense but atleast we have an answer
In principle the internal requisition hits the interorg variance account which is defined at the shipping network and is different from purchase price variance(PPV) account of the organization. So this is not included in PPV report. PPV report is only meant for purchase orders.
Best practice would be to define different account for PPV and interorg variance. Use PPV report to match PPV account with GL and use material distribution account detail report for Interorg variance.
If the customer defines PPV and Interorg variance account as the same then the workarounds would be :
1) Use material distribution account detail report.
Or
2) In R12 use SLA account balance reports -
I want to create menus in nested order i.e.
Customized Reports
....Financials
........Bank Book
Outgoing Payment Receipt
I am able to create Customized Reports and Financials.But I am not able to add Bank Book and Outgoing Payment Receipt under Financials.For creating the above menus I have referred the code from sample examples given by sdk.The code is as,
oMenuItem = SBO_Application.Menus.Item("MyMenu022")
oMenus = oMenuItem.SubMenus
'// Create s sub menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "Financials"
oCreationPackage.String = "Financials"
oMenus.AddEx(oCreationPackage)
'// Create s sub menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "MySubMenu028"
oCreationPackage.String = "Edit Item"
oMenus.AddEx(oCreationPackage)see this u get idea--
Sub AddMenuItems()
Dim MenuImage As String
Dim cmdCenterForm As SAPbouiCOM.Form
cmdCenterForm = SBO_Application.Forms.GetFormByTypeAndCount(169, 1)
If cmdCenterForm Is Nothing Then
Return
End If
'freeze the command center (faster and no flickering)
cmdCenterForm.Freeze(True)
Try
'Menu ID Range to be used is M_000131 - M_000150
'Form ID Range to be used is 2000050151 - 5000050170
oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oMenuItem = SBO_Application.Menus.Item("43520") ' Module Menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "M_000131"
oCreationPackage.String = "Exports"
oCreationPackage.Enabled = True
oCreationPackage.Position = 14
MenuImage = System.Windows.Forms.Application.StartupPath + "\Images\Imports.bmp"
oCreationPackage.Image = MenuImage
oMenus = oMenuItem.SubMenus
Try
oMenus.AddEx(oCreationPackage)
Catch ex As Exception
End Try
' Incentives
oMenuItem = SBO_Application.Menus.Item("M_000131") ' Exports
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "M_000141"
oCreationPackage.String = "Incentives"
oCreationPackage.Enabled = True
oCreationPackage.Position = 0
oMenus = oMenuItem.SubMenus
Try
oMenus.AddEx(oCreationPackage)
Catch ex As Exception
End Try
''''''' 'sub menu for Incentives
AddMenuItem1("M_000142", "Free Trade Zones")
AddMenuItem1("M_000143", "Export Oriented Units (EOU")
AddMenuItem1("M_000144", "DEEC")
AddMenuItem1("M_000145", "EPCG")
AddMenuItem1("M_000146", "Deemed Exports")
AddMenuItem1("M_000147", "Duty Drawback")
AddMenuItem1("M_000148", "PPV Report")
' Master
oMenuItem = SBO_Application.Menus.Item("M_000131") ' Exports
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "M_000161"
oCreationPackage.String = "Master"
oCreationPackage.Enabled = True
oCreationPackage.Position = 0
oMenus = oMenuItem.SubMenus
Try
oMenus.AddEx(oCreationPackage)
Catch ex As Exception
End Try
'sub menu for master
AddMenuItem1("M_000162", "Shipping Bill")
AddMenuItem1("M_000163", "Customs Declaration Form")
AddMenuItem1("M_000164", "Commercial invoice")
AddMenuItem1("M_000165", "Customs Invoice")
AddMenuItem1("M_000166", "Certified Invoice")
AddMenuItem1("M_000167", "Packing List")
AddMenuItem1("M_000168", "Certificate of Shipment")
AddMenuItem1("M_000169", "Health/ Veterinary/ Sanitary Certification")
AddMenuItem1("M_000170", "Shipping Order ")
AddMenuItem1("M_000171", "Short Shipment Form")
AddMenuItem1("M_000172", "Packing List")
Catch ex As Exception
End Try
cmdCenterForm.Freeze(False)
cmdCenterForm.Update()
End Sub
Sub AddMenuItem1(ByVal MenuID As String, ByVal MenuName As String)
Try
If MenuID = "M_000142" Or MenuID = "M_000143" Or MenuID = "M_000144" Or MenuID = "M_000145" Or MenuID = "M_000146" Or MenuID = "M_000147" Or MenuID = "M_000148" Then
oMenuItem = SBO_Application.Menus.Item("M_000141")
ElseIf MenuID = "M_000162" Or MenuID = "M_000163" Or MenuID = "M_000164" Or MenuID = "M_000165" Or MenuID = "M_000166" Or MenuID = "M_000167" Or MenuID = "M_000168" Or MenuID = "M_000169" Or MenuID = "M_000170" Or MenuID = "M_000171" Or MenuID = "M_000172" Then
oMenuItem = SBO_Application.Menus.Item("M_000161")
Else
oMenuItem = SBO_Application.Menus.Item("M_000131")
End If
oMenus = oMenuItem.SubMenus
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = MenuID
oCreationPackage.String = MenuName
oMenus.AddEx(oCreationPackage)
Catch ex As Exception
End Try
End Sub -
PPV for subcontracting materials mystery- posting to a different cost element?
Dear All:
Are there any OBYC (FI-MM) account determination settings to have PPV incurred due to Subcontract (SC) POs post to a different account than regular PPV? If not, is there any distinguishing characteristic at the line item level for SC PPV posting to report it in contrast with regular PPV line item?
Or am I looking at creating a substitution rule to make this happen?
Looking forward to some insights!Hi Althea and Szymon: Thank you for your inputs. The subcontract material in our system is setup as F/30 (Procurement Type, Special Procurement) and as a HALB (semi-finished goods) in the same plant as other semi finished goods. So, no opportunity to segregate their PPV (posted via MT 101) account via valuation modifier in OBYC.
BSV transaction is used to store the offsetting account during inventory receipt during 101. So, in essence here's an example of accounting doc during GR :
Description Amount Transaction Material Quantity
FG Inv (B/S) 100 BSX FG123 +1
GR/IR (B/S) -15 WRX FG123 -1
PPV (P/L) -25 PRD FG123 -1
SFG Cons (P/L) -75 BSV FG123 -1
Subc Fee (P/L) 15 FRL FG123 +1
Inv SFG (B/S) -12 BSX SFG456 -1
SFG Cons (P/L) 12 GBB-VBO SFG456 +1
So BSV+PRD = BSX (FG)
I am looking to see if I can get the $25 favorable PPV posted to some other account via OBYC. Right now it's getting posted through PRD and getting mixed up with PPV for external purchases.
Thanks for your inputs. -
Report for Material at subcontract AND PO number
We are preparing for Inventory verification at subcontractors.
My boss believes it would be easier for the SC vendor if we could supply the PO number for which the material was shipped.
I haven't found such a report. Is there one?
If you know the tables and links, I can write a ABAP query
Thank you for any help that can be provided.
AltheaHi,
ME2O works fine if you want to track which subcontracting PO's are still open and what is the current stock at vendor.
ME2ON is another version of the same basic ME2O report.
Try also MBLB - Stocks at subcontractor.
As far as PO to 541 link is concerned, I do not think it is possible to find it unless there is some specific business process being followed which is supported by custom code.
The reason is that when you issue against 541, you are simply providing materials to vendor that the vendor needs.
There might be multiple open SC POs for same material/batch and there is no point in tracking against a particluar PO. Its the same material/batch the vendor receives.
When you post a PGR for a SC PO, then the stock from vendor premises is consumed by 543 and the track to your SC PO is maintained.
I tried maintaining EBELN as required in OMJJ for 541 but still no MSEG-EBELN is populated. Maybe I am missing something. -
DEAR FRIENDS,
I am making a program for tracking the materials given (mb1b 541 movt.) for subcontracting and taken by me (101 for actual good receipt, 543 for the given material- stock type inward, 545 for the scrap returns). but while i made the program i am unable to pick up the materials BOM from the PO which is essential to take the difference between these and the supplied quantities taken-in by GR.
following is the program.
Please suggest the changes. Thanks,
Deepak
*& Report ZMM_SUBCONTRACTING_PO_REPORT
*& Author:
*& Date :
*& Reason: Sub Contracting PO Report.
*& Find Discreprancy in PO and BOM. according to 543 and 545
REPORT ZMM_SUBCONTRACTING_PO_REPORT NO STANDARD PAGE HEADING
LINE-SIZE 157.
*& TABLES DECLARATION
TABLES: EKKO,
EKPO,
EKBE,
ENT5303.
*& SELECTION-SCREEN.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_MATNR FOR EKPO-MATNR,
S_WERKS FOR EKBE-WERKS OBLIGATORY.
PARAMETERS: P_BUKRS LIKE EKKO-BUKRS OBLIGATORY.
SELECT-OPTIONS: S_BUDAT FOR EKBE-BUDAT OBLIGATORY,
S_EBELN FOR EKKO-EBELN,
S_BELNR FOR EKBE-BELNR,
S_GJAHR FOR EKBE-GJAHR.
SELECTION-SCREEN: END OF BLOCK B1.
*& INTERNAL TABLES DECLARATION.
DATA: BEGIN OF IT_EKKO OCCURS 0,
EBELN LIKE EKKO-EBELN,
END OF IT_EKKO.
DATA: BEGIN OF IT_EKBE OCCURS 0,
EBELN LIKE EKBE-EBELN,
EBELP LIKE EKBE-EBELP,
GJAHR LIKE EKBE-GJAHR,
BELNR LIKE EKBE-BELNR,
BUZEI LIKE EKBE-BUZEI,
BEWTP LIKE EKBE-BEWTP,
BWART LIKE EKBE-BWART,
BUDAT LIKE EKBE-BUDAT,
MENGE LIKE EKBE-MENGE,
DMBTR LIKE EKBE-DMBTR,
LFBNR LIKE EKBE-LFBNR,
MATNR LIKE EKBE-MATNR,
WERKS LIKE EKBE-WERKS,
BUKRS LIKE WB2_V_EKKO_EKPO2-BUKRS,
MENGE_I LIKE WB2_V_EKKO_EKPO2-MENGE_I,
LIFNR LIKE WB2_V_EKKO_EKPO2-LIFNR,
COUNT TYPE P DECIMALS 4,
BMENGE LIKE EKBE-MENGE,
MENGE101 LIKE EKBE-MENGE,
MENGE543 LIKE EKBE-MENGE,
MENGE545 LIKE EKBE-MENGE,
DIFFER LIKE EKBE-MENGE,
TMENGE LIKE EKBE-MENGE,
RATE LIKE EKBE-DMBTR,
NAME1 LIKE LFA1-NAME1,
LINE_COLOR(4),
END OF IT_EKBE.
DATA: WA LIKE IT_EKBE.
DATA: BEGIN OF IT_FINAL OCCURS 0.
INCLUDE STRUCTURE IT_EKBE.
DATA: END OF IT_FINAL.
DATA: BEGIN OF IT_FINAL_TEMP OCCURS 0.
INCLUDE STRUCTURE IT_EKBE.
DATA: END OF IT_FINAL_TEMP.
DATA: BEGIN OF IT_BOM OCCURS 0.
INCLUDE STRUCTURE CAPP_ITM.
DATA: END OF IT_BOM.
DATA: BEGIN OF IT_BOM_HEAD OCCURS 0.
INCLUDE STRUCTURE CAPP_BOM.
DATA: END OF IT_BOM_HEAD.
*& DATA DECLARATION.
DATA: COUNT TYPE P DECIMALS 4,
V_CNT TYPE P DECIMALS 4 VALUE '0.0001' ,
V_MENGE LIKE EKBE-MENGE,
V_DELETE.
TYPE-POOLS: slis.
DATA: l_date(12) TYPE c,
l_date1(12) TYPE c,
l_time(10) TYPE c,
l_list(60) TYPE c.
DATA: CATALOG TYPE SLIS_FIELDCAT_ALV, "FIELDCAT
TCATALOG TYPE SLIS_T_FIELDCAT_ALV, "IT FIELDCAT
EVENT TYPE SLIS_ALV_EVENT, "EVENT
TEVENT TYPE SLIS_T_EVENT, "IT EVENT
LAYOUT TYPE SLIS_LAYOUT_ALV, "LAYOUT
PG_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
PG_HEAD TYPE SLIS_T_LISTHEADER,
EXIT1 TYPE SLIS_EXIT_BY_USER,
VAR1 LIKE DISVARIANT,
VAR2 LIKE DISVARIANT.
*& START-OF-SELECTION.
START-OF-SELECTION.
PERFORM PROCESS_SELECTION.
PERFORM DELETE_CANCELLED_DOCUMENTS.
PERFORM EXPLODE_BOM_FOR_101.
SORT IT_FINAL BY COUNT.
PERFORM DISPLAY_OUTPUT.
FREE IT_FINAL_TEMP.
*& ALV FORMATTING
*& ALV DISPLAY
PERFORM GENERATE_ALV_FIELDCAT.
PERFORM EVENTS USING TEVENT.
PERFORM TEXT USING PG_HEAD.
PERFORM ALV_SHOW.
*& FORM PROCESS_SELECTION.
FORM PROCESS_SELECTION.
SELECT
A~EBELN
A~EBELP
A~GJAHR
A~BELNR
A~BUZEI
A~BEWTP
A~BWART
A~BUDAT
A~MENGE
A~DMBTR
A~LFBNR
A~MATNR
A~WERKS
B~BUKRS
B~MENGE_I
B~LIFNR
FROM
EKBE AS A
JOIN
WB2_V_EKKO_EKPO2 AS B
ON
AEBELN = BEBELN AND
AEBELP = BEBELP_I
INTO
CORRESPONDING FIELDS OF TABLE IT_EKBE
WHERE
A~MATNR IN S_MATNR AND
A~WERKS IN S_WERKS AND
A~BUDAT IN S_BUDAT AND
A~EBELN IN S_EBELN AND
A~BELNR IN S_BELNR AND
A~GJAHR IN S_GJAHR AND
A~VGABE IN ('1', '7') AND
A~BEWTP IN ('E', 'O') AND
( A~BWART IN ('101', '545', '543') OR
( ABWART = '102' AND ABEWTP = 'E' ) ) AND
B~BUKRS = P_BUKRS AND
B~BSTYP = 'F' AND
B~BSART = 'SUBC'."AND
B~LOEKZ <> 'X'.
SORT IT_EKBE BY EBELN EBELP GJAHR BELNR BUZEI.
ENDFORM.
*& FORM DELETE_CANCELLED_DOCUMENTS.
FORM DELETE_CANCELLED_DOCUMENTS.
DELETE IT_EKBE WHERE BWART = '102' AND BEWTP <> 'E'.
LOOP AT IT_EKBE WHERE BWART = '102'.
READ TABLE IT_EKBE INTO WA WITH KEY BELNR = IT_EKBE-LFBNR.
IF SY-SUBRC = 0.
DELETE IT_EKBE WHERE BELNR = WA-BELNR.
ENDIF.
ENDLOOP.
CLEAR WA.
DELETE IT_EKBE WHERE BWART = '102'.
ENDFORM.
*& FORM EXPLODE_BOM_FOR_101.
FORM EXPLODE_BOM_FOR_101.
CLEAR COUNT.
LOOP AT IT_EKBE WHERE BWART = '101' OR
BWART = '543'.
IF NOT IT_EKBE-MATNR IN S_MATNR.
V_DELETE = 'X'.
ELSE.
CLEAR V_DELETE.
ENDIF.
IF V_DELETE <> 'X'.
COUNT = COUNT + 1.
IT_EKBE-COUNT = COUNT.
V_MENGE = IT_EKBE-MENGE.
MODIFY IT_EKBE.
IT_FINAL = IT_EKBE.
APPEND IT_FINAL.
ENDIF.
call function 'CABM_READ_BOM'
exporting
I_MATNR = IT_EKBE-MATNR
I_WERKS = IT_EKBE-WERKS
I_STLAL = '01'
I_STLAN = '3'
I_DATUV = IT_EKBE-BUDAT
TABLES
EXP_BOM_DATA = IT_BOM_HEAD
EXP_ITM_DATA = IT_BOM
EXCEPTIONS
NO_RECORD_FOUND = 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.
ELSE.
*START RK 18.06.2007
DELETE IT_BOM WHERE DATUV > IT_EKBE-BUDAT.
END : 18.06.2007
IF V_DELETE = 'X'.
LOOP AT IT_BOM.
DELETE IT_EKBE WHERE MATNR = IT_BOM-IDNRK.
ENDLOOP.
REFRESH IT_BOM.
ELSE.
PERFORM CHECK_BOM_GR.
ENDIF.
endif.
ENDLOOP.
FREE IT_EKBE.
ENDFORM.
*& FORM CHECK_BOM_GR.
FORM CHECK_BOM_GR.
DATA: WACNT TYPE P DECIMALS 4.
WACNT = COUNT.
LOOP AT IT_BOM.
READ TABLE IT_EKBE INTO WA WITH KEY EBELN = IT_EKBE-EBELN
MATNR = IT_BOM-IDNRK.
IF SY-SUBRC = 0.
WACNT = WACNT + V_CNT.
WA-COUNT = WACNT.
WA-BMENGE = IT_BOM-MENGE.
WA-TMENGE = V_MENGE.
APPEND WA TO IT_FINAL.
DELETE IT_EKBE WHERE EBELN = WA-EBELN AND
EBELP = WA-EBELP AND
MATNR = WA-MATNR AND
BELNR = WA-BELNR AND
BUZEI = WA-BUZEI.
**START : ADDED BY .... KUMAR ON 14.06.2007
ELSE.
WACNT = WACNT + V_CNT.
WA-COUNT = WACNT.
WA-BMENGE = IT_BOM-MENGE.
WA-MATNR = IT_BOM-IDNRK.
WA-TMENGE = V_MENGE.
APPEND WA TO IT_FINAL.
**END ADDED BY .... KUMAR ON 14.06.2007
ENDIF.
CLEAR WA.
ENDLOOP.
REFRESH IT_BOM.
ENDFORM.
*& FORM DISPLAY_OUTPUT.
FORM DISPLAY_OUTPUT.
Populate color variable with colour properties
Char 1 = C (This is a color property)
Char 2 = 3 (Color codes: 1 - 7)
Char 3 = Intensified on/off ( 1 or 0 )
Char 4 = Inverse display on/off ( 1 or 0 )
i.e. wa_ekko-line_color = 'C410'
IT_FINAL_TEMP[] = IT_FINAL[].
LOOP AT IT_FINAL.
CLEAR IT_FINAL-DMBTR.
********added by .... .... on 17.02.2007
if it_final-bmenge < 0.
IT_FINAL-DIFFER = IT_FINAL-TMENGE * IT_FINAL-BMENGE * -1.
else.
*********end by .... .... on 17.02.2007
IT_FINAL-DIFFER = IT_FINAL-TMENGE * IT_FINAL-BMENGE.
********added by .... .... on 17.02.2007
endif.
*********end by .... .... on 17.02.2007
IF IT_FINAL-BWART = '101'.
IT_FINAL-LINE_COLOR = 'C210'.
IT_FINAL-MENGE101 = IT_FINAL-MENGE.
IT_FINAL-DIFFER = 0.
LOOP AT IT_FINAL_TEMP WHERE BELNR = IT_FINAL-BELNR AND
EBELN = IT_FINAL-EBELN AND
EBELP = IT_FINAL-EBELP.
IF IT_FINAL_TEMP-BWART <> '545'.
IT_FINAL-DMBTR = IT_FINAL-DMBTR + IT_FINAL_TEMP-DMBTR.
ELSE.
IT_FINAL-DMBTR = IT_FINAL-DMBTR - IT_FINAL_TEMP-DMBTR.
ENDIF.
ENDLOOP.
IT_FINAL-RATE = IT_FINAL-DMBTR / IT_FINAL-MENGE101.
SELECT SINGLE
NAME1
INTO
IT_FINAL-NAME1
FROM
LFA1
WHERE
LIFNR = IT_FINAL-LIFNR.
IF SY-SUBRC <> 0.
CLEAR IT_FINAL-NAME1.
ENDIF.
ELSEIF IT_FINAL-BWART = '543'.
IT_FINAL-MENGE543 = IT_FINAL-MENGE.
IT_FINAL-LINE_COLOR = 'C200'.
IT_FINAL-DIFFER = IT_FINAL-DIFFER - IT_FINAL-MENGE543.
CLEAR: IT_FINAL-LIFNR,
IT_FINAL-EBELN,
IT_FINAL-BELNR,
IT_FINAL-MENGE_I,
IT_FINAL-BUDAT.
ELSEIF IT_FINAL-BWART = '545'.
******added by .... on 17.02.2007
IT_FINAL-MENGE = IT_FINAL-MENGE * -1.
IT_FINAL-MENGE = IT_FINAL-MENGE.
*******end by .... on 17.02.2007
IT_FINAL-MENGE545 = IT_FINAL-MENGE.
IT_FINAL-LINE_COLOR = 'C200'.
IT_FINAL-DIFFER = IT_FINAL-DIFFER - IT_FINAL-MENGE545.
CLEAR: IT_FINAL-LIFNR,
IT_FINAL-EBELN,
IT_FINAL-BELNR,
IT_FINAL-MENGE_I,
IT_FINAL-BUDAT.
ELSE.
IT_FINAL-LINE_COLOR = 'C200'.
CLEAR: IT_FINAL-LIFNR,
IT_FINAL-EBELN,
IT_FINAL-BELNR,
IT_FINAL-MENGE_I,
IT_FINAL-BUDAT.
ENDIF.
MODIFY IT_FINAL.
ENDLOOP.
ENDFORM.
*& Form GENERATE_ALV_FIELDCAT
text
FORM GENERATE_ALV_FIELDCAT.
DATA: POS TYPE I.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'COUNT'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'S. No.'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'MATNR'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Mat. No.'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'BMENGE'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'BOM Qty'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'EBELN'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'PO No.'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'MENGE_I'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'PO Qty'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'BELNR'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Gr. No.'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
CATALOG-HOTSPOT = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'BUDAT'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'GR Date'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'MENGE101'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = '101 Gr Qty'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'MENGE543'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = '543 Gr Qty'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'MENGE545'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = '545 Gr Qty'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'DIFFER'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Difference'.
CATALOG-NO_ZERO = ' '.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'LIFNR'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Vendor'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'NAME1'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Vendor Name'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'RATE'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Rate'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
POS = POS + 1.
CLEAR: CATALOG.
CATALOG-COL_POS = POS.
CATALOG-FIELDNAME = 'DMBTR'.
CATALOG-TABNAME = 'IT_FINAL'.
CATALOG-SELTEXT_L = 'Value'.
CATALOG-NO_ZERO = 'X'.
CATALOG-FIX_COLUMN = 'X'.
APPEND CATALOG TO TCATALOG.
ENDFORM.
*& Form ALV_SHOW
text
FORM ALV_SHOW.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
LAYOUT-BOX_TABNAME = 'IT_FINAL'.
LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
LAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = TCATALOG
IS_VARIANT = VAR1
I_SAVE = 'A'
IT_EVENTS = TEVENT[]
TABLES
T_OUTTAB = IT_FINAL.
ENDFORM . "ALV_SHOW
*& FORM USER_COMMAND.
FORM USER_COMMAND USING
R_UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
DATA: TABIX LIKE SY-TABIX,
WA LIKE IT_FINAL.
TABIX = SELFIELD-TABINDEX.
READ TABLE IT_FINAL INTO WA INDEX TABIX.
IF NOT WA-BELNR IS INITIAL.
set parameter id : 'MBN' FIELD WA-BELNR.
CALL TRANSACTION 'MB03' AND SKIP FIRST SCREEN .
ENDIF.
ENDFORM.Hi,
U can try this standard report for subcontracting:
J1IFR (Transaction name),
Not sure how much this will be useful to u.
regards,
Viji -
Report for issuing componets to subcontracting materials
Hi
I am trynig to develop a report for issung components to subcontacrting maerial
as per our scenerio... every day we are creating purchase orders item cat L for subcontract material
then issue the materials against to subcon. pur.order...then do GR with 101..
as per our requirement...
report input entries..like 1. subcon material code
2. from date --- to --- todate
out put..for report..like.... total consumption of components with line item wise (as per bom) with that pertical period..
for this any std. report is there ?
or if go for zreport....pls guide to me..
any one can suggest to me
thanku
regards
sesidharHI,
Certain set of inforamtion can be availed in MB51 and using 541 Mvt type..
But it is better that you develop a zreport to get the information what you wanted if you are not satisfied with the MB51 report from standard SAP.
Try MBLB also
Thanks & Regards,
Kiran -
Report for subcontracting material
Dear all,
I need your help.
we have two plants suppose plant 1 and 2
plant 1 have sent some material to plant 2 by subcontracting challan
so i need a detail like
1) material sent via 57f4
2) input material (raw material)
3) output material (finish material after subcontracting)
4) vendor
5) price, qty
is there is any report like this....Hi
Go to J1ILN > Indirect taxes > procurement > subcontracting > reports > chalan Listing.
This may be of your help. beyond this you will have to develop client specific report.
Best Regards
Nishant Shende
Maybe you are looking for
-
Problem with Crystal reports for Eclipse and Postgres-databases
Hi, Is there a known problem when using a PostgreSQL-database to create a report with Crystal reports Plugin? When I drag a table, then occurs a error-windows, that the object can't created. I have found a workaround for solving the problem. After n
-
After saving GRN part1 tab not get enabled
Hi, All excise details get reflected in GRN from PO , i have entered all details such as excise number, Excise date etc related all data excise. But after saving GRN part 1 tab not got enabled which contains serial number , part1 number . which is no
-
F-53,F-30,F-03 - Selection of Items
Hi All, When running these transactions previously the items were in deselected mode we will select our items but suddenly it came to selection mode.Now we are in a position to select the items we need from the already selected items. We need to know
-
Security issue downloading PS cs5
When I go to install the download of my already-purchased Ps Cs5, I get this message: Your security preferences allow installation of only apps from the Mac App Store and identified developers. Any suggestions?
-
Hi, Can any body tell me how to use & what is use of , HR_PL_D_US_TCRT this functional module. in detail plz Thanks.