Regarding date function module
Hi abapers,
We have one requirement in selection screen validation.
From date is Day 1 of the next period(month).
To date is Day 1 of the next period*(month) + (next) 3 months.
which function module we can use.
how we can pass the selection screen of this date.
Thanks
Nani.
Hi
Why we need the fun module
Just write the code as
select-options : s_date for sy-datum no display.
data: date like sy-datum, fdate like sy-datum, tdate is like sy-daum, mon(2),
mon1(2), mon2(2), year(4).
date = sy-datum.
year = date+0(4).
mon = date+4(2).
mon1 = mon + 1.
mon2 = mon + 3.
concatenate year mon1 '01' into fdate.
concatenate year mon2 '01' to tdate.
use the fdate and tdate and write the code
<b>Reward points for useful Answers</b>
Regards
Anji
Similar Messages
-
Closing Stock of a particular date:Function Module
Hello Experts,
I m developig a report in which I want Closing Stock amount of a particular date.
Is there any funtion module for this, as in tables S031, mard I m getting Closing Stock as on date.
Pls suggest
PriyankaHi Priyanka,
I didnt find any function module for this purpose.
You can create your FM for this purpose.
You can refer following thread for the reference:
Re: closing stock of a particular date
Closing Stock of a Material
Re: Stock on a particulare date
Hope this will help.
Regards,
Nitin. -
Help regarding the Function Module GUID_CREATE
Hi Experts,
Can some one explain the functionality of GUID_CREATE function module.Thanks in advance.
With regards,
Srini...Hello,
Guid for unique identification assigned list
It think it will generate the one unique key in the program.
DATA: con_log_guid TYPE guid_16.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = con_log_guid.
WRITE con_log_guid .
Try this example it is generating a 16number id. -
if to read the data from a RT table which of the following function module will be best
. <b>pyxx_read_payroll_result</b> or <b>RP_FILL_WAGE_TYPE_TABLE</b>
what i am doing is i am filling the rgdir table using the function module <b>cu_read_rgdir</b>
as looking at the query you can see i am totally confused in these function modules
can anone please let me know that how i can get data from rt using these function modules coz i am not using ldb PNP in my program and i have got all the data wihtout using it now the only issue left is PF that i can get only from RT TABLE.
if there is any other way also for that please let me know
the wage types for pf are /3f1,/3f2./3f3
if anynobdy can help me in this i can complete rest of the parts by today ..
sorry for disturbing you all have asked too many questions on rt table
please dont mind
just wanted to have a grip on it thats y asking so many queries and thanks for all your replies that you all have given
pelase help me in this last one also:)Hi,
refer
Retrieve record from RT
Re: regarding RT tables
Hope this solves your purpose.
Award points if it helps.
-Gaurang -
Regarding Remote function module ARCHIV_CONNECTION_INSERT
Hi All,
Can any give me more detial about remote function module ARCHIV_CONNECTION_INSERT . So i have requirement that our client is archiving document from Commonstore. So want to create custom function module for TOA01 ( ZTOA01 ) and add a maintanance field. if data is archived maitaianance field should be flagged and next time when he is archivig document he dont want to give date. so only unflagged document should be archived.
so can any one help me how to overcome this requirement as this is urgent.
Thanks in advance.
Best Regards,
zuberaGo to SAP Service Marketplace (service.sap.com) and SAP Notes Search. Put in the note number 758278 and hit display.
However to be able to access service marketplace you need a s-user registered for the company you are working for. Please contact your basis team to find out what user is available to you.
Regards,
Michael -
Regarding Smartform Function module
Hi,
When i am executing the smartform function module via print program, Smart form output is displaying properly but it is not showing any OTF data in the importing parameter JOB_OUTPUT_INFO . (JOB_OUTPUT_INFO-OTFDATA). Why it is happening? Could you please help me in this regard?To get the OTF data you need to set the GETOTF parameter in the Control Parameters of the Smartforms.
DATA: LS_CONTROL TYPE SSFCTRLOP. " Controlling info
LS_CONTROL-GETOTF = 'X'.
CALL FUNCTION WF_FM
EXPORTING
CONTROL_PARAMETERS = LS_CONTROL
IMPORTING
JOB_OUTPUT_INFO = WF_OUTDATA
I guess, when we set the GETOTF flag, it will not generate the output and only puts the data JOB_OUTPUT_INFO-OTFDATA.
Regards,
Naimesh Patel -
Very important and urgent - i need info regarding a function module
hi all,
can any one suggest me a function module which calculate the
difference in two dates and give answer in days.
some one suggest me the following function m odule
CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
EXPORTING
beg_da = wpv_dati
end_da = wpv_datf
IMPORTING
no_cal_day = wpv_days
Please suggest any other function module.
or i can use this Function module onlyHi,
U can use the following function module.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
I_DATUM_BIS = date1
I_DATUM_VON = date2
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = days
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 1
OTHERS = 2
Reward if useful.
Regards,
Rajesh Akarte -
Need Material Classification data function module
Hi all,
i have requirement to fetch material classification data through function module.
is there any point to know releted function modules of classification data of material data.
Thanks in advance,
BhaskarHi,
In KLAH you get the list of Classifications linked to a Material. Give OBJEK = MATNR.
By giving CLINT in KLAH you find the corresponding CLASS.
in BAPI:
BAPI_OBJCL_GETDETAIL
pass following values:
OBJECTKEY = KSSK-OBJEK
OBJECTTABLE = 'MARA'
CLASSNUM = KLAH-CLASS
CLASSTYPE = KLAH-KLART
KEYDATE = sy-datum
UNVALUATED_CHARS
LANGUAGE = sy-langu
the output would be in
ALLOCVALUESNUM
ALLOCVALUESCHAR
ALLOCVALUESCURR
based on the type of characteristic.
Best Regards, Murugesh AS -
Regarding ALV Function modules
Hi,
Can you please explain what is the difference betweeen slis_fieldcat_alv and slis_t_fieldcat_alv?
thnx
venkatHi
ABAP List Viewer
The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
This helps us to implement all the features mentioned very effectively.
Using ALV, We can have three types of reports:
1. Simple Report
2. Block Report
3. Hierarchical Sequential Report
There are some function modules which will enable to produce the above reports without much effort.
All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
1. SIMPLE REPORT.
The important function modules are
a. Reuse_alv_list_display
b. Reuse_alv_fieldcatalog_merge
c. Reuse_alv_events_get
d. Reuse_alv_commentary_write
e. Reuse_alv_grid_display
A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
The important parameters are :
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
iii. I_callback_user_command : routine where the function codes are handled
iv. I_structure name : name of the dictionary table
v. Is_layout : structure to set the layout of the report
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
II. Tables :
i. t_outtab : internal table with the data to be output
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
Parameters :
I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
This internal table has three fields :
Typ : H header, S selection , A - action
Key : only when typ is S.
Info : the text to be printed
E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
Parameters : same as reuse_alv_list_display
This is an example for simple list.
2. BLOCK REPORT
This is used to have multiple lists continuously.
The important functions used in this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_BLOCK_LIST_DISPLAY
A. REUSE_ALV_BLOCK_LIST_INIT
Parameters:
I. I_CALLBACK_PROGRAM
II. I_CALLBACK_PF_STATUS_SET
III. I_CALLBACK_USER_COMMAND
This function module is used to set the default gui status etc.
B. REUSE_ALV_BLOCK_LIST_APPEND
Parameters :
Export :
I. is_layout : layout settings for block
II. it_fieldcat : field catalog
III. i_tabname : internal table name with output data
IV. it_events : internal table with all possible events
Tables :
i. t_outtab : internal table with output data.
This function module adds the data to the block.
Repeat this function for all the different blocks to be displayed one after the other.
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
This function module is used for hierarchical sequential blocks.
D. REUSE_ALV_BLOCK_LIST_DISPLAY
Parameters : All the parameters are optional.
This function module display the list with data appended by the above function.
Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
3. Hierarchical reports :
Hierarchical sequential list output.
The function module is
A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
i. t_outtab_header : Header table with data to be output
ii. t_outtab_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using REUSE_ALV_FIELDCATALOG_MERGE.
Important Attributes :
A. col_pos : position of the column
B. fieldname : internal fieldname
C. tabname : internal table name
D. ref_fieldname : fieldname (dictionary)
E. ref_tabname : table (dictionary)
F. key(1) : column with key-color
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
J. just(1) : (R)ight (L)eft (C)ent.
K. do_sum(1) : sum up
L. no_out(1) : (O)blig.(X)no out
M. outputlen : output length
N. seltext_l : long key word
O. seltext_m : middle key word
P. seltext_s : short key word
Q. reptext_ddic : heading (ddic)
R. ddictxt(1) : (S)hort (M)iddle (L)ong
S. datatype : datatype
T. hotspot(1) : hotspot
Regards
Anji -
Regarding obselete function modules
What are replacements for these funciton modules its urgent please reply
POPUP_TO_CONFIRM_WITH_MESSAGE,
LOG_SYSTEM_GET_RFC_DESTINATION,
HELPSCREEN_NA_CREATEHi Naveen,
'POPUP_TO_CONFIRM_WITH_MESSAGE' is obsolete.
The replacement FM is 'POPUP_TO_CONFIRM
Example:
CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
EXPORTING
DIAGNOSETEXT1 = TEXT-900
DIAGNOSETEXT2 = SY-MSGV1
DIAGNOSETEXT3 = TEXT-901
TEXTLINE1 = TEXT-902
TEXTLINE2 = TEXT-903
TITEL = TEXT-904
IMPORTING
ANSWER = UP_ANSWER.
The Diagnose object parameter Z_ZIMPCHK1_POPUP_TO_CONFIRM'
is created in SE61 transaction as DIALOG TEXT object
DATA: W_PARAM TYPE SPAR,
I_PARAMETERS TYPE STANDARD TABLE OF SPAR,
W_TEXT_Q TYPE STRING.
MOVE TEXT-900 TO W_PARAM-VALUE.
MOVE 'TEXT1' TO W_PARAM-PARAM.
APPEND W_PARAM TO I_PARAMETERS.
WRITE SY-MSGV1 TO W_PARAM-VALUE.
MOVE 'TEXT2' TO W_PARAM-PARAM.
APPEND W_PARAM TO I_PARAMETERS.
WRITE TEXT-901 TO W_PARAM-VALUE.
MOVE 'TEXT3' TO W_PARAM-PARAM.
APPEND W_PARAM TO I_PARAMETERS.
CONCATENATE TEXT-902
TEXT-903
INTO
W_TEXT_Q.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = TEXT-904
DIAGNOSE_OBJECT = 'Z_ZIMPCHK1_POPUP_TO_CONFIRM'
TEXT_QUESTION = W_TEXT_Q
IMPORTING
ANSWER = UP_ANSWER
TABLES
PARAMETER = I_PARAMETERS
EXCEPTIONS
TEXT_NOT_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.
ENDIF.
You can try,
HELP_OBJECT_SHOW
or
HELP_OBJECT_SHOW_FOR_FIELD
as an alternate for
HELPSCREEN_NA_CREATE
Also, Check the list of function modules
[http://www.sap-img.com/abap/function-list.htm]
[http://www.erpgenie.com/abap/functions.htm]
Hope it Helps.
Regards,
Anita -
hi all,
whats the function module used to calculate the difference
between two dates
regards
SuprithHi,
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_start
i_datum_von = p_end
IMPORTING
e_tage = diff
EXCEPTIONS
days_method_not_defined = 1
OTHERS = 2.
WRITE:/ diff.
Check the following code:
REPORT ZDATEDIFF.
DATA: EDAYS LIKE VTBBEWE-ATAGE,
EMONTHS LIKE VTBBEWE-ATAGE,
EYEARS LIKE VTBBEWE-ATAGE.
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.
WRITE:/ 'Difference in Days ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years ', EYEARS.
INITIALIZATION.
FROMDATE = SY-DATUM - 60.
or u may need this in certain cases
Btw, the tmp_date was to manipulate the dates in such a way to see the p_start is greater than p_end.
if p_start < p_end.
tmp_date = p_end.
p_end = p_start.
p_start = p_end.
endif.
Even we have HR_HK_DIFF_BT_2_DATES function module.
Hope this helps.
plz reward if useful.
thanks,
dhanashri. -
Regarding BAPI/Function Module for updating fields FAKSK and LIFEX
Hi All,
I have a requirement wherein i need to update the fields FAKSK(Billing block ) and LIFEX(External Identification number).
We have already tried using the function Module WS_DELIVERY_UPDATE and also BAPI_OUTB_DELIVERY_CHANGE but we didnt find both the fields in any of the above BAPI or function module.
To be more specific to the requirement we need to remove the Billing block and update the LIFEX filed.
If anyone have come accross such situation Please advice.
Thanks ina dvahi satya ranjan,
put an append to structure 'vbkok' which is used as input parameter for WS_DELIVERY_UPDATE / WS_DELIVERY_UPDATE_2.
enter faksk and lifex and data field plus an active-flag for every data field.
e.g.:
ZZKZTRSPG ZZKZTRSPG CHAR 1 0
ZZTRSPG TRSPG CHAR 2 0
find include 'LV50SFZ2' in WS_DELIVERY_UPDATE am implement like this:
if vbkok_wa-ZZKZTRSPG <> space .
perform likp_bearbeiten_vorbereiten(sapfv50k).
if not vbkok_wa-ZZKZTRSPG eq space.
likp-trspg = vbkok_wa-zztrspg.
endif.
perform likp_bearbeiten(sapfv50k).
endif.
regards
marcus -
Regarding obselete Function Module in ECC6.0...plz repl urgent
Hi,
I am copying a program from <b>4.7 to ECC 6.0 ,</b>and when i check <b>SLIN</b> errors i am getting the following error.
<b>error:</b>
<b>Function module STRING_CENTER is flagged as obsolete.
If you have any queries, contact the author of the function module</b>
The function Module is:
<b>CALL FUNCTION 'STRING_CENTER'
EXPORTING
STRING = TEXT_IN
IMPORTING
CSTRING = TEXT_OUT
EXCEPTIONS
TOO_SMALL = 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.</b>Hi,
C147_STRING_SPLIT_AT_POSITION
STRING_SPLIT
STRING_SPLIT_AT_POSITION
check this sample code
DATA: text(10) TYPE c VALUE '0123456789',
text1(6) TYPE c,
text2(6) TYPE c.
PARAMETERS position TYPE i.
CALL FUNCTION 'STRING_SPLIT_AT_POSITION'
EXPORTING
string = text
pos = position
IMPORTING
string1 = text1
string2 = text2
EXCEPTIONS
string1_too_small = 1
string2_too_small = 2
pos_not_valid = 3
OTHERS = 4.
Regards -
Questions regarding update function module
Hello experts,
I am on customer site to help them investigate one issue: they have a background job which runs periodically.
In the report database table A is changed firstly ( new entries are inserted ), then a update function module is called via keyword CALL FUNCTION ... IN UPDATE TASK.
Inside the function module database table B is updated. ( existing entries are updated )
Customer issue:
sometimes they find A is updated as expected, however B remains unchanged at the same time.
customer could not find exact steps to reproduce the issue. However the issue does exist there and occur from time to time.
the issue could only be reproduced in their production system, but works perfectly well in dev & Q system. It is difficult to debug in their production system for trouble shooting.
After analyzing related code, I have one doubt: according to ABAP help on CALL FUNCTION aaa IN UPDATE TASK, I know the function module aaa is called in a new update work process. I wonder whether there is any possibility there this issue might be caused because the update function module fails to get called at all? ( perhaps due to heavy system load so no free update function module could serve the table B update ? )
If update function module fails to execute, is there any system utility to record this? That is to say, will it be recorded in such as SM13 or SM21?
Looking forward to your expertise on this topic!
Best regards,
JerryHello friends,
Thanks a lot for your interests on this issue. I update all my findings:
1. issue background: this issue occurs in SAP CRM Channel manageement Solution, software component CRM-CHM-POS.
2. due to some limitations, the table CMSD_CI_HISTORY and history table are not updated in the same LUW. Instead the first one is updated in normal work process while the other is done in update work process. Since I am not the original developer I didn't know the whole complex scenario ( I did see this is done delibrately in note 1764006 - CMS:Sell In Release creating PB with zero available quantity ).
So for the moment we have to accept this design.
3. during our testing ,we ensure COMMIT WORK is always called.
4. So why sometimes the first table update fails, however there is no hint at all for this failure in the system like ST22 and SM21 ?? ( forget SM13, since it is updated in normal work process ).
The root cause is the flaw of SAP code below.
The code has planned to raise exception if insertion failed due to duplicate records to be inserted.
Unfortunately, the fact is if we use "INSERT db FROM TABLE xxx" to insert records into database and some record already exists with the same key, it will result in a termination but SY-SUBRC is STILL 0; Just compare it with single insertion using "INSERT db FROM <work area>", in the same error situation, processing does not terminate, and SY-SUBRC is set to 4.
As a result in this case even the insertion fails, line 29 will never be executed as sy-subrc is always 0. Since the insertion fails and the exception is caught without any notification, so customer sufferred because they do not know what has happened.
Best regards,
Jerry -
Hi,
i need to display one pop up . from this pop up i need to select one value. any one help me on this one.
which function module i have to use?(Note : i need to pass internal table to the pop up after that i have to select one value from this pop up..)Hello Srinath,
You can use tableview or alv grid on screen and call that screen loading data into it.
Also, need to register DOUBLE_CLICK event and USER_COMMAND event for handling the value selection in alv grid.
Follow the link for more details on [working with ALV grid and event handling|http://help.sap.com/saphelp_47x200/helpdata/en/0a/b5530cd30911d2b467006094192fe3/frameset.htm].
Hope this helps!
Thanks,
Augustin.
Maybe you are looking for
-
Double clicking on icons doesn't open up applications anymore
My iMac recently went thru a electrical surge in my house that ultimately caused an electircal fire in the wall of my home. Anyway, I'm no longer to able to just simply double click on a desktop icon which, in turn, wold open up the appropriate appli
-
Can I sync two ipods with different ID on the same computer?
can I sync two ipods with different ID on the same computer?
-
I am using InDesign CS 3.0.1 with Windows XP. I am getting a new computer with Windows 8.1. Will my version work with this? If not can I get an upgrade?
-
Miss matach of hours in customized report
hi friends hours that are captured via time sheet in sap does not match with one of our customized report ( single P and L Report ).im not sure where things are going wrong,can any one give me any inputs on this,how to rectify and where to do the nec
-
IPod nano touch only no longer works on dock
I have a iPod nano touch 6 th generation that no longer charges and/or plays on my Logitech S751i dock. My first generation iPod nano plays on this dock without any problem. Any solution? Suggestion? Thanks in advance...