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: 

No Import-Parameter in FM BAL_DB_LOAD

gabriel_jussli4
Discoverer
0 Kudos

Hello Experts

I using in my report the FM BAL_DB_LOAD but unfortunately I got no value

in my internal Table ( lt_msg_hdr ) back.

The input table gt_log_header got the necessary values.

Have anybody a idea?

regards

Gabriel

Here is my coding:

  DATA: lv_log_handle_tab TYPE bal_t_logh

      , lv_log_nr_tab     TYPE bal_t_lgnm

      .

  APPEND av_log_handle TO lv_log_handle_tab.


  CALL FUNCTION 'BAL_DB_SAVE'

    EXPORTING

      i_client         = sy-mandt

      i_save_all       = ' '

      i_t_log_handle   = lv_log_handle_tab

    IMPORTING

      e_new_lognumbers = lv_log_nr_tab

    EXCEPTIONS

      log_not_found    = 1

      save_not_allowed = 2

      numbering_error  = 3

      OTHERS           = 4.

  IF sy-subrc <> 0.

    RAISE save_error .

  ENDIF .




 DATA: lt_msg_hdr    type bal_t_msgh,

        ls_msg_hdr    TYPE BALMSGHNDL,

        l_s_msg       TYPE bal_s_msg,

        l_help_info   TYPE help_info,

        lv_count_mass TYPE n.

  CLEAR lt_msg_hdr.





  DATA: gr_object     TYPE bal_s_obj,

         gr_extnumber  TYPE bal_s_extn,

         gs_log_filter TYPE bal_s_lfil,

         gt_log_header TYPE balhdr_t.




  CLEAR: gs_log_filter, gr_extnumber.



*- Search only log file of this application

  gr_object-sign   = 'I'.

  gr_object-option = 'EQ'.

  gr_object-low    = 'ZISW_TEST'.

  APPEND gr_object TO gs_log_filter-object.



*- Search only log file of this change number

  gr_extnumber-sign   = 'I'.

  gr_extnumber-option = 'EQ'.

  gr_extnumber-low    = lv_auftrag.

  APPEND gr_extnumber TO gs_log_filter-extnumber.





*-- Search for log files on the database

  CALL FUNCTION 'BAL_DB_SEARCH'

    EXPORTING

      i_s_log_filter     = gs_log_filter

    IMPORTING

      e_t_log_header     = gt_log_header

    EXCEPTIONS

      LOG_NOT_FOUND      = 1

      NO_FILTER_CRITERIA = 2.

  IF sy-subrc <> 0.

    RAISE read_error .

  ENDIF.


*-- Load log files from database into memory

  CALL FUNCTION 'BAL_DB_LOAD'

    EXPORTING

      i_t_log_header     = gt_log_header

    IMPORTING

      e_t_msg_handle     = lt_msg_hdr

    EXCEPTIONS

      no_logs_specified  = 1

      log_not_found      = 2

      log_already_loaded = 3

      OTHERS             = 4.

  IF sy-subrc <> 0.

    RAISE read_error .

  ENDIF.


1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Are you able to see your log headers in transaction SLG1 and were some message displayed?

  • Insure the messages were created with some call of BAL_LOG_MSG* FM before db save
  • Look at samples like reports SBAL_DEMO_05 or SBAL_DEMO_06
  • Did you try to call BAL_DSP_LOG_DISPLAY in place of getting list of messages
2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

Are you able to see your log headers in transaction SLG1 and were some message displayed?

  • Insure the messages were created with some call of BAL_LOG_MSG* FM before db save
  • Look at samples like reports SBAL_DEMO_05 or SBAL_DEMO_06
  • Did you try to call BAL_DSP_LOG_DISPLAY in place of getting list of messages

0 Kudos

Hi,

I wanted to save and load the messages in the same sap-window-session from the

database but it can't work.

After your advice I realized that I have to load the messages from the memory.

Thanks