Regarding Function module: function module change numeric to text
Hi ,
can any help me what is the function module used for : function module change numeric to text
suppose:
if i give :
Input: 11/12/2007
Output: 11 December 2007
What is the FM used for same?
Plz help me out
I'm not sure if there is a FM that will directly change Your date to the right format but You can write simple code to do this:
DATA: lv_subrc LIKE sy-subrc,
lt_month TYPE TABLE OF t247,
ls_month TYPE t247,
lv_odate TYPE string,
lv_ndate TYPE string,
lv_char1 TYPE char1.
lv_odate = '11/12/2007'.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = sy-langu
IMPORTING
return_code = lv_subrc
TABLES
month_names = lt_month
EXCEPTIONS
month_names_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT lt_month INTO ls_month WHERE mnr = lv_odate+3(2).
CONCATENATE lv_odate(2) ls_month-ltx lv_odate+6(4) INTO lv_ndate SEPARATED BY lv_char1.
ENDLOOP.
ELSE.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Similar Messages
-
Regarding the Remote Function Module
hi,
Can any body can provide the brief information regarding the Remote Function Module.
1)How to create the remote function module
2)how it differ from the normal function module
3)any special features about this.
Thanks in advanceHi
RFC (Remote Function Call) is similar to the general SAP fun module: except that in the attributes you click the radio button: RFC enabled;
and you will be passing an Import parameter DESTINATION to it.
Other code and usage will be similar to any fun module;
Have a look at any fun module in SE37 to understand better about the different components of Fun modules;
Refer this link:
http://help.sap.com/saphelp_nw04/helpdata/en/22/042518488911d189490000e829fbbd/frameset.htm
check out the following link it might help you
http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCFESDE2/BCFESDE2.pdf
Function Modules;
Check this matter.
Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
You can create them from TCode SE37.
Go through the following doc:
Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
Function Module Interfaces
The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
Syntax
... [IMPORTING parameters]
[EXPORTING parameters]
[CHANGING parameters]
[TABLES table_parameters]
[{RAISING|EXCEPTIONS} exc1 exc2 ...]
The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
Interface parameters
The interface parameters are defined on the relevant tab pages in the Function Builder.
IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
Exceptions
The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
Note
For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
RFC is a technology which is used to access a functions (Modules) from
the remote systems.
If a function module is set as remote enabled which can be access from
the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
But Normal function modules can not accessd from the remote system.
Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
CALLING A FUNCTION MODULE:
1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
--> Write the Corresponding FM name --> Hit Enter
2)The appropriate import ,export Parameters will be displayed in ur editor
3)Pass the Values Here.
Also check these links.
http://www.geocities.com/victorav15/sapr3/abapfun.html
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
See the following links:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
<b>Reward points for useful Answers</b>
Regards
Anji -
Function module for mass changes in Scheduling agreements in 4.7
Dear All,
Can any one tell me the function module for mass changes in Scheduling agreements in 4.7
Regards
MSRclosing question
-
Bapi's or function modules to create, change( delete) partner functions
Hi,
Can anyone suggest BAPI or Function Modules for creating , changing the Partner Functions of the customer
eg: To create customer XYZ as bill-to-party of customer ZYX , i need either a BAPI or Function Module.
Thanks in Advance,
SabuHi The following are the BAPI's to create and change the Partner Function.
BAPI_BUS2001_PARTNER_CHANGE_M
BAPI_BUS2001_PARTNER_CREATE_M
Regards
Vijay -
Function Module/Document to change Reversal date for FI document.
Can anyone please provide me with the Function Module/Document to change Reversal date for FI document.
Hi Vikram,
Normally, you post a reversing document in the same period you posted the original document. The period of the original document must be open to post a reversing document. If the period is not open, you can overwrite the posting date field with a date in an open period, such as the current period.
Regards,
Manoj. -
Is there any bapi/Function module to change only header text in fb02
Hi ,
I want to change only header text in FB02 .the header text will come from a internal table.My Requirement is
1. open a document in FB02
2.change the header text of the document.
Right now i'm doing this through an BDC.but i'm looking for a BAPI /FM.
I Tried bapi_acc_gl_posting_post, fI_document_change..
is there any BAPI/FM for this???
Thanks,
ChallaYou can use SAVE_TEXT FM
Thanks
Seshu -
Transporting Function Module & Function group
Hello All,
I want some clarification in transporting a FM, FG, Extract Structure.
First I collected Function Group in a Transport Request (R3TRFUGR********) and collected Function Module in the same request and also the extract structure.
This Function Group have only one Function Module and 4 Includes (LRSALK01, LRSAXD01, LZ_BI_DS_DATATOP, LZ_BI_DS_DATAUXX, RSAUMAC).
Do I need to collect these includes separately in the same request or is it enough if i collect only function group and function module and move the request.
Please let me know.
Thank you.Hi Saptrain,
the best is always to let the system handle it: As soon as you assign an object (function group, function module, include or whatever) to a package, it will ask for a transport. Create the transport and the transport management system will include in the transport what has to be transported.
As far as I know (but I never have the question), a function group (R3TR FUGR) will transport everything that is in the function group: All functions, all modules, all includes, screens, texts, status and...I think even test cases
You will find FUGR in the transport after creating the function group.
If you change something after releasing the transport, it will transport only the changed objects (i.e. includes)
Regards,
Clemens -
Problem to print Purchase Order created in RFC module function
Hi
I created a specific RFC function module for using in a BSP application. In this specific function module, I have created a Purchase Order (PO) thanks to the standard module "BAPI_PO_CREATE". The PO is well created but I don't manage to print immediately this PO but the spool is queued. Whereas using SE37, the PO is well created and printed.
But the customer wants to find the PO immediately in the printer
Do you know a simply way to solve my problem? I have the feeling that something is lost using RFC module function and the standard module function.
Thank a lot of for your reply
Regards
FrancoisThe issue may be because, its used in BSP application.
may be you need to implement whats explained in this weblog.
/people/thomas.jung3/blog/2005/08/23/bsp-server-side-printing-for-tableviews
Regards
Raja -
Module Function Name Resolution - Issues with DefaultCommandPrefix
Just getting started on module development, running PS4, and I've run into an... inconsistency... that I'm trying to understand. I've got two test functions, Get-Something and Set-Something in a script module. In my manifest file I specify a DefaultCommandPrefix
of 'Test'.
My issue is the function name resolution doesn't result in an executable result if you leave PowerShell up to it's own process.
To begin with I closed all sessions and deleted all files in the CommandAnalysis directory. After starting a session I waited for the CommandAnalysis cache to populate. Then I ran a series of test commands to illustrate how, most of the time, the function
name PowerShell registers with tab completion can't be executed because it lacks the 'Test' prefix. Even worse, much of the time tab completion won't recognize the correct (i.e., with prefix) name of the function and honor tab completion for it.
Having just learned of the CommandAnalysis cache I assumed I would see it change as PowerShell 'learned' more about the module because the name resolves differently over time. I've included three files at the end of this post, the module code (ModuleTest.psm1),
the manifest (ModuleTest.psd1) and the capture of output to the PowerShell session (ModuleTest.txt). I've tried to include the times I used <tab> and <ret> for tab completion and execution as well as (comments in parenthesis for things I did like
starting a new session and checking the CommandAnalysis cache for changes).
An example is, when first starting a session typing 'get-som<tab>' will resolve to 'Get-Something' (prefix 'Test' missing) and typing 'get-test<tab>' won't resolve to 'Get-TestSomething'. Try to execute the 'Get-Something' from tab completion
and you'll get the 'name not recognized, blah, blah'.
Now if you type 'get-som<tab>' PowerShell will resolve to 'ModuleTest\Get-Something' - looks promising... but no. Try to execute the 'ModuleTest\Get-Something' from tab completion and you'll still get the 'name not recognized, blah, blah'.
Even though the same key strokes resolved differently there were no changes made to the CommandAnalysis cache so I'm lost on why it produces two different (though equally useless) results.
Manually importing the module and sometimes running Get-Command -Module ModuleTest will make tab completion of the function names behave correctly. Is this a known issue with using DefaultCommandPrefix in script modules or is there something I need to include
in the manifest to enforce strict name recognition (including the prefix)?
<ModuleTest.psm1>
function Get-Something
Write-Host "Get-Something Executed"
function Set-Something
Write-Host "Set-Something Executed"
<ModuleTest.psd1>
# Script module or binary module file associated with this manifest
ModuleToProcess = 'ModuleTest.psm1'
# Version number of this module.
ModuleVersion = '1.0.0.0'
# ID used to uniquely identify this module
GUID = '241877ff-64be-40c8-a603-8d5acf7a48d8'
# Author of this module
Author = 'wb3'
# Company or vendor of this module
CompanyName = ''
# Copyright statement for this module
Copyright = '(c) 2015. All rights reserved.'
# Description of the functionality provided by this module
Description = 'Module description'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '2.0'
# Name of the Windows PowerShell host required by this module
PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
PowerShellHostVersion = ''
# Minimum version of the .NET Framework required by this module
DotNetFrameworkVersion = '2.0'
# Minimum version of the common language runtime (CLR) required by this module
CLRVersion = '2.0.50727'
# Processor architecture (None, X86, Amd64, IA64) required by this module
ProcessorArchitecture = 'None'
# Modules that must be imported into the global environment prior to importing
# this module
RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to
# importing this module
ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @()
# Modules to import as nested modules of the module specified in
# ModuleToProcess
NestedModules = @()
# Default command prefix
DefaultCommandPrefix = 'Test'
# Functions to export from this module
FunctionsToExport = '*'
# Cmdlets to export from this module
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module
AliasesToExport = '*'
# List of all modules packaged with this module
ModuleList = @()
# List of all files packaged with this module
FileList = @()
# Private data to pass to the module specified in ModuleToProcess
PrivateData = ''
<ModuleTest.output>
PS C:\Scripts\PowerShell> Get-ChildItem -Path 'C:\Program Files\WindowsPowerShell\Modules' -Recurse<ret>
Directory: C:\Program Files\WindowsPowerShell\Modules
Mode LastWriteTime Length Name
d---- 3/5/2015 9:06 AM ModuleTest
Directory: C:\Program Files\WindowsPowerShell\Modules\ModuleTest
Mode LastWriteTime Length Name
-a--- 3/5/2015 8:50 AM 2907 ModuleTest.psd1
-a--- 3/5/2015 9:01 AM 140 ModuleTest.psm1
PS C:\Scripts\PowerShell> Get-Module -ListAvailable<ret>
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
Script 1.0.0.0 ModuleTest {Get-Something, Set-Something}
PS C:\Scripts\PowerShell> get-som<tab>
PS C:\Scripts\PowerShell> Get-Something<ret>
Get-Something : The term 'Get-Something' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-Something
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-Something:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
(No change in CommandAnalysis cache)
PS C:\Scripts\PowerShell> get-som<tab>
PS C:\Scripts\PowerShell> ModuleTest\Get-Something<ret>
ModuleTest\Get-Something : The term 'ModuleTest\Get-Something' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ ModuleTest\Get-Something
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (ModuleTest\Get-Something:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
(No change in CommandAnalysis cache)
PS C:\Scripts\PowerShell> get-tes<tab>
PS C:\Scripts\PowerShell> Get-TestSomething<ret>
Get-Something Executed
(New Session)
(No change in CommandAnalysis cache)
PS C:\Scripts\PowerShell> get-tes<tab><ret>
get-tes : The term 'get-tes' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ get-tes
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-tes:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Scripts\PowerShell> Import-Module ModuleTest<ret>
(No change in CommandAnalysis cache)
PS C:\Scripts\PowerShell> get-tes<tab><ret>
PS C:\Scripts\PowerShell> Get-TestSomething
Get-Something Executed
(New Session)
(No change in CommandAnalysis cache)
PS C:\Scripts\PowerShell> get-tes<tab><ret>
get-tes : The term 'get-tes' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ get-tes
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-tes:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Scripts\PowerShell> Get-Command -Module ModuleTest<ret>
CommandType Name
ModuleName
Function Get-TestSomething
ModuleTest
Function Set-TestSomething
ModuleTest
(No change in CommandAnalysis cache)
PS C:\Scripts\PowerShell> get-tes<tab>
PS C:\Scripts\PowerShell> Get-TestSomething<ret>
Get-Something Executed
PS C:\Scripts\PowerShell> moduletest\get<tab><ret>
PS C:\Scripts\PowerShell> Get-TestSomething<ret>
Get-Something Executed
William Busby, PMPHi William,
yes, that's something you'll either have to do the hard way or live with admin confusion.
If you're using Sapien's PowerShell Studio as an Editor (hint: Usually a great idea), you can very easily rename a function, even in a multi-file module project, by rightcklicking on the function-name and selecting "rename".
Alternatively you can do a bulk rename with Powershell:
Get all functions in your module (Load it and check exportedcommands)
loop over each function-name
calculate new name
search your entire project for all references and replace them.
Let me see ...
function Rename-ModulePrefix
[CmdletBinding()]
Param (
[Parameter(Position = 0, Mandatory = $true)]
[string]
$ModuleName,
[Parameter(Position = 1, Mandatory = $true)]
[string]
$OldPrefix,
[Parameter(Position = 2, Mandatory = $true)]
[string]
$NewPrefix,
[Parameter(Position = 3)]
[string]
$Path
# Catch all typos
Import-Module $ModuleName -ErrorAction 'Stop'
# Get root path if not manually passed
if (-not $PSBoundParameters["Path"])
$Path = (Get-Module $ModuleName).Path
# Get module files
$Files = Get-ChildItem -Path $path -Recurse -Include "*.ps1", "*.psm1", "*.psd1"
# Iterate over each file
foreach ($file in $Files)
# Null variable in case you get an empty file somewhere and run this from Win 7
$data = $null
# Get Content of file
$data = Get-Content $file
# Replace strings
foreach ($c in (Get-Module $ModuleName).ExportedCommands)
$newName = $c.Name -replace $OldPrefix, $NewPrefix
$data = $data | ForEach-Object { $_ -replace $c.Name, $newName }
# Write back to file
$data | Set-Content $file
While I didn't proof it, in theory this should do it (Make a backup before running it :) ).
Cheers,
Fred
There's no place like 127.0.0.1 -
PS Module: Function to Copy Standard Network
Hi,
Anybody knows of a function where I can copy values of a standard network in Project Systems module?I'm not a ABAPer but I'll suggest you to debug the program SAPLCOKO and look at the functional modules (Function groups) that are involved.
Mentioned program belongs to Transaction CN41 -Create Network where you can create a network copying a standard network.
Hope this helps!
Regards
Sreenivas
Pls close the post if satisfied. -
Disabled property: enable two Application Module functions
I am using jdeveloper 11.1.1.5 and problem I am facing is:
I want to call two different Application Module functions on one button click. Button is existing on .jspx. For that purpose I have to use Disabled property of button to enable the Application Module functions. Please tell me how to enable both of the functions by using the Disabled property of button.
Thanks,
Regards
Muddasar AminHi Ashwin,
Is this the problem only with Application module methods? Can you try with managed bean methods?
Also, do you have this commandButton enclosed within <af:form>/<af:subform> ?
Regards,
Ansh -
ABAP Unit for Function Module(Function Group)
Hi, Gurus:
Can we use ABAP Unit to test Function Module(Function Group).
If can, give me a simple example. how to create methods. Thanks.
Regards,I'm a little unclear about your question, Yunfa.
Do you want to single-test a SE37 function-module? This can be easily done, just hit the F8 button, and it takes you to a single-test environment.
Do you want to test an FM using an ABAP-program? This too is easy to do. To code the FM-call, there's a button called Pattern, in the standard SE38 screen, where you can put in your FM name, and it inserts the relevant code in your program.
Note that if you're testing BAPIs using the single-test environment, the actual document posting will not happen, because that requires a BAPI_COMMIT_WORK call. So, the way to test BAPIs which post documents would be to write an SE38 program, which also calls the commit-bapi.
Hope this answers your question! -
Call of a query bex from a module function BW
Hi,
I have to perform call of a query BEX from a BW module function
Is there a way to perform this call ?
Thanksits possible, but what are you going to do with the result
options: 1. use FM RRW3_WEBRFC
this will return results in HTML format
option: 2 use my custom FM which will return results in xml format
/people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
option 3: use FM RRW3_GET_QUERY_VIEW_DATA
you have to handle the return data to get it in two dimensional format
Regards
Raja -
Calling fortran module functions from c++
I am compiling a Fortran module with the Sun Studio Fortran compiler. The functions from this module shall be called from a C++ program. I have a name mangling problem when trying to compile or link. Actually it seems that Fortran provides names like 'module.function_' as can be seen when using nm. Putting this definition into the extern "C" statement makes the C compiler stop. After some excessive googling I found the possible bind(C) function, but this is actually not a valid option since I have not written the Fortran module myself and the solution should be somewhat compatible to other x86 compilers (here: Intel, which works fine for the name mangling)
What is now the best option to use the Fortran module in the C++ program using Sun Studio?
Cheers,
Sebastian
Sun Fire E6900
Sun Studio 12.1Sebastianm
You do not have to change the calls; you only have to change the declarations of the function in the module to add bind(c,name="whatever). In addition, you will need to recompile the rest of the Fortran code that uses the module so that
the new bind(C) names are used in calls.
Adding a call to the module function for the above example:
subroutine use_example
use example
call print_hello()
end subroutine use_example
% f90 -fast -c use_example.f
% nm -og use_example.o
use_example.o:
[Index] Value Size Type Bind Other Shndx Name
[24] |000000000000|000000000000|FUNC |GLOB |0 |UNDEF |Example_print_hello
[23] |000000000000|000000000013|FUNC |GLOB |0 |2 |use_example_
As you can see, the compiler generates a call to Example_print_hello for the call to the module function print_hello,
as this is the name specified in the bind(c) for example.print_hello, i.e., bind(C, "Example_print_hello").
If you do not want to change the module at all, you might have some luck with *elfedit* to change the external
names after the .o is produced. I suspect that doing this is as much work as adding BIND(C) to the declarations.
Good luck and please let me know if this works for you.
Diane -
Globale interface in module function
hi
please ,
I like to see in source code before importing parametrs the sentance " globale interface" in source code of Module function , instead of 'local interface'.
have you ever seen that?
like this.
FUNCTION Z_SPLIT_LONG_TEXT.
***""Globale interface:***
*" IMPORTING
*" VALUE(LIMIET) LIKE ZSPLIT-LIMIET
*" TABLES
*" TE_SPLITSEN STRUCTURE TLINE
*" GESPLITST STRUCTURE ZSPLITYes, of course. Most of you have used function modules, and know that alot of times, you will have separate includes for your FORM routines. Well, if the interface is local, then your FORM routines will not have access to these parameters, you would need to pass these parameters using FORM parameters. If you would set the parameters as global, then they are visible to any/all FORM routines that you declare within the function group. If you think about it, it really is not a good practice to globalize your parameters( good design calls for keeping things as local as possible ), which is why this feature has bee deemed obselete.
Regards,
Rich Heilman
Maybe you are looking for
-
Error 7 (windows error 126) when installing itunes
I cannot re-install or update itunes on my Windows Vista os. I get errors and a missing dll message. It worked fine until about a week ago when I tried to update, due to an update notice. Any hints? I have tried uninstalling and reinstalling seve
-
Mass deletion of parked LIV invoices
Hey Guys: I want to Mass delete the parked EDI LIV invoices. I have implemented note <b>971193 - FIPP: Mass deletion of parked documents</b> which is pulling data from FBV0...which is not the place where parked EDI LIV invoices are in. I have found a
-
Deserialization failure when using JWS
Hi folks, I have an application which works fine without being launched from JWS, but when I tried to use JWS to open it, it somehow failed a critical deserialization procedure in my program. This happens inside a thread: public void run(){ XMLDecode
-
Get hit count of a page or a dashboard (usage tracking)
hi, experts, I found that I can get the query count (using count(*)) from usage tracking. but is it possible to get the hit count on a particular tab page or on a particular dashboard? not the query count on a page or a dashboard. thank you very much
-
BT cordless phone battery rating and use as a char...
Hello, Can I use any mAh rating of rechargeable batteries in my cordless phone? Can I use my phone as a general battery charger? I've got two old cordless phones in use, the main one is a Bt Esprit 1250 (takes AAA batteries) and the spare a BT Divers