Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Date conversion in external format "MM/DD/YYYY"

Hi Experts,

I created a generic datasource on the top of TCURR table in SAP BW. I converted the inverted date in to normal date by using the function module 'CONVERSION_EXIT_INVDT_OUTPUT'. After conversion the date is available in characteristic object but my requirement is to save it as a date object. I need to save it in date format because the date object is a part of prompt in BEx query. The default date format in SAP is "YYYYMMDD" but my company's date format is "MM/DD/YYYY". When i tried to write transformation routine to convert it in to date format. I could not do it in correct format which is "MM/DD/YYYY".

I searched many threads in SCN for this issue and I found that SAP converts the characteristic object into date but in "YYYYMMDD" format. I could not find any function module which can convert the characteristic object in to date in external format like "MM/DD/YYYY". Can any one of you suggest the work around for this issue?

I will appreciate your time and help.

Thanks,

Shehzad

Former Member
Former Member replied

Thank you guys for your help and time.

I fixed it by flipping the date into "YYYYMMDD" format and it is showing in the correct way now.

DATA: ZDATE(8) TYPE C.

DATA: YY(4) TYPE C,

       MM(2) TYPE C,

       DD(2) TYPE C.

MOVE SOURCE_FIELDS-GDATU+4(4) TO YY.

MOVE SOURCE_FIELDS-GDATU+0(2) TO MM.

MOVE SOURCE_FIELDS-GDATU+2(2) TO DD.

CONCATENATE YY MM DD INTO ZDATE.

      RESULT = ZDATE.


Note: Result is a date type object

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question