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: 

Getting message-ID and message-TYPE, but not Message?

naveen_inuganti2
Active Contributor
0 Kudos

Hi Friends,

I am not getting message along with ID and TYPE...in my output table parameter..,

Let me show what i did..,

Delared one table parameter to get output message..,

in table parameter of my function module..,

> ET_RETURN LIKE BAPIRET2

And in the TOP include of that function module..,i declared xreturn

data: xreturn like bapiret2 occurs 0 with header line.

And in the source code of that FM, where I want to trigger taht message..,

perform add_message using 'E' 'MID' '001' ' ' 'ASC'
                                        ' '    ' '    ' '    ' '    ' '.
et_return[] = xreturn[].

Here MID is my message ID, where Iam havingg

one error messages like "THERE IS NO OUPUT FOR THIS"

And have a look at above subroutine, which is saved in F include of that FM,

FORM add_message  USING   type
                          id
                          number
                          language
                          format
                          v1
                          v2
                          v3
                          v4
                          field.
  clear xreturn.                                                             
  move type to xreturn-type.
  move id to xreturn-id.
  move number to xreturn-number.
  move v1 to xreturn-message_v1.
  move v2 to xreturn-message_v2.
  move v3 to xreturn-message_v3.
  move v4 to xreturn-message_v4.
  move field to xreturn-field.
  append xreturn.
  clear xreturn.

ENDFORM.

My probelm is, Iam getting this message in output.., But only ID and TYPE

So messsage as empty...??

Infact I am not good with this area, I did all this with reference of other code..!

Where I did mistake..?

Please let me know..!

Thanks,

Naveen.I

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI Naveen,

This situation arises when message is not mainatined in your logon language. Just check in SE91 giving your message ID and message number whether it is maintained in your login langauge or not.

SE91>enter message class>enter message number>click on message>goto(in menu bar)-->Translation (here you give logon language and check whether it is mainatined or not)

Srikanth.

6 REPLIES 6

Former Member
0 Kudos

Do you want to see the message text?? Coz i think the code is OK..

All the message details will be sent...If you want to read the message text, you can use the FM SWF_T100_DB_MESSAGE_TEXT_READ and pass it the message class and message number...

Else if you want to issue the message to the user...you can make use of the statement MESSAGE msg_class ID msg_id TYPE type.

~Piyush Patil

naimesh_patel
Active Contributor
0 Kudos

You need to bring the message text stored in the message repository.

You can use the syntax to get the messgae:


  clear xreturn.                                                             
  move type to xreturn-type.
  move id to xreturn-id.
  move number to xreturn-number.
  move v1 to xreturn-message_v1.
  move v2 to xreturn-message_v2.
  move v3 to xreturn-message_v3.
  move v4 to xreturn-message_v4.
  move field to xreturn-field.
        MESSAGE ID xreturn-id TYPE xreturn-type NUMBER  xreturn-number
                INTO xreturn-MESSAGE  "<
                WITH xreturn-message_v1 xreturn-message_v2 xreturn-message_v3 xreturn-message_v4.
  append xreturn.
  clear xreturn.

Or you can use the FM FORMAT_MESSAGE to get the message text.

REgards,

Naimesh Patel

0 Kudos

Hi Nimesh,

I am getting MID E 001 in my message field, as our code....!!!

Hi Srikanth..,

I checked it, in the transaletion..,

Original language DE

Target language -- <---no iput.

I given target language as EN, ANd saved. I got following screen..,

Temporary Worklist                                                       1      1

        Mes <MESS> Messages                                                   1      1

            MID 001                               SEDI                               1      1

But no improvement in my problem!!

If i see this transaltion again, no change target language is again empty!

Thanks,

Naveen.I

0 Kudos

I have tested like this:


  move 'I'   to xreturn-type.
  move 'V1'  to xreturn-id.
  move '001' to xreturn-number.
  move '000010' to xreturn-message_v1.
  move 'Test' to xreturn-message_v2.
  move 'More Test' to xreturn-message_v3.
        MESSAGE ID xreturn-id TYPE xreturn-type NUMBER  xreturn-number
                INTO xreturn-MESSAGE  "<
                WITH xreturn-message_v1 xreturn-message_v2 xreturn-message_v3 xreturn-message_v4.
  write: xreturn-message.

It has generated the output as expected:

Consider the minimum quantity for item 000010: Test More Test

Because the Message 001 in the message class V1 contains the text:

Consider the minimum quantity for item &1: &2 &3

Regards,

Naimesh Patel

Former Member
0 Kudos

HI Naveen,

This situation arises when message is not mainatined in your logon language. Just check in SE91 giving your message ID and message number whether it is maintained in your login langauge or not.

SE91>enter message class>enter message number>click on message>goto(in menu bar)-->Translation (here you give logon language and check whether it is mainatined or not)

Srikanth.

0 Kudos

Hi....

This issue if just because of language...

While creating the message it was asking for language to maintain original or log-on,

If I give log on its working fine.,

Also we need to read mesaage with function module like BAPI_MESSAGE_GETDETAIL or above mentioned.

Thanks,

Naveen.I