I want first day of month any function module is their
hi i want a function module in that it should return the first day of that month .
for example if i enter 15.12.2007 it should return 01.12.2007 or 13.06.2007 it should return 01.06.2007
ähm why would you need a FM for that?
you probably have a variable whicghs stores your date.
data: lv_date type dats value,
lv_date2 type dats.
data: lv_swap type c length 10.
concatenate '01' lv_date+2 into lv_swap.
lv_date2 = lv_swap.
write lv_date2.
Similar Messages
-
I Have a date . I want first day of that month.
Please give me FM or coding
reg
vvvHi,
Use below FMs:
First day and last day of month:
HR_JP_MONTH_BEGIN_END_DATE
First and Last day in year
FIRST_AND_LAST_DAY_IN_YEAR_GET
DATA:DATE1 TYPE D.
DATA:DATE2 TYPE D.
CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
EXPORTING
I_GJAHR = SY-DATUM+0(4)
I_PERIV = '24'
IMPORTING
E_FIRST_DAY = DATE1
E_LAST_DAY = DATE2
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.
WRITE: 'First Day', DATE1, 'Last day' , DATE2.
Also check
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = sp_gjahr
i_monmit = gp_monat
i_periv = 'K4'
i_poper = sp_monat
IMPORTING
e_date = gv_firstday
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.
Regards,
Raj. -
Default value of date as first day of month
Ho can I make my default value of date parameter as first day of month? {$SYSDATE()$} gives only current date and we can make it like {$SYSDATE()-7$} if we want to minus 7 days but how can we set the default value to first day of month?
I got the answer...It is {$FIRST_DAY_OF_MONTH()$} instead of {$SYSDATE()$}
-
Hi experts,
What's the code of First Day of Month?
For example, AsOfDate : 10/29/2011, I want to get 10/01/2011 from 10/29/2011. I made it like follow, but I believe there is a simple code.
CDate(ToText(DATEPART("m", ),0,'') + '/1/' + ToText(DATEPART("yyyy", ),0,''))
Thanks,
DavidHi
Try the follwoing :
currentdate - day(currentdate)+1
Note : replace currentdate with your date field.
Thanks,
Sastry -
Need sql querry for PreviousYear First Day Same Month And Currentday rec
Hi ,
I hAVE TABLE FOR EXAMPLE,
emp sal Arrivaldate
111 200 03-mar-2011
100 200 03-mar-2008
150 200 06-mar-2012
170 200 03-mar-2003
178 200 03-mar-2004
112 200 12-jun-2012-------------------->For Example THIS IS TABLE WE HAVE LOT OF RECORDS
I need querry to get based on this condition:Arrival Date is between Previous Year First Day Same Month And Current day.
Any one help me on this.....Hi,
To get the records between Previous Year First Day Same month to Current day..
SELECT TRUNC (ADD_MONTHS (SYSDATE, -12), 'MM') AS last_yr_first_date, TRUNC(SYSDATE) AS PRESENT_DATE
FROM DUAL;Which Outputs to:
LAST_YR_FIRST_DATE PRESENT_DATE
6/1/2011 6/13/2012When you give TRUNC(sysdate) It will removes the Time part of the SYSDATE.
For Ex :
TRUNC(SYSDATE) means that is 6/13/2012 which doesn't give the time part in the query.
Which takes into account the day start that is from 12:00 A.M to today midnight 11.59 P.M.
And, One thing is that
emp sal Arrivaldate
111 200 03-mar-2011
100 200 03-mar-2008
150 200 06-mar-2012
170 200 03-mar-2003
178 200 03-mar-2004
112 200 12-jun-2012The arrivaldate is in Character format so you need to convert to date type as
SELECT TO_DATE(ARRIVALDATE,'DD-MON-YYYY') from your_table;
and the comparison can be done as
SELECT *
FROM YOUR_TABLE
WHERE TO_DATE (ARRIVALDATE, 'DD-MON-YYYY')
AND TRUNC (ADD_MONTHS (SYSDATE, -12), 'MM')
AND TRUNC (SYSDATE);Good day!!!!!!!!!!!!!!!!!!!!!!!!
Thanks,
Shankar -
Is there any function module to convert the date format
Dear ABAPers,
Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
Thanks & Regards,
Ashok.hi,
create custom function module or copy the below code in the report ..and use it
the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
""Local interface:
*" IMPORTING
*" VALUE(DATE) LIKE SY-DATUM
*" EXPORTING
*" VALUE(FORMATTED_DATE)
*" EXCEPTIONS
*" INVALID_DATE
TABLES: TTDTG.
DATA: BEGIN OF T_DATE,
YYYY(4) TYPE C,
MM(2) TYPE C,
DD(2) TYPE C,
END OF T_DATE.
DATA: DAY(3) TYPE N.
DATA: VARNAME LIKE TTDTG-VARNAME.
IF DATE IS INITIAL.
CLEAR FORMATTED_DATE.
EXIT.
ENDIF.
check document date format
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1.
IF SY-SUBRC NE 0.
RAISE INVALID_DATE.
ENDIF.
MOVE DATE TO T_DATE.
CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
WRITE T_DATE-DD TO DAY.
CONCATENATE DAY ',' INTO DAY.
CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
SEPARATED BY SPACE.
ENDFUNCTION.
the output is :--Convert a DATE field into a full format date eg. March 23, 2000
Regards,
Prabhudas -
Is there any function module? Fiscal week no problem
Hi friends,
I want how to get physical week for given date.
Ie for 01-04-2009 week no is 1.
Is there any function module?
Pls suggest
Regards
MoosaHi,
Use the below code.
DATA: v_ersda TYPE sy-datum VALUE '20090618'.
DATA: v_month(2) TYPE c,
v_week(2) TYPE c,
v_full_week LIKE scal-week.
MOVE v_ersda+4(2) TO v_month.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = v_ersda
IMPORTING
week = v_full_week
EXCEPTIONS
date_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
MOVE v_full_week+4(2) TO v_week.
WRITE:/5 'Month = ', v_month.
WRITE:/5 'Week = ', v_week.
Regards,
Kumar Bandanadham -
Month Difference - Function Module needed
Hi Experts,
In my report, I am using mcs0-spmon as select options; one of my inputs where the user will enter month and year in the selection screen . e.g. 04.2008 to 07.2008
I want to calculate the month difference and it should not exceed 3 months. If it does, an error will be shown.
My question is -
Is there any Function Module by which I can proceed. How do I go about it?
Can anyone tell me a solution?
Thanks in advanceHi,
concatenate '200804' '01' into dur_begda.
concatenate '200807' '01' into dur_endda.
call function 'HR_PT_GET_MONTHS'
exporting
first_date = dur_begda
second_date = dur_endda
modify_interval = space
importing
duration = duration-months
exceptions
invalid_seq_dates = 1.
Thanks,
Durai.V
Edited by: Durai V on Aug 12, 2008 6:33 AM -
Is there any function module to assign Object to Transport request (Task)?
Hi There,
My requirement is to assign an object to desired task of the transport request. I found one FM called TR_EXT_INSERT_IN_REQUEST. But it has some limitations.
Limitations of FM : TR_EXT_INSERT_IN_REQUEST
1. It will assign the given object to given Transport request. But not to the task of a transport request. This FM will not allow assigning objects to the task. It will allow only to request.
2. Object entry present in transport request table e071. But, I can't find any version in version management. Moreover, the object is not locked under that particular request.
Can any one let me know, is there any function module to fullfill the requirement without above mentioned limitations?
Requirement :
1. Given object should be assigned to given task of TR.
2. Need FM to activate the Object and object texts.
3. After assigning to the request, It should show the vesion in version management and object should be locked under particular Task/ Request.
Your help would be greatly appreciated and <<removed by moderator>> Thanks in advance.
Have a nice day!!
Thanks and Regards,
Neelima. D
Edited by: kishan P on Jan 5, 2012 2:21 PM@ Dear Nabheet & Karuna
The object is not in local folder. I am aware of the process of assigning the object to request manually.
I want that to be done automatically. I wont prefer writing BDC for this.
@ Dear Keshav,
Thank you for the function module. But TR_INSERT_REQUEST_WITH_TASKS will create a tarnsport request with tasks.
@ Dear All,
My requirement is to assign the object to Task automatically. Not creating the request or Task. Task & Request are
present already. -
Any Function module or BAPIs are available to get scheme name for the inter
I have internal order no value in table AUFK-AUFNR , and the internal order corresponding Scheme value is available in IMPR-PRNAM . Now I want to inner join both the tables to extract the data , but there is no common field . Is there any Function module or BAPIs are available to get scheme name for the internal orders?
look at DB-VIEW "V_IVP_OR".
Regards,
Laurent -
Batch determination process in SD- Delivery: any Function module?
Hi All,
I want to use the logic used in SD-Delivery for batch determination in Batch Search Strategy report.
Is there any function module avaialable for batch determination process done in SD so that I can make use of it?
Thanks in advance,
Rgds,
MAdhuriHi Madhuri,
My requirement is to select that batches that were picked up by the delivery (i.e. those that passed the search strategy) using the Material and Plant combination, Customer as an optional parameter.
Could you please provide the function modules that are required to make use of the function module "VB_BATCH_DETERMINATION"? Also, could you please let me know if we need to take into consideration any other factors when using the function module VB_BATCH_DETERMINATION
Thanks in advance!
Thanks,
Manohar. Dubbaka. -
Guidence regarding creating a test data and running any function module
hi pals,
can you plz tell me how to create a test data, commit and run any function module, in details(step wise) ??Hi yawmark,
I appologise for including a poor code example ealier on, i had to come up with something quick. I will however, visit the sugeted sites you mentioned, thank you.
I did however, create a simple class that compiles and can be used to set, return, reset and print a few details about a person. I hope that is of better use than my previous example. here it is:
public class SimplePerson {
int age = 0;
String firstName = "";
String lastName = "";
/** Creates a new instance of SimplePerson */
public SimplePerson() {
/** Sets the age of this person */
private void setAge(int takeAge){
age = takeAge;
/** Returns the age of this person */
private int getAge(){
return age;
/** Sets the First Name of this person */
private void setFirstName(String takeName){
firstName = takeName;
/** Returns the First Name of this person */
private String getFirstName(){
return firstName;
/** Sets the Last Name of this person */
private void setLastName(String takeName){
firstName = takeName;
/** Returns the Last Name of this person */
private String getLastName(){
return firstName;
/** Resets the details of this person back to back to
* the default form.
private void resetAll(){
age = 0;
firstName = "";
lastName = "";
/** Prints all the details this person has */
private void printAll(){
System.out.println("Age: " +Integer.toString(age)
+ "\n First Name: " + firstName
+ "\n Last Name: " + lastName );
}Cheers mate -
Is there any function module that brings out profile planner
Hello experts,
Is there any function module that brings out profile planner (I want to set planner profile as u201CSAP800u201D. I am using 7KE1 transaction.
Example: I know, the FM - K_KOKRS_SET_BATCHINPUT will set the controlling area to 'CTIC' for the entire batch input process.
Thanks in advance.look at these fms..
CACS_PROFILE_PARTNER_READ
CACS_PROFILE_SHOW -
Any function module to transfer File(Excel) from Appli Serveto Unix Server
Hi all,
Do you have any function module to transfer excel file from application server to Unix server.
Can anyone have some sample code for the same.
Thanks in Advance.
Sreedhar MarriHi,
There is no function module ,instead use open dataset command.
Syntax example,
data: e_file like rlgrap-filename.
data : txtstr type string.
concatenate searchpoints-dirname '/scm/' werks '/' filnam into e_file.
open dataset e_file for output in text mode encoding default.
loop at itab.
concatenate itab ',' into txtstr.
transfer txtstr to e_file.
endloop.
where itab is the contents u want to transfer.
Pls check for required authorisations with ur BASIS for open dataset command.
Regards,
Balakumar.G. -
Any Function Module to get Service Conditions in Service Contracts???
Hi All,
I have created a function module inside which I have written BDC code for changing Service Contracts (ME32K).
I have used Item_condition and item_cond_validity structures in Table parameters.
For changing the conditions related to services, I need to know first which ones of those conditions were already there in the database for the contract and which ones are newly put in item_condition structure.
Similar reqmnt I had for Services also, for which I got the FM - MS_FETCH_SPEC_FOR_LIST, wherein I am giving Package number from Ekpo and getting the services related to item. I need something similar for Conditions also.
Is there any Function module wherein by giving the item and service info, I can get the conditions related to that particular Service? Or else any way using SAP std tables, I can get this info.
Please respond if anyone has this info.
Thanks a lot!
NavitaHi Mukesh,
Step 1. Use FM SO_USER_READ_API1 to get the folder details of the user
Step 2. Use FM SO_FOLDER_READ_API1 of the respective folder. You can read the Inbox, Workflow Inbox depending on what folder you read. The function modules are documented well as well with examples.
Hope this will help u,
Thanks & Regards
Kiran
Maybe you are looking for
-
Mini DisplayPort to VGA Adaptor not Mirroring
13-inch MacBook Pro (Mid 2012) running 10.8.3 Monoprice Mini DisplayPort to VGA Adaptors freeze the system (no issues with Monoprice Mini DisplayPort to DVI connected to monitor) so I tried an Apple Mini DisplayPort to VGA Adaptor and that works ok,
-
Hi, I have not done 1099 reporting from SAP. How and where do we start to do 1099 reporting from SAP? We are in version 4.6C. How do we check if we have set up the vendor information properly in our database? Thanks Ram
-
Error installing Developer suite 10g
Hello,i have downloaded the oracle developer suite 10g 10.1.2.0.2 i get this error whenever i try to start the setup program : Error in writing to directory C:\Documents And settings\<MY_CURRENT_USER>\Local Settings\TEMP\OraInstall... please ensure t
-
How about some high speed help, from these AMD 64s
Hi Guys 2 things First there is a Folding Team called MSI HQ Red Rockets, organised by RexB, You can see how we are doing here http://vspx27.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=37766 As it is from Stamford Univ, and is for Medical Re
-
Ipad2 3G coverage outside the US
I travel quite often and I'm not sure whether I can connect to 3G with my Ipad2 outside the US. Is it locked with AT&T or Verizon? I need to use it in the US with either one but have the facility of using it overseas. I'd appreciate the help.