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

Has anyone used the FORMAT_MESSAGE function module in ECC 6.0 ??

Former Member
0 Likes
1,791

We've upgraded to ECC 6.0 and now I have a BDC program using FORMAT_MESSAGE function module that has a problem. The number after the & (&1, &2, &3, &4) in the function mod isn't replaced, it stays as a literal and only the & is replaced with a valid value which it then passes back to the program.

Anyone else have this problem? Any ideas how to fix?

thanks

lz

We've upgraded to ECC 6.0 and now I have a BDC program using FORMAT_MESSAGE function module that has a problem. The number after the & (&1, &2, &3, &4) in the function mod isn't replaced, it stays as a literal and only the & is replaced with a valid value which it then passes back to the program.

Anyone else have this problem? Any ideas how to fix?

thanks

lz

4 REPLIES 4
Read only

Former Member
0 Likes
936

Hi,

Try using the FM message_prepare...

DATA: v_message TYPE string.

CALL FUNCTION 'MESSAGE_PREPARE'
  EXPORTING
    language               = sy-langu
    msg_id                 = '00'
    msg_no                 = '275'
    msg_var1               = 'Test'
    msg_var2               = 'Test'
  IMPORTING
    msg_text               = v_message
  EXCEPTIONS
    function_not_completed = 1
    message_not_found      = 2
    OTHERS                 = 3.

WRITE: / v_message.

Thanks

Naren

Read only

naimesh_patel
Active Contributor
0 Likes
936

Instead of the FM you can try with the MESSAGE with addition into .


 MESSAGE ID '00' TYPE 'E' NUMBER '398'
         into IT_MESSAGE-message
         WITH 'Test Message' SY-MSGV2 SY-MSGV3 SY-MSGV4.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
936

Hi,

try like this....


*&---------------------------------------------------------------------*
*&      Form  CALL_TRANSACTION
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM call_transaction .
  CALL TRANSACTION '<Y......>' USING it_bdcdata
                             MESSAGES INTO messtab
                             MODE 'N'
                             UPDATE 'S'.

  LOOP AT messtab.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        id        = messtab-msgid
        lang      = sy-langu
        no        = messtab-msgnr
        v1        = messtab-msgv1
        v2        = messtab-msgv2
        v3        = messtab-msgv3
        v4        = messtab-msgv4
      IMPORTING
        msg       = msg_txt
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    IF messtab-msgtyp EQ 'E'.
      WRITE:/ icon_checked AS ICON, 10 msg_txt.
      WRITE: 5 i_tab-wb_book COLOR 6.
*    ELSEIF messtab-msgtyp EQ 'S'.
*      WRITE:/10 msg_txt COLOR 6.
*    ELSEIF messtab-msgtyp EQ 'W'.
*      WRITE:/10 msg_txt COLOR 3.
*    ELSE.
*      WRITE:/10 msg_txt COLOR 4.
    ENDIF.
    CLEAR msg_txt.
  ENDLOOP.
  REFRESH:it_bdcdata,messtab.

ENDFORM.                    " CALL_TRANSACTION

Arunima

Read only

Former Member
0 Likes
936

Thanks everyone for your help.