Convertin FTPT to remove decimals
hi
i am doing as below num_in is FLTP 16 in database
DATA: NUM_OUT(12) TYPE N.
MOVE NUM_IN TO NUM_OUT.
first value of num_in is 1.0000000000000000E+01
is it becoming 000000000010
it should become 000000000001 as leading zeros but not displaying properly
nishant
check the E notation. 1.0E01 = 10 , 1.5E02 = 150, E+nn means you nee to multiply the number by 10 in NN power (degree).
1.0E+00 = 1
1.0E+01 = 10
1.0E+02 = 100
1.0E+03 = 1000
1.0E-01 = 0.1
1.0E-02 = 0.01
Similar Messages
-
Hi,
I created SAP BO Explorer report on top of SAP BEx Query.
In SAP BEx Query, Decimals were hided but when i created OLAP Universe on top that SAP BEx Query and Created Index on top of Information Space in SAP BO Explorer and then created Exploration Views. But i'm getting Decimals in my Exploration Views where as SAP BEx Query in RSRT, no decimals were appearing.
Can anyone suggest me how to remove decimals in SAP BO Exploration Views.Hi Ramana,
I am not use how you connect to SAP BEx query (Via universe or BWA or HANA)
What I could say is BWA and HANA, you cannot adjust this
For universe, you could try in universe layer, there is note about this
For BWA and HANA, this function might be enhanced but you 'd better raise OSS to SAP to check with them
Best regards
Alex yang -
How to remove displaying decimals in ALV report(using FM) ?
HI Sri,
Pass the values into a variable of type i.
data : var type i,
var1 type f value '2.111'.
var = var1.
or else
change the field catalog this way ..
<b>lv_cat-decimals_out = '0'.</b>
Regards,
Santosh -
Remove decimals when equal to 0 SAPSCRIPT
Hello all,
When printing a quantity field in a sapscript form, I would like to remove the decimals if they are all 0, but retain them if at least one is non zero. For example:
Quantity - Value to print
1000.000 - 1000
1000.020 - 1000.020
1000.200 - 1000.200
1000.002 - 1000.002
I have tried many different things including formatting options C and Z (i.e. kwmeng(C)) but neither provide the correct result. Also, kwmeng(.3) will not work because sometimes I want kwmeng(.0). I want to avoid ABAP code in the print program and I know that it is possible because a different form in our system performs exactly this way without parsing the value into mantissa and decimal (though I cannot determine how).
Please post any thoughts or ideas. Thanks!Hi,
I think that if the quantity field is linked in the DDic structure/table to a unit of measure field, which content at runtime refers to a unit with 0 decimals, then it should work exactly as you expect.
Sandra -
Remove decimals from the Bar Graph..
Hii,
How to remove the Decimals from the Bar Graph.
I am using Reports 9i.
I have created a Bar Graph in that It is showing the decimals bar. Actully in the query i hv used the inbuild function Round but while i run the report it is showing the decimals.
It is showing if the value is under 10 then 3 decimals. Value is between 10 to 100 then 2 decimals. 100 to 1000 is 1 decimal.
How can i remove the same.
Also in the X axis how can I put the description of a field. While i take the description fiel it is showing some exception error.
Description field width is 50 Now I am showing the code field only have 3 digits.
Please check this also...
remove decimal places
Thanks in Advance
JitheshHi Simran
1. You can get proper variable without decimal point.
2. Use function "FLOOR" and get the output value assigned to variable defined in step 1.
data : wv_wh_no type p decimals 0 . -
you take as per your requirement
Let say,
wv_dec_no = 1.0001.
w_no = FLOOR(wv_dec_no).
Hope it will help you.
Regards,
Anil Salekar -
Hi Gurus,
I have an IO having properties CHAR (30).
Data is showing in the report like this eg.123.000000 ,for this IO.
Can I remove the decimals?
Please help.
Points assured.
Rgds,
SouravSAP,
It would be advisable to change your ID to something else .... you might be asked to do the same by the other moderators also... try to give a name instead... makes it much easier and generally SAP would refer to the package on an SAP forum....
Arun
Sourav, you can store alphanumeric values in NUMC also - but where is the data coming from ... and how do you want it to be changed?
Message was edited by:
Arun Varadarajan -
Hi Gurus,
Before posting this thread, i serached SDN and i could not find proper answer for my requirement.
My Question is , i have a text filed which will contain a numeric value. say .5 . the desired output should be 0050.
means , it should remove the decimals from text and result output shuold contain 4 characters. (It should consider 2 numbers before decimal and 2 numbers after decimal)
any suggestions pls..
Thanks
MeherSee this code:
v_number = '.5'.
v_whole = trunc( v_number ).
v_deci = frac( v_number ).
concatenate v_whole v_deci into v_newnum.
you may need to put the whole and deci into a character variable; just adjust accordingly...
v_whole and v_deci are type N of length 2
hope this helps
Edited by: Chris C. on Jul 28, 2009 8:39 AM -
Removing decimals when initial
i declared variable 'ulimit' as type p decimals 2.
ulimit type p decimals 2.
now its printing as ulimit = 12.00 (when no decimals are there)
ulimit = 13.76(when decimals are there)
but when no decimals are there i should print as ulimit = 12 only (not ulimit = 12.00).Please help.
Thanks
K SrinivasHi Srinivas,
Here is the sample code.
REPORT ZCC_TEST.
DATA: ulimit type p decimals 2 VALUE '12.09'.
DATA: STR(10) TYPE C.
DATA: FINAL(10) TYPE C.
DATA: LEN TYPE I.
DATA: LEN1 TYPE I.
STR = ULIMIT.
CONDENSE STR.
IF STR CA '.'.
LEN = SY-FDPOS.
ENDIF.
LEN1 = LEN + 1.
IF STR+LEN1(2) = '00'.
FINAL = STR+0(LEN).
WRITE: FINAL.
ELSE.
WRITE: ULIMIT.
ENDIF.
\[removed by moderator\]
Edited by: Jan Stallkamp on Jun 17, 2008 6:26 PM -
Remove Decimals in Smartform not working
Hi,
I use
&struc-field(C)&
to hide decimals in a SF.
The type of this field is LGMNG.
This code works for all instances, except when the UOM is type ROL (Role). I have put a break-point in the SF just before the value is output and they are identical.
But the output would be, for example say five units:
a) 5 SH (Correct)
b) 5,000 ROL (incorrect)
Anyone seen this before?
Thanks.Nick,
thanks for the reply. I tried both of these already:
&struc-field(.0)&
&struc-field(C.0)&
And, for both, I am told at runtime that (.0) is not a correct "formatting option for the field struc-field".
I'm going to put a code block in to convert to an integer and display that. It will work - I just thought that (C) or (.0) would work too?
Thanks. -
Remove decimales in an formula in MS Project 2010
Hi,
we have created an formula for cost (actual cost /cost * 100) so we can get an % off the cost used in the project.
After som testing and trying we found on formula to use : (CStr([Actual Cost] / [Cost]) * 100) & "%"
But the % number that appers is full off decimales, like 74,186543256 %.
We dont want any decimal, just the hole number. Can you help us fix this?
JeanetteHi,
Try to update your formula as following:
Format(formula, "0%")
See also this
similar thread.
Hope this helps,
Guillaume Rouyre, MBA, MCP, MCTS | -
Hello all,
How can we suppress decimals in smartform. Because I do not want it for a Quantity field.
Thanks.Hi
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
Regards
Pavan -
Remove Decimals in smartform for QUAN Field
Hi,
I want to display the Quantity field in smartform by Suppressing Decimals,
if i give &field(13.0)& it is showing Error : Incorrect formatting option.
The Same will work with CURR Field. Then what i have to give for QUAN Field.
Thanks & Regards
Praveen.
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Mar 24, 2009 10:42 AMHi Praveen,
Maybe you can try it with &field(.0)& ,
But it is possible that it is concerning a field which formatting is customized with transaction CUNI.
Hope this will help.
Gr.,Frank -
Can't remove decimals from chart value axis
After several hours trying to create a simple bar graph in Pages and the same in Numbers (iWork '08) for a class assignment, I am at a loss. To any kind soul who can help, I will be very grateful.
Here is the dilemma.
In Numbers as well as trying this in Pages '08, I selected a blank document, clicked on the Chart icon, and in the Chart Data Editor I entered titles for 2 rows, and title for 3 columns along with their values. Then in the Chart Inspector I entered the following values under Value Axis Format: minimum= 3, Maximum= 26, and Steps=9.
I Need to have along the y-axis (the left column, from bottom to top) the numbers starting from 3 up to 26, in increments of 3, i.e. 3-6-9-12-15-18-21-24 and at the top 26.
I have the correct sets of columns which is: 3 sets of bar graphs (2 bars side-by-side, 3 sets).
The problem I have is that I NEED the left column of numbers, my y-axis, to be whole numbers. But Pages keeps converting them into whole numbers with 3 decimal places to the right. How can I fix this? I also keep running into a problem when entering values in Minimum-Maximum-Steps, in which I'll put 26 or 27 as a Maximum, 3 in Steps, and the Max changes to something like 96. This happens a lot, although the number changes to different values than what I enter. My Chart is a standard chart, not a stacked chart. I've tried searching and find no answers to this. And I do need the step increments to be exactly as I stated. There must be a way. I tried it in Excel 2002, and was able to do the entire chart in about 5 minutes. Numbers must be able to do this, I'm not even using calculations or formulas.
I would insert a picture of the way the chart needs to look here, but I don't know how to do that in Posting this question.
In God's Harmony,
RODDYIt would be useful to give us the used values so we may give you a response.
I made a test with this setting:
Minimum 5.0
Maximum 9.5
Steps 5
and I got: 5.0, 5.9, 6.8, 7.7, 8.6, 9.5
which is perfectly correct.
It's our duty to check that ((Maximum - Minimum) / Steps) * 10 is an integer.
Yvan KOENIG (from FRANCE lundi 8 septembre 2008 15:19:14) -
Help: Crystal Report displays decimals on X-axis when published in Infoview
Hi everyone
I've been banging my head on my keyboard trying to get past the following issue:
We have a Crystal Report (XI R2 SP3) containing a bar chart that has numbers on both the X- and Y-axis.
On the Y-axis I can control the "Number" settings to remove decimals after the comma. So far so good.
On the X-axis on the other, the numbers are the result of an extensive formula trying to breakdown
numbers into ranges. Numbers are always whole (no decimals). The X-Axis is an Ordinal scale, which
does not allow to set any number formatting. Numeric scale does not work in this case because it
compresses the entire chart into a few bars. And this is where the problem is:
In Crystal Reports I have a global setting for "Numbers" not to show any decimals. This works, when
generated in Crystal, I have no decimals past the comma in the graphs on the X-axis.
when I publish this report to Business Objects Infoview portal and schedule and run it there, all of a
sudden the PDF displays an X-axis that has 2 decimals past the comma (1234.00). It's driving me nuts.
I suspect this is a bug, because I've not managed to get rid of these decimals without a text-conversion in
the formula (does not suit me, I need data ordered properly).
Can anyone help? Has anyone had this issue?
Much appreciated!
Thanks.
The latest of version of my formula truncates and converts ToNumber. Nothing helps:
Tonumber(
truncate(
IIF (InStr ({Command.SUB_SPECIFICATION},'XF') > 0
IIF ({Command.X_TIME} <= 300,300,
IIF ({Command.X_TIME} <= 5000,
Ceiling ({Command.X_TIME}, 200),10000
,IIF(InStr ({Command.SUB_SPECIFICATION},'XT') > 0 Or InStr
({Command.SUB_SPECIFICATION},'XY') > 0,
IIF ({Command.X_TIME} <= 1000,Ceiling ({Command.X_TIME}, 50),
IIF ({Command.X_TIME} <= 5000,
Ceiling ({Command.X_TIME}, 200),10000
IIF ({Command.X_TIME} <= 300,Ceiling({Command.X_TIME},10),
IIF ({Command.X_TIME} <= 5000,
Ceiling ({Command.X_TIME}, 200),10000
Edited by: FREDERIC AGOSTINI on Nov 6, 2008 3:43 PMHi Frederic,
I tired the following on my machine having CR XI R2, just as a sample report i created the following formulas,
Reproducing the issue:
u2022 Create a formula field u2013 FiscalCurrentHeader u2013
"FY " & year(DateAdd ("m",+6,CurrentDate))
u2022 Use a text box and place this formula field
Summary for {@FiscalCurrentHeader}
u2022 In the designer, the string exports to .pdf as 'FY 2009' , but on the scheduling/distribution server (BOE XI), the string exports to .pdf as 'FY 2,009.00' (as a number).
Cause:
u2022 The datatype of the field u2013 FiscalCurrentHeader is considered as number, because of which when scheduling/distribution server (BOE XI), the string exports to .pdf as 'FY 2,009.00' (as a number).
Resolution:
u2022 To remove the comma use ToText in the formula
"FY " & ToText(Year(DateAdd ("m",+6,CurrentDate)), "0")
u2022 To remove the comma we can even use
u201CFY u201D & ToText(Year(DateAdd ("m",+6,CurrentDate)), "0","")
The last "" defines your 000 separator.
Try using ToText in place of ToNumber.
I hope this works at your end.
Regards,
Abhijeet Taskar.
Edited by: Abhijeet Taskar on Nov 6, 2008 6:02 PM -
***INCLUDE LUCR_LSTF03 .
*& Form display_detail_list
FORM display_detail_list_subscreen.
IF g_display_detail_again IS INITIAL.
IF g_display_detail_next IS INITIAL.
* Header text is displayed as dyn. document
IF go_dydo IS INITIAL.
CREATE OBJECT go_dydo.
ELSE.
FREE go_dydo.
CLEAR go_dydo.
CREATE OBJECT go_dydo.
PERFORM free_create_screen_objects.
ENDIF.
ELSE.
IF NOT go_dydo->html_control IS INITIAL.
CALL METHOD go_splitter_container->remove_control
EXPORTING
row = 1
column = 1.
ENDIF.
ENDIF.
ENDIF.
* Initialize document
CALL METHOD go_dydo->initialize_document.
IF LINES( gt_header ) > 0.
* Build and display detail-header
PERFORM build_header TABLES gt_header
USING go_dydo
gs_header.
ENDIF.
* Merge header-document
CALL METHOD go_dydo->merge_document.
* set toolbar-added functions for detailed list
REFRESH gt_toolbar.
IF go_model->ds_tx_data_io_type-documents IS BOUND. "mb210303
PERFORM fill_tool_tab USING:
gt_toolbar gs_toolbar 'UCR_DUMMY' '1',
gt_toolbar gs_toolbar 'UCR_ENTRIES' '2',
gt_toolbar gs_toolbar 'UCR_DUMMY' '3',
gt_toolbar gs_toolbar 'UCR_PREV' '4',
gt_toolbar gs_toolbar 'UCR_NEXT' '5',
gt_toolbar gs_toolbar 'UCR_DUMMY' '6'.
ELSE. "mb210202 beg.
PERFORM fill_tool_tab USING:
gt_toolbar gs_toolbar 'UCR_DUMMY' '1',
gt_toolbar gs_toolbar 'UCR_PREV' '2',
gt_toolbar gs_toolbar 'UCR_NEXT' '3',
gt_toolbar gs_toolbar 'UCR_DUMMY' '4'.
ENDIF. "mb210202 end.
SET HANDLER go_event_grid->handle_toolbar_comp FOR go_grid.
* Display header
CALL METHOD go_dydo->display_document
EXPORTING
parent = go_container_head.
* Set header-control visible with user set or
* predefined height
IF NOT go_splitter_container IS INITIAL.
IF g_height IS INITIAL.
g_height = 27.
ENDIF.
CALL METHOD go_splitter_container->set_row_height
EXPORTING
id = 1
height = g_height.
ENDIF.
* display detail-list
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = 'X'
is_layout = gs_layout_save
it_toolbar_excluding = gt_exclude_toolbar
CHANGING
it_fieldcatalog = gt_fieldcat_d
it_outtab = <gt_outtab_detail>.
IF NOT g_display_detail_next IS INITIAL.
CALL METHOD go_grid->refresh_table_display.
ENDIF.
* Set cursor on selected row if necesary
IF NOT gt_row_id_detail IS INITIAL.
CALL METHOD go_grid->set_selected_rows
EXPORTING
it_index_rows = gt_row_id_detail.
REFRESH gt_row_id_detail.
ENDIF.
CLEAR: g_display_detail_next,
g_display_detail_again.
ENDFORM. " display_detail_list_subscreen
*& Form display_main_list
FORM display_main_list_subscreen. "using i_reporting_logic type uc_flg.
CLEAR g_detail.
* set toolbar-added functions
REFRESH gt_toolbar.
IF go_model->ds_tx_data_io_type IS NOT INITIAL.
IF go_model->ds_tx_data_io_type-documents IS BOUND. "mb210303
* and i_reporting_logic is initial.
PERFORM fill_tool_tab USING:
gt_toolbar gs_toolbar 'UCR_DUMMY' '1',
gt_toolbar gs_toolbar 'UCR_ENTRIES' '2',
gt_toolbar gs_toolbar 'UCR_DUMMY' '3',
gt_toolbar gs_toolbar 'UCR_SEL_COND' '4',
gt_toolbar gs_toolbar 'UCR_DUMMY' '5'.
ELSE.
PERFORM fill_tool_tab USING:
gt_toolbar gs_toolbar 'UCR_DUMMY' '1',
gt_toolbar gs_toolbar 'UCR_SEL_COND' '2',
gt_toolbar gs_toolbar 'UCR_DUMMY' '3'.
ENDIF. "mb210303
SET HANDLER go_event_grid->handle_toolbar_comp FOR go_grid.
ELSE .
PERFORM fill_tool_tab USING:
gt_toolbar gs_toolbar 'UCR_DUMMY' '1',
gt_toolbar gs_toolbar 'UCR_SEL_COND' '2',
gt_toolbar gs_toolbar 'UCR_DUMMY' '3'.
SET HANDLER go_event_grid->handle_toolbar_comp FOR go_grid.
ENDIF.
* Set header-control invisible while main-list is displayed
IF NOT go_splitter_container IS INITIAL.
* Header container can be set visible by user on main-screen
CALL METHOD go_splitter_container->set_row_height
EXPORTING
id = 1
height = 0.
IF NOT go_dydo IS INITIAL.
* Display last header if user wants to set it visible
CALL METHOD go_dydo->display_document
EXPORTING
parent = go_container_head.
ENDIF.
ENDIF.
* subscreen with main list simply is started once again
* prepared with current user settings
IF ( LINES( gt_fieldcat_save ) > 0 ) AND
NOT g_display_main_again IS INITIAL.
REFRESH gt_fieldcat.
gt_fieldcat[] = gt_fieldcat_save[].
* clear g_display_main_again.
* is necessary, because current_frontend_fieldcat must be set
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = 'X'
i_save = g_save
is_layout = gs_layout
is_variant = gs_variant
it_special_groups = gt_sgrp "mb110403
it_toolbar_excluding = gt_exclude_toolbar
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = <gt_outtab>.
* set current fieldcat
CALL METHOD go_grid->set_frontend_fieldcatalog
EXPORTING
it_fieldcatalog = gt_fieldcat.
* now reset other current layout-infos if necessary
PERFORM set_current_layout USING go_grid
gt_filter_save
gt_sort_save
gs_layout_save.
* display current main-list
CALL METHOD go_grid->refresh_table_display.
REFRESH: gt_fieldcat_save, gt_filter_save, gt_sort_save.
CLEAR : gs_layout_save.
ELSE.
* Show ALV
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = 'X'
i_save = g_save
is_layout = gs_layout
is_variant = gs_variant
it_special_groups = gt_sgrp "mb110403
it_toolbar_excluding = gt_exclude_toolbar
CHANGING
it_sort = gt_sort
it_fieldcatalog = gt_fieldcat
it_outtab = <gt_outtab>.
CLEAR g_display_detail_again.
g_display_main_again = 'X'.
ENDIF.
* Set cursor on selected row if necesary
IF NOT gt_row_id IS INITIAL.
CALL METHOD go_grid->set_selected_rows
EXPORTING
it_index_rows = gt_row_id.
ENDIF.
ENDFORM. " display_main_list_subscreen
*& Form display_message
FORM display_message USING lo_grid_object TYPE REF TO cl_gui_alv_grid
lf_refresh_msg_table TYPE c.
DATA: l_lines TYPE i,
ls_layout TYPE lvc_s_layo.
* header_main is not used by Worbench
IF g_subscreen IS INITIAL.
PERFORM header_main.
ENDIF.
g_no_data = 'X'.
* if first data selection results no data gt_parameter_save must be
* filled from lt_parameter to take care of further user changed
* parameters from list screen
DESCRIBE TABLE gt_parameter_save LINES l_lines.
IF l_lines = 0.
gt_parameter_save[] = gt_parameter[].
ENDIF.
PERFORM no_data_selected IN PROGRAM (gc_progname)
USING gt_fieldcat_mess
gs_fieldcat_mess
gt_message
gs_message
text-101
text-102
'TEXT'
'LT_MESSAGE'
lf_refresh_msg_table " 'X'
space. " 'C610'. no color, accessibility
*** Start of Comment By Ramesh Babu N,IBM - C1DK900725 ***
* Set header-control invisible while main-list is displayed
* IF NOT go_splitter_container IS INITIAL.
* CALL METHOD go_splitter_container->set_row_height
* EXPORTING
* id = 1
* height = 0.
* CALL METHOD go_splitter_container->set_row_sash
* EXPORTING
* id = 1
* type = cl_gui_splitter_container=>type_sashvisible
* value = cl_gui_splitter_container=>false.
* ENDIF.
*** End of Comment By Ramesh Babu N,IBM - C1DK900725 ***
* display messages
* ls_layout-no_toolbar = 'X'.
CALL METHOD lo_grid_object->set_table_for_first_display
EXPORTING
i_bypassing_buffer = 'X'
it_toolbar_excluding = gt_exclude_toolbar_mess
is_layout = ls_layout
CHANGING
it_fieldcatalog = gt_fieldcat_mess
it_outtab = gt_message.
*** Start of Comment By Ramesh Babu N,IBM - C1DK900725 ***
* Event-Handler for docking-container
* IF go_event_dock IS INITIAL.
* CREATE OBJECT go_event_dock.
* ENDIF.
*** End of Comment By Ramesh Babu N,IBM - C1DK900725 ***
IF go_parameter IS INITIAL.
CALL METHOD cl_uc_parameter=>get_instance
IMPORTING
eo_instance = go_parameter.
ENDIF.
*** Start of Comment By Ramesh Babu N,IBM - C1DK900725 ***
* SET HANDLER go_event_dock->handle_new_parameters FOR go_parameter.
*** End of Comment By Ramesh Babu N,IBM - C1DK900725 ***
ENDFORM. " display_message
*& Form sub_download_data
* Used for downloading BCS data to a TAB delimited file in Custom task *
* <--ct_data HASHED TABLE
FORM f_download_data USING ct_task TYPE uc_task
ct_sel TYPE uc0_ts_sel
gt_param TYPE ucm_ts_parameter
CHANGING ct_message TYPE uc0_t_message
ct_data TYPE HASHED TABLE..
* SUBROUTINE DESCRIPION: Used for downloading BCS data to file in Custome Task
* DEVELOPER: Ramesh Babu Nalla , IBM
* CREATION DATE: 2007-10-11
* DER NUMBER: None
* TRANSPORT NUMBER(S): C1DK900725
* REVISION HISTORY-----------------------------------------------------*
* REVISION NO: C1DK900725 REFERENCE NO: None
* DEVELOPER: Ramesh Babu N,IBM DATE: 2007-10-11
* DESCRIPTION: Copied from SAP FM UCR_LST_LOGIC *
CONSTANTS : c_task01 TYPE uc_task VALUE 'T2700',
c_task02 TYPE uc_task VALUE 'T2490'.
TYPES: BEGIN OF ty_download,
** /bic/zcs_comp TYPE char08, " Unilever-Company
** /bic/zcs_item TYPE char10, " Unilever-Item
** /1fb/move_type TYPE char03, " Unilever-Movement type
** /bic/zcs_pcom TYPE char08, " Unilever-Partner Company
** /bic/zcs_invc TYPE char08, " Unilever-Investee Company
** /bic/zcs_cang TYPE char03, " Unilever-Cost Analysis Group
** /bic/zcs_ad TYPE char08, " Unilever-Aquisitions/Disposals
** /bic/zcs_cd TYPE char08, " Unilever-Continued/Discontinued Ops.
** /bic/zcs_prgp TYPE char08, " Unilever-Product Category
/bic/zfb_comp TYPE char08, " Unilever-Company
/bic/zfb_item TYPE char10, " Unilever-Item
/bic/zfb_move TYPE char03, " Unilever-Movement type
/bic/zfb_pcom TYPE char08, " Unilever-Partner Company
/bic/zfb_invc TYPE char08, " Unilever-Investee Company
/bic/zfb_cang TYPE char03, " Unilever-Cost Analysis Group
/bic/zfb_ad TYPE char08, " Unilever-Aquisitions/Disposals
/bic/zfb_cd TYPE char08, " Unilever-Continued/Discontinued Ops.
/bic/zfb_prgp TYPE char08, " Unilever-Product Category
/1fb/cs_trn_lc TYPE string, " Unilever-Period value in Local currency
/1fb/cs_trn_qty TYPE string, " Unilever-Periodic quantity
unit type string,
END OF ty_download.
* flag
DATA flg_chk TYPE c.
DATA: lr_s_data_out TYPE REF TO data,
lr_t_data_out TYPE REF TO data,
l_outtype TYPE field_type VALUE 'UCR_SX_TX_DATA_LST',
lr TYPE REF TO data,
lo_conv TYPE REF TO lcl_convert_output,
lt_char TYPE lcl_convert_output=>th_comp,
ls_comp TYPE lcl_convert_output=>s_comp,
lr_s_data TYPE REF TO data,
lr_t_data TYPE REF TO data,
l_filename TYPE string,
l_action TYPE i,
l_path TYPE string,
l_seperator TYPE char01 VALUE 'X',
l_fullpath TYPE string,
l_mmyy TYPE string,
lr_sel_data TYPE REF TO data,
lr_t_val TYPE REF TO data,
lr_t_final TYPE REF TO data,
lr_val TYPE REF TO data,
ls_download TYPE REF TO data,
lt_download TYPE REF TO data,
ls_sel TYPE REF TO data,
ls_msg TYPE uc0_s_message.
** SOC by Dpak-------------------------------------------------------------------------------------------
** Changed by Deepak N Jain, IBM on 16/11/2006 as the corresponding field name assigned by Ramesh from
** the structure <LS_DATA_OUT> are not matching. This is because of the new cube from whch the Financial
** data is coming now. The new cube is ZFBCS_T1 which has replaced the old cube ZCS_T1.
** Hence, Short Dump on Execution.
** DATA: l_comp TYPE string VALUE '/BIC/ZCS_COMP', " Unilever-Company
** l_cgcomp TYPE string VALUE '/1FB/SEM_CGCOMP'," Unilever-Consolidation Group
** l_pcomp TYPE string VALUE '/BIC/ZCS_PCOM', " Unilever-Partner Company
** l_doct TYPE string VALUE '/BIC/ZCS_DOCT', " Unilever-Document type
** l_plevel TYPE string VALUE 'CS_PLEVEL', " Unilever-Posting Level
** l_tc TYPE string VALUE '/1FB/CS_TRN_TC', " Unilever-Period value in Transaction currency
** l_qty TYPE string VALUE '/1FB/CS_TRN_QTY'," Unilever-Periodic quantity
** l_trn_lc TYPE string VALUE '/1FB/CS_TRN_LC', " Unilever-Period value in Local currency
** l_bu TYPE string VALUE '/BIC/ZCS_PROF', " Unilever-Business Unit/Cost Centre
** l_low TYPE string VALUE 'LOW'.
DATA: l_comp TYPE string VALUE '/BIC/ZFB_COMP', " Unilever-Company
l_cgcomp TYPE string VALUE '/BIC/ZFB_CG1', " Unilever-Consolidation Group
l_pcomp TYPE string VALUE '/BIC/ZFB_PCOM', " Unilever-Partner Company
l_doct TYPE string VALUE '/BIC/ZFB_DOCT', " Unilever-Document type
l_invc TYPE string VALUE '/BIC/ZFB_INVC', " Unilever-Investee Company
l_plevel TYPE string VALUE 'CS_PLEVEL', " Unilever-Posting Level
l_tc TYPE string VALUE '/1FB/CS_TRN_TC', " Unilever-Period value in Transaction currency
l_qty TYPE string VALUE '/1FB/CS_TRN_QTY'," Unilever-Periodic quantity
l_trn_lc TYPE string VALUE '/1FB/CS_TRN_LC', " Unilever-Period value in Local currency
l_bu TYPE string VALUE '/BIC/ZCS_PROF', " Unilever-Business Unit/Cost Centre
l_low TYPE string VALUE 'LOW',
l_unit TYPE string VALUE 'UNIT'.
** EOC by Dpak-----------------------------------------------------------------------------------------------
** future use **
** FISCVARNT TYPE L0002FISCVARNT,
** FISCPERIOD TYPE L0002FISCPERIOD,
** /BIC/ZFB_VERS TYPE L0002/BIC/ZFB_VERS,
** /BIC/ZFB_CG1 TYPE L0002/BIC/ZFB_CG1,
** /BIC/ZFB_COMP TYPE L0002/BIC/ZFB_COMP,
** /1FB/CS_CHART TYPE L0002/1FB/CS_CHART,
** /BIC/ZFB_MOVE TYPE L0002/BIC/ZFB_MOVE,
** /BIC/ZFB_PCOM TYPE L0002/BIC/ZFB_PCOM,
** ACQ_YEAR TYPE L0002ACQ_YEAR,
** ACQ_PER TYPE L0002ACQ_PER,
** /BIC/ZFB_INVC TYPE L0002/BIC/ZFB_INVC,
** /BIC/ZFB_ALCO TYPE L0002/BIC/ZFB_ALCO,
** CS_PLEVEL TYPE L0002CS_PLEVEL,
** /BIC/ZFB_DOCT TYPE L0002/BIC/ZFB_DOCT,
** BCS_CTFLG TYPE L0002BCS_CTFLG,
** UNIT TYPE L0002UNIT,
** /1FB/CURKEY_TC TYPE L0002/1FB/CURKEY_TC,
** /1FB/CURKEY_LC TYPE L0002/1FB/CURKEY_LC,
** /1FB/CURKEY_GC TYPE L0002/1FB/CURKEY_GC,
** /BIC/ZFB_PRGP TYPE L0002/BIC/ZFB_PRGP,
** /BIC/ZFB_COUN TYPE L0002/BIC/ZFB_COUN,
** /BIC/ZFB_CANG TYPE L0002/BIC/ZFB_CANG,
** /1FB/FUNC_AREA TYPE L0002/1FB/FUNC_AREA,
** /BIC/ZFB_CT TYPE L0002/BIC/ZFB_CT,
** /BIC/ZFB_CD TYPE L0002/BIC/ZFB_CD,
** /BIC/ZFB_AD TYPE L0002/BIC/ZFB_AD,
** /BIC/ZFB_FR01 TYPE L0002/BIC/ZFB_FR01,
** /BIC/ZFB_FR02 TYPE L0002/BIC/ZFB_FR02,
** FISCYEAR TYPE L0002FISCYEAR,
** /BIC/ZFB_ITEM TYPE L0002/BIC/ZFB_ITEM,
** future use **
FIELD-SYMBOLS: <lt_data_out> TYPE STANDARD TABLE,
<ls_data_out> TYPE ANY,
<ls_data> TYPE ANY,
<ls_data_cop> TYPE ANY,
<lt_data_std> TYPE STANDARD TABLE,
<ls_data_std> TYPE ANY,
<ls_download> TYPE ANY,
<lt_download> TYPE STANDARD TABLE,
<comp> TYPE ANY,
<cgcomp> TYPE ANY,
<pcomp> TYPE ANY,
<doct> TYPE ANY,
<plevel> TYPE ANY,
<tc> TYPE ANY,
<invc> TYPE ANY,
<qty> TYPE ANY,
<unit> TYPE ANY,
<trn_lc> TYPE ANY,
<comp1> TYPE ANY,
<cgcomp1> TYPE ANY,
<pcomp1> TYPE ANY,
<doct1> TYPE ANY,
<plevel1> TYPE ANY,
<tc1> TYPE ANY,
<invc1> TYPE ANY,
<qty1> TYPE ANY,
<trn_lc1> TYPE ANY,
<unit1> TYPE ANY,
<bu> TYPE ANY,
<bu1> TYPE ANY,
<low> TYPE ANY,
<l_year> TYPE ANY ,
<l_period> TYPE ANY ,
<l_mmyy> TYPE ANY,
<ls_sel_data> TYPE ANY,
<ls_val> TYPE zbcs_check_val,
<lt_t_val> TYPE STANDARD TABLE,
<lt_t_final> TYPE STANDARD TABLE.
**************** Begin Of Addtion - ASIF MAQBOOL ******************
Data: BEGIN OF l_s_tab,
values TYPE C LENGTH 400,
end OF l_s_tab,
gs_param LIKE LINE OF gt_param,
l_temp_store LIKE gt_param.
Field-SYMBOLS: <gt_param> TYPE ANY TABLE,
<final_gt> TYPE any ,
<gs_fieldname> TYPE any,
<gs_value> TYPE any.
Data: l_t_tab TYPE TABLE OF string INITIAL SIZE 0,
str TYPE string,
str1 TYPE string.
**************** End Of Addtion - ASIF MAQBOOL ******************
* create Line-structure of data table
CREATE DATA lr_s_data LIKE LINE OF ct_data.
ASSIGN lr_s_data->* TO <ls_data_std>.
** create cumulation table
CREATE DATA lr_t_data LIKE STANDARD TABLE OF <ls_data_std>.
ASSIGN lr_t_data->* TO <lt_data_std>.
LOOP AT ct_data INTO <ls_data_std>.
COLLECT <ls_data_std> INTO <lt_data_std>.
ENDLOOP.
FREE ct_data.
* get reference for outtab / create outtab
CALL METHOD go_model->create_data_reference
EXPORTING
io_tx_data_io_type = go_model->ds_tx_data_io_type-totals
i_type = l_outtype "'UCR_SX_TX_DATA_LST'
IMPORTING
er_data = lr_s_data_out.
ASSIGN lr_s_data_out->* TO <ls_data_out>.
ASSIGN lr_s_data_out->* TO <ls_data_cop>.
CREATE DATA lr_t_data_out LIKE STANDARD TABLE OF <ls_data_out>.
ASSIGN lr_t_data_out->* TO <lt_data_out>.
CREATE DATA lr LIKE LINE OF <lt_data_std>.
ASSIGN lr->* TO <ls_data>.
CALL METHOD lcl_convert_output=>get_instance
EXPORTING
io_model = go_model
it_char = lt_char
IMPORTING
eo_instance = lo_conv
CHANGING
cs_data = <ls_data>.
ASSIGN: l_comp TO <comp>,
l_cgcomp TO <cgcomp>,
l_pcomp TO <pcomp>,
l_invc TO <invc>,
l_doct TO <doct>,
l_plevel TO <plevel>,
l_tc TO <tc>,
l_qty TO <qty>,
l_trn_lc TO <trn_lc>,
l_bu TO <bu>,
l_mmyy TO <l_mmyy>,
l_low TO <low>,
l_unit TO <unit>.
LOOP AT <lt_data_std> INTO <ls_data>. " loop
CALL METHOD lo_conv->convert_output. "end of "wis240605
* fill outtab
ASSIGN COMPONENT if_uc_model=>gc_type_comp_s_char
OF STRUCTURE <ls_data> TO <ls_data_cop>.
MOVE-CORRESPONDING <ls_data_cop> TO <ls_data_out>.
ASSIGN COMPONENT if_uc_model=>gc_type_comp_s_kfig
OF STRUCTURE <ls_data> TO <ls_data_cop>.
MOVE-CORRESPONDING <ls_data_cop> TO <ls_data_out>.
IF ct_task = c_task01 OR ct_task = space . "'it can be T2700 or blank
***** aggregate the transactionaldata for given Rules *****
ASSIGN COMPONENT : <comp> OF STRUCTURE <ls_data_out> TO <comp1>,
<cgcomp> OF STRUCTURE <ls_data_out> TO <cgcomp1>,
<pcomp> OF STRUCTURE <ls_data_out> TO <pcomp1>,
<doct> OF STRUCTURE <ls_data_out> TO <doct1>,
<invc> OF STRUCTURE <ls_data_out> TO <invc1>, "added by Asif M.
<plevel> OF STRUCTURE <ls_data_out> TO <plevel1>,
<tc> OF STRUCTURE <ls_data_out> TO <tc1>,
<qty> OF STRUCTURE <ls_data_out> TO <qty1>,
<trn_lc> OF STRUCTURE <ls_data_out> TO <trn_lc1>.
**** 1st Rule ****
* dont include records where '/1FB/CS_TRN_QTY' and '/1FB/CS_TRN_LC' are blank
IF <trn_lc1> = 0 AND <qty1> = 0.
CONTINUE.
ENDIF.
**** 2nd Rule ****
* delete the Posting levels if it is > 1 and clear to blank CS_PLEVEL
CHECK <plevel1> LE 1.
CLEAR <plevel1>.
**** 3rd Rule ****
* replace the Unilever Company with CG without prefix G and compare with Partner comp for deletion
* /BIC/ZCS_COMP with /1FB/SEM_CGCOMP and check with /BIC/ZCS_PCOM
IF ct_task <> space.
*** code added by Ramesh for the removal GBRNCH records while downloading the file.
**** code for removal of GBRNCH records only - Hardcode - sample code
* IF <cgcomp1> <> 'GBRNCH'. " to avoid BRNCH records
** replace Company with CG without prefix G when task name is not blank
* <comp1> = <cgcomp1>+1.
* ELSE.
* CONTINUE.
* ENDIF.
**** code for removal of GBRNCH records only - Hardcode - sample code
*** the assumption here,is consider only records with Legal entity as numeric excepting the first character
IF <cgcomp1>+1 CN sy-abcde. " to avoid BRNCH records
* replace Company with CG without prefix G when task name is not blank
<comp1> = <cgcomp1>+1.
ELSE.
CONTINUE.
ENDIF.
ENDIF.
* removing leading zero's as SAP sometimes adding them to <pcomp1>.
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
* EXPORTING
* input = <pcomp1>
* IMPORTING
* output = <pcomp1>.
PERFORM f_alpha_conversion USING <comp1>
CHANGING <comp1>.
PERFORM f_alpha_conversion USING <pcomp1>
CHANGING <pcomp1>.
" removing leading zero's from Investee Unit company - Added By Asif Maqbool, IBM/Unilever, 25/01/2008.
PERFORM f_alpha_conversion USING <invc1>
CHANGING <invc1>.
CHECK <comp1> <> <pcomp1>.
**** 4rth Rule ****
* initialise Document type & PV TC to blank /BIC/ZCS_DOCT & /1FB/CS_TRN_TC
CLEAR: <doct1>,<tc1>.
ENDIF.
COLLECT: <ls_data_out> INTO <lt_data_out>.
ENDLOOP. " end loop
IF <lt_data_out> IS INITIAL.
PERFORM f_build_msgs USING 'UCM0'
'W'
'053'
text-102
space "ct_task
space
space
CHANGING ct_message.
RETURN.
MESSAGE e208(00) WITH text-102.
EXIT.
ENDIF.
* perform various steps based on task name
CASE ct_task.
WHEN c_task01 OR space. " 'T2700' or blank
* download the data into a tab delimited file
**** start of Task 0001 ****
* create Line-structure of download table
CREATE DATA ls_download TYPE ty_download.
ASSIGN ls_download->* TO <ls_download>.
** create Download data internal table for task T2700
CREATE DATA lt_download LIKE STANDARD TABLE OF <ls_download>.
ASSIGN lt_download->* TO <lt_download>.
LOOP AT <lt_data_out> INTO <ls_data_out>.
MOVE-CORRESPONDING <ls_data_out> TO <ls_download>.
ASSIGN COMPONENT <trn_lc> OF STRUCTURE <ls_download> TO <trn_lc1>.
*** 6th Rule **********************
" Check for values, if present remove decimals, if not present clear it of (blank).
UNASSIGN <qty1>.
ASSIGN COMPONENT <qty> of STRUCTURE <ls_download> to <qty1>.
ASSIGN COMPONENT <unit> of STRUCTURE <ls_download> to <unit1>.
if <unit1> = '' OR <unit1> <> '%'.
REPLACE ALL OCCURRENCES OF '.' in <qty1> WITH '' RESPECTING CASE.
<qty1> = ''.
endif.
if <unit1> <> '' And <qty1> <> ''.
<unit1> = ''. " We dont need unit downloaded.
REPLACE ALL OCCURRENCES OF '.' in <qty1> WITH '' RESPECTING CASE.
<qty1> = <qty1>+0(2).
endif.
**** 5th Rule ****
* Move the Negative sign to front
PERFORM f_put_sign_in_front CHANGING <trn_lc1>.
INSERT <ls_download> INTO TABLE <lt_download>.
ENDLOOP.
* move the aggregated data to final table for display
FREE ct_data.
ct_data = <lt_data_out>.
CLEAR: l_path,l_filename,l_fullpath,l_action.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
window_title = 'Download aggregated BCS data to Tab Delimited file'
default_extension = 'txt'
* DEFAULT_FILE_NAME = dynamic file name as like ALE settings
file_filter = 'Text files (*.txt)'
IMPORTING
filename = l_filename
path = l_path
fullpath = l_fullpath
user_action = l_action .
CALL METHOD cl_gui_cfw=>flush.
" *************************** START OF CHANGE - ASIF MAQBOOL ************************
IF l_action = 0 OR l_action = 1.
ASSIGN gt_param TO <gt_param>.
APPEND '100' to l_t_tab.
READ TABLE gt_param INDEX 6 INTO gs_param.
ASSIGN COMPONENT 2 OF STRUCTURE gs_param to <gs_value>.
APPEND <gs_value> to l_t_tab.
Clear gs_param.
READ TABLE gt_param INDEX 4 INTO gs_param.
ASSIGN COMPONENT 2 OF STRUCTURE gs_param to <gs_value>.
APPEND <gs_value> to l_t_tab.
* LOOP AT <gt_param> INTO gs_param.
* ASSIGN COMPONENT 1 OF STRUCTURE gs_param to <gs_fieldname>.
* CASE <gs_fieldname>.
* WHEN '/BIC/ZFB_VERS'.
* APPEND '100' to l_t_tab.
* WHEN 'FISCPERIOD'.
* ASSIGN COMPONENT 2 OF STRUCTURE gs_param to <gs_value>.
* APPEND <gs_value> to l_t_tab.
* WHEN 'FISCYEAR'.
* ASSIGN COMPONENT 2 OF STRUCTURE gs_param to <gs_value>.
* APPEND <gs_value> to l_t_tab.
* WHEN OTHERS.
* ENDCASE.
* ENDLOOP.
CONCATENATE LINES OF l_t_tab INTO str1 SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CLEAR l_t_tab.
INSERT str1 INTO TABLE l_t_tab.
ASSIGN l_t_tab TO <final_gt>.
" To Start by adding the Header Data.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = l_fullpath
write_field_separator = l_seperator "SPACE
CHANGING
data_tab = <final_gt>
EXCEPTIONS
file_write_error = 1.
" Now append the Data after the header data insertion.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = l_fullpath
write_field_separator = l_seperator "SPACE
append = 'X'
CHANGING
data_tab = <lt_download>
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
" *************************** END OF CHANGE - ASIF MAQBOOL ************************
IF sy-subrc <> 0.
* MESSAHi,
I am also from same project.
We are facing a problem with this code.
How can I increase the length of the field obtained by this method.
CALL METHOD go_model->create_data_reference
EXPORTING
io_tx_data_io_type = go_model->ds_tx_data_io_type-totals
i_type = l_outtype "'UCR_SX_TX_DATA_LST'
IMPORTING
er_data = lr_s_data_out.
ASSIGN lr_s_data_out->* TO <ls_data_out>.
We are getting data overflow error when we try to move some large value to one of the field in <ls_data_out>.
we can avoid this if the field length is increased.
Waiting for your reply.
Regards
Madhu G S
Maybe you are looking for
-
I started a thread on this topic many months ago, and have yet to see any reply for support for this topic. The issue I have had now for over 6 months is that Firefox will not load my "My Yahoo" page at all. I get no error messages or anything, just
-
Query taking longer to execute the second time.
Hello, I have a query joing few tables and views and when i execute it the first them, it executes within a seconds, immediately if i execute it the second time it takes about 40 seconds to execute. I am using Oracle 11g [11.2.0.1.0]. Please find the
-
Problems with movie playback after iTunes update
Recently updated iTunes to 11.1.1.11 and now my Disney movies won't play - the audio keeps dropping out. Any help?
-
Hello together. I would like to have a small JLabel where I just have the name and then a big TextField. My problem is as I have it in a GridLayout all are the same size. How can I make that I can choice the size. Thanks in advance
-
Fonts for L4 -Bickham Script Pro
I was on my new laptop and exporting with a new font in L4 and when I went to my iMac it wasnt in there and it is up to date? Specificaly Bickham Script Pro. I can't figure out why the laptop has the font and the imac doesnt when it is the same pro