Program schduled at backgrond analysis
she/he program is schduled background every day at 10 , so that every day it run the program in background. it's running fine in evevry day .
my problem is say monday tues day wends day thursday and friday.
it's running every day in background but some times it's exting alternatives days. i want to know what is the reason if not run on particular day
its behaving like that because its a "she/he program"
Similar Messages
-
Capturing keystrokes from other programs
Hi,
I'm looking for away to to capture mouse and keyboard events from programs other than my java program. I want my program to log and analyse mouse and keyboard events from any program that is open in windows. I'm designing a user interface analyser. Can anyone help?
Cheers!
JacquesThanks for all your input, but I am sadly no closer to
an answer :-( It looks like its going to have to be VB
unless someone can save my life and help me out in
Java. Please keep posting and hopefully someone might
give me that elusive solution.VB won't do this either. What you are asking about is injecting a system wide hook into the operating system. I can pretty much guarantee that this will not be possible without resorting to native code.
If you are on a Win32 box, the system hook you are looking for is (duh) the keyboard hook. To get it to work across processes, you have to prepare a DLL that contains the hook procedure, then register the hook procedure (and the DLL hmodule) with the Windows hooking system. After that, every time an application is loaded, Windows will also load your DLL, and will forward key press events through your hook procedure.
Setting global hooks like this is a tricky business, and I wouldn't recommend it as a first program.
You can do a Google search on "Windows Global Keyboard Hook" and find info on how to do this. If you want to do it using only Java, then you are out of luck.
- K -
Time out not working in program
Hello all,
I have a program that is not timing out after 2 or 3 hours of on-line execution. I have checked that the parameter abap.timeout and it is set to 5200 secs. I have been told that a commit work or a message statement will reset the timmer that controls this time out. However, the part of the code that is eating basiclly all the time does not contain either of these statements. Does any one know of where I could get a complete list of statements that reset the time out timmer?
On another related issue, when I executed the program in run time analysis it took the normal 2 and a half hours. And on return to the run time analyses main screen I recieved the error 'Unable to end the measurement (error number 5, Time limit reached)' Message no. S7 068. Without any extra information. It's obviously not suprising that the runtime analysis program refuse to analysis code that takes more than two hours to execute but could anyone tell me which parameter controls this time limit?
Thanks in advance for your help as I am in real need of it.
JamieHi Jamie,
In runtime analysis, these problems are there what you can do the best options in ECC6.0 is ST12 for doing both Run Time Analysis and SQL Trace. In ST12 you have the option to increase the timlimit so that your programs whole measurement will come in file which is generated by SAP.
Following are the steps for using ST12:
1. Open ST12. Click on Current Mode.
2. Enter the program name or transaction code for which you want to do the measurement.
3.There is button in the middle of the screen which has given the heading as 'Further opt.' there you can increase the file size to 99MB and at the bottom Max Trace Runtime which you can increase upto 2147483647 and enter.
4. Then Click on Execute.
5. Enter the inputs of the Selection screen.
6. After the program run is completed in the TRACE ANALYSIS section select your program and after that it appears in the Selected trace analysis box.
7. After that click on ABAP Trace that will give an exact analysis and for SQL Trace Click on Performance Trace.
8. and for Checking how much CPU Utilization and how much Data base utilization is required click on SUMMARY.
Thanks
Harsh -
Ageing analysis for the down payment made to vendors-reg
Dear Gurus,
Can anybdoy explains my how to do ageing analysis for the down payment made to various vendors.
Thanks
C.M.SATHISH KUMAR.
[email protected]OK
Config t code is OBDF
Select AP view and due date analysis.
You need to create a variant for the field BSIK-UMSKZ in program RFKRRE01 which is the program for Vendors for due data analysis.
In the config you need to make sure create evalution is ticked.
You then need to set up a variant in program RFKRRSEL, for Vendor analysis, it should be called SAP_VARI.
Once all of that has been set up, you need to schedule a job to run for RFKRRSEL daily.
In terms of accessing the programs you need yo use t code SE38.
and to schedule a job use t code SM36.
Hope this helps.
Please award points. -
How to improve the performance of the abap program
hi all,
I have created an abap program. And it taking long time since the number of records are more. And can anyone let me know how to improve the performance of my abap program.
Using se30 and st05 transaction.
can anyone help me out step by step
regds
harithaHi Haritha,
->Run Any program using SE30 (performance analysis)
Note: Click on the Tips & Tricks button from SE30 to get performance improving tips.
Using this you can improve the performance by analyzing your code part by part.
->To turn runtim analysis on within ABAP code insert the following code
SET RUN TIME ANALYZER ON.
->To turn runtim analysis off within ABAP code insert the following code
SET RUN TIME ANALYZER OFF.
->Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
->Avoid for all entries in JOINS
->Try to avoid joins and use FOR ALL ENTRIES.
->Try to restrict the joins to 1 level only ie only for tables
->Avoid using Select *.
->Avoid having multiple Selects from the same table in the same object.
->Try to minimize the number of variables to save memory.
->The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
->Avoid creation of index as far as possible
->Avoid operators like <>, > , < & like % in where clause conditions
->Avoid select/select single statements in loops.
->Try to use 'binary search' in READ internal table. -->Ensure table is sorted before using BINARY SEARCH.
->Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
->Avoid using ORDER BY in selects
->Avoid Nested Selects
->Avoid Nested Loops of Internal Tables
->Try to use FIELD SYMBOLS.
->Try to avoid into Corresponding Fields of
->Avoid using Select Distinct, Use DELETE ADJACENT
Check the following Links
Re: performance tuning
Re: Performance tuning of program
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
check the below link
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
See the following link if it's any help:
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Check also http://service.sap.com/performance
and
books like
http://www.sap-press.com/product.cfm?account=&product=H951
http://www.sap-press.com/product.cfm?account=&product=H973
http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Performance tuning for Data Selection Statement
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
Debugger
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
CATT - Computer Aided Testing Too
http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
Test Workbench
http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
Coverage Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
Runtime Monitor
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
Memory Inspector
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
ECATT - Extended Computer Aided testing tool.
http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
Just refer to these links...
performance
Performance
Performance Guide
performance issues...
Performance Tuning
Performance issues
performance tuning
performance tuning
You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.
edited by,
Naveenan -
Predictive Analysis won´t start
Hi everyone,
a few weeks ago I used Predictive Analysis and it worked perfectly fine. For some reason yesterday I was not able to start the application and it always freezed on the loading screen with "Loading SAP Hana" or something like that. I tried to restart and reinstall the application but unfortunately nothing worked so far.
Best regards and thanks in advance,
ThomasHi Thomas,
It's likely because your windows profile has changed to "roaming" or you've lost write access to your rooming folder. The PA log files should have some error recorded relating to \\some.server.corp\users\<User ID>\.sapvi directory
Solution:
Clear following directories for PA
C:\Users\<user>\.sapvi
C:\Users\<user>\AppData\Local\SAP\Lumira
C:\Users\Public\sappa
In Window's Explorer navigate to PA's install folder, typically C:\Program Files\SAP Predictive Analysis\Desktop.
Make a backup copy of SAPPredictiveAnalysis.ini.
Edit SAPPredictiveAnalysis.ini and add the following line near the top before @user.home is used to redirect the users home directory to the directory of your choice:
-Duser.home=<<New File Location>>
For example this causes the c:\temp directory to be used:
-Duser.home=c:\temp
Looking forward to your feedback.
Regards,
Jayant -
i was wondering what is the maximum value of records that i can set in web analysis for hyperion 11.1.2.1
and from where i can set the value ?
and some times when i create report in web analysis from relational database it doesn't show in the result when i open the report from workspace it show me blank page even i open it from the admin account
thanks in advanceweb analysis:
I Have downloaded and installed below products from edelivery site,
Hyperion Reporting and Analysis system 9 client
Hyperion Reporting and Analysis system 9 services
Hyperion Reporting and Analysis system UI Serives
I need to work on webanalysis , even after downloaded and installed also i can not see any option
for web analysis in Programs --> Hyperion --> Reporting and Analysis.
How can i start work on web analysis. -
Performance Tunned Trace/ Analysis tool
Hi,
I am seraching for any tool / utility provided by SAP in the ABAP Development workbench to trace/analyse the perofrmace of DB Accesses , Internal table operations in programs so I could analyse the inefficient ABAP code and could replace the same with efficient.
thanks and regards,
Avakash.Hi Avakash,
Check this info.
You can use ST05 to find the performance of each select.
u can use SE30 - runtime analysis to find which part of your code is taking more time.
using ST05:
activate the trace --> execute the program --> deactivate the trace --> display trace.
then go to Trace list --> Summarize trace by SQL statements.
here u can analyze performance of all the selects.
If you want to compare the duration by the selects in your program itself then use: GET RUNTIME statement.
Hope this resolves your query.
Reward all the helpful answers.
Regards -
BI7. Analysis Authorisations: 0TCA_DS01 to 0TCA_DS05
Good day
For those who have already implemented Analysis authorisations, PLEASE help?
I am investigating analysis authorizations and also need to implement at our site.
What I need to know is what objects are delivered with the template DSO's 0TCA_DS01 to 0TCA_DS05? Should they have any transformations, DTP's and datasources?
I am a bit lost on how this should work. I have gone through numerous links and instructions, with no success at all. Seems as if this whole concept of analysis authorisation is escaping me.
Please assist with any detailed information regarding the HOW TO, or STEP-BY-STEP instructions.
Thanks in advance.
CjHi Cornelius,
you're right, there is no data flow available for those DSO objects. What dataflow would you expect? You want to upload the auth data via flat file? Or you want to load from another source system by an dedicated logic or perhaps with an workflow as a trigger? You see, it's not that simple to deliver "the one and only" dataflow. The mentioned objects are templates as the program to generate the analysis auth expects a special order of the fields which are given when you use the ODS objects..
Read more here, http://help.sap.com/saphelp_nw70/helpdata/en/59/fd8b41b5b3b45fe10000000a1550b0/frameset.htm
You have to create the dataflow by your own, regardless if you want to use 3.x dataflow or 7.0. The only thing you have to ensure is the correct order of the field in the DSO whit the values you want to use later in the generation.
Hope that helps a bit.
Best regards,
Maik. -
Hi all,
Is there any table where I can find all Z progrms.
I want to make a list of all Z programs and do some analysis.
Many Thabks
ShivaHi Shiva,
You can get all program names in se38 it self by putting z*, still if you want the table name where program names stores it is TRDIR.
Reward Points if it is helpful
Reagrds,
Kiran I -
Hi,
I have a program wich clean Ztables, but now I have to evaluate in one of table date, if month(date) less than two month of sy-datum, program must delete all records with this features, I need to know how to send to execute another program wich evaluate it.
Thanks in advance.
Regards
TokioHo Tokio,
If i understand correctly ... you need to execute a report program which will delete some old records as batch job.
but whenever you run program A, it identifies some records needs to be deleted then we need to run program B as backgrond job(it will takecare of deletion part).
If this is correct, you can create a job for program B, and maintain as AFTER EVENT. and in program A raise an event.
Thanks
Pavan -
Program /SSA/BWT is not including all user names
Hi Friends ,
I'm using /SSA/BWT program to have query analysis , but as I see not all usernames are included into analysis. I wonder why ,and how to achieve an analysis with full user list.
Thansk for your helps
Regardsnot solved
-
Report needs to be corrected it is urgent
Ageing Analysis of Inventory Material. This is a report for Inventory Ageing. The report is not giving correct result for the field Value of total valuated stock(MBEWH-SALK3). After displaying the report when we add up the field SALK3 it not the correct result which I got in transaction code MB5L. Can anyone kindly help me in correcting out this report. I am keeping the source code also.
*& Application : Materials Management (MM)
*& Description : Ageing Analysis of Inventory Material
*& Transaction Code :
*& Area Menu Code : ZMM
Report ZMM0001.
MAPPING OF MONTH AND PERIOD AS FINACIAL YEAR STARTS FROM APR - MAR. *
just for reference.
MONTH PERIOD
01.2003 - 10.2003
02.2003 - 11.2003
03.2003 - 12.2003
04.2003 - 01.2003
05.2003 - 02.2003
06.2003 - 03.2003
07.2003 - 04.2003
08.2003 - 05.2003
09.2003 - 06.2003
10.2003 - 07.2003
11.2003 - 08.2003
12.2003 - 09.2003
01.2004 - 10.2004
02.2004 - 11.2004
03.2004 - 12.2004
04.2004 - 01.2004
REPORT ZMMR0001 MESSAGE-ID GW NO STANDARD PAGE HEADING
LINE-COUNT 1000
LINE-SIZE 170.
*FLOWLOGIC
*This Program displays the Ageing Analysis details of Material inventory
*pick up the opening balance consider the previous month of the period
*entered in selection screen.
*Get the qty and value for all material types from mbew table but
*excludeentries where no valuation type is defined
*calculate the receipt qty pick all entries from z_mkpf_mseg where
*date( is less that or equal to the last day of the month and movement
*type equals '101', '561', '501', '951', '953', '955', '957', '301' *
*into i_mseg table.
*To calculate the reversal for receipt qty.
*To get the issue qty upto the date of receipt, delete the issue qty
*fromstock to get the exact stock value on the date the receipt of
*materials happen.
*Calculate the difference in days and mark values based on the below
*condition.
*Display the output as per the user given format.
*FLOWLOGIC
Tables
TABLES : S031, " Statistics: Movements for current stocks
S032, " Statistics: Current Stock and Grouping Terms
MBEW, " Material Valuation
MBEWH, " Material Valuation: History
MARC, " Plant Data for Material
MARA, "material master
T001W, " Plant Details
MKPF,
V_T179.
TYPE-POOLS
TYPE-POOLS: SLIS.
DATA: IT_HEADING TYPE SLIS_T_LISTHEADER WITH HEADER LINE.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
DATA: LAY TYPE SLIS_LAYOUT_ALV.
DATA: IT_SORT_SUBTOTAL TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE.
DATA: IT_EVENT TYPE SLIS_T_EVENT WITH HEADER LINE.
DATA: V_REPID LIKE SY-REPID.
DATA: PRDHA1(5),
PRDHA2(10),
LVL1(40),
LVL2(40),
LVL3(40).
RANGES: S_BWTAR FOR BWTAR.
INTERNAL Tables
*******For Mat. Desc.************
DATA : BEGIN OF I_MAKT OCCURS 0,
MATNR TYPE MAKT-MATNR, " Material Code
MAKTX TYPE MAKT-MAKTX, " Material Description
END OF I_MAKT.
DATA : BEGIN OF TEMP OCCURS 0,
VTEXT(40),
END OF TEMP.
*******For Mat. No. & Type & Grp*
DATA : BEGIN OF I_MARA OCCURS 0,
MATNR TYPE MARA-MATNR, " Material Code
MATKL TYPE MARA-MATKL,
MTART TYPE MARA-MTART,
MFRNR TYPE MARA-MFRNR,
END OF I_MARA.
******For Stock******************
DATA : BEGIN OF I_MBEWH OCCURS 0,
MATNR TYPE MBEWH-MATNR,
BWTAR TYPE MBEWH-BWTAR,
LBKUM TYPE MBEWH-LBKUM,
SALK3 TYPE MBEWH-SALK3,
BWKEY TYPE MBEWH-BWKEY,
VBELN TYPE EBEW-VBELN,
POSNR TYPE EBEW-POSNR,
SOBKZ TYPE QBEW-SOBKZ,
PSPNR TYPE QBEW-PSPNR,
LFGJA TYPE MBEW-LFGJA,
LFMON TYPE MBEW-LFMON,
END OF I_MBEWH.
DATA: I_MBEWH1 LIKE I_MBEWH OCCURS 0 WITH HEADER LINE.
*******For Moving Price***********
DATA : BEGIN OF I_MBEW OCCURS 0,
MATNR TYPE MBEWH-MATNR,
BWTAR TYPE MBEWH-BWTAR,
LBKUM TYPE MBEWH-LBKUM,
VERPR TYPE MBEWH-VERPR,
VPRSV TYPE MBEWH-VPRSV,
STPRS TYPE MBEWH-STPRS,
END OF I_MBEW.
DATA : BEGIN OF I_RECIPT1 OCCURS 0,
MATNR TYPE Z_MKPF_MSEG-MATNR,
NAME1 TYPE LFA1-NAME1,
MAKTX TYPE MAKT-MAKTX,
BWTAR TYPE Z_MKPF_MSEG-BWTAR,
VERPR TYPE MBEWH-VERPR,
PRDHA LIKE MARA-PRDHA,
VTEXT(40) ,
LBKUM TYPE MBEWH-LBKUM,
SALK3 TYPE MBEWH-SALK3,
QTY1 TYPE MBEWH-LBKUM,
VAL1 TYPE P DECIMALS 2,
QTY2 TYPE MBEWH-LBKUM,
VAL2 TYPE P DECIMALS 2,
QTY3 TYPE MBEWH-LBKUM,
VAL3 TYPE P DECIMALS 2,
QTY4 TYPE MBEWH-LBKUM,
VAL4 TYPE P DECIMALS 2,
QTY5 TYPE MBEWH-LBKUM,
VAL5 TYPE P DECIMALS 2,
QTY6 TYPE MBEWH-LBKUM,
VAL6 TYPE P DECIMALS 2,
QTY7 TYPE MBEWH-LBKUM,
VAL7 TYPE P DECIMALS 2,
END OF I_RECIPT1.
DATA : BEGIN OF I_MKPF_MSEG OCCURS 0,
MATNR LIKE MARA-MATNR,
MBLNR LIKE MSEG-MBLNR,
ZEILE LIKE MSEG-ZEILE,
MENGE LIKE MSEG-MENGE,
BWART LIKE MSEG-BWART,
BUDAT LIKE MKPF-BUDAT,
NET_VAL LIKE MSEG-MENGE,
EBELN LIKE MSEG-EBELN,
EBELP LIKE MSEG-EBELP,
LFBNR LIKE MSEG-LFBNR,
LFPOS LIKE MSEG-LFPOS,
SHKZG LIKE MSEG-SHKZG,
MEINS LIKE MARA-MEINS,
SMBLN LIKE MSEG-SMBLN,
SMBLP LIKE MSEG-SMBLP,
END OF I_MKPF_MSEG,
WA_MSEG LIKE I_MKPF_MSEG.
********For Material Movement***
DATA: BEGIN OF I_MSEG OCCURS 0,
MBLNR TYPE Z_MKPF_MSEG-MBLNR,
MATNR TYPE Z_MKPF_MSEG-MATNR,
WERKS TYPE Z_MKPF_MSEG-WERKS,
BWART TYPE Z_MKPF_MSEG-BWART,
BUDAT TYPE Z_MKPF_MSEG-BUDAT,
MENGE TYPE Z_MKPF_MSEG-MENGE,
MEINS TYPE Z_MKPF_MSEG-MEINS,
BWTAR TYPE Z_MKPF_MSEG-BWTAR,
NET_VAL LIKE MSEG-MENGE,
ZEILE TYPE MSEG-ZEILE,
END OF I_MSEG.
********For Material Monvment(Reverse)***
DATA: BEGIN OF I_MSEG1 OCCURS 0,
MBLNR TYPE Z_MKPF_MSEG-MBLNR,
MATNR TYPE Z_MKPF_MSEG-MATNR,
WERKS TYPE Z_MKPF_MSEG-WERKS,
BWART TYPE Z_MKPF_MSEG-BWART,
BUDAT TYPE Z_MKPF_MSEG-BUDAT,
MENGE TYPE Z_MKPF_MSEG-MENGE,
MEINS TYPE Z_MKPF_MSEG-MEINS,
BWTAR TYPE Z_MKPF_MSEG-BWTAR,
SMBLN TYPE Z_MKPF_MSEG-SMBLN,
SMBLP TYPE Z_MKPF_MSEG-SMBLP,
END OF I_MSEG1.
DATA: I_MSEG2 LIKE I_MSEG1 OCCURS 0 WITH HEADER LINE.
********For Recipt Details*******
DATA: BEGIN OF I_RECIPT OCCURS 0,
MATNR TYPE Z_MKPF_MSEG-MATNR,
BWTAR TYPE Z_MKPF_MSEG-BWTAR,
BUDAT TYPE Z_MKPF_MSEG-BUDAT,
DAYS TYPE P,
QTY TYPE Z_MKPF_MSEG-MENGE,
MONTH(3),
YEAR(4),
VERPR TYPE MBEWH-VERPR,
COST TYPE P DECIMALS 2,
MARK(1),
END OF I_RECIPT.
DATA: BEGIN OF I_PLANT OCCURS 0,
WERKS LIKE T024W-WERKS,
EKORG LIKE T024W-EKORG,
BUKRS LIKE T024E-BUKRS,
CHK(1) TYPE C,
END OF I_PLANT.
DATA: BEGIN OF I_USERGRP OCCURS 0.
INCLUDE STRUCTURE USGRP_USER.
DATA: VKORG LIKE VBAK-VKORG,
END OF I_USERGRP.
DATA: MUGRP LIKE USGRP_USER-USERGROUP.
DATA: MUNAME LIKE SY-UNAME,
MMSGTX1(50) TYPE C.
*********For Temp.Values*****
*data: begin of i_temp occurs 0,
matnr type z_mkpf_mseg-matnr,
bwtar type z_mkpf_mseg-bwtar,
budat type z_mkpf_mseg-budat,
menge type z_mkpf_mseg-menge,
end of i_temp.
DATA: DAYS(2).
DATA: NET_VAL LIKE MSEG-MENGE.
DATA: DATE1 TYPE D.
DATA: DATE2 TYPE D.
DATA: MBLNR TYPE MSEG-MBLNR.
DATA: MATNR TYPE MSEG-MATNR.
DATA: BWTAR TYPE MSEG-BWTAR.
DATA : V_DATE TYPE SY-DATUM.
DATA : X(2) TYPE C VALUE '01'.
DATA : P TYPE T009B-POPER. " MONTH
DATA : Q TYPE T009B-BDATJ. " YEAR
DATA : A TYPE T009B-POPER. " FOR MONTH WHERE MONTH STARTS AT APRIL
DATA : B(4) TYPE C. " FOR YEAR
DATA : DATE TYPE SY-DATUM.
DATA: NUMBER_OF_DAYS TYPE P.
DATA: DAT TYPE D.
DATA : X1(2) .
DATA: VPRSV TYPE MBEWH-VPRSV,
STPRS TYPE MBEWH-STPRS.
DATA: C TYPE C VALUE 0,
S(10).
Parameter / Selection - screens
SELECTION-SCREEN BEGIN OF BLOCK IND1 WITH FRAME TITLE TEXT_001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) TEXT_002 FOR FIELD P_WERKS.
PARAMETERS : P_WERKS LIKE S031-WERKS OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) TEXT_003 FOR FIELD P_SPMON.
PARAMETERS : P_SPMON LIKE S031-SPMON MODIF ID ABC .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TEXT_004 FOR FIELD S_MATNR.
SELECT-OPTIONS : S_MATNR FOR S031-MATNR.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK IND1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT_005.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TEXT_006 FOR FIELD SO_MATTP.
SELECT-OPTIONS : SO_MATTP FOR MARA-MTART.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TEXT_007 FOR FIELD SO_MATGP.
SELECT-OPTIONS : SO_MATGP FOR MARA-MATKL.
SELECTION-SCREEN END OF LINE.
begin of changes by cvns01
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TEXT_008 FOR FIELD SO_MFRNR.
SELECT-OPTIONS : SO_MFRNR FOR MARA-MFRNR.
SELECTION-SCREEN END OF LINE.
end of changes by cvns01
*changes
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TEXT_009 FOR FIELD SO_MFRNR.
SELECT-OPTIONS : SO_PRDHA FOR MARA-PRDHA NO INTERVALS."NO-EXTENSION.
SELECTION-SCREEN END OF LINE.
*end
SELECTION-SCREEN END OF BLOCK B2.
Initialization
INITIALIZATION.
TEXT_001 = 'Required Data'.
TEXT_002 = 'Plant'.
TEXT_003 = 'Period to analyze - month'.
TEXT_004 = 'Material Number'.
TEXT_005 = 'Optional Data'.
TEXT_006 = 'Material Type'.
TEXT_007 = 'Material Group'.
start of changes by cvns01
TEXT_008 = 'Manufacturer No.'.
TEXT_009 = 'Product Hierarchy'.
end of changes by cvns01
CLEAR:P,Q.
CLEAR A.
P = SY-DATUM+4(2).
SHIFT P LEFT DELETING LEADING C.
Q = SY-DATUM(4).
IF P <= 9.
CONCATENATE Q '0' P INTO S. "p_spmon.
ELSE.
CONCATENATE Q P INTO S. "p_spmon.
ENDIF.
*concatenate q p into s. "p_spmon.
CONDENSE S.
P_SPMON = S.
AT SELECTION-SCREEN ON WERKS
AT SELECTION-SCREEN ON P_WERKS.
CHECK SY-UCOMM = 'ONLI'.
SELECT SINGLE * FROM T001W WHERE WERKS EQ P_WERKS.
IF SY-SUBRC NE 0.
MESSAGE E999 WITH 'Invalid Plant'.
ENDIF.
SELECT T024W~WERKS T024E~EKORG T024E~BUKRS
INTO CORRESPONDING FIELDS OF TABLE I_PLANT
FROM T024W
JOIN T024E ON T024E~EKORG = T024W~EKORG
WHERE T024W~WERKS EQ P_WERKS.
SORT I_PLANT BY WERKS.
DELETE ADJACENT DUPLICATES FROM I_PLANT COMPARING WERKS.
SELECT * INTO CORRESPONDING FIELDS OF TABLE I_USERGRP
FROM USGRP_USER
WHERE BNAME = SY-UNAME.
IF I_USERGRP[] IS INITIAL.
MESSAGE E208(00) WITH 'You are not authorised to view this report'.
ENDIF.
LOOP AT I_USERGRP.
CONCATENATE I_USERGRP-USERGROUP(2) '00' INTO I_USERGRP-VKORG.
MODIFY I_USERGRP.
ENDLOOP.
LOOP AT I_USERGRP.
LOOP AT I_PLANT WHERE BUKRS = I_USERGRP-VKORG.
I_PLANT-CHK = 'X'.
MODIFY I_PLANT.
ENDLOOP.
ENDLOOP.
*delete i_plant where chk = ''.
IF NOT I_PLANT[] IS INITIAL.
LOOP AT I_PLANT.
IF I_PLANT-CHK = ''.
CLEAR P_WERKS.
CONCATENATE 'You are not authorised for plant ' I_PLANT-WERKS INTO MMSGTX1 SEPARATED BY SPACE.
MESSAGE E208(00) WITH MMSGTX1.
ENDIF.
ENDLOOP.
ENDIF.
IF P_WERKS = ''.
MESSAGE E208(00) WITH 'Select/Enter Plant'.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN
*AT SELECTION-SCREEN .
SELECT SINGLE * FROM s031 WHERE werks EQ p_werks
AND spmon EQ p_spmon
AND matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE e999 WITH 'NO VALUES EXIST FOR SELECTION CRITERIA'.
ENDIF.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM PRDHA_INITIALIZATION.
PERFORM FETCH_DATA.
PERFORM DISPLAY_DATA.
END-OF-SELECTION.
*& Form FETCH_DATA
text
--> p1 text
<-- p2 text
FORM FETCH_DATA .
CLEAR:P,Q.
CLEAR A.
P = P_SPMON+4(2).
Q = P_SPMON+0(4).
******Materials**********************************
changes made by akshatha
SELECT MARA~MATNR
FROM MARA
JOIN MARC
ON MARCMATNR = MARAMATNR
INTO CORRESPONDING FIELDS OF TABLE I_MARA
WHERE MARA~MATNR IN S_MATNR
AND MARC~WERKS = P_WERKS
AND MARA~MTART IN SO_MATTP
AND MARA~MATKL IN SO_MATGP
AND MARA~MFRNR IN SO_MFRNR
AND MARA~PRDHA IN SO_PRDHA.
end of changes
To get material description for the material
IF NOT I_MARA[] IS INITIAL.
SELECT MATNR
MAKTX
FROM MAKT
INTO CORRESPONDING FIELDS OF TABLE I_MAKT
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND SPRAS = SY-LANGU.
TO GET OPEN BALANCE QTY WE NEED TO CONSIDER PREVIOUS MONTH OF THE
CORRESPONDING PERIOD
WE WILL GET PROBLEM ONLY PROBLEM WHEN PERIOD IS '01'. THEN WE MUST
CONSIDER FOR 12 TH MONTH OF PREVIOUS YEAR.
****Closing Stock as on Selection-Screen Month....
*By Default last date of month is taken
changed by akshatha
CONCATENATE P_SPMON X INTO V_DATE.
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = V_DATE
I_MONMIT = 00
I_PERIV = 'V3'
IMPORTING
E_BUPER = A
E_GJAHR = Q
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 3
OTHERS = 4 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
to get stock quantity
SELECT MATNR LBKUM SALK3 BWKEY LFGJA LFMON
FROM MBEWH
INTO CORRESPONDING FIELDS OF TABLE I_MBEWH
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND BWKEY = P_WERKS AND BWTAR IN S_BWTAR
AND LFGJA = Q
AND LFMON = A
AND LBKUM > '0.0'.
SELECT MATNR LBKUM SALK3 BWKEY VBELN POSNR LFGJA LFMON
FROM EBEWH
APPENDING CORRESPONDING FIELDS OF TABLE I_MBEWH
WHERE MATNR = I_MARA-MATNR
AND BWKEY = P_WERKS
AND BWTAR IN S_BWTAR
AND LFGJA = Q
AND LFMON = A
AND LBKUM > '0.0'.
and VPRSV = 'S'.
SELECT MATNR LBKUM SALK3 BWKEY SOBKZ PSPNR LFGJA LFMON
FROM QBEWH
APPENDING CORRESPONDING FIELDS OF TABLE I_MBEWH
WHERE MATNR = I_MARA-MATNR
AND BWKEY = P_WERKS
AND BWTAR IN S_BWTAR
AND LFGJA = Q
AND LFMON = A
AND LBKUM > '0.0'.
SELECT MATNR LBKUM SALK3 BWKEY BWTAR
FROM MBEW
INTO CORRESPONDING FIELDS OF TABLE I_MBEWH1
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND BWKEY = P_WERKS
AND LBKUM > '0.0'.
SELECT MATNR LBKUM SALK3 BWKEY VBELN POSNR SOBKZ BWTAR
FROM EBEW
APPENDING CORRESPONDING FIELDS OF TABLE I_MBEWH1
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND BWKEY = P_WERKS
AND LBKUM > '0.0'.
SELECT MATNR LBKUM SALK3 BWKEY BWTAR SOBKZ PSPNR
FROM QBEW
APPENDING CORRESPONDING FIELDS OF TABLE I_MBEWH1
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND BWKEY = P_WERKS
AND LBKUM > '0.0'.
SORT I_MBEWH BY MATNR BWKEY.
SORT I_MBEWH1 BY MATNR BWKEY.
LOOP AT I_MBEWH.
LOOP AT I_MBEWH1 WHERE MATNR = I_MBEWH-MATNR
AND BWKEY = I_MBEWH-BWKEY.
DELETE I_MBEWH1.
ENDLOOP.
ENDLOOP.
APPEND LINES OF I_MBEWH1 TO I_MBEWH.
CLEAR : I_MBEWH1.
REFRESH I_MBEWH1.
SORT I_MBEWH BY MATNR.
LOOP AT I_MBEWH .
I_MBEWH1 = I_MBEWH.
AT END OF MATNR.
SUM.
I_MBEWH1-LBKUM = I_MBEWH-LBKUM.
I_MBEWH1-SALK3 = I_MBEWH-SALK3.
APPEND I_MBEWH1.
ENDAT.
ENDLOOP.
DELETE I_MBEWH1 WHERE LBKUM <= 0.
I_MBEWH[] = I_MBEWH1[].
end of changes
loop at i_mara.
concatenate p_spmon x into v_date.
call function 'DATE_TO_PERIOD_CONVERT'
exporting
i_date = v_date
I_MONMIT = 00
i_periv = 'V3'
importing
e_buper = a
e_gjahr = q
exceptions
input_false = 1
t009_notfound = 2
t009b_notfound = 3
others = 4 .
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
To get STOCK QUANTITY and STOCK VALUE for All Valuation Type
select matnr
bwtar
lbkum
salk3
from mbewh
into corresponding fields of i_mbewh
where matnr = i_mara-matnr
and bwkey = p_werks
and lfmon = a " 'A' IS PERIOD FOR FISCAL YR
and lfgja = q.
collect i_mbewh.
clear i_mbewh.
endselect.
if sy-subrc ne 0.
select matnr
bwtar
lbkum
salk3
from mbew
into corresponding fields of i_mbewh
where matnr = i_mara-matnr
and bwkey = p_werks.
collect i_mbewh.
clear i_mbewh.
endselect.
endif.
endloop.
end of changes
Logic: If the Val. Type is defined then for that material dont take
the line item where Val. Type is blank......
sort i_mbewh by matnr bwtar.
i_mbewh1[] = i_mbewh[].
delete i_mbewh where bwtar = ' '.
loop at i_mbewh1.
read table i_mbewh with key matnr = i_mbewh1-matnr.
if sy-subrc <> 0.
move-corresponding i_mbewh1 to i_mbewh.
append i_mbewh.
endif.
endloop.
sort i_mbewh by matnr bwtar.
i_mbewh1[] = i_mbewh[].
end of changes
*****************Last Date of the month is Calculated to find Qty
DAT = V_DATE.
CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
EXPORTING
P_FECHA = DAT
IMPORTING
NUMBER_OF_DAYS = NUMBER_OF_DAYS.
X1 = NUMBER_OF_DAYS.
CONCATENATE P_SPMON X1 INTO DATE.
********RECIPT QTY FETCHING*************************
select mblnr
matnr
bwart
budat
menge
meins
bwtar
zeile
from z_mkpf_mseg
into (i_mseg-mblnr,
i_mseg-matnr,
i_mseg-bwart,
i_mseg-budat,
i_mseg-menge,
i_mseg-meins,
i_mseg-bwtar,
i_mseg-zeile)
for all entries in i_mbewh
where matnr = i_mbewh-matnr and werks = p_werks
and ( budat le date or budat eq date )
and bwart in ('101','561','501','951','953','955',
**'957','301','105')
and bwtar = i_mbewh-bwtar.
append i_mseg.
clear i_mseg.
endselect.
select mblnr
matnr
bwart
budat
menge
meins
bwtar
zeile
from mseg "z_mkpf_mseg
into corresponding fields of table i_mseg
(i_mseg-mblnr,
i_mseg-matnr,
i_mseg-bwart,
i_mseg-budat,
i_mseg-menge,
i_mseg-meins,
i_mseg-bwtar,
i_mseg-zeile)
for all entries in i_mbewh
where matnr = i_mbewh-matnr and werks = p_werks
and ( budat le date or budat eq date )
and bwart in ('101','561','501','951','953','955',
***'957','301','105')
and bwart in ('101','561','501','951','953','955',
*'957','301','309','105')
and bwtar = i_mbewh-bwtar.
loop at i_mseg.
select single * from mkpf
where mblnr = i_mseg-mblnr.
if ( mkpf-budat ge date ).
delete i_mseg where mblnr = i_mseg-mblnr.
else.
i_mseg-budat = mkpf-budat.
modify i_mseg.
endif.
endloop.
sort i_mseg descending by matnr bwtar budat.
**********For Reversal FOR RECIPT(CHECK FOR REFERENCE)
**********(102,562,502,952,954,956,958)
select mblnr
matnr
bwart
menge
meins
bwtar
smbln
smblp
from mseg
into corresponding fields of table i_mseg1
for all entries in i_mbewh
where matnr = i_mbewh-matnr and werks = p_werks
and bwart in ('102','562','502','952','954','956','958','302')
and bwtar = i_mbewh-bwtar.
loop at i_mseg1.
select single * from mkpf
where mblnr = i_mseg1-mblnr.
if ( mkpf-budat ge date ).
delete i_mseg1 where mblnr = i_mseg1-mblnr.
else.
i_mseg1-budat = mkpf-budat.
modify i_mseg1.
endif.
endloop.
loop at i_mseg1.
read table i_mseg with key mblnr = i_mseg1-smbln
zeile = i_mseg1-smblp.
if sy-subrc = 0.
i_mseg-menge = i_mseg-menge - i_mseg1-menge.
delete i_mseg where mblnr = i_mseg1-smbln and
zeile = i_mseg1-smblp.
move-corresponding i_mseg to i_mseg2.
append i_mseg2.
endif.
endloop.
loop at i_mseg2.
move-corresponding i_mseg2 to i_mseg.
append i_mseg.
endloop.
end of changes.
SELECT MSEGMATNR MSEGMBLNR MSEGZEILE MSEGMENGE MSEGBWART MSEGEBELN
MSEGEBELP MSEGSMBLN MSEG~SMBLP
MKPFBUDAT MSEGSHKZG
FROM MKPF
JOIN MSEG ON MSEGMBLNR = MKPFMBLNR
AND MSEGMJAHR = MKPFMJAHR
INTO CORRESPONDING FIELDS OF TABLE I_MKPF_MSEG
FOR ALL ENTRIES IN I_MARA
WHERE MSEG~MATNR = I_MARA-MATNR
AND MSEG~WERKS = P_WERKS
AND MKPF~BUDAT LE DATE
AND MSEG~BWART IN ('101','105','561','501','301','309','951','953','955','957','712','657','658',
'521','522','303','304','102','562','502','952','954','956','958','302').
DELETE I_MKPF_MSEG WHERE ( BWART = '309' AND SHKZG = 'H' )
OR ( BWART = '303' AND SHKZG = 'H' )
OR ( BWART = '304' AND SHKZG = 'S' )
OR ( BWART = '657' AND SHKZG = 'H' )
OR ( BWART = '658' AND SHKZG = 'S' ).
SORT I_MKPF_MSEG BY MATNR MBLNR.
LOOP AT I_MKPF_MSEG.
if i_mkpf_mseg-bwart = '101' or i_mkpf_mseg-bwart = '102'.
select single * from ekpo where ebeln = i_mkpf_mseg-ebeln
and ebelp = i_mkpf_mseg-ebelp.
if ekpo-pstyp = 7.
delete i_mkpf_mseg where ebeln = i_mkpf_mseg-ebeln
and ebelp = i_mkpf_mseg-ebelp.
CLEAR I_MKPF_MSEG-MENGE.
endif.
endif.
IF ( I_MKPF_MSEG-BWART = '101' OR I_MKPF_MSEG-BWART = '105' OR I_MKPF_MSEG-BWART = '561' OR
I_MKPF_MSEG-BWART = '501' OR I_MKPF_MSEG-BWART = '301' OR I_MKPF_MSEG-BWART = '309' OR
I_MKPF_MSEG-BWART = '951' OR I_MKPF_MSEG-BWART = '953' OR I_MKPF_MSEG-BWART = '955' OR
I_MKPF_MSEG-BWART = '957' OR I_MKPF_MSEG-BWART = '303' OR I_MKPF_MSEG-BWART = '521' OR
I_MKPF_MSEG-BWART = '712' OR I_MKPF_MSEG-BWART = '657' ).
NET_VAL = NET_VAL + I_MKPF_MSEG-MENGE.
ENDIF.
LOOP AT I_MKPF_MSEG WHERE MATNR = I_MKPF_MSEG-MATNR.
IF ( I_MKPF_MSEG-BWART = '102' OR I_MKPF_MSEG-BWART = '562' OR
I_MKPF_MSEG-BWART = '502' OR I_MKPF_MSEG-BWART = '952' OR
I_MKPF_MSEG-BWART = '954' OR I_MKPF_MSEG-BWART = '956' OR
I_MKPF_MSEG-BWART = '958' OR I_MKPF_MSEG-BWART = '302' OR
I_MKPF_MSEG-BWART = '304' OR I_MKPF_MSEG-BWART = '522' OR
I_MKPF_MSEG-BWART = '658' ) AND
( I_MKPF_MSEG-MBLNR = I_MKPF_MSEG-SMBLN AND
I_MKPF_MSEG-ZEILE = I_MKPF_MSEG-SMBLP ).
NET_VAL = NET_VAL - I_MKPF_MSEG-MENGE.
DELETE I_MSEG WHERE MBLNR = I_MSEG1-SMBLN AND
ZEILE = I_MSEG1-SMBLP.
ENDIF.
ENDLOOP.
WA_MSEG = I_MKPF_MSEG.
AT END OF MATNR.
I_MSEG-MATNR = WA_MSEG-MATNR.
I_MSEG-MENGE = NET_VAL.
I_MSEG-BUDAT = WA_MSEG-BUDAT.
APPEND I_MSEG.
CLEAR NET_VAL.
ENDAT.
ENDLOOP.
end of changes
DELETE I_MSEG WHERE MENGE = '0.000'.
SORT I_MSEG DESCENDING BY MATNR BWTAR BUDAT.
***#******RECIPT COMPLETE FINAL TABLE( I_MSEG)**********
********IF THE VAL. TYPE IS NOT THERE THEN PUT 'X'
loop at i_mbewh.
if i_mbewh-bwtar = ' '.
i_mbewh-bwtar = 'X'.
modify i_mbewh.
endif.
endloop.
delete i_mbewh where lbkum = '0.00'.
end of changes
loop at i_mseg.
if i_mseg-bwtar = ' '.
i_mseg-bwtar = 'X'.
modify i_mseg.
endif.
endloop.
end of changes
DATA: MENGE TYPE MSEG-MENGE.
start of changes by akshatha
SORT I_MSEG BY MATNR BWTAR.
SORT I_MBEWH BY MATNR BWTAR.
LOOP AT I_MSEG.
if condition, read and it_mseg-loop commented by akshatha.
if i_mbewh-lbkum > '0.00'.
read table i_mbewh with key matnr = i_mseg-matnr
bwtar = i_mseg-bwtar.
loop at i_mseg .
if ( i_mseg-mblnr <> mblnr ) and ( i_mseg-matnr ne i_temp-matnr
or i_mseg-bwtar ne i_temp-bwtar ) .
i_temp-matnr = i_mseg-matnr.
i_temp-bwtar = i_mseg-bwtar.
i_temp-budat = i_mseg-budat.
i_temp-menge = i_mseg-menge.
mblnr = i_mseg-mblnr.
matnr = i_mseg-matnr.
bwtar = i_mseg-bwtar.
append i_temp.
end of changes
delete i_mseg .
loop at i_mbewh where matnr = matnr
and bwtar = bwtar.
end of changes
LOOP AT I_MBEWH WHERE MATNR = I_MSEG-MATNR
AND BWTAR = I_MSEG-BWTAR.
FOR GETTING THE VALUES OF ISSUES ON & UPTO THE DATE OF RECIPT.
DELETE THE ISSUE QTY FROM STOCK SO THAT WE CAN GET THE EXACT STOCK
VALUE ON THE DATE WHEN RECIPT OF MATERIAL HAS HAPPEN
ISSUES R NOTHING BUT TYPE OF CONSUPTION.
commented and changed by akshatha
if ( i_mbewh-lbkum >= i_temp-menge ).
IF ( I_MBEWH-LBKUM >= I_MSEG-MENGE ).
I_RECIPT-MATNR = I_MBEWH-MATNR.
I_RECIPT-BWTAR = I_MBEWH-BWTAR.
i_recipt-budat = i_temp-budat.
I_RECIPT-BUDAT = I_MSEG-BUDAT.
end of changes
*Type Conversion From Sy-datum to type d.
DATE1 = DATE.
DATE2 = I_RECIPT-BUDAT.
*Type Conversion From Sy-datum to type d.
CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
EXPORTING
DATE1 = DATE1
TIME1 = SY-UZEIT
DATE2 = DATE2
TIME2 = SY-UZEIT
IMPORTING
DATEDIFF = I_RECIPT-DAYS.
IF SY-SUBRC <> 0.
ENDIF.
i_recipt-qty = i_temp-menge.
I_RECIPT-QTY = I_MSEG-MENGE.
i_mbewh-lbkum = i_mbewh-lbkum - i_temp-menge.
I_MBEWH-LBKUM = I_MBEWH-LBKUM - I_MSEG-MENGE.
elseif ( i_mbewh-lbkum < i_temp-menge ).
ELSEIF ( I_MBEWH-LBKUM < I_MSEG-MENGE ).
I_RECIPT-MATNR = I_MBEWH-MATNR.
I_RECIPT-BWTAR = I_MBEWH-BWTAR.
i_recipt-budat = i_temp-budat.
I_RECIPT-BUDAT = I_MSEG-BUDAT.
*Type Conversion From Sy-datum to type d.
DATE1 = DATE.
DATE2 = I_RECIPT-BUDAT.
*Calculation of Difference of dates
CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
EXPORTING
DATE1 = DATE1
TIME1 = SY-UZEIT
DATE2 = DATE2
TIME2 = SY-UZEIT
IMPORTING
DATEDIFF = I_RECIPT-DAYS.
IF SY-SUBRC <> 0.
ENDIF.
I_RECIPT-QTY = I_MBEWH-LBKUM.
I_MBEWH-LBKUM = '0.00'.
ENDIF.
MODIFY I_MBEWH.
APPEND I_RECIPT.
exit.
end of changes
ENDLOOP.
endif.
IF I_MBEWH-LBKUM <> '0.00'.
clear i_temp.
CLEAR I_MSEG.
ENDIF.
endloop.
endif.
end of changes
ENDLOOP.
**********FINAL RECIPT TABLE WITH AGE
SORT I_RECIPT BY MATNR BWTAR DAYS.
LOOP AT I_RECIPT.
*Calculation of Fiscal yr for moving price.
PERFORM PERIOD_CALCULATION USING I_RECIPT-BUDAT+4(2)
I_RECIPT-BUDAT+0(4) I_RECIPT-MONTH
I_RECIPT-YEAR.
IF I_RECIPT-BWTAR = 'X'.
I_RECIPT-BWTAR = ' '.
ENDIF.
**************Moving Price for All material for all months......
SELECT SINGLE VERPR
VPRSV
STPRS
FROM MBEWH
INTO (I_RECIPT-VERPR,
VPRSV,
STPRS )
WHERE MATNR = I_RECIPT-MATNR
AND BWTAR = I_RECIPT-BWTAR
AND BWKEY = P_WERKS
AND LFMON = I_RECIPT-MONTH
AND LFGJA = I_RECIPT-YEAR
and lbkum = i_recipt-qty.
IF SY-SUBRC <> 0.
SELECT SINGLE VERPR
VPRSV
STPRS
FROM MBEW
INTO (I_RECIPT-VERPR,
VPRSV,
STPRS )
WHERE MATNR = I_RECIPT-MATNR
AND BWKEY = P_WERKS
and lbkum = i_recipt-qty.
ENDIF.
IF I_RECIPT-VERPR IS INITIAL.
SELECT SINGLE VERPR
VPRSV
STPRS
FROM EBEWH
INTO (I_RECIPT-VERPR,
VPRSV,
STPRS )
WHERE MATNR = I_RECIPT-MATNR
AND BWTAR = I_RECIPT-BWTAR
AND BWKEY = P_WERKS
AND LFMON = I_RECIPT-MONTH
AND LFGJA = I_RECIPTNever mind. I updated my aperture in app store and it fixed the problem. Thank you.
-
Not able to get data while executing in background for mb52
Dear all,
my requirement is i want to schedule the zreport for every 1 hour.but proble is when iam executing in fore ground iam able to get data.but when iam going to scheduling this iam not able to get data.
my code is
type-pools:slis.
data zbudat type RANGE OF budat.
data wab like line of zbudat.
data zmatkl type RANGE OF MATKL.
data waz like line of zMATKL.
data zwerks type RANGE OF werks.
data wax like line of zwerks.
waz-sign = 'I'.
waz-low = 'CRUDE'.
waz-option = 'EQ'.
append waz to zmatkl.
clear waz.
waz-sign = 'I'.
waz-low = 'SGO'.
waz-option = 'EQ'.
append waz to zmatkl.
clear waz.
*waz-sign = 'I'.
*waz-low = 'FINES'.
*waz-option = 'EQ'.
*append waz to zmatkl.
*clear waz.
*waz-sign = 'I'.
*waz-low = 'LUMPS'.
*waz-option = 'EQ'.
*append waz to zmatkl.
*clear waz.
*waz-sign = 'I'.
*waz-low = 'UFO'.
*waz-option = 'EQ'.
*append waz to zmatkl.
wax-sign = 'I'.
wax-low = 'BIMI'.
wax-option = 'EQ'.
append wax to zwerks.
clear wax.
wax-sign = 'I'.
wax-low = 'BIPL'.
wax-option = 'EQ'.
append wax to zwerks.
*waz-sign = 'I'.
waz-low = 'C'.
*waz-option = 'CP'.
*append waz to zmatnr.
*clear waz.
*waz-sign = 'I'.
waz-low = 'S'.
*waz-option = 'CP'.
*append waz to zmatnr.
*clear waz.
*waz-sign = 'I'.
waz-low = 'UC'.
*waz-option = 'CP'.
*append waz to zmatnr.
*waz-sign = 'I'.
waz-low = 'F'.
*waz-option = 'CP'.
*append waz to zmatnr.
*clear waz.
*waz-sign = 'I'.
waz-low = 'L'.
*waz-option = 'CP'.
*append waz to zmatnr.
types:begin of w_tab,
bwkey type werks_d,
matnr type matnr,
lgort type LGORT_D,
budat type budat,
labst type labst,
endmenge type p decimals 3,
end of w_tab.
DATA : IT_TAB TYPE STANDARD TABLE OF W_TAB WITH HEADER LINE .
FIELD-SYMBOLS: <gt_fieldcat> TYPE slis_fieldcat_alv,
<gt_report_list> TYPE w_tab .
field-symbols <lt_pay_data> type any table.
*FIELD-SYMBOLS : <LT_DATA> LIKE LINE OF IT_TAB .
FIELD-SYMBOLS : <LT_DATA> type any . " i have chaged it
data lr_pay_data type ref to data.
cl_salv_bs_runtime_info=>set( exporting display = abap_false
metadata = abap_false
data = abap_true ).
****SUBMIT ZQM_GR_BARGE_LOADING WITH S_date in zbudat with s_werks in zwerks with p_pend = ' ' AND RETURN .
submit RM07MLBS with MATKLA in zmatkl with werks in zwerks
"with XVBST = 'X'
using selection-SCREEN '1000' and return.
try.
cl_salv_bs_runtime_info=>get_data_ref( importing r_data = lr_pay_data ).
assign lr_pay_data->* to <lt_pay_data>.
catch cx_salv_bs_sc_runtime_info.
message `Unable to retrieve ALV data` type 'E'.
endtry.
cl_salv_bs_runtime_info=>clear_all( ).
data: obj_s type ref to ZKMINCO_MINESTOCKFROM_SAP_OUT.
create OBJECT obj_s.
data : output TYPE ZKMINMINESTOCKFROM_SAP1 ,
record type ZKMINMINESTOCKFROM_SAP_REC_TAB ,
wa_record like line of record.
LOOP AT <lt_pay_data> ASSIGNING <LT_DATA>.
MOVE-CORRESPONDING <LT_DATA> TO IT_TAB .
APPEND IT_TAB .
wa_record-STOCK_AS_ON_DATE = sy-datum .
wa_record-STOCK_AS_ON_TIME = sy-uzeit .
wa_record-PLANT_ID = it_tab-bwkey.
wa_record-STORAGE_LOC_ID = it_tab-lgort .
wa_record-MATERIAL = it_tab-matnr .
wa_record-STOCK_QTY = it_tab-labst.
append wa_record to record.
clear wa_record.
endloop.
output-MINESTOCKFROM_SAP-record = record .
CALL METHOD obj_s->MINESTOCKFROM_SAP_OUT
EXPORTING
output = output .
commit work.
Thanks in advance.Hi,
I assume that in your case you have two program lets say ZFOREGROUND and ZBACKGROUND (Called inside zforeground using submit statement)
zforeground has :
1. a input field to browse excel sheet or some file at the selection screen, and
2. button 'post all' to determine the background processing.
Now your requirement is such that you want zbackground to get scheduled as background job when post all button is clicked.
So, within the event AT USER-Command, check the sy-ucomm as that of post all button, if so write the following code to schedule the job:
DATA: jobname LIKE tbtcjob-jobname.
DATA :jobcount LIKE tbtcjob-jobcount,
host LIKE msxxlist-host.
DATA: BEGIN OF starttime.
INCLUDE STRUCTURE tbtcstrt.
DATA: END OF starttime.
DATA: starttimeimmediate LIKE btch0000-char1.
DATA: gv_job_dt TYPE sy-datum,
gv_job_tm TYPE sy-uzeit.
jobname = 'EXCLUSION_LISTING'.
gv_job_dt = sy-datum.
gv_job_tm = sy-uzeit.
Job open
CALL FUNCTION 'JOB_OPEN'
EXPORTING
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
IF sy-subrc NE 0.
"error processing
ENDIF.
Insert process into job
SUBMIT ZBACKGROUND AND RETURN
WITH p_file1 = gv_file_cust_exc "<----
Parameters which you want to pass to report zbackground from the report
WITH p_file2 = gv_file_win_deal "------zforeground
USER sy-uname
VIA JOB jobname
NUMBER jobcount.
IF sy-subrc ne 0.
"error processing
ENDIF.
Close job
starttime-sdlstrtdt = gv_job_dt.
starttime-sdlstrttm = gv_job_tm.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
EXCEPTIONS
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
OTHERS = 99.
IF sy-subrc EQ 0.
WRITE:/1 'JOB' COLOR 3,
jobname COLOR COL_GROUP,
'Scheduled in Background' COLOR 3. "error processing
gv_time = starttime-sdlstrttm.
gv_date = starttime-sdlstrtdt.
ENDIF.
Above code will schedule the report zbackground in background.
Note:
the program schduled in background will not be able to access any data present on your presentation server. data should be provided either by the program schhedulling it in foreground or it has to be thr in application server.
Regards,
Ravi -
I have two identical, but independant test stations, both feeding data back to a Data Acquisition Computer running LabView 6.1. Everything is duplicated at the computer as well, with two E-series multifunction I/O cards (one for each test station) and two instances of the same LabView program for acquiring and analysing the data. The DAQ computer has a Celeron processor w/ 850Mhz clock and 512MB memory, and is running on Windows NT.
I have noticed that when I run both the applications simultaneously, I take a substantial performance hit in terms of processing speed (as opposed to running just one program). Why does this happen and how can I prevent it? (In t
his particular case, it may be possible to combine both the tests into one program since they are identical, but independant, simultaneous control of two different LabView programs is a concept I need to prove out).
Thanks in advance for any tips, hints and spoon feedings (!)....Depending on your application, you may or may not be able to improve things.
Firstly, each task requires CPU time, so a certain performance difference is guaranteed. Making sure you have a "wait until ms" in every while loop helps in all but the most CPU intensive programs.
Secondly, if you are
1) streaming data to disk
2) Acquiring lots of data over the PCI bus
3) Sending lots of data o ver the network
you can have bottlenecks elsewhere than in your program (limited Disk, PCI or Network bandwidth).
Avoid also displaying data which doesn`t need to be displayed. An array indicator which only shows one element still needs a lot of processing time if the array itself is large.... Best is to set the indicator invisible if this is the case.
I think
it would be best if you could give some more information about the amount of data being acquired, processed and sent. Then maybe it will be more obvious where you can optimise things. If you are running W2000, try activating the task manager while the program(s) are sunning to see where the bottleneck is.
Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Maybe you are looking for
-
How to determine the mimetype of an uploaded file (GUI_UPLOAD)?
Hi everybody. I use method cl_gui_frontend_services=>gui_upload to upload files and save the binary data in the database. to preview the filetype (pdf, doc, jpg, ...) later i also need to store the mimetype. but how can I determine the mimetype of an
-
How to install Rescue and Recovery CD to my T42
I ordered Rescue and Recovery CD to install my T42, and I got 8 CDs, one is independant, and other 7 CDs are for T42, so I just wonder how do install it, I mean use which CD, or which is used firstly, anyway, could someone tell me step-by-step to res
-
Bar chart with current date in X axis
Hello I have attached a vi that I hoipe somebody can help with. If you look at the vi, there are two bars showing. 1.How can I attach the current date to the X axis. For instance.....suppose the first bar (far left) was produced with data from yester
-
How to resolve jstart.EXE "Synchronizing binaries" in the sapmmc?
I've recently installed NetWeaver CE 7.1 SP8 using JSPM, which seemed to go fine with several restarts, accesses to the nwa, etc. After starting application testing restarts began hanging with jstart.EXE indicating "Synchronizing binaries" in the sa
-
Find table for a structure field
Hi, I need to find table for field Q0743-OFFR1. I tried using tcode SE15, but was not able to find any table where the field is used. Is there any other method of finding a table for a structure field. Any pointers in this regard would be helpful. Th