Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Details of DB12 Into Custom Program

rbharathi123
Explorer
1,691

Hi Experts,

Can Any one give me solution how to get Backup catelog details from DB12 Tcode into My Custom Report Program which is shown below.

1 ACCEPTED SOLUTION

xiaosanyu
Participant
1,588
TRY.
DATA(system) = cl_db6_sys=>get_sys_ref( system_id = sy-sysid
synchronize = abap_false ).
DATA(meta) = cl_dba_rdi_meta=>get_instance( sys_ref = system
use_new_query_processor = abap_false ).
DATA(query) = NEW cl_hdb_rdi_query( rdi_meta = meta ).
DATA itab TYPE hdb_backup_catalogue_tab.
query->if_dba_rdi_query~set_top_n( 1000 ).
query->if_dba_rdi_query~get_snapshot( EXPORTING ddic_src = cl_hdb_rdi_meta=>co_ddic_hdb_backup_catalogue
IMPORTING data = itab ).
CATCH cx_root.
ENDTRY.

please try :).

10 REPLIES 10

raymond_giuseppi
Active Contributor
0 Kudos
1,588

Look at tables SDBAH and SDBAD (or execute a trace during execution of the transaction)

0 Kudos
1,588

Hi Raymond,

I checked both SDBAH and SDBAD tables but database table entries are empty and im not able to find any details through tracing also.

xiaosanyu
Participant
1,589
TRY.
DATA(system) = cl_db6_sys=>get_sys_ref( system_id = sy-sysid
synchronize = abap_false ).
DATA(meta) = cl_dba_rdi_meta=>get_instance( sys_ref = system
use_new_query_processor = abap_false ).
DATA(query) = NEW cl_hdb_rdi_query( rdi_meta = meta ).
DATA itab TYPE hdb_backup_catalogue_tab.
query->if_dba_rdi_query~set_top_n( 1000 ).
query->if_dba_rdi_query~get_snapshot( EXPORTING ddic_src = cl_hdb_rdi_meta=>co_ddic_hdb_backup_catalogue
IMPORTING data = itab ).
CATCH cx_root.
ENDTRY.

please try :).

0 Kudos
1,588

Hi xiaosan yu,

Thank you very much for your Source code and its been working, I have been Looking for this answer for more than a week, finally you have given. Thank you very much xiaosan yu.

1,588

Hi, Bharathi R,

I am very glad to help you.

0 Kudos
1,588

Dear xiaosan yu,

Last time youve shared me source code, from that im getting Tetant DB backup details, Now the issue is I need to get system DB details from DB12, I have debugged the standard program but it is protected by Kernal mode as shown below.

Can you tell me or share any source code to get system DB backup status details.

Regards,

Bharathi

0 Kudos
1,588

hi,rbharathi123

I'm a bit confused about the difference between the backup details of Titant DB and system DB, and where did you see the system DB backup details?

0 Kudos
1,588

Hi xiaosanyu,

In our Hana system we have two System. one is IKD(development) and second one is System DB.

he source code you shared me is for IKD, If its possible let me know how to get system db details.

In below one look at the destination path is DB_IKD ( Belongs to IKD )

In below one destination path is DB_systemdb ( belongs to System DB )

These System DB details gets displayed when im switching from IKD to SYSTEMDB

Regards,

Bharathi

0 Kudos
1,588

pls try, change system_id = sy-sysid to system_id = 'SYSTEMDB'

0 Kudos
1,588

Hi xiaosanyu,

Once Again Thank you for suggestion, Its working but the issue is while executing the code the SYSTEMDB is getting delete in DB12,

we need to add the system DB manually Again.

Regards,

Bharathi.