cancel
Showing results for 
Search instead for 
Did you mean: 

Write Comments Using BADI

Former Member
0 Kudos

Hi All,

Can anyone please guide me on how we can write / retrieve a comment using BADI? Appreciate your help as I am not really familiar to it.

Thank you.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can use this class cl_uj_gen_table-get_ddic_table_name to get the desired comments database table name and use select statement after that. When you are rewriting the record. if you are inserting the record as a new record then you need to generate recordid for that you can use this class to generate the recordid cl_uj_services=>generate_guid( IMPORTING e_uni_idc = Dataobject ). Otherwise simple modify statement will do.

Thanks,

Arun

Former Member
0 Kudos

Hi Xin,

Take a look on class CL_UJC_CMTMANAGER, methods:

GET_CMTInstance MethodPublicBPC: Get Comment Entries
DEL_CMTInstance MethodPublic                              BPC: Delete Comment Entries
UPDATE_CMTInstance MethodPublic                              BPC: Update Comment Entries
ADD_CMTInstance MethodPublic                              BPC: Add a Comment Entry

You can use these methods through write back badi. Furthermore, using data manager package process.

Best Regards,

Lucas

former_member182766
Contributor
0 Kudos

Hello!

Comments are stored in a simple db tables which always follow the naming rules:

BPC creates tables/1CPMB/XXYYYCMT and /1CPMB/XXYYYCMTA to store comments in SAP.

In order to see the comments table, you need Appset prefix(XX) and Application prefix(YYY), which you can get from tables like UJA_APPSET_INFO and UJA_APPL. Or just do a search within SE11 using wildcard *CMT to find the comments tables and see what's in there.