on 02-18-2011 1:19 PM
Hi Friends,
Can anyone please provide me UDF for following Condition
my input is 123456 or 1234567.i need read first 4 char and replace it by sw..the output should be sw56 or sw567
Thanks in adv.
Reg,
dinesh
Edited by: Dineshbabu.M on Feb 18, 2011 2:20 PM
Hi Dinesh,
Is the length of the string is constant? If so then you can go ahead with the mapping as said. If the length varies then you need to write a UDF for it.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if its varied length then u can do it by function - replaceString - no need of UDF....
http://help.sap.com/saphelp_nw04/helpdata/en/1f/ea0fb12403844bbb6c4cbc8a00cda9/frameset.htm
chirag.
Hi,
This simple UDF will do what you want:
The UDF takes a single String array as input, say s[ ] and it has a single ResultList item result as output.
The complete code is as follows:
s[0]="sw"+s[0].substring(4,s[0].length());
result.addValue(s[0]);
Pass the output of the UDF to the required target field. That's it.
HOPE IT HELPS YOU BUDDY!!!
THANKS
BISWAJIT
Edited by: 007biswa on Feb 18, 2011 7:04 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
U can do it with graphical mapping itself
u can use substring function and remove the first four character then use concat function along with constant to append the sw value.
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.