‎2007 Mar 08 5:09 AM
hi all
i have to convert the type matnr from one itab(say i_mara) to type obnum and put in this itab by using conversion_exit_matn1_input. how can i do this?
kindly can anyone help me?
‎2007 Mar 08 5:13 AM
Hi,
Pass the Matnr field as Importing paramter and pass the Field similar to OBNUM as exporting paramter to the fun module after calling it in code.
Regards,
Anji
‎2007 Mar 08 5:13 AM
Hi,
Pass the Matnr field as Importing paramter and pass the Field similar to OBNUM as exporting paramter to the fun module after calling it in code.
Regards,
Anji
‎2007 Mar 08 5:23 AM
hi anji
i am doing the samething and i have to use this in a select query with for all entries where i_mara -matnr = i_ausp-objnum.
but its not working.
what can i do.
kindly help me
‎2007 Mar 08 5:30 AM
SELECT matchin MATNR from database will not work because you have to use MATNR value with proper formatting
For this use TYPE MATNR field instead of i_ausp-objnum (which I guess is type OBJNUM 20 char).
So first convert i_ausp-objnum to TYPE MATNR by calling CONVERSION_EXIT_MATN1_INPUT with INPUT = i_ausp-objnum and OUTPUT = TYPE MATNR field say V_MATNR. Store V_MATNR value thus calculated in another copy of i_ausp table, say i_ausp2 table in a new field i_ausp2-matnr.
Now do the SELECT query select query with for all entries where i_mara -matnr = i_ausp-matnr.
‎2007 Mar 08 5:41 AM
data: m_objek type objnum.
hi anji
i am doing the following code and after that writing the select statements , but thats not working.
types:begin of t_matnr,
matnr type matnr,
end of t_matnr.
data: i_matnr type standard table of t_matnr,
w_matnr type t_matnr.
loop at i_matnr into w_matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = w_matnr-matnr
IMPORTING
OUTPUT = m_objek
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.
at new matnr.
w_matnr-matnr = m_objek.
modify i_matnr from w_matnr.
append w_matnr to i_matnr.
clear:w_matnr.
endat.
endloop.
loop at i_material into w_material.
read table i_matnr into w_matnr with key matnr = w_material-matnr binary search.
if sy-subrc = 0.
move:w_matnr-matnr to w_material-matnr.
modify i_material from w_material.
endif.
clear:w_matnr, w_material.
endloop.
‎2007 Mar 08 5:49 AM
Where is the SELECT with FOR ALL entries? Moreover the function in your code converts a non MATNR type to MATNR formatting. So the IMPORT parameter should be MATNR type. You will see that it will be formatted in 18 char with leading zeros
‎2007 Mar 08 5:54 AM
Though you can always give a TYPE MATNR fields in both input and output. The difference would be like this -
if input = 12345678
ouput = 000000000012345678
Input can be MATNR type or not but Output should always be TYPE MATNR field
I hope I made myself clear
‎2007 Mar 08 6:27 AM
hi vishnu thank for all
i tried the o/p to be type matnr as u said but still its not working.
what can i do?
can any one suggest?
thanks in advance
data: m_matnr type matnr.
types:begin of t_matnr,
matnr type matnr,
end of t_matnr.
data: i_matnr type standard table of t_matnr,
w_matnr type t_matnr.
loop at i_matnr into w_matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = w_matnr-matnr
IMPORTING
OUTPUT = m_matnr
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.
at new matnr.
w_matnr-matnr = m_matnr.
modify i_matnr from w_matnr.
append w_matnr to i_matnr.
clear:w_matnr.
endat.
endloop.
loop at i_material into w_material.
read table i_matnr into w_matnr with key matnr = w_material-matnr binary search.
if sy-subrc = 0.
move:w_matnr-matnr to w_material-matnr.
modify i_material from w_material.
endif.
clear:w_matnr, w_material.
endloop.
‎2007 Mar 08 6:29 AM
I can see a loop on an internal table, and you are appending the internal table within the loop itself? Doesn't make much sense to me.
Can you please explain in detail what you trying to do. Explain the full problem at hand. Then I can help you.
‎2007 Mar 08 5:30 AM
Hi,
the matnr field is char type with length 18 but the objnum field is character type with length 50 . So you can concatenate spaces to that field and then move it in the corresponding field in the internal table.
Regards,
Sunmit.