2013 Jan 21 5:43 PM
Hello SAP-Experts,
I have created a generic data source containing the field: “Period” which is defined as a numeric value (MM.YYYY).
In order to fill the InfoObjects “0CALMONTH” and “0CALYEAR” we have developed a formula with the formula editor.
This formula does not work because if you want to use the LEFT, RIGHT and CONCATENATE functions of the formula editor it is necessary that the value in with the date is provided is a string value.
Does anybody know how to convert a numeric value into a string value?
Or does anybody know an alternative to the RIGHT, LEFT and CONCATENATE functions
RIGHT( 4, 'SPBUP' )
CONCATENATE( RIGHT( 4, 'SPBUP' ), LEFT( 2, 'SPBUP' ) )
Thank you for your help!
Holger
Hello SAP-Experts,
I have created a generic data source containing the field: “Period” which is defined as a numeric value (MM.YYYY).
In order to fill the InfoObjects “0CALMONTH” and “0CALYEAR” we have developed a formula with the formula editor.
This formula does not work because if you want to use the LEFT, RIGHT and CONCATENATE functions of the formula editor it is necessary that the value in with the date is provided is a string value.
Does anybody know how to convert a numeric value into a string value?
Or does anybody know an alternative to the RIGHT, LEFT and CONCATENATE functions
RIGHT( 4, 'SPBUP' )
CONCATENATE( RIGHT( 4, 'SPBUP' ), LEFT( 2, 'SPBUP' ) )
Thank you for your help!
Holger
2013 Jan 21 8:39 PM
hello,
try using FM "CONVERT_DATE_TO_EXTERNAL"
best regards,
swanand
2013 Jan 22 6:11 AM
Hi,
String accepts any kind of value, no matter it is of type c or type N
data:date(5) type n.
data:begin of wa,
dd(2) type n,
yy(4) type n,
end of wa.
data:lv_str type string.
concatenate '01' '.' '2013' into date.
wa = date.
lv_str = date.
If this did not answer your question, could you provide more details, I am not sure about the formula editor ( is it related to Bex Analyzer functions ? )which is mentioned, but before entering the formula editor the value can be passed to string as above.
2013 Jan 22 6:27 AM
hi
one question for you. why my thread is deleted. I am aware of my question is very basic. but why? because you have the authority??!
peng tang
2013 Jan 22 6:40 AM
2013 Jan 22 6:17 AM
Hi Holger,
Try passing the numeric value to a string variable as below .
data : lv_num TYPE n LENGTH 6 VALUE '201301',
lv_char TYPE c LENGTH 8.
lv_char = lv_num.
lv_char+6(2) = '01'.
Regards,
Vikram
2013 Jan 22 6:58 AM
Hi Holger,
Check the below mentioned Function Modules list.
All are related to date and time calculations. That would help you.
http://wiki.sdn.sap.com/wiki/display/ABAP/Function+Module+related+on+Date+calculations
Hope this helps.
2013 Jan 22 7:34 AM
Hi Holger,
You can simply create a new variable like :
data : l_char_date tyep char8
and do the casting operation , as;
l_char_date = numeric date
This will convert the numeric date to character
I hope this will work fine !
regards,
nitin
2013 Jan 22 7:56 AM
Hi,
Try having a char type instead of numeric.
Let me know if this is mandatory for you to not have the char values.
Regards,
Shitanshu Sahai