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

Converting error message into French

Former Member
0 Likes
1,624

HI all...

Is it possible to somehow convert error code coming from BAPI call from <b><u>English to French</u></b>; provided user logged into SAP system with English language?

Thanks,

Pooja

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,556

HI,

loop at it_return. " return table from bapi

Use the language parameter in the format_message function module and pass FR and messege id etc to it.

endloop.

Thanks

Mahesh

HI all...

Is it possible to somehow convert error code coming from BAPI call from <b><u>English to French</u></b>; provided user logged into SAP system with English language?

Thanks,

Pooja

10 REPLIES 10
Read only

Former Member
0 Likes
1,557

HI,

loop at it_return. " return table from bapi

Use the language parameter in the format_message function module and pass FR and messege id etc to it.

endloop.

Thanks

Mahesh

Read only

0 Likes
1,556

Hi Mahesh,

Thanks for your response.

I have used the functional module FORMAT_MESSAGE in following way and I am getting below showed values.

************************************************************************************************

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = SY-MSGID

LANG = 'FR'

NO = SY-MSGNO

V1 = SY-MSGV1

V2 = SY-MSGV2

V3 = SY-MSGV3

V4 = SY-MSGV4

IMPORTING

MSG = message

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.

**************************************************************************************************


Before function call message

looks like :

-

-


No customer master record exists for customer 10000080----

-


Sales document was not changed

**************************************************************************************************

Message contains following value after function call :

-

-


Le document de vente n'est pas modifié-------Le document de vente n'est pas modifié</b>

***************************************************************************************************

I dont think that its really converting message into french, but its just converting into some constant text.

Do you know any other method which can handle my requirement ?

Thanks,

Pooja

Read only

0 Likes
1,556

Loop at return.

select message text from T100 with message class and number with language equal to french.

update in return.

endloop.

Read only

0 Likes
1,556

So Nilesh does it mean that I cant give any text stored in variable and FORMAT_MESSAGE converts into French ??

Read only

0 Likes
1,556

Message is basically the combined error code received from BAPI call.

Do you think I am going wrong in defining the functional module ?

Read only

0 Likes
1,556

oops i haven't checked the FM, it return the same text as which is maintained in t100 in resp. language.

Please confirm the message in T100 table where it is same in French or not.

Read only

0 Likes
1,556

Thanks Nilesh for your response.

I am not an ABAPer so I really dint understand your response.

As per me if I am sending two different text then response should be two different text but seems that FORMAT_MESSAGE is returning same text.

Read only

0 Likes
1,556

Format_message is not converting any message from one language to another language. It will return the stored message in provided language.

For ex.

If you pass ID as 00, Language as DE and NO as 002. It will return message in German language. If you change language from German to English it will return in English language.

What you have to do it just pass the return parameter from bapi to this format_message function module.

Just pass ID, Number, Message_v1 to Message_v4 and requried Language to the respective parameters of format_message function module.

Read only

0 Likes
1,556

Hi Nilesh,

I tried to work in your approach. I have variable ls_return1 which actually contains the return table from BAPI and I have tried passing that in FORMAT_MESSAGE in following way :

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = SY-MSGID

LANG = 'FR'

NO = SY-MSGNO

V1 = SY-MSGV1

V2 = SY-MSGV2

V3 = SY-MSGV3

V4 = SY-MSGV4

IMPORTING

MSG = ls_return1

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

ENDIF.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

But I am getting error dump saying

Runtime error: OBJECTS_MOVE_NOT_SUPPORTED.

and text as :

Conversion of type "C" to type "h" not supported..........................

Nilesh/anyone else see any problem in here ???

Thanks

Pooja

Read only

0 Likes
1,556

Hi could you send me the input which you passing to format_message FM.

I guess some incorrect parameter you pass to format_message FM.

It will better you check with your technical consultant, if possible.