on 08-07-2006 5:54 PM
How should I get partial time stamp ( I need only CCYYMMDDHHMMSS ) without Hyphans(-). Any Ideas?
Ram
An option is that in your message mapping you include User Defined Function with the DynamicConfiguration name and add as parameter the predefined function currentDate and you change the type of TimeStamp there that you want to give.
saludos
J.R.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Henrique,
See this for usig Java Mapping to access Adapter SPecific Identifiers,
http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/content.htm
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You could write a simple UDF which is going to split the value at hyphens.Combine the values and map the output to the target tag
Regards,
Smitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bhavesh,
that's very interesting.
Where can I have more information on how to access this data on XI mapping?
I have a request to creat a path based on some informations from the payload, but these information need to be manipulated and not just copied (so I can't just use a variable substitution). I think this solution you provided, used in a Java Mapping, would just be the solution I'm looking for (maybe using FilePath instead of FileName, or something like that).
Do you know if I can just use it in a Java Mapping? Which imports do I have to do?
One more thing: in SAP BASIS SWCV, I have http://sap.com/xi/XI/System/ namespace but I don't have http://sap.com/xi/XI/System/File namespace. Is that a problem or it doesn't need to be there for this to work?
Best regards,
Henrique.
Ram,
I'm was also checking this request and I came to this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm
If you use this XSLT, you can use it on MessageTransformBean Module Processor, in the adapter, and not affect your scenario at all.
Best regards,
Henrique.
Hi Henrique,
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
This link gives youi the details. Yes, you can access all Mapping objects from your Java Mapping also.
REgards,
Bhavesh
Ram,
One option, write a script that will pick up the file after the file adapter has added the hiphen and created the file in the target directory and rename it as per your requirements.
Take a look at this for how to execute scripts in FIle Adapter,
http://help.sap.com/saphelp_nw04/helpdata/en/6a/3f93404f673028e10000000a1550b0/content.htm
Regards,
Bhavesh
Insert the timeStamp in a XML tag (using Message Mapping) and use the Variable Substitution. For Example:
Create a "filename" tag
[File Name Schema] = %fileName%
Variable Substitution (Table)
... add a Line
Variable name = fileName
Reference = payload:myXml,1,filename,1
Evandro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is you using Content Conversion? The file that is created is in text format?
I have the folowing XML:
<?xml version="1.0" encoding="UTF-8"?>
<p2:Y_SD_XPLAN_C_SALESORDER xmlns:p2="urn:sap-com:document:sap:rfc:functions">
<SENDER/>
<T_SALESORDER>
<item>
<FLGALT/>
<CD_PEDLIN/>
<DT_PEDLIN_CRI/>
<EAN11/>
<STCD1_CL/>
<DT_PEDLIN_MOV/>
<QT_PED/>
<QT_REC/>
</item>
</T_SALESORDER>
</p2:Y_SD_XPLAN_C_SALESORDER>
And did this configuration in the Content Conversion Parameter:
Record Structure = record,row
[Table]
row.fieldSeparator = ,
row.endSeparator = 'nl'
row.processConfiguration = fromConfiguration
record.fieldSeparator = '0'
record.fieldFixedLengths = 0
record.fixedLengthTooShortHandling = Cut
record.endSeparator = '0'
Evandro.
Sorry,
I sent a wrong XML.
The correct is:
<?xml version="1.0" encoding="UTF-8"?>
<p3:XPlanCargaPedidos xmlns:p3="urn:spasa.xplan.pedidos.carga"><record><row><FLGALT></FLGALT><CD_PEDLIN></CD_PEDLIN><CD_PEDLIN_XPLAN></CD_PEDLIN_XPLAN><DT_PEDLIN_CRI></DT_PEDLIN_CRI><OBSERVACAO></OBSERVACAO><ID_EMPRESA>1</ID_EMPRESA><EAN11></EAN11><STCD1_CL></STCD1_CL><DT_PEDLIN_MOV></DT_PEDLIN_MOV><QT_PED></QT_PED><QT_REQ></QT_REQ><CONTRAPARTIDA>HAVAIANAS</CONTRAPARTIDA></row><filename>X_20060807164415_lin_ped_colocado.txt</filename></record></p3:XPlanCargaPedidos>
Ram,
You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
Just use this code in an UDF,
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = conf.get(key);
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
dateformat.format( new java.util.Date() );
String newfilename=SourceFileName+dateformat;
// change to new file name
conf.put(key, newfilename);
return "";
Regards,
Bhavesh
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.