cancel
Showing results for 
Search instead for 
Did you mean: 

Comments Selection Table using BAdI

Eyal_Feiler
Participant
0 Kudos

Hi Experts,

We want to copy selected comments swapping the entity and Interco similar to the IC_MATCHING in the IFRS toolkit.

This will allow us to share comments between entity and Interco sets.

For Example:

ENTITY INTERCO AUDITID SComment1

1010 I_1120 INPUT_ICE Product x Sales

1120 I_1010 INTCO_ICE Product x purchases

  • 1.How do we access the comments table from the BAdI?
  • 2.Do we use the enhancement spot - UJ_CUSTOM_LOGIC BAdI?

Previously we created a BAdI for financial data but now the data is located in a different table.

(We know the comments table name via UJ0_GET_GEN_TABNAME)

3 Will we receive the data via the CT_DATA or do we need to run a SQL SELECT from the database?

The goal is to run the BAdI from BPC via DM package or possibly even via the default script.

Thanks in advance.

Regards,

Eyal

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Searching SAP notes just found the badi that will do what you need:

BADI_UJC_COMMENT_PREPROCESS

https://launchpad.support.sap.com/#/notes/2002431

https://launchpad.support.sap.com/#/notes/2424484

This badi is available for SAP Business Planning and Consolidation 10.1, version for SAP Netweaver, support package 03+

Answers (4)

Answers (4)

Eyal_Feiler
Participant
0 Kudos

Thanks Vadim

former_member186338
Active Contributor
0 Kudos

Some extra explanation:

When you save data (values) to BPC model:

1. write back badi is triggered with the data to be saved in CT_DATA

2. After data is saved the default.lgf is launched with the scope of data saved.

Nothing happens when comment is saved.

Eyal_Feiler
Participant
0 Kudos

Hi Vadim,

Thanks. Yes we are using the copy comments and clear comments functionality. I also have the comments table name already from UJ0_GET_GEN_TABNAME.

  • 1. Scenario is that controllers are restricted by security to a specific entity. A controller from entity A will enter data (including comments to an input form). As part of saving the data/comments the comments written to an interco (I_B) will copy to that entity ( B ) this will allow the controller from Entity B to immediately see the intercompany data posted against his company (B ).

We want to to run via the default script (this is a specific model for this functionality – no other data is in this model).

My questions are

  • A)To confirm we use the UJ_CUSTOM_LOGIC enhancement spot and
  • B)How does the programmer select the desired comments table. SQL Select or CT Data?

Thanks

Eyal

former_member186338
Active Contributor
0 Kudos

"We want to to run via the default script (this is a specific model for this functionality – no other data is in this model)."

Not possible - no info is available about saved comments.

Have to repeat:

P.S. There is no event that is triggered when comments are saved 😞

It means that your A and B questions are meaningless.

User can launch a DM package to copy comments from one company to another (May be with badi to switch user to prevent security issues).

lucas_costa3
Active Contributor
0 Kudos

P.S. There is no event that is triggered when comments are saved 😞

What I did in the past was to create a "dummy" member that would be changed (+1) every time the comment was altered. That was the work around to trigger custom logic and be able to handle the comments...

But that obviously has its limitation such as, only possible via the specific input form that created for that..

former_member186338
Active Contributor
0 Kudos

You mean dummy member for each comment cell? To my mind if you "absolutely" need to perform some action on the comment save it's better to enhance BPC code (with all maintenance issues).

former_member186338
Active Contributor

Ups, just found badi!

lucas_costa3
Active Contributor
0 Kudos

Nah, not related to the cell but for the comment context - e.g. Project Definition. Then you'd have record saved against the project ID dim + dummy member. It was just a few so no implications with number of dummies.

Amazing finding that badi, and more amazing is the fact that was released in 2014 and no one noticed!

former_member186338
Active Contributor

My search:

Class: CL_UJC_CMTMANAGER

Method: ADD_NEW_CMT (looking for enhancement point)

And:

...
  TRY.
    lf_badi_impl_found = abap_true.
    " Find BAdI implementation
    GET BADI lo_badi
      FILTERS
        appset_id = d_appset_id
        application_id = d_appl_id.
    CATCH cx_badi_not_implemented.
      lf_badi_impl_found = abap_false.
  ENDTRY.
    IF lf_badi_impl_found <> abap_false.
      CALL BADI lo_badi->pre_process
        EXPORTING
          i_appset_id = d_appset_id
          i_appl_id   = d_appl_id
          i_module_id = i_module_id
          i_oper_mod = uj00_c_cmt_oper_add
        IMPORTING
          et_message  = ct_message
          ef_success  = lf_badi_call_success
        CHANGING
          ct_compact_cmtbl = lt_compact_cmtbl.
    ENDIF.

Then double click on pre_pocess, and... badi found!

Former Member
0 Kudos

Hi Eyal,

My requirement is to execute Copy comments package and clear the FROM selection meaning if I am copying

Intersection "A" Comments to "B"

Clear Comments for Intersection "A".

Did you have the same requirement. Any suggestions for this ?.

former_member186338
Active Contributor
0 Kudos

Not related to the question!

Eyal_Feiler
Participant
0 Kudos

Hi Nick,

No we didn't delete. Once re realized the work effort required we dropped this development.

We are implementing SAP Intercompany - rather than work with comments as initially planned.

Good luck

Eyal

former_member186338
Active Contributor
0 Kudos

"How do we access the comments table from the BAdI?" - look on the code of UJ0_GET_GEN_TABNAME to get the name of table and then access this table from ABAP. What's the issue?

Please look also on a standard chain: /CPMB/COPYCOMMENTS

Class: CL_UJD_BPC_CLEAR_COMMENTS

Case is not clear:

"The goal is to run the BAdI from BPC via DM package or possibly even via the default script."

DM package - use standard chain.

default /write back - can be some issues, explain business case!

P.S. There is no event that is triggered when comments are saved 😞

former_member186338
Active Contributor
0 Kudos

P.S. Look on the class:

CL_UJC_CMTMANAGER

Method:

COPY_CMTS