Call Function in FOX - 'DATE_TO_PERIOD_CONVERT'
Hi,
I have added the FM in 'DATE_TO_PERIOD_CONVERT' in RSPLF_FDIR.
There are 2 Date fields which the user enters based on which I need to populate another field- 'No. of Months'.
I need to convert the dates into months before I calculate the number of months.(difference of the two periods).
When I tried to pass the parameters to the FM, Im gettin an error as below:
Types of parameter I_DATE () and variable CHA_ZSTCTDT(D) are inconsistent
When I checked the domain of both the fields, both are of the same type DATS of length 8.
Im not able to figure out what went wrong..
Sample Code:
DATA CHA_ZSTCTDT TYPE ZSTCTDT.
DATA CHA_ZEDCTDT TYPE ZEDCTDT.
DATA CHA_FISCPER3 TYPE 0FISCPER3.
DATA CHA_FISCYEAR TYPE 0FISCYEAR.
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = CHA_ZSTCTDT
I_MONMIT = 00
I_PERIV = 'K4'
IMPORTING
E_BUPER = CHA_FISCPER3
E_GJAHR = CHA_FISCYEAR .
Rgds
Shyam
When I defined as String:
Types of parameter I_DATE () and variable CHA_ZSTCTDT(C) are inconsistent.
But again Bindu,
as per Marcs document on FOX:
Restriction on types for parameters
F, I, D, or STRING
Types of characteristics and attributes
No structures or tables..
I tried all those, but stills ame error
Rgds
Shyam
Similar Messages
-
In fox , can I use call function which developed by ABAP?
I want to use the call function to read table in FOX.
thankshi
u can use functions, but not complex.
the syntax is as follows
CALL FUNCTION UPC_FUNCEXEC_SAVE
EXPORTING
I_NO_TRANSACTION_DATA = FLAG
tx
srin -
How to call standard planning function in FOX code
Hi,
I want to call std. Distribution by reference planning function in FOX formula. Through CALL FUNCTION std planning functions can not be used.
My requirement is that because I need to execute this distribution function thousands of times with different variable values so I am planning to pass the values for these variables through FOREACH loop.
Any help is appreciated.
regards
Amit JainHi Amit,
unfortunately calling a planning function inside a planning function is not possible. And calling a planning sequence from a planning sequence is not supported as well.
I think is is better if go for a more complex FOX or an exit-function if the planning function needs to be executed online.
Another way some customers are using to met similar requirements is writing a z-program which determines the variable values in a loop (e.g. by reading a z-table). Inside the loop they set the variables (in the variable container) and when this is done execute a planning sequence for the current variable setting. The whole thing could be executed e.g. in a process chain.
Hope this helps ...
Regards Matthias Nutt
SAP Consulting Switzerland -
How to pass string value to call function in BIIP FOX?
Dear all,
In BIIP fox , we can call function module.
I got a simple test FM like:
FUNCTION ZTESTBPSFM2.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_X) TYPE STRING
*" REFERENCE(I_H) TYPE BSP_STRING
*" EXPORTING
*" REFERENCE(I_Y) TYPE F
ENDFUNCTION.
My FOX is like,
DATA YM TYPE 0CALMONTH.
DATA I_N TYPE F.
DATA J TYPE STRING.
J = 'KKKK'.
FOREACH YM.
CALL FUNCTION ZTESTBPSFM2
EXPORTING
I_X = J
IMPORTING
I_Y = I_N.
{ZREV , YM} = I_N.
ENDFOR.
When I run the function , I got a error .
"Types of parameter I_X (S) and variable J(C) are inconsistent "
Does anyone know which string data type I should use in function module?
Best Regards,
JeffHi Jeff
this is a bug. Please open a customer message so SAP support can correct the issue.
Regards,
Marc
SAP NetWeaver RIG -
Type error while calling function module with in FOX formula
Hi,
I am getting following error while calling function module from FOX Formula:
"Types of parameter DAY_IN () and variable J_CALDAY(D) are inconsistent"
Following is the code:
DATA I_CALDAY TYPE 0CALDAY.
DATA N_CALDAY TYPE 0CALDAY.
DATA KYF TYPE KEYFIGURE_NAME.
FOREACH I_CALDAY, KYF.
CALL FUNCTION SLS_MISC_GET_LAST_DAY_OF_MONTH
EXPORTING
DAY_IN = I_CALDAY
IMPORTING
LAST_DAY_OF_MONTH = N_CALDAY.
{KYF, N_CALDAY} = {KYF, L_CALDAY}.
ENDFOR.
Import parameter DAY_IN is of type sy-datum (that inturn is data element SYDATUM of data type DATS - same as 0CALDAY). Not sure why error is being thrown. Any idea? Thanks.
Edited by: SAP_BOY on Dec 4, 2009 5:26 PMHi,
I think It will not identify ,though you have (data element SYDATUM of data type DATS - same as 0CALDAY).Check it out by assigning it through a variable of type D.
Data I_CALDAY TYPE D.
Hope it may work out.
Regards,
Indu -
Data Type Issue Calling Function DATE_GET_WEEK in FOX
Hi,
I am calling DATE_GET_WEEK in the FOX Formula in Integrated Planning.
DATA START_DATE TYPE 0CALDAY.
DATA START_WEEK TYPE 0CALWEEK.
CALL FUNCTION DATE_GET_WEEK
EXPORTING
DATE = START_DATE
IMPORTING
WEEK = START_WEEK.
I get an error saying
Type of Paramters WEEK () and variable START_WEEK(N) are inconsistent
I get a similar error for DATE ().
Please tell me what DATA Type to use using passing and reciving values from this function module.
Once I get the value, I want convert the WEEK into Type 0CALWEEK. Please tell me how to this also.
Regards, DheerajHi Mti,
I tried what you recommended.
But I get the error TYPE SCAL is not permitted.
In Fox Formula as I know only the following are permitted.
1. I for integter
2. F Float
3. D Date
4. Characteristics.
Regards, Dheeraj -
Dear experts,
How can I call a function in FOX? I want to read a table and extract a value in a field.
thankssorry for my ignorance...
I created MF Z_COST_ITEM2:
Import:
I_AREA TYPE UPC_Y_AREA
I_PLEVEL TYPE UPC_Y_PLEVEL
I_METHOD TYPE UPC_Y_METHOD
I_PARAM TYPE UPC_Y_PARAM
I_PACKAGE TYPE UPC_Y_PACKAGE
T_EXITP TYPE UPF_YT_EXITP
ITO_CHA TYPE UPC_YTO_CHA
ITO_KYF TYPE UPC_YTO_KYF
Z0CO_AREA TYPE /BI0/OICO_AREA
ZCOST_CENTER TYPE /BI0/OICOSTCENTER
ZGL_ACCOUNT TYPE /BI0/OIGL_ACCOUNT
ZZ99CCGOR TYPE /BIC/OIZ99CCOGR
Export:
ET_MESG TYPE UPC_YT_MESG
Z99CCOSIT TYPE /BIC/OIZ99CCOSIT
Change:
XTH_DATA TYPE HASHED TABLE
In the code :
FUNCTION Z_COST_ITEM2.
""Interfase local
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL
*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD
*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM
*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE
*" REFERENCE(T_EXITP) TYPE UPF_YT_EXITP
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF
*" REFERENCE(Z0CO_AREA) TYPE /BI0/OICO_AREA
*" REFERENCE(ZCOST_CENTER) TYPE /BI0/OICOSTCENTER
*" REFERENCE(ZGL_ACCOUNT) TYPE /BI0/OIGL_ACCOUNT
*" REFERENCE(ZZ99CCGOR) TYPE /BIC/OIZ99CCOGR
*" EXPORTING
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
*" REFERENCE(Z99CCOSIT) TYPE /BIC/OIZ99CCOSIT
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
select single /BIC/Z99CCOSIT
INTO
Z99CCOSIT
from /BIC/AZ99OS07900
where CO_AREA EQ Z0CO_AREA
AND GL_ACCOUNT LE ZGL_ACCOUNT
AND /BIC/Z99CACCTO GE ZGL_ACCOUNT
AND COSTCENTER LE ZCOST_CENTER
AND /BIC/Z99CCOSTO GE ZCOST_CENTER
AND /BIC/Z99CCOGR LE ZZ99CCGOR
AND /BIC/Z99CGRPTO GE ZZ99CCGOR.
ENDFUNCTION.
The test is not working. An error produced.
And now? where I can call the FM??? in which part of the modeler? -
How using ABAP function in fox formula ?
Hello,
I want to launch standard function :"RSW_CURRENCY_TRANSLATION" by Fox formula. I declare this function in SAP Table :rsplf_fdir, and I can call this function by fox, with all parameters.
But when I want to use it, I've a problem with the first parameter : "Formula error: Type RSR_CTTNM is not permitted"
What's the solution ?
Best regards,Hi Cyril,
I read the fact that you have chosen to use CURC instead of the Function Module.
Did you fix your exchange rate type in your CURC formula: For example:
CURC (LCAMT,12312008,EURP,LCUR,GCUR).
Or did you make into a variable, that can be chosen at run time?
I'm asking because I'm trying to make the 'exchange rate type' in this formula to be more dynamic (like a local variable).For example:
DATA EXRATE TYPE 0RTYPE.
DATA EXRATE_V TYPE 0RTYPE.
EXRATE_V = VARV(EXCHRATE).
{0AMOUNT,GCUR, GCTYPE,FYPERIOD,VERSION,COSTELM,INT_ORDER} = CURC (LCAMT,12312008,EXRATE_V,LCUR,GCUR).
But the system returns the error meesage that it doesn't recognise 'EXRATE_V' even though i have declared it earlier on. So I have a fear that the system is expecting me to enter a fixed exchnage rate type that exists in RSCUR, in this formula..!! Is that true??
I don't want it to be fixed in the formula, it should be chosen at time of planning. How do you have yours right now? Do you know why I get this error message, and what I need to do to in the FOX formula, to make sure it can be populated at run time?
Thanks for your help and information in advance. -
Call function POPUP_TO_CONFIRM after Excel close
Good morning
I have written code like this
DATA: EXCEL TYPE OLE2_OBJECT.
DATA: BOOKS TYPE OLE2_OBJECT.
DATA: BOOK TYPE OLE2_OBJECT.
DATA: CELL TYPE OLE2_OBJECT.
DATA: FONT TYPE OLE2_OBJECT.
DATA: FILE TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
CALL METHOD OF EXCEL 'WORKBOOKS' = FILE.
CALL METHOD OF FILE 'OPEN'
EXPORTING
#1 = 'C:temp8D.xls'
#2 = 1.
CALL METHOD OF EXCEL 'CELLS' = CELL
EXPORTING
#1 = 6
#2 = 'C'.
SET PROPERTY OF CELL 'VALUE' = zak_pomoc.
CALL METHOD OF EXCEL 'QUIT'.
FREE OBJECT EXCEL.
If user has modified the 8D file I want display this file on the screen, but first function POPUP_TO_CONFIRM should ask him if he really wants to show file.
I make it like this.
call function 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Display report'
TEXT_QUESTION = 'Display report 8D?'
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = 'X'
START_COLUMN = 25
START_ROW = 6
IMPORTING
answer = ans.
if ans eq '1'.
DATA gs_excel TYPE ole2_object .
DATA gs_wbooks TYPE ole2_object .
DATA gs_wbook TYPE ole2_object .
DATA gs_application TYPE ole2_object .
CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
SET PROPERTY OF gs_excel 'Visible' = 1 .
GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
GET PROPERTY OF gs_wbooks 'Application' = gs_application .
*--Opening the existing document
CALL METHOD OF gs_wbooks 'Open' = gs_wbook
EXPORTING
#1 = 'c:temp8D.xls'.
endif.
But there is my problem because two windows: first- asking about saving the file and the second- asking about showing the file, pop up in this same time.
What condition should I write to call second window after this first one?
Please, any suggestions?
Thank you.Hello
I'm just beginner and there is one thing I don't understand. Between lines
CALL METHOD OF EXCEL 'QUIT'
and
FREE OBJECT EXCEL
the window 'Do you want save changes' appears. And in that moment what is the value that says if the user chooses OK or QUIT?
If I would know that value, I could call function POPUP_TO_CONFIRM in the right moment. -
Call Function Destination in a background job
I am having a problem using:
CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
DESTINATION p_dest
in a background job.
I am working on a program that would compare the same table in 2 different systems and write the differences. It works when I run it in the foreground. However, I want to run this in a nightly background job. However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
How can I bypass the logon screen or enter information into the logon screen using a background job?
Thanks.
JonHi Jonathan,
Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
You can click on the yellow star on the right of each post header to reward points.
For more information:
https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
John. -
Uncatchable exception: BSP calling Function Module
Hi all,
currently i'm facing a very weird problem. My application class calls function module
HR_INFOTYPE_OPERATION. Normally, in case of an error, the function module gives you back a return parameter. But if i call it from my BSP, the processing doesn't leave the function module. It directly throws an exception ERROR_MESSAGE_STATE instead of writing the message into parameter return.
If i call the function module with the same parameters from a report, it works fine and the error message is written to return parameter without throwing an exception.
What am i doing wrong? I don't want that exception and need to go on with filled parameter result.
Regards
Mark-AndréHi MA,
try using ERROR_MESSAGE in the exceptions list, like this.
CALL FUNCTION 'func_name'
EXPORTING
string = text
pos = position
IMPORTING
string1 = text1
string2 = text2
EXCEPTIONS
string1_too_small = 1
string2_too_small = 2
ERROR_MESSAGE = 3
OTHERS = 4.
Cheers
Graham Robbo -
What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?
Hi experts,
I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
Finally, thanks for reading and help.HI,
When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days -
How to fill data when call function of sap standard script form?
Hi every experts,
<Priority Normalized>
In our system, when we log in 'FR', we can print purchase order in language Franch,in t_code:ME22N. And when logging in 'EN', we can print it in language English, in ME22N. The English form is just only translated from Franch, with all same structure and frame. The form is done by script form.
And when logging in 'ZH', we create a new program, calling function smartform, instead of translating from EN language. Because of different structure and frame, I don't know the way to write script, so I print puchase order by smartform, when logging in 'ZH'.
But I have a new issue. Our MM module consultant needs me to print Chinese form if one condition, print English form in other condition.
So I have no idea to solve it. Because in my program, I get data to fill smartform and call function of smartform. And I don't know how to get data to fill script form. I only know the function name, 'OPEN_FORM' 'WRITE_FORM' 'CLOSE_FORM'.....
If I only call the several functions, I will get only frame without no data. So who can tell me how to do????
<Urgency downgraded>
Edited by: Suhas Saha on Jul 26, 2011 3:34 PM
Edited by: Vinod Kumar on Jul 26, 2011 4:09 PMHi,
Normally if we look in NACE transaction, you can see that upto five different FORMS can be assigned to a single output type . i.e. for each form there will be a seperate routine through which it gets called. But it all start from the first form only.
so you need to write your code in the ENTRY of the first form and if it does not satisfy do not go for processing of it but just exit of that form ENTRY. so that it will take you to next form.
hope this helps.
Thanks,
Venkatesh -
Function Module CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
Hello All,
While using CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH' to download to Unix file in GLD (Version 4.5b) the F.M is working fine, but in KLD(Version ECC 6.0) CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH' is not working & the error message is displayed saying incomplete filename.
Could you let me know any alternate Function Module/ Method in this regard.
ThanksHi,
In ECC6 also Its Working fine only.
1. Go to SE37 -> Enter FM Name -> Test(F8).
2. Give any file path and test it.
Thanks,
Reward If Helpful. -
Call function 'gui_download'
Hallo Friends,
I am using the above fuction in my program. I want the header of my internal table to be writen als header in the text file. So, I created another Itab (Itab-col_1) and appended all the headers in this, which I later use as below.
Problem:
1.
I am not satisfied with the downloaded output in file.txt I want the header to be excactly over the column content. Please see my output:
MANDT LIFNR LAND1 NAME1 NAME2 NAME3
010§§§§§§0000010000§§§§§§§§§§§§§§§§§§DE§§§§§§Test
010§§§§§§0000100000§§§§§§§§§§§§§§§§§§US§§§§§§TEST
§ § means Space
It is Obvious LAND1 should be over DE / US, NAME1 should be over Test / TEST etc etc
2.
I would like filed seperator to be ( ; ) not space. The flag 'X' gives space.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = str
filetype = 'ASC'
write_field_separator = 'X'
dat_mode = 'X'
TABLES
data_tab = itab_kreditor
fieldnames = itab_datei_col_header
EXCEPTIONS
file_write_error = 1
file_not_found = 19
OTHERS = 22.
So, how can I solve these two problems.
Blacky.CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = BIN_FILESIZE
filename = filename
FILETYPE = 'ASC'
APPEND = ' '
<b> WRITE_FIELD_SEPARATOR = ';'</b>
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH = FILELENGTH
TABLES
data_tab = data_tab
FIELDNAMES = FIELDNAMES
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
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
Vasu
Maybe you are looking for
-
Cannot download statements from financial sites
Since downloading Adobe Reader's latest version, I am unable to download statements from internet banking/credit card sites. They require Adobe Reader. I have uninstalled, reinstalled, gone back to older version that used to work to no avail. One b
-
Location of IMPORTED Movies in iMovie
So, I use an elgato game capture to make videos and once edited on the elgato program i have to export the video over to iMovie. However this has not been working lately, but this is an issue on the elgato program. This program offers other export fo
-
Safari 3 and mail 3 in Leopard
I try to send a link in safari and it can't send. It says unable to locate mail application. I have re-installed the new mail program, and it still won't send a link or contents of the page. Any possible solutions?
-
My Macbook air charges fine with the Thunderbolt screen connection but only sometimes with the 45 W chargers. It seems to be the combination of the chargers and the computer. I was thinking whether the Thunderbolt screen has a larger power supply whi
-
Creative Labs sent me the email announcing that the X-Fi Xtreme Audio works withVista!
Why settle for basic, built-in sound? The ad asks.Wow look at all the specs...Speaker and Headphone connections for stereo to 7.Line In / Microphone In / Digital Out / Digital I/O / Auxiliary Line level Input?Wait a minute...this is the card I alread