Skip to Content
author's profile photo Former Member
Former Member

return table in update rules

hi,

in update rules there is option of return table

i know what is return table but i dont know

where and how to write a code for that

please suggest me in which scenario it is generally used

i will assign points

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 15, 2007 at 03:47 PM

    Lets say your info source supplies profit center, month,amount to the cube and you wish to add another field or fields such as the cost centers that are assigned to this profit center, then you use return table to do this. In this case, you cant derive the cost center with master data attribute option, as they have 1:M relationships.

    Ravi Thothadri

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 15, 2007 at 04:47 PM

    thanks for answering

    but its not clear

    like where to write code in update rules

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I have the same issue, and Im trying to make to two registers in destination for each one on the source.

      Example:

      Source ODS

      CREDIT SECECO KF1 KF2

      000001 ABC 5.5 10.1

      000002 EFG 6.3 11.5

      Expected Result:

      Destination ODS (Key Values = CREDIT, TYPE)

      CREDIT SECECO TYPE KF3

      000001 ABC 1 5.5

      000001 ABC 2 10.1

      000002 EFG 1 6.3

      000002 EFG 2 11.5

      Real Result 1:

      CREDIT SECECO TYPE KF3

      000001 00 1 5.5

      000001 00 2 10.1

      000002 00 1 6.3

      000002 00 2 11.5

      Im using a return table for Update routine KF3 and it is working fine. However SECECO (a characteristic) is getting blank values always.

      Here my code:

      FORM compute_data_field

      TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring

      RESULT_TABLE STRUCTURE /BIC/AZBI990400

      USING COMM_STRUCTURE LIKE /BIC/CS8ZBI9905

      RECORD_NO LIKE SY-TABIX

      RECORD_ALL LIKE SY-TABIX

      SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

      ICUBE_VALUES LIKE /BIC/AZBI990400

      CHANGING RETURNCODE LIKE SY-SUBRC "Do not use!

      ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update

      *

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

      • fill the internal table "MONITOR", to make monitor entries

      • DATA:

      RESULT_TABLE = ICUBE_VALUES.

      RESULT_TABLE-/bic/KF3 = COMM_STRUCTURE-/BIC/KF1.

      RESULT_TABLE-/bic/SECECO = COMM_STRUCTURE-/BIC/SECECO.

      RESULT_TABLE-/bic/TYPE = 1.

      APPEND RESULT_TABLE.

      RESULT_TABLE-/bic/KF3 = COMM_STRUCTURE-/BIC/KF2.

      RESULT_TABLE-/bic/SECECO = COMM_STRUCTURE-/BIC/SECECO.

      RESULT_TABLE-/bic/TYPE = 2.

      APPEND RESULT_TABLE.

      • if the returncode is not equal zero, the result will not be updated

      RETURNCODE = 0.

      • if abort is not equal zero, the update process will be canceled

      ABORT = 0.

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

      ENDFORM.

      The Update Rules for SECECO is left as Blank. I tried mapping it to SECECO but the result was this:

      Real Result 2:

      CREDIT SECECO TYPE KF3

      000001 ABC 0.0

      000001 00 1 5.5

      000001 00 2 10.1

      000002 EFG 0.0

      000002 00 1 6.3

      000002 00 2 11.5

      I have already tried with a fixed value like the one for TYPE, still no succees. The only difference between SECECO and TYPE is that TYPE is part of the key of the ODS Destiny. However SECECO must not be part of the key.

      I also tried looping the RESULT_TABLE at the end and assigning the value directly to SECECO with the same result.

      ¿What else should I consider?

      I would award points.

      DavidG

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.