Application Development and Automation 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: 
Read only

Duplicate records using FM 'BAL_DSP_LOG_DISPLAY' in PAI

pramodv
Explorer
3,409

Dear Gurus,

I need to populate few error messages in table format as Pop Up window on a custom screen based on few fields input. The best form of display I opted for is 'BAL_DSP_LOG_DISPLAY' since other FMs like 'C14Z_MESSAGES_SHOW_AS_POPUP' had spacing issue and kind of weird display.

But my issue is, when I call the FM 'BAL_DSP_LOG_DISPLAY' in PAI event, I see messages are getting duplicated on every call of the PAI event. The Pop up will appear multiple times unless are the errors are rectified in the screen and when this happens I see lot of duplicate records in the popup. Any idea of how to clear the old logs or some sort of refresh options. I tried 'BAL_LOG_MSG_DELETE' but I get the exception Log not found. Any help.

Thanks.

4 REPLIES 4
Read only

NTeunckens
Active Contributor
2,055

Please verify if you cal Clear some / All LogMsg via any of the Following FM's :

  • BAL_LOG_MSG_DELETE_ALL
  • BAL_LOG_REFRESH


Personally I would opt for the use of FM "FB_MESSAGES_DISPLAY_POPUP" because you can use a "BAPIRET2"-Table to gather your Messages, possibly sort / delete for Duplicates, and then Show the Results via the FM. Also, any SystemMsg ('SY-MSGNO' / 'SY-MSGTY') can Easily be added to your "BAPIRET2"-Table via FM "ALM_ME_MESSAGE_TO_RETURN" ...

"Fetch any SY-SUBRC Msg or MESSAGE ... into BAPIRET2-Table ...
MESSAGE e005(00) INTO DATA(msg).
CALL FUNCTION 'ALM_ME_MESSAGE_TO_RETURN'
  TABLES
    return = bapiret2table[].

IF bapiret2table[] IS NOT INITIAL.
  "Call Popup
  CALL FUNCTION 'FB_MESSAGES_DISPLAY_POPUP'
    EXPORTING
*     IT_SMESG        = IT_SMESG
*     ID_SMESG_ZEILE  = ID_SMESG_ZEILE
      it_return       = bapiret2table[]
*     ID_SEND_IF_ONE  = ID_SEND_IF_ONE
    EXCEPTIONS
      no_messages     = 1
      popup_cancelled = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
*           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDIF.
Read only

pramodv
Explorer
0 Kudos
2,055

Hi Nic, Thanks for replying. I tried with this FM as well. But the popup looks weird. Please refer the screenshot. Many of the Popups have the same issue. For long messages, they are truncated for display and full message is not seen. Its not even of Grid type of display so that you can scroll and see the rest of the message.

Read only

pramodv
Explorer
2,055

Thanks Nic, the issue got resolved after using FM 'BAL_LOG_REFRESH'.

Read only

NTeunckens
Active Contributor
0 Kudos
2,055

OK, great.

Please close the Question if the Solution was sufficient ...

Kind regards

Nic T.