How to use functions in Message Mapping
Hi All,
I am new to SAP XI. I don't know how to use functions in message mapping. Can any body tell me how to use IF condition in message mapping.
Please provide me a good link where I can get the details how to use those functions.
Thanks,
Srinivas.
HI Srinivas
Please take a look at these links,
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
This will help you
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/190eb190-0201-0010-0ab3-e69f70b6c257
http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/a8/bfc6373c8fea43bdb3541535bcbd43/frameset.htm
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
This will give you a detailed Idea about Context
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95f835c111d1829f0000e829fbfe/frameset.htm
This will give more explanation on Queue
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/51a39490-0201-0010-5b9f-ae21e8b78195
For understanding node functions this blog will help you
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
Not sure you can find a collection of all...
Cheers..
Vasu
<i>** REward Points if found useful **</i>
Similar Messages
-
How to use Variable in message mapping
Hi Experts,
I have some problem using variable in message mapping.
In one message mapping, since a block of logic is repeated for several fields, then i tried to use a variable instead.
the repeated logic is: first if condition, then use a udf to form a queue which will be suppressed by its father node.
i tried to assign the result queue to a variable after the UDF execution. (this variable is created after the father node)
I am wondering is there any restriction of using variable?
Can we assign the whole queue to a variable?
Can we use UDF during the process of assigning value to variable?
thanks in advance.I dont think you can assign a queue to a variable,I am not 100% sure, . and there is no restriction to useing a Zvariable, only u can use it after you declare at some parent level.
Yes you can use a UDF in the process of assigning to a Zvariable.
Check out this link and read the comments of the blog.
SAP PI 7.1 Mapping Enhancements Series: Using Graphical Variable
/people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
Edited by: Saiyog Gonsalves on Nov 6, 2010 6:40 PM -
How to use functions in OWB (mapping/mapplet/pluggable)
Hi all,
we haev developed some sql code for populate data into respective tables. currently we are building mappings to populate data with help of sql code which we created earlier.
1> in sql code we have called some functions to populate some columns. in owb how do we call functions and which is the best way to do eigther mapping or mapplet/pluggable level.
we have to pass in put parameter to functions like MONTH,REGION,OFFICE,FINACIAL YEAR like that.
in owb how do we pass.
please find the code.
insert into con_gdpi2
SRNO,
REGION,
OFFICE,
MONTH,
FINANCIAL_YEAR,
DEPT_NAME,
DEPT_CODE,
POL_CAT,
TOT_PREM_UPTO,
PUB_SEC_PREM_UPTO,
ORG_DIR_PREM_UPTO,
ORG_IND_AGENT_PREM_UPTO,
ORG_CORP_PREM,
ORG_BROKER_PREM_UPTO,
ORG_BANKASSURANCE_PREM_UPTO,
ORG_REFERRAL_PREM_UPTO,
TIED_SEC_PREM,
OTH_SEC_PREM
select
seq_gdpi2.nextval,
gdpi2.REGION,
gdpi2.OFFICE,
gdpi2.MONTH,
gdpi2.FINANCIAL_YEAR,
gdpi2.DEPT_NAME,
gdpi2.DEPARTMENT_CODE,
'-' pol_cat,
gdpi2.TOTAL_PREMIUM_UPTO,
gdpi2.PUBLIC_PREM,
gdpi2.DIRECT,
gdpi2.IND_AGT,
gdpi2.CORPORATE,
gdpi2.BROKER,
gdpi2.BANKASSURANCE,
gdpi2.REFERRAL,
gdpi2.TIED,
OTHER_SEC_PREM_FOR(to_char(MONTH),to_char(FINANCIAL_YEAR),DEPARTMENT_CODE,OFFICE) as OTHER_SEC
from
dual,
(select temp1.REGION
,temp1.OFFICE
,temp1.DEPT_NAME
,temp1.DEPARTMENT_CODE
,temp1.FINANCIAL_YEAR
,temp1.MONTH
,sum(temp1.TOTAL_PREMIUM_UPTO) TOTAL_PREMIUM_UPTO
,sum(temp1.IND_AGT) IND_AGT
,sum(temp1.BROKER) BROKER
,sum(temp1.CORPORATE) CORPORATE
,sum(temp1.BANKASSURANCE) BANKASSURANCE
,sum(temp1.DIRECT) as DIRECT
,sum(temp1.REFERRAL) REFERRAL
,sum(temp1.TIED) TIED
,sum(temp1.PUBLIC_PREM) PUBLIC_PREM
from
(select temp.REGION
,temp.OFFICE
,temp.DEPT_NAME
,temp.DEPARTMENT_CODE
,temp.FINANCIAL_YEAR
,temp.MONTH
,temp.policy_id
,sum(temp.TOTAL_PREMIUM_UPTO) TOTAL_PREMIUM_UPTO
,case when sum(temp.DIRECT) = 0 then sum(temp.IND_AGT) else 0 end as IND_AGT
,sum(temp.BROKER) BROKER
,sum(temp.CORPORATE) CORPORATE
,sum(temp.BANKASSURANCE) BANKASSURANCE
,sum(temp.DIRECT) as DIRECT
,sum(temp.REFERRAL) REFERRAL
,sum(temp.TIED) TIED
,sum(temp.PUBLIC_PREM) PUBLIC_PREM
from
(select
substr(at.ATN_VOUCHER_NUMBER,1,2)||'0000' as REGION
,substr(at.ATN_VOUCHER_NUMBER,1 , 6) as OFFICE
,(case when aa.ACC_DEPARTMENT_CODE=31 then 'Motor'
when aa.ACC_DEPARTMENT_CODE=32 then 'Motor T.P'
when aa.ACC_DEPARTMENT_CODE=39 then 'Motor T.P.Pool'
end) as DEPT_NAME
,aa.ACC_DEPARTMENT_CODE as DEPARTMENT_CODE
,t.FISCAL_YEAR as FINANCIAL_YEAR
,'AUGUST' as MONTH
,pp.policy_id
,case when pp.STAKE_HOLDER_ID = 2 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as TOTAL_PREMIUM_UPTO
,case when pp.STAKE_HOLDER_ID = 3 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as IND_AGT
,case when pp.STAKE_HOLDER_ID = 46 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as BROKER
,case when pp.STAKE_HOLDER_ID = 517928030012008 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as CORPORATE
,case when pp.STAKE_HOLDER_ID = 544821913052008 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as BANKASSURANCE
,case when pp.STAKE_HOLDER_ID = 544472422042008 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as DIRECT
,case when pp.STAKE_HOLDER_ID = 544885218052008 then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as REFERRAL
,case when org.BUSINESS_TYPE like 'Block/Tied Business%' then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as TIED
,case when org.BUSINESS_TYPE like 'Public Sector Business%' then (atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT ) else 0 end as PUBLIC_PREM
from
accounting_transaction at
,accounting_trn_detail atd
,account aa
,account bb
,POLICY_PARTY pp
,time t
, (select * from organization_policy_holder where effective_end_date is null) org
where
at.ATN_ACCOUNTING_TRANSACTION_ID = atd.ATN_ACCOUNTING_TRANSACTION_ID
and atd.ACC_ACCOUNT_ID = aa.ACC_ACCOUNT_ID
and aa.ACC_ACC_ACCOUNT_ID = bb.ACC_ACCOUNT_ID
and bb.ACC_ACCOUNT_TYPE = '1101'
and at.POLICY_ID = pp.POLICY_ID
and at.policy_id is not null
and pp.party_id=org.org_policy_holder_id(+)
--and bb.ACC_GL_CODE like '%.130700%'
--and t.MONTH_NAME= 'AUGUST'
and trunc(at.ATN_TRANSACTION_DATE) between '1-APR-2008' and '31-AUG-2008'
and t.CAL_DATE = trunc(at.ATN_TRANSACTION_DATE)
and pp.policy_party_id in
( select max(pp1.policy_party_id) from policy_party pp1
where pp.POLICY_ID = pp1.POLICY_ID and pp.STAKE_HOLDER_ID = pp1.STAKE_HOLDER_ID
group by
pp1.policy_id
,pp1.stake_holder_id
)temp
group by temp.REGION
,temp.OFFICE
,temp.DEPT_NAME
,temp.DEPARTMENT_CODE
,temp.FINANCIAL_YEAR
,temp.policy_id
,temp.MONTH)temp1
group by temp1.REGION
,temp1.OFFICE
,temp1.DEPT_NAME
,temp1.DEPARTMENT_CODE
,temp1.FINANCIAL_YEAR
,temp1.MONTH
)gdpi2;You have to create first your function in OWB :
Database / Oracle / Your module / Transformation / Functions
Then in a mapping, use an expression operator :
* drag and drop the column that you want for our function in the ingroup
* double click on the expression operator : add an output variable, closed the operator windows
* click on your outpuy variable and then click in the expression field of the attributes properties (on the left)
* enter your expresson :
OTHER_SEC_PREM_FOR(to_char(MONTH),to_char(FINANCIAL_YEAR),DEPARTMENT_CODE,OFFICE)* connect your output attributes to your target table
Success
Nico -
How to use result of message mapping as source to another message mapping
Hi.
I need to map iDoc to MT_A (MessageType) using MessageMapping.
And then using the result of the above mapping, map MT_A to MT_B using JavaMapping.
Can I do this all at once in my scenario or what is the best way to do this?
Regards,
HjorturHi,
chk this:
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Ur flow will be something like this under operation mapping :
1) Graphical mapping( iDoc to MT_A)
2) Java mappinmg.(MT_A to MT_B)
Thanks
Amit -
How to Use Function Module READ_TEXT
Hi
Anyone give me code or link or example for how to use function module READ_TEXT
and what are the parameters which we have to pass in module.
Regards.
MohsinHi,
refer the given below code.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = 'KOPF'uF0E0 these details we will get thru transaction , where we enter these details.
language = 'EN'uF0E0 these details we will get thru transaction , where we enter these details.
name = TNAME "table name
object = 'AUFK' " these details we will get thru transaction , where we enter these details.
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
IMPORTING
HEADER = HTEXT
tables
lines = LTEXT
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks
Arun -
How to use function:MLApp_DIMLAppPutWorkspaceData?
how to use function:MLApp_DIMLAppPutWorkspaceData?
MLApp_DIMLAppPutWorkspaceData is a function of MATLAB ACTIVE
在LABWINDOWS/CVI调用MATLAB的控件生成的函数有下面一个
MLApp_DIMLAppGetWorkspaceData (CAObjHandle objectHandle,ERRORINFO *errorInfo,const char *name,const char *workspace,VARIANT data);
在使用过程中应该如何用?
定义了一个VARIANT *DATA=NULL,无法获得数据,应该如何处理?Hi,
refer the given below code.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = 'KOPF'uF0E0 these details we will get thru transaction , where we enter these details.
language = 'EN'uF0E0 these details we will get thru transaction , where we enter these details.
name = TNAME "table name
object = 'AUFK' " these details we will get thru transaction , where we enter these details.
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
IMPORTING
HEADER = HTEXT
tables
lines = LTEXT
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks
Arun -
How to use error table in mapping level?
Hi all
Any one please tell me how to use error table in mapping level or how to handle the errors in mapping.
I am creating one error table in oracle but i dont know how to use it in mapping.
Thanks in advance.
KumarHi Kumar,
You need to use Error Table along with the Data Rule .
Error tables are used with Logical error handlers (Data Rules). Detailed description on using data rules is explained in the following document
http://www.oracle.com/technology/products/warehouse/pdf/OWB10gR2_ETLandBusinessRules.pdf
In a nut shell usage of error tables is as follows.
1. Create a data rule associate it with a table (Target table or table in which you load data).
2. Use the table in a mapping as target table.
3. Deploy the table and mapping.
Now in the target schema one more table will be created with the name <target table name>_ERR. When a mapping is executed the data which violates the data rule gets into this error table.
The following has to be done to have error table name of customers choice.
1. Right click on the table and click configure.
2. Give the table name in "shadow table name" section.
3. Deploy the table.
4. Use this table in a mapping. Now in the mapping on this table properties in "Error Table Name" section the name of the table specified in "shadow table name" will be populated.
Thanks,
Sutirtha -
How to do this with message mapping in PI ?
Hi All,
Field 1 = 100 characters having values in first fifty characters and last 50 characters blank . I need to remove all the first 50 characters with blank and pass 100 blank characters .How to do this with message mapping
ThanksAdding to that, since usually a tab = 8 spaces. What you can do is to open notepad, press tab 4 times. Copy it and paste 3 times, afterwards press space 4 more times and you get 100 spaces.
Regards,
Mark -
How to use GPS with google maps in ios 6.01
How to use GPS with google maps in ios 6.01
Settings > Privacy > Location Services.
Make sure Safari is On. -
How to use functional module " DETERMINE_DUE_DATE"
Hi All,
Can anyone suggest how to use functional module " DETERMINE_DUE_DATE" as it is used in an FI transaction code "FBL5N" and i have to use it in my zprogram to capture the net due date..please suggest..
Regards,
Shanuhi,
CALL FUNCTION 'DETERMINE_DUE_DATE'
EXPORTING
I_FAEDE = LS_FAEDE
IMPORTING
E_FAEDE = LS_FAEDE
EXCEPTIONS
OTHERS = 1 -
Copy value function in message mapping?
can someone help me understand copy value function in message mapping???
Hi,
Here's a good example providen yesterday by Mark in a thread.
[Re: different contexts to different targets]
And here's SAP help: [http://help.sap.com/saphelp_nwpi71/helpdata/EN/26/d22366565be0449d7b3cc26b1bab10/content.htm]
Then play...
Mickael -
Could Mapping Template be used in Multi Message mapping
I had a 1:1 message mapping: MM_A
but later i foudd that the mapping should be 1:n
Multi message mapping
so firstly i created mapping template of MM_A
but the template doesn't work when i am doing the multi mapping.
Could Mapping Template be used in Multi Message mapping?
Thank you very muchHi leo,
<i>
Could Mapping Template be used in Multi Message mapping?</i>
Yes it can be used......
Regards,
Abhy -
How to use node functions in Message mapping !!
Hi Gurus,
I have got one issue in message mapping, please can any one put some ideas on this !!
Source Structure
<Group_ZA> 0..unbound
<D02_ZA> 0.. unbound
ZA_01 0..1 - QA
ZA_02 0..1 20
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QD
ZA_02 0..1 40
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QN
ZA_02 0..1 12
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QP
ZA_02 0..1 60
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
<D02_ZA>
ZA_01 0..1 QA
ZA_02 0..1 20
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QD
ZA_02 0..1 40
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QN
ZA_02 0..1 12
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QP
ZA_02 0..1 60
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
<D02_ZA>
ZA_01 0..1 QN
ZA_02 0..1 12
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QP
ZA_02 0..1 60
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
<D02_ZA>
ZA_01 0..1 QA
ZA_02 0..1 20
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QD
ZA_02 0..1 40
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QN
ZA_02 0..1 12
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
<D02_ZA>
ZA_01 0..1 QP
ZA_02 0..1 60
ZA_03 0..1
ZA_04 0..1
</D02_ZA>
</Group_ZA>
Target Structure
ProductActivityNotification 0..unbound
ProductActivity 1..1
Item 1..unbound
Inventory 0..1
UnrestrictedUseQuantity 0..1
The Group_ZA comes 'n' number of times and D02_ZA comes sometimes 5 times and sometimes 6 times etc.,
ZA_01 field can come with 5 to 6 different values like 'QA','QD','QN' etc., sometimes ZA_01 comes only 3 times QA,QD,QN.
if ZA_01 = 'QA' then only we need to pass ZA_02 value on to ''UnrestictedUseQuantity'' (target side),
I mapped the fields, the vlaue ZA_02 passing properly on to 'UnrestictedUseQuantity' when D02_ZA comes 5 or 6 times, all the times 'QA' value comes into ZA_01 field. In case if QA value missed or doesn't come from source, the Target side ' 'UnrestictedUseQuantity' field last value comes into last but one.
Ex: QA value is in 3 times, but I have 4 source message on top. values comes into target side like
20
20
20
suppose to come like
20
20
-- (Space)
20
Please required your valuable inputs in bit urget !!
how to map field level please?
Many Thanks in Advance
Kind Regards
SanPetre:
If you want to use standard functions then you try this:
If-->currentdate -OR- Constant(01.02)
currentdate -OR- Constant(02.02) --> OR -->
currentdate -OR- Constant(03.02)
Then give some output
Else give some output
So give the output for the first two conditions to another OR and the result of the third to the same OR. So whenever the condition is true in any of the condition you will get the THEN value else you will get the ELSE value.
---Satish -
How to use or function in Message Mapping?
Hi! I was wondering if anyone can show me how to use the or function.
Im trying to match the current date to three possible values so i need three or functions.
EG. if ( currentDate == 01.02 || currentDate = 02.02 || currentDate = 03.02 ) {
do something;Petre:
If you want to use standard functions then you try this:
If-->currentdate -OR- Constant(01.02)
currentdate -OR- Constant(02.02) --> OR -->
currentdate -OR- Constant(03.02)
Then give some output
Else give some output
So give the output for the first two conditions to another OR and the result of the third to the same OR. So whenever the condition is true in any of the condition you will get the THEN value else you will get the ELSE value.
---Satish -
Using useOneAsMany function in Message Mapping if subtree is optional
Hi,
I am trying to develop a message mapping for the following case:
In the source message, there is a value "Value1" which is on the same level as a subtree "Struct2" which can occur 0..unbound times
In the target message the value "Value1" has to be part of that subtree, so it has to be copied for each occurence of "Struct2" in the source message
For the case that the subtree has cardinality 1..n there are some examples on the web, e.g. useOneAsMany (SAP-Bibliothek - Partner Connectivity Kit). But that does not fit my case. The subtree in the source message is optional here.
See a screenshot of the message mapping and my solution for the mapping of "Value1" below:
All other values are mapped 1:1.
Sadly, this solution does not work when "Struct2" has cardinality 0..unbound, for 1..unbound it works perfectly. Here is my example:
When I try the mapping, I get the following error message:
That is true. The first queue of the useOneAsMany function has more values than the second. But I don't know how I can fix it, so that it works for my example. Can anyone give me a hint please?
Setup is AEX 7.31.Hi Stefan,
You can use this mapping.
And for Struct2-Value1
Result:
Hope this helps,
Mark
Maybe you are looking for
-
SAP PI /DB2 : Monitor volumes
Hi , We have PI 7.1 on DB2 installation. how do we montitor / check volumes etc for DB2 ? our OS is Linux. Thank you.
-
Hi all. Got this code in a tutorial. Any help would be grateful. The Code: import java.applet.Applet; import java.awt.BorderLayout; import java.awt.Frame; import java.awt.event.*; import java.awt.GraphicsConfiguration; import com.sun.j3d.utils.applet
-
Payment processing is temporarily unavailable. Please try again later..... That's all I've received all day, can't even change my payment type to none
-
Estimated time to download Xcode 3.2.6 is 2 days.
Hi, I am a brand new mac user. Am trying to download XCode 3.2.6 for Snow leopard from developer.apple.com. The file is about 4 GB and my internet download speed is 0.36 Mbps. The estimated time to download this huge file is 2 days:(. Is there any ot
-
Safari crashes w/ B of A and Intuit
I originally intended to post that my Safari is crashing everytime I try to go to the Intuit website. After reading the discussion board, I tried my B of A account, and it, also, crashes Safari. It could be a coincidence that both Intuit and B of A c