Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Simple transformation formatting

Former Member
0 Kudos

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

13 REPLIES 13

Former Member
0 Kudos

hi

you may use EDITMASK.

FOLLOW the link http://www.sap-basis-abap.com/sapab015.htm

Former Member
0 Kudos

HI ,

you split (keyword) the variable at '-' and collect iinto three different variable and make the required format.

Thanks

Shambhu

Former Member
0 Kudos

HI ,

you split (keyword) the variable at '-' and collect iinto three different variable and make the required format.

Thanks

Shambhu

Former Member
0 Kudos

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.

Former Member
0 Kudos

USE EDIT-MASK command in your program.

EDIT-MASK 'YYYYMMDD'.

former_member189420
Active Participant
0 Kudos

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

Former Member
0 Kudos

use edit-mask a EDIT-MASK - 'YYYYMMDD'.

Former Member
0 Kudos

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

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

0 Kudos

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

0 Kudos

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

JerryWang
Advisor
Advisor
0 Kudos

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