07-06-2009 11:41 AM
Dear Expert,
I would like to know how can I format my transformation result using simple transformation. I have an attribute that is supposed to display a date in the format YYYYMMDD. However, the default format is YYYY-MM-DD. How can I change this behavior in simple transformation? Thanks!
Regards,
Alex
07-06-2009 11:45 AM
07-06-2009 11:45 AM
HI ,
you split (keyword) the variable at '-' and collect iinto three different variable and make the required format.
Thanks
Shambhu
07-06-2009 11:46 AM
HI ,
you split (keyword) the variable at '-' and collect iinto three different variable and make the required format.
Thanks
Shambhu
07-06-2009 11:46 AM
hi,
you can use concatenate in that case :
CONCATENATE: zdate+6(02)
'-'
zdate+4(02)
'-'
zdate(04) INTO date.
hope this will surely help you!!!
Thanks & Regards,
Punit Raval.
07-06-2009 11:48 AM
07-06-2009 11:52 AM
Hi,
data: gv_chars TYPE char100.
gv_chars = '2009-07-06'.
replace all occurrences of substring '-' in gv_chars with ''.
Hope this helps.
Regards,
Anand Patil
07-06-2009 1:21 PM
07-07-2009 2:42 AM
Dear Experts,
Thanks for all the previous input. However, I think my title is not clear enough. "Simple transformation" is a SAP terminology that help developer to export / transform data in XML. The above suggestion cannot be applied in simple transformation.
I am looking for way to apply date format in the XSLT used in simple transformation. Thanks!
Regards,
Alex
05-28-2014 7:57 AM
Hey Alex,
do you have a solution already? I have the same problem, the format of the date in the XML-File is "20140101" and I can´t transform it with Simple Transformation to the ABAP Type DATS which waits for "2014-01-01" or "2014.01.01".
the Transformation looks like this in the moment:
...
<DATE tt:value-ref="DATE"/>
...
The ABAP type of the field DATE is DATS. And the XML looks at this part like this:
<DATE>20131201</DATE>
Regards,
Christoph
06-28-2014 9:46 AM
Hi Christoph,
as I demonstrate in my document, this could be done via an external ABAP class call within the simple transformation.
Best regards,
Jerry
07-07-2014 7:46 AM
Thanks Jerry !!
I think that will work for me, I will test it later, but this looks like the solution I searched for
I have not tested it yet, but I think, it will only work for the output of the XML file, or? If it should work for both (output/input of xml <=> itab), with same Transformation, the method "GET_NEW_DATE" should be extended a bit
But this sould be possible without problems.
best regards,
Christoph
06-28-2014 9:45 AM
Hello Alex,
in the simple transformation an external ABAP class could be used to do date format manually. See my solution in this document: http://scn.sap.com/docs/DOC-56211
Best regards,
Jerry
07-30-2020 2:19 PM
the correct link now is https://blogs.sap.com/2014/06/26/change-date-format-in-web-service-response-for-crm-attachments/