This is a test message to test the length of the message box.
Login
|

Kommentar verfassen

Das Schreiben von Kommentaren ist nur registrierten Benutzern erlaubt, die Registrierung ist kostenlos und erfordert keine E-Mail Adresse und kann schnell hier durchgeführt werden.

Miss the result of bgPF returned

DungVT - 13.04.2025 - 05:50

Hi guy, I have posted 3 Journal Entries using bgPF (SAP Public Cloud ABAP Environment) in control mode.

Some codes here:

  1. save_modified
   LOOP AT update-JournalEntryHeader ASSIGNING FIELD-SYMBOL(<f_update>).

      " Check if a process via bgpf shall be started
      IF     <f_update>-Xmwst          = zbgpfcl_post_je_ps=>bgpf_state-started_from_bo
         AND <f_update>-%control-Xmwst = if_abap_behv=>mk-on.


        TRY.

            zbgpfcl_post_je_ps=>run_via_bgpf( EXPORTING i_rap_bo_entity_key      = <f_update>-%key
                                              IMPORTING e_process_monitor_string = lv_monitor
                                                        e_state                  = lv_state ).

          CATCH cx_bgmc INTO DATA(bgpf_exception).

        ENDTRY.

      ENDIF.

      " JENumber is updated via BGPF
      IF <f_update>-%control-JENumber = if_abap_behv=>mk-on.

        CLEAR events_to_be_raised.
        APPEND INITIAL LINE TO events_to_be_raised.
        events_to_be_raised[ 1 ] = CORRESPONDING #( <f_update> ).
        RAISE ENTITY EVENT zr_upl_je_psJournalEntryHeader~GetJENumber FROM events_to_be_raised.

      ENDIF.

    ENDLOOP.
  1. Class zbgpfcl_post_je_ps
  METHOD run_via_bgpf.
    TRY.
        DATA(process_monitor) = cl_bgmc_process_factory=>get_default( )->create(
                                              )->set_name( |Post Custom JE Peoplesoft|
                                              )->set_operation(
                                                  NEW zbgpfcl_post_je_ps( i_rap_bo_entity_key = i_rap_bo_entity_key )
                                              )->save_for_execution( ).

        e_process_monitor_string = process_monitor->to_string( ).
        e_state = process_monitor->get_state( ).


      CATCH cx_bgmc INTO DATA(lx_bgmc).
        e_process_monitor_string = lx_bgmc->get_longtext( ).
    ENDTRY.
  ENDMETHOD.
  1. if_bgmc_op_single~execute.

I implemented data and called the API to post the Journal Entry.

==========================================================================

One strange thing is that most cases are successful, but sometimes, I cannot obtain the result from bgPF.

The custom log indicates that I triggered three bgPF processes, but I only received two results: 0100000629 and 0100000631, and I missed 0100000630. When I returned to SAP Public Cloud and checked 0100000630, it already existed in the system, but the bgPF could not get it.

Is there any step I missed?

Please let me know and correct me if I am wrong.

Thank you so much.


Xexer - 13.04.2025 - 21:32

Hello DungVT,

have you checked bgPF queue in the system? When it's working for 2/3 cases, there must be another problem. Maybe there was a lock on the entry and the process was not finished. Maybe check, if you handle all error situations and maybe the bgPF process should also create a log.

Greetings Björn