‎2005 Jun 20 6:24 PM
Hi,
somebody has written mv45afzz program. now I am modifying that.
last week i included a field in vbap table as field1 (CHAR, 18).
num1 field has CHAR(10).
FORM USEREXIT_MOVE_FIELD_TO_VBAP.
if vbap-matnr <> *vbap-matnr.
clear vbap-field1.
select single t1~num1 into vbap-field1
from mara as t1 inner join zcust as t2
on t1num1 = t2num1
where matnr = vbap-matnr
and mtart = 'NSTK'
and delet = ''.
endif.
this user exit is related to Contracts(va41). when i am giving material number in va41, it is checking with mara table and saying that number is not valid.
for example i entered 1001 number as matnr which is exist in the mara table.
In debug mode, i added 14 zeros in field1, then it is working perfectly.
shall i need to call the field conversion function module like...
CONVERSION_EXIT_MATN1_INPUT...
anybody has idea...
Thanks in advance,
Yad.
‎2005 Jun 20 6:38 PM
Yes, use the CONVERSION_EXIT_MATN1_INPUT function module. You could also use the function module CONVERSION_EXIT_ALPHA_INPUT.
data: num1(10) type c value '123456',
new_num(18) type c.
call function 'CONVERSION_EXIT_MATN1_INPUT'
exporting
input = num1
IMPORTING
OUTPUT = new_num
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2
.
Regards,
Rich Heilman
‎2005 Jun 20 6:38 PM
Yes, use the CONVERSION_EXIT_MATN1_INPUT function module. You could also use the function module CONVERSION_EXIT_ALPHA_INPUT.
data: num1(10) type c value '123456',
new_num(18) type c.
call function 'CONVERSION_EXIT_MATN1_INPUT'
exporting
input = num1
IMPORTING
OUTPUT = new_num
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2
.
Regards,
Rich Heilman
‎2005 Jun 20 7:11 PM
Hi,
I have written like this..still not getting...padding zeros to vbap-field1 is my solution..but how can i do that...
FORM USEREXIT_MOVE_FIELD_TO_VBAP.
Data: num1 like zcust-num1,
field1 like vbap-field1.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = num1
IMPORTING
OUTPUT = field1
if vbap-matnr <> *vbap-matnr.
clear vbap-field1.
select single t1~num1 into vbap-field1
from mara as t1 inner join zcust as t2
on t1num1 = t2num1
where matnr = vbap-matnr
and mtart = 'NSTK'
and delet = ''.
endif.
Thanks in advance,
Yad.
‎2005 Jun 20 7:20 PM
Shouldn't you be doing the conversion after you get the data?
Data: num1 like zcust-num1,
field1 like vbap-field1.
if vbap-matnr <> *vbap-matnr.
clear vbap-field1.
select single t1~num1 into vbap-field1
from mara as t1 inner join zcust as t2
on t1~num1 = t2~num1
where matnr = vbap-matnr
and mtart = 'NSTK'
and delet = ''.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = vbap-field1
IMPORTING
OUTPUT = vbap-field1
endif.
Regards,
Rich Heilman
‎2005 Jun 20 7:58 PM
‎2005 Jun 20 7:59 PM
‎2005 Jun 20 8:09 PM