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

Doubt in message class.

Former Member
0 Likes
1,130

Hi All.

I have one input field like MATNR (Module pool),if i enter invalid Material no , i need error message with what we given in input field .i done it ,like

Example: This Material no 000000000204004990 does not exit in MARA.

But Now i want remove the leading zero’s in the message.like

Example: This Material no 204004990 does not exit in MARA.

How can i do?

please help me.

Regards.

Raju.j

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,103

Hi,

Assign the material number to a character variable (say data v1(18)).

v1 = mat_no.

pack v1 to v1.

Then use v1 in message.

10 REPLIES 10
Read only

former_member404244
Active Contributor
0 Likes
1,103

Hi ,

u can do this by using FM CONVERSION_EXIT_ALPHA_OUTPUT.

regards,

nagaraj

Message was edited by:

nagaraj kumar nishtala

Message was edited by:

nagaraj kumar nishtala

Read only

Former Member
0 Likes
1,103

use FM CONVERSION_EXIT_ALPHA_OUTPUT

regards

shiba dutta

Read only

Former Member
0 Likes
1,103

Hi Raju

Please pass the value to FM: CONVERSION_EXIT_ALPHA_OUTPUT to truncate the leading ZEROES.

Alternatively, we can use SHIFT LEFT command as well...

Eg: SHIFT <matnr> LEFT DELETING LEADING '0'.

Kind Regards

Eswar

Read only

0 Likes
1,103

Hi Eswar.

I want elemenate Zero's in Message. i done it in input fields.

Read only

0 Likes
1,103

Hi Raju

I guess you will be passing the value of material number to the message class to display the message, hence use any of the above methods to remove the leading ZEROES and then pass to the message class to get the desired output.

I guess you are using Z message class.

If you have still doubts, please post your code of displaying the message so we can be able to help you.

Kind Regards

Eswar

Read only

graghavendra_sharma
Contributor
0 Likes
1,103

Try using <b>PACK</b> command

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,104

Hi,

Assign the material number to a character variable (say data v1(18)).

v1 = mat_no.

pack v1 to v1.

Then use v1 in message.

Read only

0 Likes
1,103

hi Jayanthi.

Thank you so much i solved my problem with your help.

I given 10 mark to your help.

Read only

anversha_s
Active Contributor
0 Likes
1,103

hi raju,

do this.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = wf_matnr
            IMPORTING
              output =  wf_matnr.

Example:


input = 00000000000123 
output = 123

Rgds

Anver

Read only

Former Member
0 Likes
1,103

Define a new variable of type n, pass your screen value to it, and use it in your message.

data g_matnr(xx) type n.

.....

g_matnr = matnr ...(your screen value)

.......

message xxx(xx) with g_matnr.