0% found this document useful (0 votes)
186 views5 pages

Automatic Time Conversion Not Possible For Source Field

This document discusses an issue with automatically converting time fields when mapping a generic data source to an analytic data store object (ADSO) in SAP BW on HANA. Specifically, the user is trying to map the year and month fields (AJAHR and SMONT) in the data source to calendar year and month fields (0CALYEAR and 0CALMONTH2) in the ADSO. The automatic time conversion is not possible because the data source consists of fields rather than infoobjects. The answer provides a code example for an ABAP routine that can be used to perform the conversion by extracting parts of the date string in AJAHR and assigning it to 0CALYEAR. A similar approach is suggested for 0

Uploaded by

Bac Aston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views5 pages

Automatic Time Conversion Not Possible For Source Field

This document discusses an issue with automatically converting time fields when mapping a generic data source to an analytic data store object (ADSO) in SAP BW on HANA. Specifically, the user is trying to map the year and month fields (AJAHR and SMONT) in the data source to calendar year and month fields (0CALYEAR and 0CALMONTH2) in the ADSO. The automatic time conversion is not possible because the data source consists of fields rather than infoobjects. The answer provides a code example for an ABAP routine that can be used to perform the conversion by extracting parts of the date string in AJAHR and assigning it to 0CALYEAR. A similar approach is suggested for 0

Uploaded by

Bac Aston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Automatic time conversion not possible for source field

1 of 5

https://archive.sap.com/discussions/thread/3951017

10/31/2016 8:18 PM

Automatic time conversion not possible for source field

2 of 5

https://archive.sap.com/discussions/thread/3951017

This question is answered

Hi Experts,
I'm using SAP BW on HANA 7.4 and I created a generic data source based on an ABAP coded table. The
fields are in the attachment/screenshot. I'm trying to map the time chars from the data source to the ADSO.
Trying to map AJAHR (Year) in the datasource to 0CALYEAR in the data source and I keep getting error
Automatic time conversion is not possible for source field AJAHR. And I get the same error trying to map
SMONT from the datasource to 0CALMONTH2 in ADSO:

Message No. RSTRAN070

Automatic time conversion of source field AJAHR to 0CALYEAR could not be defined. This is because the
source is a DataSource and consists of fields, and not InfoObjects. Time conversion can only be defined
automatically for InfoObjects.

Time recording is set to direct recording .

If you need a time conversion, you can assign an InfoObject to the field in the rule details.
Alternatively, you can define your own time conversion using a formula or a routine.
Here's the transformation error:
I know I need to write a routine. Could some one please help with a routine that I need to write for this
conversion. I'll assign points.

10/31/2016 8:18 PM

Automatic time conversion not possible for source field

3 of 5

https://archive.sap.com/discussions/thread/3951017

conversion. I'll assign points.

Thanking you for all your assistance.

Transformation.PNG

(54448 B)

Kalinda Kalinda
August 30, 2016 at 19:25 PM
0 Likes

Correct Answer

Maju Alexander

replied
August 31, 2016 at 06:35 AM

A simple code would do..


For example if your AJAHR is
coming as "20160831"
Then write code in end routine as:
Loop at result_package assigning
<result_fields>.
<result_fields>-calyear =
<result_fields>-ajahr+0(4).

endloop.
Else if your AJAHR is coming as
"31082016"
Then write code in end routine as:
Loop at result_package assigning
<result_fields>.
<result_fields>-calyear =
<result_fields>-ajahr+4(4).
endloop.
Similarly you can populate
0CALMONTH as well.
Other simple approach would be to
map the AJAHR to a DATE type
infoobject in LDP layer and assigning

10/31/2016 8:18 PM

Automatic time conversion not possible for source field

4 of 5

https://archive.sap.com/discussions/thread/3951017
Other simple approach would be to
map the AJAHR to a DATE type
infoobject in LDP layer and assigning
it directly to 0CALYEAR in BT layer
Br,
Maju

View this answer in context

Correct Answer

Maju Alexander

replied August 31, 2016 at 06:39 AM

A simple code would do..


For example if your AJAHR is coming as "20160831"
Then write code in end routine as:
Loop at result_package assigning <result_fields>.
<result_fields>-calyear = <result_fields>-ajahr+0(4).
endloop.
Else if your AJAHR is coming as "31082016"
Then write code in end routine as:
Loop at result_package assigning <result_fields>.
<result_fields>-calyear = <result_fields>-ajahr+4(4).
endloop.
Similarly you can populate 0CALMONTH as well.
Other simple approach would be to map the AJAHR to a DATE type infoobject in LDP
layer and assigning it directly to 0CALYEAR in BT layer
Br,

10/31/2016 8:18 PM

Automatic time conversion not possible for source field

5 of 5

https://archive.sap.com/discussions/thread/3951017

Br,
Maju
0

Kalinda Kalinda

replied
August 31, 2016 at 22:03 PM

Thank you very much


Maju, this help alot!
0

Kalinda Kalinda

replied August 31, 2016 at 22:17 PM

How do I assign points? Are we still able to do this? I don't see anything to
assign with
0

Maju Alexander

replied
September 01, 2016 at 06:19 AM

It gets assigned automatically when you


mark your question as "answered" or
"helpful" or "like".
0

10/31/2016 8:18 PM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy