Skip to Content
0

Duplicate records using FM 'BAL_DSP_LOG_DISPLAY' in PAI

Jan 11 at 07:40 PM

47

avatar image
Former Member

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.

capture1.jpg (116.8 kB)
10 |10000 characters needed characters left characters exceeded

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.
1
Former Member
Nic Teunckens

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.

capture2.jpg (56.1 kB)
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Jan 12 at 04:26 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

OK, great.

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

Kind regards

Nic T.

0