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

ABAP routine to populate key figures from another ODS

HI all,

I have GL ODS and Purchasing ODS . our requirement is

GL Account doc Number , Amount, PO , PO Line ,PO Amount in one report. I have created infoset with GL and PO data tagets but I am getting

PO PO LIne POAMT ACCT DOC AMOUNT

1234 10 4000 33333 1000

- 10 4000 44444 2000

- 10 4000 55555 1000

actully we want the report folowing format

PO PO LIne POAMT ACCT DOC AMOUNT

1234 10 4000 33333 1000

- - - 44444 2000

- - - 55555 1000

I tried almost all methods in query designer to eliminate reating values but no luck.

PO Line item has multiple invoices thats why infoset repeating po amount at each invoice level . so I am planning to write abap routine in GL ods update rule to read po ods net price.

but I don"t know how to write abap program if po line item has multiple invoices.

I have PO and Line item in GL ods .

Appriciate your response

Thanks

Rohan

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2006 at 06:56 AM

    Hi,

    Check out this thread..

    abap-routine-to-join-two-ods-objects-into-one

    Rgds,

    San!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Rohan,

      first of all sorry for late reply. the data format you are refering to is in Report i think.

      try this code on 0FI_GL02 start routine of update between this ods and cube.

      And make sure that you GL account PO and POitem are in same dimension of cube. and then make a report and let me this works...

      *********************************************

      PROGRAM UPDATE_ROUTINE.

      $$ begin of global - insert your declaration only below this line -

      TABLES: /BIC/A0PUR_O0100. ' PO ODS

      • DATA: ...

      $$ end of global - insert your declaration only before this line -

      • The follow definition is new in the BW3.x

      TYPES:

      BEGIN OF DATA_PACKAGE_STRUCTURE.

      INCLUDE STRUCTURE /BIC/CS8Z0FIGL_O02.

      TYPES:

      RECNO LIKE sy-tabix,

      END OF DATA_PACKAGE_STRUCTURE.

      DATA:

      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE

      WITH HEADER LINE

      WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

      FORM startup

      TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring

      MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n

      DATA_PACKAGE STRUCTURE DATA_PACKAGE

      USING RECORD_ALL LIKE SY-TABIX

      SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

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

      *

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

      • fill the internal tables "MONITOR" and/or "MONITOR_RECNO",

      • to make monitor entries

      DATA: S_DATA TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE

      WITH HEADER LINE

      WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

      DATA: ITEM_TABLE TYPE STANDARD TABLE OF /BIC/A0PUR_O0100

      WITH HEADER LINE

      WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

      *start of modification

      *Populating the order number data from ODS1 table

      SELECT * FROM /BIC/A0PUR_O0100 INTO TABLE ITEM_TABLE.

      SORT DATA_PACKAGE BY 0GL_ACCOUNT PO POITEM 0AC_DOC_NO(infoobject) ASCENDING.

      SORT ITEM_TABLE BY 0GL_ACCOUNT PO POITEM (infoobject) ASCENDING.

      LOOP AT DATA_PACKAGE INTO S_DATA.

      LOOP AT ITEM_TABLE WHERE GL_ACCOUNT = S_DATA-GL_ACCOUNT and PO = S_DATA-PO and POITEM = S_DATA-POITEM.

      if sy-subrc eq 0.

      s_data-net_po_val = iten_table-0NET_PO_VAL

      if s_data-vendor is intial

      s_data-vendor = item_table-vendor.

      endif.

      endif.

      APPEND S_DATA.

      ENDLOOP.

      ENDLOOP.

      DATA_PACKAGE[] = S_DATA[].

      • 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.

      ********************************************************

      Any issues, revert back

      Regards,

      San!

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.