How to check a field in Message mapping wether it is Non Numeric?
Hi XI Guru's
I am totally new to XI world, Kindly help hopw can I chexk a field while doing message mapping whether the field is non numeric or not.
I dont find any built in function for the same.
If it is using UDF can some body help me in providoing a UDF for this.
Many Thanks
Arun
Hi Arun,
In SAP PI, all the XML contents by default treated as STRINGS.
So if u want to check whether the incoming field is numeric or not... the only way is to write a UDF code for the same.
the UDF will be,
1. At first
import java.util.regex.Matcher;
import java.util.regex.Pattern;
in functions.
2.UDF content:
input: field,container
output:boolean
Code
boolean return_Value;
Pattern p = Pattern.compile("[0-9]*"); // If u are using the decimals please change the regular expression accordingly.
Matcher m = p.matcher(field);
if(m.matches())
retuen_Value = true;
else
return_Value = false;
return return_Value ;
I hope this will solve ur problem....
Babu
Similar Messages
-
How to validate a date in message mapping
Hi experts,
how to validate a date in message mapping. For ex: if date comes as 2008/02/31, then file it shold not get processed.how to achieve this in message mapping. Please help .
Thanks&Regards,
Reyaz HussainHi,
There are few simple ways for date validation as follow,
1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
If in case the format miss-matched then it will create the exception.
You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
CONVERT_DATE_FORMAT
ISU_DATE_FORMAT_CHECK
Thanks
Swarup -
How to find the name of message mapping
Hi folks
i want to check the name of message mapping which is used at run time. i can find the name of Interface mapping name in trace of message in SXMB_MONI.
but i am not able to find the MM name.
can some one help me .....
Regards
Gagan> but i am not able to find the MM name.
You will find your message mapping name as class name in the pipeline step Request Message Mapping. Please search for interface mapping and below which you will find the mapping name as this format...
<Trace level ='"3" type="T"> Mapping steps 1 JAVA_JDK
com/sap/xi/tf/_<your mapping name> </Trace>
Example as similar below... -
Send Multiple field values to Single Target field in Message Mapping
Hi,
My Requirement is to Map Multiple fields to Single field in Target side.I have to send all the values concatenated and pass the same to target Field in Message Mapping.
We can use Concat function,but more that 15 fields are there.If using concat,the mapping will be complex.
Is there any way to simplify this requirement or we can use any UDF for this,kindly suggest.
Regards,
Madhu>>>We can use Concat function,but more that 15 fields are there.If using concat,the mapping will be complex.
I don't think it's complex but just that it occupies more mapping area
Just write a simple UDF - a one line code and pass all your input variables.
return var1+var2+var3+var4+...+var15; -
Display queue for Target field in Message Mapping
Hi Folks,
If i check my Target Field (DT_Req) (Display queue) in Message Mapping, I am getting 2 values like ie [] that means ....in my test result in MM, i should get 2 times DT_Req field.
Is it right?
Plz give some idea how this display queue works on each field?
Thanks
Prabaharan
Edited by: Prabaharan on Sep 10, 2008 12:22 AM
Edited by: Prabaharan on Sep 10, 2008 12:24 AMHi,
In my scenario occurrence of that
target field is 0...unbounded
and in my display queue.. Initially it is
suppress, [], suppress, suppress, suppress,suppress,suppress,suppress,suppress,suppress, [],suppress
in my result i could get only one DT_req field.
Plz throw some idea on this?
thanks -
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 -
SOAP fault - How to log error in response message map
Hi,
I have a scenario ABAP Proxy <-> XI <-> SOAP.
Occassionally there is an issue with communication to the destination system and an HTTP 500 Error is returned. I assume this is due to a system related error and it is returned as a SOAP Fault as opposed to a SOAP response with payload.
How do I get this "HTTP-500" error into my message map to return to the calling system ?
I have looked at Fault Messages but need to know if these are relevant for the SOAP Adapter and how they can be utilised ?
Thanks for any help.
Kind regards
Colin.SOAP fault message not in correcto format to allow an application error to be caught.
-
How to check Le field is missed?
Hi,
When the protocol is T=1, I have problem with Le field.
When the card recieve Case 2 format command without Le(like '00B2010C' - Read Record) , how to check the Le field is missed?
I tried below but not working.
if(APDU.getProtocol() == APDU.PROTOCOL_T1 && apduBuffer[ISO7816.OFFSET_LC] != 0 && apdu.setIncomingAndReceive() != 0){
ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
I look forward your feedback.
Many thanks in advance!
글 수정: user11280436
글 수정: user11280436Hi,
You should check the response from apdu.setOutgoing() to see what value was passed in as Le. This will return the number of bytes expected by the terminal.
You only need to call apdu.setIncomingAndReceive() if the INS expects data. You can also use it to ensure that there was no data passed in (returns 0).
Cheers,
Shane -
How to set EXPORT parameter from message mapping
Again, ask the question of export parameter.
I wrote a java version transformation and it worked good with export parameter.
However I can not work it out in graphical message mapping. I refered http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm.
In PI7.1, I add an export parameter "EXPORT_PARA" in the "Signature" tab. Are there any special step to assign this parameter to an UDF? I did not find a way to do it.
And then I define an UDF,
public String SetExportPara(String sss, Container container) throws StreamTransformationException{
String str = "GOOD";
GlobalContainer gc = container.getGlobalContainer();
OutputParameters paras= gc.getOutputParameters();
if(paras.exists("EXPORT_PARA ") == true) {
paras.setString("EXPORT_PARA ", str);
}else {
str = "NOT FOUND EXPORT_PARA";
return str;
And I assign this UDF to one element of my output XML, I tried to run it in IE, it always output "NOT FOUND EXPORT_PARA.
why?????
I know there is a blog : https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8654. [original link is broken] [original link is broken] [original link is broken]
But it did not talk how to set export parameters.Hi,
i read thread
How to export parameters from Message Mapping
and blog
/people/jin.shin/blog/2008/02/14/sap-pi-71-mapping-enhancements-series-parameterized-message-mappings
but not found issue
in this topic
http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm.
if i writting this code in UDF, i getting an error.
If use this code:
GlobalContainer gc = container.getGlobalContainer();
OutputParameters paras= gc.getOutputParameters();
paras.setString("EXPORT_PARA ", str);
the export parameter is defined locally (in transformation step area). In integration process area parameter is equal to NULL.
How send export parameter to Integration Process? For exapmple, i wanna send parameter to other transformation step in my integration process.
thx. -
How can i test after creating Message mapping transformations
Hi guys,
How can i test my transformation after creation of message mapping in Integration Repository.
Pleae expain step by step procedure
Thanks & Regards.,
Pushparaju.BHi,
1. If you just want to test the mapping --In message Mapping there are three tab, the second one being hte Test tAb. So u can pu the values in the left side XML and do test.
http://help.sap.com/saphelp_nw04/helpdata/en/c3/e3072e65f04445a010847aa970b68b/content.htm
2. You can do the Testing from Interface mapping also. There is a Test tab there too.
3. If you have created the whole scnerio then you can do testing from Integration directory:
http://help.sap.com/saphelp_nw04/helpdata/en/6b/874a4273bb3830e10000000a155106/content.htm
Regards
Vijaya -
How to check which fields of a table are changed
Hi
I have a FM in which i pass VBAK and VBAP. I store records of table in internal tables and update the values during execution and at the end of this i have to cpmare VBAK and VBAP with internal tables to chcek which field value is changed in both VBAK and VBAP. Its not possible to check all fields bcause there are so many fields in VBAK and VBAP. Can any body help me.
Thanks and Regards
AdityaHi,
Try using where used list.
click on the field. pree F1. select Technical Info from the pop-up. then from the field data, double click one the field name. it will navigate to the table/structure where the field is used. double click on the field there or
press CntrlShiftF3.
It will give you the where used list.
Pls reward poins if useful.
Regards,
Chandru -
How to check what fields are output from ABAP to smartform
Hi All,
I am working on a Zcopy of RLB_INVOICE smart form and need to check what fields are being output to the vendor_address window in the smartform.
I have examined the NACE setup and found "Medium -> printoutput", "Program -> ZRLB_INVOICE", "Form Routine -> "ENTRY_INS", "Form -> ZRLB_INVOICE", "PDF/SmartForm -> ZRLB_INVOICE".
Where would I find the code that shows the direct correlation between the driver program and a specific element of the smart form.
All I need to check is that all elements of the venfore address are being sent to the form as I am hearing reports that we are missing house number on the printed output.
Many thanksHi Meenakshi,
First you find out your driver program. Here in your case it is ZRLB_INVOICE. Then within that check where address of the vendor is found and is assigned to which import parameter of the smartform.
Check your smartform also. Find which all fields are being printed in that. If vendor_address window is an address window, then there will be uniques identifier passed to that window from the driver program.
Regards,
Abijith -
Splitting XML string as separate fields in message mapping
Hi Experts,
I am getting XML string in one field from source message, i need to separate those fields and map it to target fields.
Sorce message:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:test_source xmlns:ns0="urn:gp:prototype">
<Document>
<store>3021</store>
<date>2011-03-24</date>
<type>3002</type>
<till>32</till>
<transaction>1478</transaction>
<data><![CDATA[<buy><merchantID>006001007031992</merchantID><laneID>29</laneID><referenceID>PP0323095107</referenceID><localDate>2011-03-2302:00</localDate><localTime>09:51:0702:00</localTime></buy>]]></data>
</Document>
</ns0:test_source>
Target Message:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:test_target xmlns:ns0="urn:gp:prototype">
<item>
<storeID>3021</storeID>
<businessdate>2011-03-24</businessdate>
<Typecode>3002</Typecode>
<workstation>32</workstation>
<SeqNum>1478</SeqNum>
<XX>006001007031992</XX>
<YY>29</YY>
<PP>PP0323095107</PP>
<QQ>2011-03-23+02:00</QQ>
<RR>09:51:07+02:00</RR>
</item>
</ns0:test_target>
Can anyone please suggest me how can we do this???You can easily do both using standard function or simple udf
Use indexOf and substring to achieve this...
Simple UDF
String var1="><![CDATA<buy><merchantID>006001007031992</merchantID><laneID>29</laneID><referenceID>PP0323095107</referenceID><localDate>2011-03-23+02:00</localDate><localTime>09:51:07+02:00</localTime></buy>]>";
String search = "<merchantID>";
if(var1.indexOf(search) != -1){
int pointer = var1.indexOf(search);
return var1.substring(pointer+12, pointer+27);
}else{
return "";
similarly for laneid
search ="<laneID>";
if(var1.indexOf(search)!= -1){
int pointer = var1.indexOf(search);
return var1.substring(pointer+8,pointer+10);
}else{
return "";
Same way you can do for all the elements creating seperate method for each element or just use standard function to achieve this.
Edited by: Baskar Gopal on Mar 24, 2011 10:13 AM -
How to remove carriage returns in message mapping
Hi Experts,
I am getting carriage returns in one of the source field, i need to remove those carriage returns and i need to pass it to target field, can anyone suggest me how can i achieve this.Hello,
Are you getting only CR or CR+LF (line feed) ?
In this case - CRLF - you can use content conversion in your sender adapter:
<recordset_structure>.fieldSeparator = 'nl'
So in your receiver adapter you can replace any special char by 'nl' again.
Check these links.
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
Regards,
Diego Estanguini Gabriel -
How to handle Hirarchy structures in MESSAGE MAPPING
Hi...
I'm getting data from a file.. and that is contain Hierarchy structure.. but i want to load it to a plain structure.. for this how can we map the source fields to target fields..
here my source structure is...
HEADER :
--DATE
--COMPANY
--LINE_ITEM_1:
-----CUSTOMER_NO
-----LINE_ITEM2:
ORDER_NO
MATERIAL_NO
QUANTITY
PRICE
DELIVARYDATE
-----LINE_ITEM2
ORDER_NO
MATERIAL_NO
QUANTITY
PRICE
DELIVARYDATE
-----CUSTOMER_NO
-----LINE_ITEM2
ORDER_NO
MATERIAL_NO
QUANTITY
PRICE
DELIVARYDATE
-----LINE_ITEM2----
ORDER_NO
MATERIAL_NO
QUANTITY
PRICE
DELIVARYDATE
this structure i want to map it to a plin structure..
regards
JainHi,
removeContext:- Deletes all context changes in a queue.
For Eg:-
<RootNode>
<Node1>
Value1
Value2
</Node1>
<Node2>
Value3
Value4
</Node2>
</RootNode>
When removeContext not used:-
<RootNode>
Value1
Value2
</RootNode>
When removeContext used:-
<RootNode>
Value1
Value2
Value3
Value4
</RootNode>
Refer [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638]
Hope this helps.
Regards,
Ambili
Maybe you are looking for
-
I restarted Windows 8, but now my keyboard and touchpad don't work!
I have an HP Envy M6-1184ca laptop that I got about 4 weeks ago. It's running Windows 8 64-bit. Today, I downloaded and installed VirtualBox and it disabled my wireless adapter for the installation. So, when it was done, I tried to re-enable it, but
-
Which PO's are/not supported in MM-SUS ?
Hi , We are going for SRM 7.0 with ECC 6.0 (Ehp4) and MM-SUS scenarion . Can any one please confirm me , along with Standard PO , Account assignmnet catagory (standarized the solution for Service PO for SRM 7.0 with ECC 6.0 (Ehp4) ,as per note 8681
-
hii all, plz help me. in my system few problems are coming, 1) job work challan is not getting generate., means job work register is not fetting updated. 2) i am doing to post the excise document , after capturing the excise doc., means PO- Jiex-MIGO
-
The procedure entry point longimp could not be located in dll orauts.dll
I am using oracle 11g R1,on Windows xp sp2 OS.when i wrote sqlplus in Start->Run this error came: the procedure entry point longimp could not be located in dynamic link library orauts.dll Earlier that was working fine,but now its showing error.How to
-
HT1222 When trying to download IOS 5.1 on my IPAD2, I keep getting an error message
When trying to download IOS 5.1 on my IPAD2, I keep getting an error message