cancel
Showing results for 
Search instead for 
Did you mean: 

0COSTELMNT_0102_HIER with intervals

Former Member
0 Kudos

Component information:
BW 730 Patch 005
SAP ECC 6.0

Hello All,


I am facing issues trying to load 0COSTELMNT_0102_HIER with intervals from ECC 6.0 to BW 730
The datasource 0COSTELMNT_0102_HIER has been migrated. I am able to load PSA with data. But during DTP I am recieving the following error.

Interval node with the ID 4: The from-value is larger than the to-value
Message no. RH214

Diagnosis
The "from" value is larger than the "to" value for the interval node with ID 4 and node name .


Procedure
By swapping the "from" and "to" values you can get a valid hierarchy structure.

In my transformation is as follows..

hierarchy cost element header mapping is
HIENM > 0H_HIENM
OBJECTID > 0OBJECTID

HEADER TEXTS

SIMPLE 1 > 1 MAPPING

HIERARCHY NODES

ONE TO ONE MAPPING AND

NODEID > 0COSTELMNT WITH ROUTINE

DATA wa_seg_5 TYPE ty_seg_5.
    DATA flag.

    WHILE flag EQ space. ENDWHILE.

    READ TABLE t_seg_5 INTO wa_seg_5
      WITH KEY nodeid = SOURCE_FIELDS_3-nodeid.

    IF sy-subrc EQ 0.
      RESULT = wa_seg_5-leaffrom+4(10).
    ENDIF.

NODEID > 0CO_AREA WITH ROUTINE
   DATA wa_seg_5 TYPE ty_seg_5.

    READ TABLE t_seg_5 INTO wa_seg_5
      WITH KEY nodeid = SOURCE_FIELDS_3-nodeid.

    IF sy-subrc EQ 0.
      RESULT = wa_seg_5-leaffrom(4).
    ENDIF.


NODE TEXTS ONE TO ONE MAPPING

INTERVALS

NODEID > 0H_NODEID
LEAFFRMOM >

LEAFTO > 0COSTELMNT WITH ROUTINE
   RESULT = SOURCE_FIELDS_5-leafto+4(10).

LEAFTO > 0CO_AREA WITH ROUTINE
RESULT = SOURCE_FIELDS_5-leafto(4).


OBJECTID > OBJECTID

Please can anyome advise how the mapping should be done or any routines I need to include

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Forhad,

Any particular reason why you have migrated to 7.x flow. Although 7.3 supports transformation and dtps in hierarchy loads I suggest to keep it in 3.x if you don't have a special reason for it.

If you wish to use 7.x flow then you need to use routines to be able to convert the data to right format.

Sap documentation

http://help.sap.com/saphelp_nw73/helpdata/en/ba/45db1795cd41ae83230ae01e882500/frameset.htm

Some more threads

https://scn.sap.com/thread/2127868

http://scn.sap.com/thread/3251605

Regards,

Sujit.

Former Member
0 Kudos

Hi Sujit,

I looked over the documentation you attached, however, which is the function module being stated that needs to be removed from the comments?

Could you please help in providing what exactly needs to be changed on the transformation in order to load to the hierarchy.

Thanks.

Former Member
0 Kudos

When I open the start-routine there is no default coding.

The documentation says:

The corresponding function call is created by default as a comment in a new start routine.

When I create the transformation I get a start routine automatically but there is no function call in the comments.

What is the exact coding needed here?

Answers (1)

Answers (1)

Former Member
0 Kudos

When I open the start-routine there is no default coding.

The documentation says:

The corresponding function call is created by default as a comment in a new start routine.

When I create the transformation I get a start routine automatically but there is no function call in the comments.

What is the exact coding needed here?

michael_sidon
Explorer
0 Kudos

I was searching for this coding, too. I just tried to delete the existing start routine and created a new one. And it works! (BW 7.40)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Michael,

Can you please send me your code?. i got the same problem as you, i tried a lot of code but it still unsuccessfully

Thanks

Former Member
0 Kudos

    CALL METHOD cl_rstran_gen_step_hier_split=>reset_interval_nodes
EXPORTING
i_iobjnm     
= '0COSTELMNT'
i_t_intervals
= SOURCE_PACKAGE_5
CHANGING
c_t_nodes    
= SOURCE_PACKAGE_3.

I_T_INTERVALS     TYPE ANY TABLE

I_IOBJNM          TYPE STRING

C_T_NODES         TYPE ANY TABLE

METHOD reset_interval_nodes.


CONSTANTS: l_c_nodeid TYPE string VALUE 'NODEID'.

FIELD-SYMBOLS: <l_s_nodes>     TYPE any,
<l_s_intervals>
TYPE any,
<l_nodeid>     
TYPE any,
<l_iobjnm>     
TYPE any,
<l_nodename>   
TYPE any,
<l_leaffrom>   
TYPE any.


LOOP AT i_t_intervals ASSIGNING <l_s_intervals>.

UNASSIGN
: <l_s_nodes>, <l_nodeid>, <l_iobjnm>, <l_nodename>,
<l_leaffrom>
.

*   Assign relevant fields
*   If any of the relevant fields can't be assigned => skip this record
ASSIGN COMPONENT 'NODEID' OF STRUCTURE <l_s_intervals> TO <l_nodeid>.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
READ TABLE c_t_nodes ASSIGNING <l_s_nodes>
WITH KEY (l_c_nodeid) = <l_nodeid>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'IOBJNM' OF STRUCTURE <l_s_nodes> TO <l_iobjnm>.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
ASSIGN COMPONENT 'NODENAME' OF STRUCTURE <l_s_nodes> TO <l_nodename>.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
ASSIGN COMPONENT 'LEAFFROM' OF STRUCTURE <l_s_intervals> TO <l_leaffrom>.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.

*     If all relevant fields could be assigned
*     => Overwrite:
*        1. IOBJNM with given source system hierarchy infoobject name
*        2. NODENAME with LEAFFROM
<l_iobjnm>  
= i_iobjnm.
<l_nodename> = <l_leaffrom>.

ENDIF.
ENDLOOP.


ENDMETHOD.

Former Member
0 Kudos

Thanks Thomas,

i paste your code and execute but i got an Error: I_T_INTERVAL is not defined. Check your spelling.

Could you please help me how to fix this Problem?

Thanks

michael_sidon
Explorer
0 Kudos

Hi Pha,

the problem was, that the initially generated start routine was buggy. The workaround was:

- delete the start routine

- activate the transformation

- create a new start routine (no changes are needed!)

- activate the transformation again

The new generated start routine looks like this for a hierarchy with intervals:

  METHOD start_routine.

*=== Segments ===

    FIELD-SYMBOLS:

      <SOURCE_FIELDS_1>    TYPE _ty_s_SC_1,

      <SOURCE_FIELDS_2>    TYPE _ty_s_SC_2,

      <SOURCE_FIELDS_3>    TYPE _ty_s_SC_3,

      <SOURCE_FIELDS_4>    TYPE _ty_s_SC_4,

      <SOURCE_FIELDS_5>    TYPE _ty_s_SC_5.

    DATA:

      MONITOR_REC     TYPE rstmonitor.

*$*$ begin of routine - insert your code only below this line        *-*

... "insert your code here

*--  fill table "MONITOR" with values of structure "MONITOR_REC"

*-   to make monitor entries

... "to cancel the update process

*    raise exception type CX_RSROUT_ABORT.

*-- prepare the node table for correct handling of interval from values

*(from value has to be stored in the nodename of the node).

*-- please make sure that the to value is passed correctly in the interv

*al segment.

    CALL METHOD cl_rstran_gen_step_hier_split=>reset_interval_nodes

      EXPORTING

        i_iobjnm      = 'ACAUFNR'

        i_t_intervals = SOURCE_PACKAGE_5

      CHANGING

        c_t_nodes     = SOURCE_PACKAGE_3.

*-- Remove above code if required

*$*$ end of routine - insert your code only before this line         *-*

  ENDMETHOD.                    "start_routine

Hope that helps.

Best regards

Michael