on 04-14-2007 6:19 PM
Hi All,
Can anyone has sample code to fill the target field with spaces? I have many fields where I need to fill with spaces like 30,164 like that.
Thx
Navin
Navin,
use this simple udf. The input will be a constant containing the number of spaces you want .Let this input parameter be Blanks.
String returnBlank="";
for(int i=0; i<Blanks;i++){
returnBlank=returnBlank+" ";
}
return returnBlank;
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 Bhavesh,
I get the following error when I use sampel code below:
H:/usr/sap/RXI/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map0478a140eabb11dbb905001143eeb19b/source/com/sap/xi/tf/_test_source1_target2_.java:42: <b>operator < cannot be applied to int,java.lang.String for(int i=0; i<Blanks;i++){ ^ 1 error</b>
Please let me know how to resolve this?
Thx
Navin
From http://help.sap.com/saphelp_nw2004s/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm :
<i>
Replaces empty contexts in the inbound queue with a default value, which you specify in the function properties.
Example:
If Default is the default value and
A|B1,B2| |C| |D
is the inbound queue,
mapWithDefault returns the following outbound queue:
A | B1,B2 | Default | C | Default |D.
The function corresponds to the following combination of standard functions:
If(
[]field,
exists([]field),
Constant([value=default]))</i>
So, just click twice on the MapWithDefault field and enter your 30 spaces or whatever. It will fill empty fields with it.
But, for it to work, your empty field will need to be unique in the context, meaning, it must have max occurrence of 1 and be inserted in the unbounded tag. If thats not the case, just use the udf.
Regards,
Henrique.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.