You are on page 1of 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