Function module find date Range input for scheduling a job
hi i have created a program for scheduling a back ground job for purchase order extract in that i have to get the last 7 days records when i schedule it on every sunday can any one tell me the function module which satisfies the requirment
Date Range input in my program to be calculated for past 7 days from current date (ie from Sunday to Saturday of the week.)
Hi,
You can do it simply by
v_cdate TYPE sy-datum, " current system date
v_cdate = sy-datum - 7. " take date 7 days before current date
Pass this v_cdate in your logic
Hope it will help you.
Thanks
Arun Kayal
Similar Messages
-
Table for Function modules - Changed date & Changed by.
Hi Experts,
Help me to get Function module changed date & changed by.
For programs we can get the mentained information in TABLE : TADIR.Function Modules change history can be retrieved from table TRDIR.
Function Module stores a program Include in table TRDIR.
The details of the Function Module can be found in Attributes-->general data tab in the Function Module.
You need to pass the Include which correponds the FM.
Hence you can find the Log changes.
Hope this helps.
Regards
Vinayak -
Functionality / modules currently available in MySAP for asset tracking.
Hi All,
We have a new requirement in the asset accounting. If any one have come accross can you let me know the feasibility and the process.
1.Functionality / modules currently available in MySAP for asset tracking.
2.Could MySAP support data input from other external devices e.g. scanner.
3.What kind of asset level info is stored in MySAP and how they are modified along the asset life cycle
Thanks nd Regards
Srihari BollaYes this is possible.
In the asset itself you have the fields Last inventory on and Include asset in inventory list
From SAP you can print barcodes (asset and asset sub number) that you can put on your assets TC S_ALR_87010137 - Bar Codes . There is a standard SAP script for this, but you can create your own one.
The date you want to use for your tracking you can get ot ouf the table ANLA
For all the barcode's reader there is software that can create a file. This file you upload with an LSMW in SAP that updates the field Last inventory on. -
Data migration approach for Scheduling Agreements
Gurus,
Can anyone provide guidance on the data migration approach for Scheduling Agreements? How can we migrate the open delivery schedules and the respective cumulative quantities? The document type being used is "LZ".
Can correction deliveries (Doc type - LFKO) be used update the initial cumulative quantities?
Any help in this regard is higly appreciated.
Regards,
GajendraHi Zenith
You might find useful information here: IS-U data export (extraction) for EMIGALL.
I've done numerous IS-U migrations in the last 10+ years, but never one from IS-U to IS-U.
One main questions to start with: Are the two systems on the same release level?
If they are not and it would be too much effort to get them onto the same release level I would think creating your own extract programs and using the Migration workbench (EMIGALL) is the way to go.
If they are on the same level, there might possible other ways to do it, dependent on the differences between the two systems (mainly around customising). Assuming there are significant differences - otherwise why would you bother migrating? - there's the high probability that using EMIGALL is the way to go as well.
Yep
Jürgen -
Function module like ENQUEUE and DEQUEUE for function location.
Hi All,
I should be highly appreciate if any one help me for locking function module like ENQUEUE and DEQUEUE
for function location.
Thanks
ShawHi,
You can either use the standard way of locking by using :
data:lv_varkey TYPE rstable-varkey.
concatenate functional_location sy-mandt into lv_varkey .
* Lock table
CALL FUNCTION 'ENQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'E'
tabname = 'IFLOS'
varkey = lv_varkey
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
* Unlock table
CALL FUNCTION 'DEQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'E'
tabname = 'IFLOS'
varkey = lv_varkey.
Or,
As mentioned above create a lock object via transaction SE11.
Go to transaction se11:
--> Enter lock object name e.g EZ_IFLOS
--> Click on create
--> Enter description
--> Click on tables tab
--> Enter 'IFLOS' as table name
--> select lock mode
--. click on save and activate.
2 function modules will be created as DEQUEUE_EZ_IFLOS and ENQUEUE_EZ_IFLOS .
Regards. -
Function Modules in Data Modeling
Hi,
Can anyone give me example of use of functional modules at data modeling side?
Cheers!!!!!!Hi,
You can also define your own Z fucntion modules and use them.
Some more examples are converting letters from lower case to upper case, filtering data, transformations for languages, converting formats between systems, etc
Cheers,
Kedar -
Unable to find data in RSA3 for particular fields2lis_04_p_arbpl datasource
I am working with datasource 2lis_04_p_arbpl to construct Yield Report. I have a field GAMNG(Target Quantity) in the table AFKO, so I added it to the communication structure and activated it. I also want the field IGMNG(confirmed quantity) which is available in the table AFKO but not appearing in the pool tables of ARBPL datasource, so I have done datasource enhancement and obtained the field in the datasource. When I am checking for the data in RSA3, unable to find data(zero values) for both the fields.
Edited by: bhagav on Jan 5, 2012 1:20 PMHi ,
Please make sure that you are doing the extractor check in Update mode 'Full' .If the setup tables are filled then this should pick the data for the 2 newly added fields .
check and update accordingly later .
Thanks
Kamal Mehta -
Function module to choose the file for download and upload
what is the function module to choose the file for download and upload for presentation server.
give me with examplePlease search in SCN.
This has been discussed so many times. -
Function module WWW_ALV_CALL is not released for the Internet
Hi
I am facing this error Function module WWW_ALV_CALL is not released for the Internet and Only user SAP can release the function module.
Best Regards
GAGANhi,
This Web based calls are not available anymore in Netweaver 2004s/7.0.
More information in SAP-Note: 910202
Hope this helps
regards
Tobias -
How to incoporate a function module in data source based on view
Hi,
I need to develop a data source in R/3 based on a view (which is straight forward).
One field in the R/3 Z table will be in like this 20,070,709,110,000
There is a function module developed in R/3 when executed will split the record(20,070,709,110,000) and display time & date
How can i incorporate this function module in data source so that the data and time records will be loaded to BW
ThanksEnhance the data source with date and time and populate these fields in the user exit using the function module IB_CONVERT_FROM_TIMESTAMP .
OR
You can create Z function module IB_CONVERT_FROM_TIMESTAMP in BW side and write a routine in update rules/transfer rules to populate date and time.
hope this helps ...
Ravi -
Reg Super user for schedule background Jobs
Hi Experts,
I have created new user copied from DDIC with the same authorization. This is for scheduling Background Jobs. Now all the standard background Jobs are running fine. After scheduling the Jobs I have changed to system user. Now for audit purpose I need SAP note to do same. Please help me to get the sap note for the same. Please respond ASAP. treat this is as high priority.
Thanks & Regards,
Haseem.HI,
It is not necessary for user having SAP_ALL authorization under which background job is running.
Define specific users to use for background processing. Define them as system users (non-dialog) and give them only the necessary authorizations that are needed for the executed programs
check http://help.sap.com/saphelp_nw04/helpdata/en/db/f6f3393bef4604e10000000a11402f/frameset.htm
also check Note 101146 - Batch: authorization object S_BTCH_JOB, S_BTCH_NAM
regards,
kaushal -
Find date range for sick leaves
Hi,
Ive been trying to get readable output from HR system.
I have added the source data into Data Model, since i had to read the data with power query. Now i have pivot table like this:
date workdaY? user
6.3.2014 Sickleave user1
1.2.2014 Sickleave user2
2.2.2014 Sickleave user2
5.3.2014 Sickleave user4
5.3.2014 Sickleave user1
5.5.2014 Sickleave user1
16.9.2014 Sickleave user3
7.3.2014 Sickleave user1
6.5.2014 Sickleave user1
6.3.2014 Sickleave user4
Is there any possible way to get some kind of find function to sort and combine the data like this:
user1 Sickleave 5.3-7.3.2014
user1 Sickleave 5.5-6.5.2014
user2 Sickleave 1.2-2.2.2014
user3 Sickleave 16.9-16.9.2014
user4 Sickleave 5.3-6.3.2014One way to do this is with a VBA macro. The following should get you started.
As you can see looking at the macro, the original data is assumed to be on a worksheet named HRData and starts in A1.
The results are placed on the same worksheet but starting at cell G1. You could easily write the results to another worksheet.
The original data is copied to a temporary worksheet for sorting (and the temporary sheet is subsequently deleted).
A Class Module is added so we can use a User Defined Object which has the properties of the user name, start date and end date of the vacation period.
We then cycle through the sorted data, and create a Sickleave object and add it to a collection. If the "previous" row has the same user, and the date is one more than the previous End Date, we add one to the previous end date; if not, we
create a new object and start another sickleave period.
This is the data input:
and here are the results:
To enter this Macro (Sub), <alt-F11> opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
First, from the top menu, select Insert/Class Module. Highlight the new class module in the Project Explorer; click F4, and rename it to cSickLeave
Then paste the code below into that class module:
=======================================
Option Explicit
Private pUser As String
Private pStartDt As Date
Private pEndDt As Date
Public Property Get User() As String
User = pUser
End Property
Public Property Let User(Value As String)
pUser = Value
End Property
Public Property Get StartDt() As Date
StartDt = pStartDt
End Property
Public Property Let StartDt(Value As Date)
pStartDt = Value
End Property
Public Property Get EndDt() As Date
EndDt = pEndDt
End Property
Public Property Let EndDt(Value As Date)
pEndDt = Value
End Property
Then, from the top menu, select Insert/Module and
paste the code below into the regular module window that opens.
To use this Macro (Sub), <alt-F8> opens the macro dialog box. Select the macro by name, and <RUN>.
====================================
Option Explicit
Option Compare Text
Sub SickLeave()
Dim cSL As cSickLeave, colSL As Collection
Dim wsSrc As Worksheet, wsRes As Worksheet
Dim wsTemp As Worksheet, rTemp As Range
Dim vSrc As Variant, rSrc As Range
Dim vRes() As Variant, rRes As Range
Dim I As Long
'set Worksheets
Set wsSrc = Worksheets("HRData")
With wsSrc
Set rSrc = .Range("A1", .Cells(.Rows.Count, "C").End(xlUp))
End With
Set wsRes = Worksheets("HRData")
Set rRes = wsRes.Range("G1") 'upper left cell of results
'Sort the HRdata on a Temp sheet
Worksheets.Add
Set wsTemp = ActiveSheet
Set rTemp = wsTemp.Range("A1")
rSrc.Copy rTemp
Set rTemp = rTemp.CurrentRegion
With rTemp
.Sort key1:=.Columns(3), order1:=xlAscending, _
key2:=.Columns(1), order2:=xlAscending, _
Header:=xlYes, MatchCase:=False
End With
vSrc = rTemp.Value
With Application
.ScreenUpdating = False
.DisplayAlerts = False
wsTemp.Delete
.DisplayAlerts = True
End With
'create collection for results
Set colSL = New Collection
For I = 2 To UBound(vSrc)
If vSrc(I, 2) = "Sickleave" Then
If I = 2 Then
Set cSL = New cSickLeave
With cSL
.User = vSrc(I, 3)
.StartDt = vSrc(I, 1)
.EndDt = vSrc(I, 1)
colSL.Add cSL
End With
ElseIf vSrc(I, 3) = colSL(colSL.Count).User And _
(vSrc(I, 1) - 1) = colSL(colSL.Count).EndDt Then
With colSL(colSL.Count)
.EndDt = .EndDt + 1
End With
Else
Set cSL = New cSickLeave
With cSL
.User = vSrc(I, 3)
.StartDt = vSrc(I, 1)
.EndDt = vSrc(I, 1)
colSL.Add cSL
End With
End If
End If
Next I
ReDim vRes(0 To colSL.Count, 1 To 3)
vRes(0, 1) = "User"
vRes(0, 2) = "workdaY?"
vRes(0, 3) = "Date Range"
For I = 1 To colSL.Count
With colSL(I)
vRes(I, 1) = .User
vRes(I, 2) = "Sickleave"
vRes(I, 3) = Format(.StartDt, "d.m\-") & _
Format(.EndDt, "d.m.yyyy")
End With
Next I
Set rRes = rRes.Resize(UBound(vRes) + 1, UBound(vRes, 2))
With rRes
.EntireColumn.Clear
.Value = vRes
.EntireColumn.AutoFit
.Rows(1).HorizontalAlignment = xlCenter
End With
Application.ScreenUpdating = True
End Sub
Ron -
Identify tables from where the function module extracts data for the ES
Hi All,
For the datasource, 0CRM_SALES_ORDER_I in the CRM system, we need to add a new field (in the table level). This datasource's extraction type is 'F1 - function module'. Is the extractor itself is this function module? If it is a sepeate FM, where can we find the function module name used for this datasource?
We need to identify the tables from where the fields in this datasource fetch data from. Where can we find this information?
To be specific, in the sales order in tcode crmd_order, if we goto conditions tab and create a new condition, in what table this will get stored?
Thank you in advance,
HariIgnore this thread! there is another thread I have created for the same problem.
I created only one; wonder how it became two!! -
Function Module Call Via CMOD Logic for Master Data Enhancement
Hi Friends Please help me to resolve this, would really be very kind of all of you.
Requirement. I want to Enhance the field ZFACTREG from VIBDBE table in my datasource 0busentity_attr extract structure l_s_REIS_BUSENTITY_ATTR, I want to create the logic in CMOD exit_saplrsap_002 to call my function module for enhancement of master data. Please help me Step by Step
Thanks
Poonam Roy
<b>Step #1</b>
I put this code which gives me error in CMOD like this
ERROR : Das formale Argument 'OTHERS' muss am Schluss der Ausnahmeliste stehen.
ABAP Code#1 IN exit_saplrsap_002
DATA: l_d_fmname(30) TYPE c.
CONCATENATE 'Z_DS_' i_datasource(25) INTO l_d_fmname.
TRY.
CALL FUNCTION l_d_fmname
EXPORTING
I_DATASOURCE = I_DATASOURCE
I_UPDMODE = I_UPDMODE
TABLES
I_T_SELECT = I_T_SELECT
I_T_FIELDS = I_T_FIELDS
I_T_DATA = I_T_DATA
C_T_MESSAGES = C_T_MESSAGES
EXCEPTIONS
RSAP_CUSTOMER_EXIT_ERROR = 1
OTHERS = 2
IF FOUND.
IF SY-SUBRC <> 0.
RASIE RSAP_CUSTOMER_EXIT_ERROR.
END IF
CATCH CX_SY_DYN_CALL_ILLEGAL_FUNC.
ENDTRY.
<b>Step#2</b>
I simple created the Function module Z_DS_BUSINESS
and put the code in source code which gives me error . what should i put in other tabs like"Import", Export", Tables" i kept blank
ABAP CODE give me error : The Dictionary structure or table "FIELD-SYMBOLS" is either not active. i have to remove include in the FM. WHY SO??
FUNCTION Z_DS_BUSINENSS
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_DATASOURCE) TYPE RSAOT_OLTPSOURCE
*" VALUE(I_CHABASNM) TYPE SBIWA_S_INTERFACE-CHABASNM
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT
*" I_T_FIELDS TYPE SBIWA_T_FIELDS
*" I_T_DATA
*" C_T_MESSAGES STRUCTURE BALMI OPTIONAL
*" EXCEPTIONS
*" RSAP_CUSTOMER_EXIT_ERROR
INCLUDE ZXRSAU02.
WRITE: / 'INSIDE THE Z_DS_MEASUREMENTS PROGRAM'.
TABLES: REIS_BUSENTITY_ATTR,
VIBDBE,
field-symbols:.<fs_REIS_BUSENTITY_ATTR> like REIS_BUSENTITY_ATTR.
DATA: BEGIN OF i_c_t_data OCCURS 0.
include structure REIS_BUSENTITY_ATTR.
DATA END OF i_c_t_data.
DATA: i_c_t_data_copy like i_c_t_data OCCURS 0 WITH HEADER LINE,
begin of i_vibdbe occurs 0,
INTRENO like vibdbe-INTRENO,
ZFACTREG like vibdbe-ZFACTREG,
end of i_vibdbe.
i_c_t_data_copy[] = i_c_t_data[] = c_t_data[].
sort i_c_t_data_copy by vibdbe.
Select INTRENO
into table i_VIBDBE from VIBDBE
for all entries in i_c_t_data_copy
where INTRENO = i_c_t_data_copy- INTRENO.
if sy-subrc = 0.
sort i_VIBDBE by INTRENO.
loop at i_c_t_data assigning <fs_REIS_BUSENTITY_ATTR>.
clear: i_VIBDBE.
read table i_VIBDBE with key INTRENO = <fs_REIS_BUSENTITY_ATTR>-INTRENO
BINARY SEARCH
transporting ZFACTREG .
if sy-subrc = 0.
<fs_REIS_BUSENTITY_ATTR>-ZZFACTORY = i_vibebe-ZFACTREG
endif.
null(I leave office until Monday morning, Europe time)
in include from customer-exit ZXRSAU01, etc.
CASE I_DATASOURCE.
WHEN '0CUSTOMER_ATTR'.
PERFORM 0customer_attr changing i_t_data...
ENDCASE.
In each perform, doing what you wrote ; select (needed fields) from complementary-database-table into an internal table with a for all entries. sort the table. LOOP and MODIFY on i_t_data.
In some case i had to insert lines of i_t_data to an internal table of DS_structure when entering subroutine and back at exit. (on 4.6C PI 2003 if i remember)
Some optimization done when reading small tables (T001 society and the same, these are filled once and not for each packet of data.
Your idea of creating different FM is of interest, but the cost of passing i_t_data between two programs (two function groups) may overcome the gain of performance. In a job only one DataSource is processed so only one routine is actually called.
Regards. -
How to find function module's and tables used for the particulat screen or TCODE?
Hello Nation,
I would like to know how to find the function modules and tables used for the particular screen or TCODE or program.
Example : I would like know the function module used in the program RDBGFT?
How can i find that?
Thanks in advance ,Awaiting your reply.Make use of Find function with the keyword "CALL FUNCTION".
Make use of the same find function with the keyword "Select" to know the database tables used.
Regards,
Philip.
Maybe you are looking for
-
How do I move a playlist from my ipod to my iphone without duplicating songs?
My iPod and iPhone have the same songs on them, both manually managed. I have a playlist on my iPod that I want to move to iPhone. I tried exporting, and then importing to iTunes and them draggin and dropping that into my iPhone, but that results in
-
Can't compile the medrec tutorial
I can't build the medrec tutorial. Following the Tutorial 10: Exposing a Stateless Session EJB as a Web Service, I execute the command "ant prepare build.split.dir". But the medrecEar can't be compiled correctly. There are primarily two kinds of erro
-
SAP_CONVERT_TO_XML_FORMAT
We are on ECC5.0. I am trying to use function module SAP_CONVERT_TO_XML_FORMAT. I am having problems. When I try to execute the FM I get the message "Error generating the test frame". Do I need to use a different FM. All help is appreciated and will
-
I have set up an instrument control project using the producer-consumer architecture. Now I would like to implement a "Master Timer" VI that can be started, stopped, and reset using the P-C VI. Furthermore, I would like to display the seconds and min
-
I have tried many solutions including chatting with a Adobe Support person and he couldn't fix it. Ive uninstalled everything using the cleaner several times and oh so much more. When i open Creative Cloud, the home page will not come up including th