Functions Used in SAP XI
Hi,
Good Noon,
I want to understand all the functions with detailed example like TEXT,NODE,USER DEFINED,ARITHMETIC,STATIC,DATE,CONSTANTS,BOOLEAN.
Regards,
Komik Shah
Hi,
These Blogs discuss some of the standard functions used...
Have a loog at this...
<a href="/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i Mapping Simplified - Part 1</a> by Sravya Talanki
<a href="/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii Mapping Simplified - Part II</a> by Sravya Talanki
<a href="/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13 Functions in the Graphical Mapping Tool SP13</a> by Stefan grube's
Apart from this also have a look at this pdf...
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638">Mapping Funcationality</a>
Regards
Santhosh
Remember to set the thread to solved when you have received a solution
[url=Use a Good Subject Line, One Question Per Posting - Award Points; Use a Good Subject Line, One Question Per Posting - Award Points[/url]
Similar Messages
-
What are the different functions used in sap script?
Hi,
What are the different functions used in sap script? What are the parameters used in each Function?
Regards,
Maheshhe print program is used to print forms. The program retieves the necesary data from datbase tables, defines the order of in which text elements are printed, chooses a form for printing and selects an output device and print options.
Function modules in a printprogram:
When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine forms into a single spool request use START_FORM and END_FORM.
To print textelements in a form use WRITE_FORM. The order in which the textelements are printed, is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you can also use the WRITE_FORM_LINES function module.
To transfer control command to a form use CONTROL_FORM.
Structure of a print program
Read data
Tables: xxx.
SELECT *
FROM xxx.
Open form printing - Must be called before working with any of the other form function modules.
Must be ended with function module CLOSE FORM
call function 'OPEN_FORM'.....
To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM
call funtion 'START_FORM'.....
Write text elements to a window of the form
call function 'WRITE_FORM'.....
Ends spool request started with START_FORM
call funtion 'END_FORM'.....
Closes form printing
call function 'CLOSE_FORM'...
OPEN_FORM function
Syntax:
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = ' '
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Some important parameters:
FORM Name of the form
DEVICE
PRINTER : Print output using spool
TELEFAX: Fax output
SCREEN: Output to screen
OPTIONS Used to control attrubutes for printing or faxing (Number of copies, immediate output....
The input for the parameter is structure ITCPO.
CLOSE_FORM function
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Paramerters:
RESULT Returns status information and print/fax parameters after the form has been printed. RESULT is of structure ITCPP.
WRITE_FORM function
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Some important parameters:
ELEMENT Specifies which textelement is printed
WINDOW Specifies which window is printed
TYPE Specifies the output area of the main window. This can be:
TOP - Used for headers
BODY
BOTTOM - Used for footers
FUNCTION Specifies whether text is to be appended, replaced or added
Example of how to use the WRITE_FORM function module together with a script.
Form layout of the MAIN window
/E INTRODUCTION
Dear Customer
/E ITEM_HEADER
IH Carrier, Departure
/E ITEM_LINE
IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
/E CLOSING_REMARK
The print program
Writing INTRODUCTION
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'INTRODUCTION'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Writing ITEM_HEADER
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Set ITEM_HEADER into TOP area of main window for subsequent pages
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'TOP'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Write ITEM_LINE
LOOP AT .....
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_LINE'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8.
ENDLOOP.
Delete ITEM_HEADER from TOP area of main window
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'DELETE'
TYPE = 'TOP'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Print CLOSING_REMARK
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'CLOSING_REMARK'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
START_FORM function
CALL FUNCTION 'START_FORM'
EXPORTING
ARCHIVE_INDEX =
FORM = ' '
LANGUAGE = ' '
STARTPAGE = ' '
PROGRAM = ' '
MAIL_APPL_OBJECT =
IMPORTING
LANGUAGE =
EXCEPTIONS
FORM = 1
FORMAT = 2
UNENDED = 3
UNOPENED = 4
UNUSED = 5
SPOOL_ERROR = 6
OTHERS = 7
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END_FORM function
CALL FUNCTION 'END_FORM'
IMPORTING
RESULT =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SPOOL_ERROR = 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.
CONTROL_FORM function
The CONTROL_FORM function module alows you to create SapScript control statements from within an APAB program.
Syntax:
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command =
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Example:
Protecting the text element ITEM_LINE
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'PROTECT'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
TEXELEMENT = 'ITEM_LINE'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'ENDPROTECT'. -
Using Standard SAP Tables in SAP Tables, clusters or functions connections
Hi Gurus,
I am trying to use Standard SAP table like MARA, MAKT.. etc. in my crystal designer. When i make a new connection using SAP tables, Cluster or Functions, these tables are not listed.
Any configuration i have to maintain to list those standard table.?
With Regards,
Balachander.SDue to performance reasons there is a limitation regarding the number of the dispplayed table names. Once you are in the connection/table browser select a table and invoke the context menu by pressing the right mouse button. Select Options and in the options panel you can use wildcards in order to limit the results to the desired range (eg. use MA% to get a list of tables starting with MA). After you close the options panel press F5 and expand the connection entry again.
Regards,
Stratos -
Using Function Module in SAP Script
Dear Friends,
how can i use function modules in sap scripts?. i want to use call function SPELL_AMOUNT in sap script?
in text element using perform statement hw can i use?
Regarding i search related articles but, i am not getting any solution.
Plz help Me.
Regards,
K.S.KannanDear Kanan,
You can do it in two ways:
Way1
your Amount will be in some variable say VAR_AMT1 and want in words in field say VAR_SPELL.
In your report program you can use the function module SPELL_AMOUNT and pass the VAR_AMT1 to it and you will get the words in VAR_SPELL.
So now in your sap script you can use the variable VAR_SPELL to print the amount in words.
we normally use this above method.
WAY2
You are inside Sap script and you can write the following code in the sap Script window.
/: PERFORM AMT_TEXT IN PROGRAM ZF_REPORT USING &VAR_AMT1& CHANGING &VAR_SPELL&
/: ENDPERFORM
In the Tag Column when you press F4 you can see various symbols like
/: = ( / /= /( /: /* /E
. Select
In the program ZF_REPORT (any report) you should have the perform AMT_TEXT where you should use the function module SPELL_AMOUNT to convert the amount into words.
Hope its Clear. -
Sap function used in crystal- date parameter issue
have a function developed in sap and it is using date parameters in the function
i can run the function in sap and retrieve records
when i create a report from the function and create my date parameter to use in the record selection
and i enter my parameter values to run the report, it doenst retrieve any records
i have hardcoded dates
i am using this in the record selection
if hasvalue({?Run Date}) then {?Run Date} else currentdate
any ideas?Actually, what are you returning? In your record selection, what date are you trying to filter? Set your formula equal to whatever you want to return in the report:
if (not hasvalue({?Run Date})) then REPORT FIELD = currentdate else REPORT FIELD = {?Run Date} -
How to code a predifined function module in sap ,in se37.
can any one tell me how to code a predifined function module in sap ,in se37.it's an immediate requirement.if u give a brief description it'll do.
Hi Henry,
There are two possible ways in which I can interpret your question.
1. You want to create a new Function Module in SE37. you will have to refer to the <a href="http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e9a454211d189710000e8322d00/frameset.htm">Function Builder</a> tutorial for that.
2. You want to use an existing function module in your program. In the code of your program in SE38, click the button <i>Pattern</i>. On the pop-up, give the name of the function module that you wish to use in your program.
Regards,
Anand Mandalika. -
How to develope custom function modules in SAP R/3 system to maintain c...
How to develope custom function modules in SAP R/3 system to maintain cross
referencing tables for sales order number.Hi Raja,
Steps to crate FM..
Follow these steps..
Go to the T: code SE37
First You Create Function Group
On That u specify
Function Group Name..............
Short Text..............................
save...
Go to SE 37
Specify the Function Module Name: Eg: Z_Bapi_Materialmaster
Short Text.......
Save...
Next Go to Attributes..
Select Radio button : Remote enabled model
Go to Parameters..
Click Import...
Give Parameter Type Associate type S.t
next Click Export...
Give Parameter Type Associate type S.t
Next Click Tables Button..
Specify tables..
Next click source code button..
Write Source code here..
Eg : Select statements Etc..
Finally we should be select the Radio button Enable remorely
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/bapi%2bstep%2bby%2bstep
Hope this information is useful to you..
Reward points if it is usefulll....
Thanks ,
Satya Kumar.. -
Can i call a function module of SAP?
Hi, i have a question... Can i call a function module of SAP... I need print a document from a device, can i call the function module of SAP in order that me it prints it?
Thanks,Hi Victor,
you can use the GenericSync Example of the MDK. This calls the Module to verify the user directly. Generic Sync is exactly for that purpose: call a BADI directly and no usage of SyncBO. Be aware, that you - out of the box- sync your app data as well at that moment, because a sync runs both - generic and smartsync. Even worse: even when you have nothing to sync in Generic Sync - so nothing to print - it will call the function module for generic sync as long as it is registered.
Well, anyway, this is the way to call a function module separate.
If it works with you rparticular print module? I have no idea, but if this is a normal function module - well, it should be ok.
Hope this helps.
Regards,
Oliver -
Possibility to execute Acrobat Pro's "Combine files into PDF" function from within SAP?
Good day.
Presently, a company uses Acrobat Pro to manually combine files such as *.pdf, *.jpg, *.doc, which have been downloaded from SAP's Document Management System, into one pdf file. I would like to know if it is possible to automatically execute Acrobat Pro's "Combine files into PDF" function from within SAP (ECC 6.0) application system. I'm wondering if this could be achieved from a program via OLE (Object Linking and Embedding) or RFC (remote function call).
Thanks in advance for your thoughts and inputs.Yes, you can combine PDF files via IAC/COM methods.
-
Error in UseOneAsMany Function Error in SAP XI
Error in UseOneAsMany Function Error in SAP XI
Hi Experts,
I am trying the Example of function UseOneAsMany. My Input and Output XML Files are provided below:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_MM4 xmlns:ns0="http://test/mapping.test">
<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
</Header>
<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<MatGroup>MatGroup1</MatGroup>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<MatGroup>MatGroup2</MatGroup>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</ns0:MT_MM4>
My Expected Output should be :
<?xml version="1.0" encoding="UTF-8"?>
-<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup1</MatGroup>
</Header>
-<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup2</MatGroup>
</Header>
-<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</ns0:MT_MM4R>
But for me Headers are coming first and then followed by two items. Please let me know how to solve the issue and also please provide the explanation.
Thanks,
GIRIDHARHello,
Change ur structure little bit (add parent node "Record") and then use java mapping pasted in below blog to remove Record node to get ur desired structure.
File Conversion using 'Nodeception'
<?xml version="1.0" encoding="UTF-8"?>
-<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
<Record> --- 0..Unbounded
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup1</MatGroup>
</Header>
-<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
</Record>
<Record>
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup2</MatGroup>
</Header>
-<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</Record>
</ns0:MT_MM4R>
Thanks
Amit Srivastava -
Use of SAP DMS & SAP Archive Link both together
Dear DMS Experts,
I am little bit new to DMS and have very less idea about functionalities and capabilities of SAP DMS & Archive Link.
I have got few questions:
1. Is it possible to use both SAP DMS & SAP Archive link togther.
For example, there are certain objects like GRN, Invoice, Employee etc which are not supported in standard DMS.
However, they are supported in archive link.
But at the same time, there is requirement of setting and resetting of some statuses of the documents attached with PM notification or with PR / PO. This functionality is available with SAP DMS.
So I want to know, is it possible to use SAP archive link for few objects and SAP DMS for other objects.
2. In case of SAP archive link configuration, we need to define link between Object Type, Document type and content repository
in node "Edit Links" under "Basic Customizing" under "ArchiveLink".
Here we can not use all the content repository which we have created normally. But we can use only limited content repository ID.
How does system decides, which content repository id can be used.? Where can i define that.?
3. With SAP archive link, can i store my documents in the same content repository in which I am storing my all the documents with SAP DMS. I mean to say, both the SAP DMS & Archive link, can share the same content repository.
We are having a seperate content server and requirement is to store all the documents in content server only.
Would request you all to please help.
Thanks & Regards,
Mihir Popat..is it possible to use SAP archive link for few objects and SAP DMS for other objects...
Yes,you may use Archivelink for static documents that would be required purely for reference while DMS can be configured to handle documents that are more dynamic in nature (that require status change,version,revisions et-al)
..both the SAP DMS & Archive link, can share the same content repository.We are having a seperate content server and requirement is to store all the documents in content server only...
Yes,you may store DMS and Archivelink documents can reside on the same Content Server.Content repository is a logical area/partition,hence you may create one content repository for DMS and another for Archivelink(on the same Content Server).
Regards,
Pradeepkumar Haragoldavar -
Function call in SAP GUI with errors
Dear All,
When i am calling FM of Comports using OLE Integration i got " Function call in SAP GUI with errors" error
now my front end version is 6.40. how to solved this problem.
In my Function Module i am creating object like this
CREATE OBJECT O_OBJ 'MSCOMMLib.MSComm.1'.
IF SY-SUBRC <> 0.
RAISE NO_CREATE_OBJECT.
ENDIF.
it raised the sy-subrc = 2 this error is "Function call in SAP GUI with errors"
send to me how to handle this error.
Thank,
Vijay.gHi Vijay,
We are facing the same issue.
Interestingly
From program's code only we are facing this issue.
If we display the program and Execute (Direct processing), it is working fine.
Can you please share how you resolved this issue.
Thanks
Sreedhar -
Is ABAP expression FORM - PERFORM can be used in SAP BI 7.0 transformation
Hello
Is ABAP expression FORM - PERFORM can be used in SAP BI 7.0 transformations or method odf class is a recommended approach?
ThanksSAP BI 7.x Transformations use OO ABAP where the logic that you enter into the tranformational routines (Start Routine, Characteristic Routines and End Routine) are inside METHODS. PERFORM and FORM are procedural-based ABAP and cannot be used in METHODS.
CLASS-METHOD and Function Modules are your best bets for processing outside of the transformational routine. As for performance, we use both and haven't found any signicant difference between the two (our custom Function Modules usually perform only slight better than our custom METHODS). -
Cross-company code functionality using Idoc type FIDCCP02
Hello,
I have a problem I need to use an IDoc to create incoming invoices from a legacy system, but there are 2 functionalities that need to exist.
1.- Extended withholding taxes.
2.- Cross-company code.
I have been using the basic type FIDCCP02, because it was easy to use extended withholding taxes.
But now the functional team requested us to implement the functionality Cross-company code.
I did some test using ACC_INVOICE_RECEIPT03, where just specifying 2 different company codes at item level, SAP will create 2 different invoices one for each company code) ,
The problem here is that I need both functionality, but only use 1 Idoc type. Do you know how can I solve this problem??Imelda ,
I am also trying to use FIDCCP02 Idoc for Cross-Company code functionality , and we are not able to do it ..
I saw this message in SDN posted by you last year but it was not answered , hence was wondering if you were at some point of time able to get any answer on this one OR did you find any solution by yourself on this issue.
I would also like to use Cross-company code functionality using FIDCCP02 , so please let me know if you have anything on this one .
Would appreciate your reply .
Thanks,
Ashutosh Chitrao -
Hi Experts
how to use function module in sap pi using soap adapter?
My senario is soap to soap using function module?
can you tell me any one step by step procedure
REGARDS
SAGARAs this looks like a mapping error - please check if the error has been thrown before reaching the SOAP receiver and format of the input data you are posting. You may want to check at he following link for exposing rfc as webservice.
http://scn.sap.com/docs/DOC-38805
Regards
Maybe you are looking for
-
How does this IMPORT statement works
can any one tell me how does this statement will work.. I am wokring on Solution manager system , where in there is a function module SSF_FIELD_LIST to which system passes form name. import fields to fieldlist from database stxfcontr(sf) i
-
I got a first generation ipod and i friend of mine borrowed it and added some apps but now when i try to add apps they wont show up on the ipod but it says it syncs
-
Good Day, I am currently using a PXI-6251 module and I need to measure Phase Angle between two sinusoidal waveforms. I have done a lot of searching and can not find much. If anyone is able to help I would appreciate it. TIA, TomJr
-
DEFAULT TRANSLATION: CHANGE
Hello We need to change some default translation in the portal, e.g. we need to change the spanish translation of "Give feedback" option we've included in some KM navigation iViews. Does anybody know where are these default translations defined? Than
-
I am having problems with my ipad2. It shows I have 4 updates but when in click to go to these updates the screen is blank. I have tried reboot, reset, logging out, etc and nothing works.....my iphone is working ok! Help!