on 03-21-2007 2:38 PM
Hi Group,
I have one date field node with format dd/mm/yyyyy,I need to check whethere this field is blank or not if it is blank I need to pass blank as it is and if the field is with
dd/mm/yyyy I need to transform into yyyymmdd,can any body give me suggestions
hi swabap,
1. first check your node is blank or not. this can be done by
boolean-><b>equals</b> function
equals function has two input parameters . give one as your souce node(date) and the other as a constant[]
2. now use the boolean-><b>if</b> function
give the output of <b>equals</b> as the input to <b>if</b>
3. the <b>if</b> has two options <b>then</b> and <b>else</b>
give a constant[] in the side of <b>then</b>(this will allow as to pass blank value if the date is blank)
at the side of <b>else</b> use the use the Date-><b>DateTrans</b>
double click on datetrans
give dd/mm/yyyy in the source format and yyyymmdd in the target format
4.connect the output of <b>if</b> to your target node
Kind Regards
Francis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
do below:
source field check with constant[] with equalS function.....take this to boolean if then else functio.........in then put constant[].......in else put source field -> dateTrans....in dateTrans specify yyyymmdd........take to output field
Thanks,
Rajeev Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
>>>>field is blank or not if it is blank I need to pass blank
use exists function
>>>>I need to transform into yyyymmd
use DateTrans function (you can specify format as yours
in functions parameters)
from:
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do as michal said just add if else condition after exhist function. if does not exhist then use else part and send blank if exhist use the if part then use date transmission.
this works based on the assumption that alwayas you get any correct date or no field value. in other cases this is one will fail . you need to use UDF for other conditions to check.
Sreeram Reddy
The node may exist and still have blank value.
If the only possibilities for input are blank or dd/mm/yyyy formats, go as Gupta said. Just use a standard If function, and compares the input field with a blank String (using equalS function) or check if its length is zero (using equalsA function).
Regards,
Henrique.
Hi Michal,
the source date node may exist but it can have a blank value ....then your dateTrans function will give error.......
so its better to use MapWithDefault for a blank value [] and then send its output to equalS function as i have said above.........this will handle all the cases....
Thanks,
Rajeev Gupta
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.