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

Read parameters content from dynpro

Former Member
0 Likes
589

Hello,

I have a problem with reading a parameters content.

Following coding:

...

...

  • Log table

DATA: BEGIN OF it_log OCCURS 0,

matnr_short(10),

matnr TYPE matnr,

END OF it_log.

...

...

PARAMETERS s_matnr TYPE rmmg1-matnr.

...

...

Now I enter numbers like 1234000000, 1235000000, 1236000000.

Content of s_matnr will be 000000001234000000, etc.

Q: How can I read all entries of s_matnr into it_log-matnr ?

2.Q: How can I read 1234000000 to it_log-matnr_short ?

Thanks a lot!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
559

What the user enters and sees is 1234000000. But internally, SAP stores it with leading zeroes, this is why you see 000000001234000000 in debug, and this value is also stored in database.

The conversion from 1234000000 to 000000001234000000 is made by a function module named CONVERSION_EXIT_<routine>_INPUT, see below for value of <routine>.

The conversion from 000000001234000000 to 1234000000 is made by a function module named CONVERSION_EXIT_<routine>_OUTPUT.

To find out the <routine> value:

Start SE11 transaction

Look at structure "rmmg1"

Look at the component of its field "matnr" (it is a data element)

Look at the domain of this data element

Look at the "routine" of this domain. If it is named MATN1, it means that the conversion functions are CONVERSION_EXIT_MATN1_INPUT and CONVERSION_EXIT_MATN1_OUTPUT.

You can call yourself the second function module if you need to remove the zeroes.

Sap library here : http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee19446011d189700000e8322d00/frameset.htm

3 REPLIES 3
Read only

Former Member
0 Likes
560

What the user enters and sees is 1234000000. But internally, SAP stores it with leading zeroes, this is why you see 000000001234000000 in debug, and this value is also stored in database.

The conversion from 1234000000 to 000000001234000000 is made by a function module named CONVERSION_EXIT_<routine>_INPUT, see below for value of <routine>.

The conversion from 000000001234000000 to 1234000000 is made by a function module named CONVERSION_EXIT_<routine>_OUTPUT.

To find out the <routine> value:

Start SE11 transaction

Look at structure "rmmg1"

Look at the component of its field "matnr" (it is a data element)

Look at the domain of this data element

Look at the "routine" of this domain. If it is named MATN1, it means that the conversion functions are CONVERSION_EXIT_MATN1_INPUT and CONVERSION_EXIT_MATN1_OUTPUT.

You can call yourself the second function module if you need to remove the zeroes.

Sap library here : http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee19446011d189700000e8322d00/frameset.htm

Read only

Former Member
0 Likes
559

OK Sandra,

I will try to convert in the way you described. Thx.

Q: How can I read all the material numbers in s_matnr to it_log structure?

Read only

0 Likes
559

Something like that :

it_log-matnr = s_matnr
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING input = s_matnr
IMPORTING output = it_log-short_matnr

Maybe an error in your code: don't you want to use SELECT-OPTIONS ... FOR ... instead of PARAMETERS ... TYPE ... for having multiple values ? (as I see that it_log is an internal table)