‎2005 Aug 17 12:49 PM
hai all
is there any function module to convert char type to packed decimal type .
thanks in advance
‎2005 Aug 17 12:54 PM
I think MOVE command will work in this case. But make sure that there is no thousand separator in between the digits.
‎2005 Aug 17 12:58 PM
Take a look also at the "Pack/Unpack" statement.
Regards,
Erwan.
‎2005 Aug 17 1:02 PM
move will work. but make sure that the char field length is less than or equal to 16. because the max length of a type p field is 16.
Regards
Raja
‎2005 Aug 17 1:21 PM
Hi
i have fetch the value from app. serve using offset.
like: w+string321(11).
Now i have to move the value to type p variable.
And this string321(11) is of char type.
any suggestions..actually facig problem when activated the unicode
thanks
‎2005 Aug 17 1:27 PM
I have tried this and is working. This is unicode enabled.
data: w1 type p decimals 2.
data: c1(11).
c1 = '12345678.78'.
move c1 to w1.
write w1.
‎2005 Aug 17 8:41 PM
Hi Anu,
There is no reason why "move" shouldn't work. Go in debug mode and check the content of char field value, if it is a number there should not be a problem. If you are getting a problem elaborate on that.
Cheers,
Sanjeev
‎2005 Aug 17 9:34 PM
‎2005 Aug 18 9:38 AM
hi
the code is like:
READ DATASET p_extfil INTO w_struct. "cnxt-28
IF sy-subrc = 4.
EXIT.
ENDIF.
*Begin of cnxt-28{
tab_wa-sort1 = w_struct+0(20).
tab_wa-sort2 = w_struct+20(20).
tab_wa-sort3 = w_struct+40(20).
tab_wa-sort4 = w_struct+60(20).
tab_wa-sort5 = w_struct+80(20).
tab_wa-sort6 = w_struct+100(20).
tab_wa-sort7 = w_struct+120(20).
tab_wa-bzirk = w_struct+140(6).
tab_wa-name1 = w_struct+146(35).
tab_wa-bstnk = w_struct+181(20).
tab_wa-vbeln = w_struct+201(10).
tab_wa-posnr = w_struct+211(6).
tab_wa-etenr = w_struct+217(4).
tab_wa-matnr = w_struct+221(18).
tab_wa-crd = w_struct+239(8).
tab_wa-ffd = w_struct+247(8).
tab_wa-edatu = w_struct+255(8).
tab_wa-shpd = w_struct+263(8).
x = w_struct+271(13).
MOVE x TO tab_wa-bmeng.
x1 = w_struct+284(13).
MOVE x1 TO tab_wa-lfimg.
x2 = w_struct+297(13).
MOVE x2 TO tab_wa-oqty.
x3 = w_struct+310(11).
PACK w_struct+310(11) TO tab_wa-netpr.
*ASSIGN w_struct+310(11) to <f1> CASTING."type P DECIMALS 2.
MOVE <F1> TO tab_wa-netpr.
MOVE X3 TO tab_wa-netpr.
tab_wa-lifnr = w_struct+321(10).
tab_wa-werks = w_struct+331(4).
tab_wa-uepos = w_struct+335(6).
tab_wa-stlnr = w_struct+341(8).
tab_wa-vkorg = w_struct+349(4).
tab_wa-vtweg = w_struct+353(2).
tab_wa-spart = w_struct+355(2).
tab_wa-vkgrp = w_struct+357(3).
tab_wa-vkbur = w_struct+360(4).
tab_wa-ernam = w_struct+364(12).
tab_wa-erdat = w_struct+376(8).
tab_wa-kunnr = w_struct+384(10).
tab_wa-auart = w_struct+394(4).
tab_wa-scheduled = w_struct+398(1).
tab_wa-dlvry = w_struct+399(10).
tab_wa-ship_stat = w_struct+409(1).
tab_wa-crdt_stat = w_struct+410(1).
tab_wa-prodh = w_struct+411(18).
tab_wa-matkl = w_struct+429(9).
tab_wa-maktx = w_struct+438(40).
tab_wa-lgort = w_struct+478(4).
x4 = w_struct+482(3).
MOVE x4 TO tab_wa-mahza.
tab_wa-shipto = w_struct+485(10).
tab_wa-inco1 = w_struct+495(3).
tab_wa-lifsk = w_struct+498(2).
tab_wa-bstdk = w_struct+500(8).
x5 = w_struct+508(15).
MOVE x5 TO tab_wa-trprice.
tab_wa-waerk = w_struct+523(5).
tab_wa-pstyv = w_struct+528(4).
tab_wa-crsd = w_struct+532(8).
tab_wa-dispo = w_struct+540(3).
tab_wa-program_code = w_struct+543(15).
tab_wa-endcust = w_struct+558(10).
tab_wa-sortl = w_struct+568(10).
x6 = w_struct+578(13).
MOVE x6 TO tab_wa-cskk_oqty.
tab_wa-katr1 = w_struct+591(2).
Actually this is unicode enabled thats why its givin some problem.so can u gave some suggestion
thanks in advance
‎2005 Aug 18 10:05 AM
Hi,
this is'nt really good code:
why can't you say tab_wa = w_struct.
=> build your structure tab_wa , so that you can move w_struct in one statement.
if necessary work with 2 structures, as SAP-Standard
(e.g. RFBIBL00 with BBSEG), 1 structure only with char-fields and 1 structure with the correct domains
Andreas
‎2005 Aug 18 8:34 PM