Skip to Content
0
Aug 09, 2013 at 06:21 AM

how to pass decimal values to a idoc_data-sdata at 170th place

308 Views

hi

i want to pass 30000.000 into a idoc_data-sdata+170(14) place

but i am not able to pass decimals after .000 and it is working fine for if the value is 30000.200 with out two zeros of decimal value and it is as

30000.2

I want to pass all the decimals after . with decimal

and one more case is if the value is 30000 with out decimal then also it shud pass 30000.000(3 decimal values).

below is the code where ia m not able to pass.

if message_type = 'DESADV' and e1edl24-hipos is initial.
modify idoc_data index x_lines.
endif.

data : lt_lips type standard table of lips,"internal table
ls_lips type lips." work area

data : lv_var1 type string,
* Data : lv_var1(15) type p DECIMALS 3,
lv_var2(6) type c,
lv_var3(15) TYPE c,
lv_var4(4) type c.

if message_type = 'DESADV'.

lt_lips[] = data-tab_lips[] .
read table idoc_data with key segnam = 'E1EDL20'.
if sy-subrc ne 0.
clear: e1edl20.
else.
e1edl20 = idoc_data-sdata.
endif.

read table lt_lips into ls_lips with key vbeln = e1edl20-vbeln
posnr = e1edl24-posnr.
if sy-subrc = 0.
if e1edl24-hipos is not initial and e1edl24-posnr = ls_lips-posnr.
lv_var1 = lv_var1 + e1edl24-lfimg.
clear idoc_data.
delete idoc_data index x_lines.

loop at idoc_data where segnam = 'E1EDL24'.
lv_var2 = idoc_data-sdata+0(6).
if lv_var2 = e1edl24-hipos.
split e1edl24-lfimg at '.' INTO lv_var3 lv_var4.
idoc_data-sdata+176(14) = idoc_data-sdata+176(14) + lv_var1.
shift idoc_data-sdata+176(14) left DELETING LEADING space.
CONCATENATE '.' lv_var4 into lv_var4.
* if idoc_data-sdata+176(14) cn '.' .
* concatenate idoc_data-sdata+176(14) '.000' INTO idoc_data-sdata+176(14)." SEPARATED BY lv_var4.
* elseif idoc_data-sdata+176(14) ca '0123456789'.
*
* else.
* concatenate idoc_data-sdata+176(14) lv_var4 INTO idoc_data-sdata+176(14)." SEPARATED BY lv_var4.
* endif.
modify idoc_data index sy-tabix.
endif.
endloop.
endif.
endif.
endif.