08-05-2009 12:53 PM
please help
1)
data : kunnr1(7) type c.
data : kunnr like kna1-kunnr.
kunnr1 has only field length 7 and it is of type character.
kunnr is a sap field.
everytime i need to fill the data from the field kunnr1 to sap kunnr and pass to bdc .
suppose kunnr1 = 1930903 ie 7 characters .
and in sap shall i simply copy like this
kunnr = kunnr1. " will this work
or
concatnate '000' kunnr1 to kunnr.
or
any other one .
2)same with the purchase order number.
data : po(7) type c.
dat : bstdk type vbak-bstdk.
po = asdefgr
bsdtk = po
or
concatenate '' po to bsdtk.
if i assign value from po to bsdtk will at end command will work on bstdk?
example
loop at itab into workarea.
at last bsdtk." i need this to work so tell me how to assign the value from po to bsdtk
endloop.
08-05-2009 12:59 PM
08-05-2009 1:05 PM
kunnr1 and po are only 7 charas, then how they will be adjusted to 10 in sao if we simply pass like this
kunnr = kunnr1
bstdk = po
will this be added as from first to last or from last to first. I mean
first to last
kunnr = 1022200and the rest three spaces
kunnr= first three chars spaces and then1022200.
because i need to use this value to update the database tables.
please suggest
08-05-2009 1:08 PM
08-05-2009 1:09 PM
Hi,
Pass like this
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = kunnr1
IMPORTING
output = kunnr
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = po
IMPORTING
output = bstdk
Regards,
Vik
08-05-2009 1:59 PM
i checked the customer number in sap system,
in the sales order it is stored as 1277494
i checked in vbak table and it is stored as 1277494and rest blank spaces.
i checked in kna1 table , the same kunnr is stored as 0001277494.
why is this difference?
so i need to use the 'CONVERSION_EXIT_ALPHA_INPUT' for kunnr?
I checked for po but that is stored as a charater format and no need to add the leading zeros, is that right?
I used CONVERSION_EXIT_MATN1_INPUT for material do i need to use CONVERSION_EXIT_ALPHA_INPUT for material also?
thank you for the solutions given.
08-05-2009 2:07 PM
How do you check, tools like SE16/SE16n execute conversion exits.
Use the conversion input exit associated with the DOMAIN of the field.
Regards,
Raymond
08-05-2009 1:05 PM
Hi,
The simple assignment statement will work even if you use it with AT END ... ENDAT inside a loop.
kunnr = kunnr1.
bsdtk = po.
You have to use the conversion rouine 'CONVERSION_EXIT_ALPHA_INPUT' if you want to append the leading zeros and make the length to that of the database field.
Regards,
Vik
08-05-2009 1:09 PM
If you use BDC just move the data, during the execution of the session the standard conversion exits (like ALPHA) will convert from external format to internal data.
If you use BAPI, some FM of fill some CUSTOMERS tables via OpenSQL, use CONVERSION_EXIT_ALPHA_INPUT to convert to internal format.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = kunnr1
IMPORTING
output = kunnr.
Regards,
Raymond