Number Format in Grid Cell
I can't get a SQLDataType=8 cell to format with comma separators (ie, 9,999,999). Have the number format options changed in 12.0? I can't find the reference table in the Help Docs. The table in the 11.5 help docs is here (file:///C:/Inetpub/wwwroot/LighthammerCMS/Help/popups/NumberFormatPopup.htm).
Nothing changed much other than the WB, it's still the basic java number formatting options (which is probably why the help doc popup looks a bit like a javadoc).
I believe the WB has a bug when setting and retrieving a nested comma in the ColumnFormats property, which itself is a comma separated DT property.
Use something like this in your PARAM's:
0.00,#^^#0.00,MM/dd/yy (just use the double carat for any nested comma and leave the commas to denote column breaks in the list).
Similar Messages
-
How do I change the number formatting within a Cell Table in Microsoft Word?
Hi, I was wondering if someone could help me out on an issue I've been having... I work for an accounting firm and we do a lot of financial statements.
I was wondering if we would be able to treat a cell table in Microsoft Word 2007 like I would a cell table in Microsoft Excel. Meaning, I would like to change the formatting of the numbers in the table to the "Accounting" (number) format so it
aligns by the decimal point and use the $ signs and () for negative numbers. We do use the link tables feature, however, most of our balancing pages just can't be done in Excel because of the way the text is written. It would be much harder to format
the text if it were to be typed in Excel. We have also tried creating an Excel sheet within Microsoft Word but it is the same as linking the tables... Again, a text formatting issue. The only option is to use tables within Word but how do we change
the number formatting to a "accounting" (number) format where the numbers would align with the decimal point and use () for the negative numbers. Is there ANY option for us to do this other than manually entering this information in using tabs?
If there are no options other than entering it in manually, please consider this as an option for your next software update. I believe that a LOT of people out there will be interested in this feature... My manager and I just attended a webinar on Microsoft
Advanced Word Tips Tricks and Techniques and 75% of the attending people had this question but no answer.
Thank you very much for your help!!!!!Word does not really have number formatting for table cells. You can align cell contents on the decimal point, though, by setting a so-called decimal tab stop.
Option 1:
- Select the cells for which you want to do this.
- Display the ruler.
- Click the Tab box on the left hand side of the ruler until the box contains an inverted T with a dot.
- Click in the ruler where you want the decimal tab.
Option 2:
- Select the cells for which you want to do this.
- Click the arrow in the lower right corner of the Paragraph group on the Home tab of the ribbon.
- Click the Tabs... button in the lower left corner of the dialog.
- Specify a tab position in the box, e.g. 1.5".
- Select the 'Decimal' radio button under 'Alignment'.
- Click Set.
- Click OK.
You will have to type the numbers as they should appear, including the $ for currency and the ( ) for negative numbers.
Regards, Hans Vogelaar -
How to apply a number format to a cell within a table in Word 2011??
I am creating a fillable PDF form and I need to be able to apply a phone number format to a cell in Word 2011 similar to how it is done in Excel...Can someone please HELP me? Thank You!
846640 wrote:
I have to import some data form excel sheet. but the number in that sheet have been saveed as the following format mask 1,000.000(2,000.000,1,5000,00) as charchterI am wonder how to apply format mask in excel for the character cell.
but in may table that field is a number, so how can remove the format mask from the excelsheet?So, while reading from excel how the values is coming in the variable i assume its coming with comma(,) than what happens if you try like below?
variable_name:=TO_NUMBER(REPLACE(variable_name,',',''));
-Ammad -
How do I assign images to grid cells based on their random number value?
Hello everyone!
I need a good point (or shove) in the correct direction.
Background
I've created (with previous help from this forum) a 12 x 9 random number grid which cycles through the numbers 1 to 9 a total of twelve times each. I've then created a button which shuffles the current grid's cells each time it is clicked. I now want to use 9 images that I have imported as individual symbols into the library (I have given them each their own class titled "skin1," "skin2," ... "skin9") as cell labels or the equivalent. I have also set the images up as individual movie clips (using the .Sprite class as the extended base class but keeping the actual image class names in line with their object name, i.e. the "skin1" image is the "skin1.as" class).
Question
How do I assign these images to the grid cells based on their respective values (ranging from 1 to 9) and have them populate the grid each time I click the "shuffle" button? So for example, in my grid the numbers 1 through 9 randomly appear 12 times each. Every time the number 4 appears in a cell, I want it to be assigned to the image "skin4" (which is just a graphic that looks like a button and has a fancy number "4" printed on it). Below is a chunk of the code I am using to draw the grid cells with:
// Creates a grid cell when called by generateGrid().
private funciton drawCell(_numeral:int):Sprite
This is the code I am currently implementing to populate the grids with (although I
don't want to use text labels as I want to fill each grid with an image according
to its numerical value (1 to 9).
var _label:TextField = new TextField();
_label.multiline = _label.wordWrap = false;
_label.autoSize = "center";
_label.text = String(_numeral);
// Add numerical label to cell array.
cellLabels.push(_label);
var _s:Sprite = new Sprite();
_s.graphics.lineStyle(2, 0x019000);
_s.graphics.drawRect(30, 0, cellW, CellH);
_s.addChild(_label);
return _s;
While the following isn't working code, it will hopefully demonstrate what I want to achieve inside this function so I don't have to use the above snippet for text labels:
//This will "hopefully" create an array of all 9 images by calling their classes. var _imageArray:Array = [skin1, skin2, skin3, skin4, skin5 , skin6, skin7, skin8, skin9]; // This is what I want to happen for each cell using the above image array: for (i = 0; i < cells; i++) { if (_numeral == 1) { // Insert skin1 image for each instance of #1 in the grid. } if (_numeral == 2) { // Insert skin2 image for each instance of #2 in the grid. } ... if (_numeral == 9) { // Insert skin9 image for each instance of #9 in the grid. } }
Again, I don't want to use text labels. I have a custom skin graphic that I want to go over each number on the grid based on its numerical value (1 to 9). Any help with this is much appreciated!kglad,
Thank you for your help with this one. Using the code below, I have successfully populated my grid cells with the desired corresponding graphics. I noticed one thing though regarding my use of the shuffle button with this particular implementation: even though the numerical values residing in each cell get shuffled, the original images remain in the grid rather than being replaced by new ones. The first code snippet below is the revised cell drawing function including your help; the second snippet shows you my simple shuffle button function (where the problem lies, I think).
Snippet #1:
// Creates a grid cell when called by generateGrid().
private function drawCell(_numeral:int):Sprite
var _label:TextField = new TextField();
_label.multiline = _label.wordWrap = false;
_label.autoSize = "center";
// Creates a label that represents the numerical value of the cell.
cellLabels.push(_label);
var _s:Sprite = new Sprite();
_s.graphics.lineStyle(2, 0x019000);
_s.graphics.drawRect(30, 0, cellW, cellH);
// Physically adds the labels to the grid.
_s.addChild(_label);
// Assigns a graphic class to a cell based on its numerical value.
var _classRef:Class = Class(getDefinitionByName("skin" + _numeral));
// Undefined variable for holding graphic classes.
var _image:* = new _classRef();
// Lines the images up with the grid cells.
_image.x = 30;
// Physically adds a graphic on top of a cell label.
_s.addChild(_image);
return _s;
So far so good (although I question needing text labels at all if they are just going to remain invisible underneath the images, but enough about that for now). This next part is the reason that the images won't shuffle with the cell values, I think.
Snippet #2:
// When shuffleButton is clicked, this event shuffles
// the number array and fills the cellLabels with the new values.
private function onButtonShuffleClick(e:MouseEvent):void
// Shuffles the number array.
shuffle(numbers);
// Verifies the array has been shuffled.
trace("After shuffle:", numbers);
// Loop replaces old cellLabels with new number array values.
for (var i:int = 0; i < cells; i++)
cellLabels[i].text = String(numbers[i]);
As you can see, it never replaces the original images that populate the grid. I tried using the _s.removeChild(image) function but that didn't work, nor would copying/pasting some of the code from snippet #1 directly into this function as it would cause another instance of the images to be placed over top of the existing ones rather than actually swapping them out. Any continued help here is greatly appreciated!
PS Is there a quicker method for posting code into these forums without having to type it all out by hand again (i.e. copy/paste or drag/drop from my .fla or Notepad file directly into this thread)? -
Forcing a number only format on a cell
I have set the format on particular cells to numbers but the spreadsheet user can still type in any character (letter A for instance). This causes errors in subsequent formula.
Is there any way to prevent this - that is allow the entry of numeric values only ?You cannot prevent a user from entering whatever characters they want. One way to prevent downstream errors is to not use the data entry cell in downstream formulas. For example, if the user enters data in B2, use C2 for data validation and use C2 in downstream formulas. For numerical entry you can use
C2=IFERROR(B2*1,0) which sets the default to 0 for downstream numeric formulas if the entry contains any non-numeric characters.
To flag the error for the user, you can put a conditional format in B2 so that if B2 is not equal to C2 then fill red.
When you are done designing your table, hide column C.
I'll have to think about how I'd do something similar if the text entry had to contain alphabet characters only. Luckily that was not your question.
Another method is to use a slider or a popup then you don't need to do data validation. Popups are good for a limited number of choices of whatever entries you want to allow (numbers, words, letters, etc) . Sliders are good for numerical entry but not overa really wide range of numbers if you want the user to pick an exact number. If you are looking for entry of the digits 0-9, I'd go with a popup. -
Can't change cell number format
Has anyone else had a cell that you can't change the number format? I had a table with a sum and it was not including 3 rows that were stuck as 'text'. Changing the format did not stick. I ended up just filling the cells from the ones that were able to change to 'number'.
Not a good feature for a spreadsheet!This is a design flaw that I consider a bug. It depends on the keyboard used to input the numbers. If you used the text keyboard (the one you get when selecting the "T"), the "number" you enter is text; you cannot change its format and it will not show up, for example, in a sum (it is treated as a null). Type the same "number" into the cell using the number keypad (the one you get by selecting the "42") and it is a number. This makes absolutely no sense to me but its the way it works. While I might be able to buy that a "number" being entered from the text ("T") keyboard is by default treated as text, changing the format to number should work. That it does not is something I can never buy.
-
Grid cell displaying 1 when value is 0
Why is it that grid column cells sometimes display 1 when the value in the cell is actually 0? Here is the scenario - I have a column in my grid with the following definition:
AttributeInfo SalesDollarsMasterCol = new AttributeInfo(java.sql.Types.NUMERIC);
The column is set up the following way:
SalesDollarsMasterCol.setName("SalesDollars");
SalesDollarsMasterCol.setColumnWidth(50);
SalesDollarsMasterCol.setUpdateable(false);
SalesDollarsMasterCol.setFormatterInfo(new FormatterInfo(DefaultFormatManager.NUMERIC_VALUE,"###,###,##0"));
SalesDollarsMasterCol.setLabel("Sales $");
SalesDollarsMasterCol.setDisplayed(true);
SalesDollarsMasterCol.setSortingEnabled(true);
When I display my grid, and there is a 0 value in SalesDollars, a 1 sometimes appears. To double check that I have a 0 value in SalesDollars, I get the actual Number value from the cell and print it out in the message window using getDoubleValue(), and the value is 0.0.
What's even stranger is that I can click in the cell, then click in another cell in the same row and the number changes to 0. But, when I navigate out of the row, the number changes back to 1.
Is this a bug in JDeveloper, or is it something I'm doing? I'm using JDeveloper 3.2.2 Build 915 on Windows 2000 and Oracle 8.1.7.I think u can use SRW.SET_FIELD_NUM in the format trigger to set the value conditionally.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sanjay Sharma ([email protected]):
Hi All,
I have two querries of master-detail type. Master has groups of types and subtypes. I have set the detail column property to display 0 when there is no value for the master type-subtype combination. But the detail colum displays balnk and not Zero. I am using report 6i. How can I dispaly 0 for null value in detail record. any one with solution. Sanjay<HR></BLOCKQUOTE>
null -
Button in alv grid cell using REUSE_ALV_GRID_DISPLAY
Hi all,
I want to make the contents of 2 columns of my alv grid as push button with values as text on it. I am not using classes or methods but alv grid fm. On clicking the button one dialog box has to pop up which gives edit option for the values in that coloumn, my question is how to introduce button in alv grid cell? if i can use t_fieldcatalog-icon, then please give me the complete steps for that.
Thanks.this may helps u
u need to copy stadard screen elemetn to MARATAB1(at PF -STATUS)
You should copy the 'STANDARD' GUI status from program <b>SAPLSLVC_FULLSCREEN</b>
type this one in SE41 program name is:<b>SAPLSLVC_FULLSCREEN</b>
status : <b>STANDARD_FULLSCREEN</b>
and copy it ...
Type-pool
type-pools slis.
Tables
tables: mara,sscrfields.
Selection screen
select-options: s_matnr for mara-matnr.
PARAMETERS: p_email TYPE somlreci1-receiver.
TYPES: BEGIN OF t_charmara,
matnr(18) TYPE c, " Material Number
ernam(12) TYPE c, " Person Credited
aenam(12) TYPE c, " Person Changed Object
pstat(15) TYPE c, " Maintenance Status
END OF t_charmara.
Data Declarations
data: rt_extab type slis_t_extab, " Table of inactive function
codes
wa_charmara TYPE t_charmara, " work area of mara Table
fs_fieldcat type slis_t_fieldcat_alv,
" Field catalog with field
descriptions
t_fieldcat like line of fs_fieldcat,
" Table of Field catalog
r_ucomm like sy-ucomm, " User Command
rs_selfield TYPE slis_selfield. " cursor position ALV
data: filedlayout type slis_layout_alv,
heading type slis_t_listheader with header line,
t_event type slis_t_event.
data: fs_event like line of t_event.
data: fs_sort type slis_sortinfo_alv,
t_sort type slis_t_sortinfo_alv.
data: w_char(200) type c,
w_matnr type mara-matnr.
fs_sort-fieldname = 'MATNR'.
fs_sort-up = 'X'.
fs_sort-group = '*'.
append fs_sort to t_sort.
clear fS_sort.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
Internal Tables
data: begin of it_mara occurs 0,
matnr like mara-matnr, " Material Number
ernam like mara-ernam, " Person Credited
aenam like mara-aenam, " Person Changed Object
pstat like mara-pstat, " Maintenance Status
end of it_mara.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
*at selection-screen on field event
AT SELECTION-SCREEN on s_matnr.
PERFORM f0100_VALIDATE_MATERIAL_NUMBER.
start-of-selection.
retrive Data from the data base table Mara
perform retrive_data_from_mara.
end-of-selection.
*Field catalog with field descriptions
perform fieldcat.
*perform top_of_page.
PERFORM EVENT_LIST.
*ALV Grid Display
perform alv_display.
Creating one Push button ENTER
perform maratab1 USING RT_EXTAB.
*& Form f0100_VALIDATE_MATERIAL_NUMBER
text
There are no interface parameters to be passed to this subroutine
FORM F0100_VALIDATE_MATERIAL_NUMBER .
select matnr " Material Number
from mara
up to 1 rows
into mara-matnr
where matnr in s_matnr.
endselect.
IF sy-subrc NE 0.
clear sscrfields-ucomm.
MESSAGE e000 WITH 'Enter valid Material number'(003).
ENDIF. " IF sy-subrc NE 0
ENDFORM. " f0100_VALIDATE_MATERIAL_NUMBER
*& Form retrive_data_from_mara
text
*There are no interface parameters to be passed to this subroutine
FORM retrive_data_from_mara .
select matnr " Material Number
ernam " Person Credited
aenam " Person Changed Object
pstat " Maintenance Status
from mara
into table It_mara
where matnr in s_matnr.
IF sy-subrc NE 0.
MESSAGE i001 WITH 'Records are not found'.
exit.
stop.
ENDIF. " IF sy-subrc NE 0
ENDFORM. " retrive_data_from_mara
*& Form fieldcat
text
*There are no interface parameters to be passed to this subroutine
FORM fieldcat .
*field catalog for MATNR
t_FIELDCAT-REF_TABNAME = 'MARA'.
t_fieldcat-fieldname = 'MATNR'.
t_fieldcat-col_pos = 1.
append t_fieldcat to fs_fieldcat.
clear t_fieldcat.
*field catalog for ERNAM
t_FIELDCAT-REF_TABNAME = 'MARA'.
t_fieldcat-fieldname = 'ERNAM'.
t_fieldcat-col_pos = 2.
append t_fieldcat to fs_fieldcat.
clear t_fieldcat.
*field catalog for AENAM
t_FIELDCAT-REF_TABNAME = 'MARA'.
t_fieldcat-fieldname = 'AENAM'.
t_fieldcat-col_pos = 3.
append t_fieldcat to fs_fieldcat.
clear t_fieldcat.
*field catalog for PSTAT
t_FIELDCAT-REF_TABNAME = 'MARA'.
t_fieldcat-fieldname = 'PSTAT'.
t_fieldcat-col_pos = 4.
append t_fieldcat to fs_fieldcat.
clear t_fieldcat.
ENDFORM. " fieldcat
*& Form EVENT_LIST
text
*There are no interface parameters to be passed to this subroutine
FORM EVENT_LIST .
fs_event-name ='TOP_OF_PAGE'.
fs_event-form = 'TOP_PAGE'.
append fs_event TO t_EVENT.
CLEAR FS_EVENT.
fs_event-name ='END_OF_PAGE'.
fs_event-form = 'END_PAGE'.
append fs_event TO t_EVENT.
CLEAR FS_EVENT.
fs_event-name ='END_OF_LIST'.
fs_event-form = 'LIST_END'.
append fs_event TO t_EVENT.
CLEAR FS_EVENT.
ENDFORM. " EVENT_LIST
*& Form alv_display
text
*There are no interface parameters to be passed to this subroutine
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'MARATAB1'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = FS_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = T_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = T_EVENT
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_MARA[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alv_display
form TOP_PAGE.
data:tbl_listheader type slis_t_listheader,
wa_listheader type slis_listheader .
wa_listheader-typ = 'S'.
wa_listheader-info = 'Created by : Vijay Pawar'.
append wa_listheader to tbl_listheader.
wa_listheader-typ = 'S'.
concatenate ' Date ' sy-datum into
wa_listheader-info separated by space.
append wa_listheader to tbl_listheader.
wa_listheader-typ = 'S'.
concatenate ' From ' s_matnr-low ' To ' s_matnr-high into
wa_listheader-info separated by space.
append wa_listheader to tbl_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = tbl_listheader
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
endform. " form TOP_PAGE.
form END_PAGE.
STATICS W_PAGE TYPE I .
data:tbl_listheader type slis_t_listheader,
wa_listheader type slis_listheader .
wa_listheader-typ = 'S'.
wa_listheader-info = W_PAGE.
append wa_listheader to tbl_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = tbl_listheader
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
add 1 to w_page.
endform. " form END_PAGE.
form list_end.
data:tbl_listheader type slis_t_listheader,
wa_listheader type slis_listheader .
wa_listheader-typ = 'S'.
wa_listheader-info = '......................................Last Page'
append wa_listheader to tbl_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = tbl_listheader
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
endform. " form list_end.
*& Form maratab1
text
-->P_RT_EXTAB text
FORM maratab1 USING P_RT_EXTAB.
SET PF-STATUS 'MARATAB1' EXCLUDING rt_extab.
ENDFORM. " maratab1
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
case r_ucomm.
when 'ENTER'.
perform bulid_xls_data_table.
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email "'[email protected]'
'Example .xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
perform populate_email_message_body.
PERFORM initiate_mail_execute_program.
endcase. " case r_ucomm.
endform. " FORM user_command
perform populate_email_message_body.
PERFORM initiate_mail_execute_program.
CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
EXPORTING
DATA_FILENAME = 'MARA.XLS'
DATA_PATH_FLAG = 'W'
DATA_ENVIRONMENT =
DATA_TABLE = ITAB[]
MACRO_FILENAME =
MACRO_PATH_FLAG = 'E'
MACRO_ENVIRONMENT =
WAIT = 'X'
DELETE_FILE = 'X'
EXCEPTIONS
NO_BATCH = 1
EXCEL_NOT_INSTALLED = 2
INTERNAL_ERROR = 3
CANCELLED = 4
DOWNLOAD_ERROR = 5
NO_AUTHORITY = 6
FILE_NOT_DELETED = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
leave to list-processing.
endcase.
*& Form bulid_xls_data_table
text
*There are no interface parameters to be passed to this subroutine
FORM bulid_xls_data_table .
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'matnr' 'ernam' 'aenam' 'pstat'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT It_mara INTO wa_charmara.
CONCATENATE wa_charmara-matnr wa_charmara-ernam
wa_charmara-aenam wa_charmara-pstat
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP. " LOOP AT it_mara INTO...
ENDFORM. " bulid_xls_data_table
*& Form send_file_as_email_attachment
Send email
-->P_IT_MESSAGE text
-->P_IT_ATTACH text
-->P_P_EMAIL text
-->P_0387 text
-->P_0388 text
-->P_0389 text
-->P_0390 text
-->P_0391 text
-->P_0392 text
<--P_GD_ERROR text
<--P_GD_RECIEVER text
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. " send_file_as_email_attachment
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test mara records'.
APPEND it_message.
endform. "form populate_email_message_bod
rewards if it helps u -
Multiple Lines in a Single ALV Grid Cell
Is there any way to Display Multiple Lines in a Single ALV Grid Cell.
This can be accomplished by Sorting the First 3 fields and Make it Looks like below displayed format.
But My problem is while downloading also it should be Displayed in the same format.
All inputs are highly appreciated.there was a post similar to this some days back... search it..
any ways...
what u can do is...
arrange ur final internal table so that it will look like same line...
like...lets say ur internal table is :
A1 B1 C1 D1 123
A1 B1 C2 D2 123
A1 B2 C1 D1 123
A1 B2 C2 D2 123
and u can rearrange ur table to be like
A1 B1 C1 D1 123
C2 D2 123
A1 B2 C1 D1 123
C2 D2 123
what i mean to say is dont pass the fields if they are same in the previous line... try it out..
and then pass it two ur ALV.
it will look like they are in one line
Edited by: soumya prakash mishra on Jun 17, 2009 1:31 PM -
Buttons in ALV Grid cell need focus to be clicked :-(
Hi,
I have an ALV Grid with single cells displayed as buttons (dependend on the data in the corresponding row). Unfortunatelly the button-cells need focus to be clicked. So you need two clicks: one to get the focus to the desired cell and one to really click the button.
Any ideas how to make this work with one single click ? (Setting a hotspot does not work, cause hotspots have the same problem.)
Regards,
TobiHello Tobias
The proposal by Naimesh is valid for CL_GUI_ALV_GRID, too. You may have a look at sample report ZUS_SDN_ALVGRID_EVENTS_HOTSPOT. Put the focus on any non-button cell and next click on any customer button.
*& Report ZUS_SDN_ALVGRID_EVENTS_HOTSPOT
*& Thread: Buttons in ALV Grid cell need focus to be clicked :-(
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1009251"></a>
REPORT zus_sdn_alvgrid_events_hotspot.
DATA:
gd_okcode TYPE ui_func,
gt_fcat TYPE lvc_t_fcat,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid1 TYPE REF TO cl_gui_alv_grid.
DATA:
go_table TYPE REF TO cl_salv_table,
go_grid_adapter TYPE REF TO cl_salv_grid_adapter.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1.
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '2000' OBLIGATORY.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender, " grid instance that raised the event
handle_button_click FOR EVENT button_click OF cl_gui_alv_grid
IMPORTING
es_col_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
* define local data
DATA:
ls_knb1 TYPE knb1,
ls_col_id TYPE lvc_s_col.
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row_id-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CASE e_column_id-fieldname.
WHEN 'KUNNR'.
SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
WHEN 'ERNAM'.
* SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
* NOTE: no parameter id available, yet simply show the priciple
CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
WHEN OTHERS.
* do nothing
ENDCASE.
* Set active cell to field BUKRS otherwise the focus is still on
* field KUNNR which will always raise event HOTSPOT_CLICK
ls_col_id-fieldname = 'BUKRS'.
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
is_row_id = e_row_id
is_column_id = ls_col_id.
ENDMETHOD. "handle_hotspot_click
METHOD handle_button_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
READ TABLE gt_knb1 INTO ls_knb1 INDEX es_row_no-row_id.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDMETHOD. "handle_button_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = p_bukrs.
** TRY.
** CALL METHOD cl_salv_table=>factory
*** EXPORTING
*** LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
*** R_CONTAINER =
*** CONTAINER_NAME =
** IMPORTING
** r_salv_table = go_table
** CHANGING
** t_table = gt_knb1.
** CATCH cx_salv_msg .
** ENDTRY.
** go_table->display( ).
** go_table->get_metadata( ).
** EXIT.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create ALV grid
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_docking
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR go_grid1,
lcl_eventhandler=>handle_button_click FOR go_grid1.
* Build fieldcatalog and set hotspot for field KUNNR
PERFORM build_fieldcatalog_knb1.
* Display data
CALL METHOD go_grid1->set_table_for_first_display
CHANGING
it_outtab = gt_knb1
it_fieldcatalog = gt_fcat
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* ok-code field = GD_OKCODE
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_FIELDCATALOG_KNB1
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog_knb1 .
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'KNB1'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
* I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT gt_fcat INTO ls_fcat
WHERE ( fieldname = 'KUNNR' OR
fieldname = 'ERNAM' OR
fieldname = 'BUKRS' ).
IF ( ls_fcat-fieldname = 'BUKRS' ).
ls_fcat-style = cl_gui_alv_grid=>mc_style_button.
" column appears as button
ELSEIF ( ls_fcat-fieldname = 'KUNNR' ).
ls_fcat-style = cl_gui_alv_grid=>mc_style_button.
ls_fcat-hotspot = abap_true.
ELSE.
ls_fcat-hotspot = abap_true.
ENDIF.
MODIFY gt_fcat FROM ls_fcat.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG_KNB1
Regards
Uwe -
How to add text after number in the same cell? "200 units", "3Kg", "17 sqm"
Dear Sirs,
I have problem with adding text after a number in the same cell.
For instance, in excel I am able to do this:
200 units -----> this is on the same cell. Any number I type, "units" will follow automatically.
I know that we can just type "200 units" but its in text format so it cannot be calculated supposedly I want to multiply it by others number.
I know that we can do this by splitting into two cells, one on the left for the number "200" and another one on the right for the text "units".
It would be helpfull if we could do this function such as "20 years", "3Kg" etc.
Sorry to trouble you all.
Thank you
QThis is a case of uneven implementation in Numbers. This sort of functionality is available to format numbers used to label axis ticks on various charts, but not to format numbers in a cell. This feature should be requested.
As an aside, perhaps a spreadsheet that actually managed numeric units as part of the calculation would be powerful and useful in avoiding formula bugs, something like is available in Google calculations. If you are unfamiliar with this, try one of the following examples typed into any Google search entry field:
150 miles per gallon in liters per 100 kilometers
100 * 20 yards / 40 minutes in mph
Read more at http://www.google.com/intl/en/help/features.html#calculator -
Pulling my hair out: Change format from date to number format?
I was recently sent a formatted Excel spreadsheet in which to enter my own numbers. The format is date and duration, but the last column is the total number of hours and minutes converted into decimals, e.g. 3hrs. 30mins. = 3.5 hours.
It was going fine until last night when I tried to enter 5:73 as a number, not a duration, but Numbers keeps changing it to 6m 13s. I've tried changing the format from Duration to Number but although the cell will say 0:00, when I enter the number 5:73 it automatically switches back.
The weird thing is that it's only happening on about one-third of the cells. I even cut-and-pasted a section of the spreadsheet that didn't have this problem, cleared the contents and then typed my info into the same lines and rows and it's still doing the same thing.
How can I see the hidden formatting in Numbers cells to see if I can figure what needs to be changed?
Thank you.Hi Jane,
dragging on bottom right corner but all that does is increase the range, not the size of the actual cell itself.
Hover the cursor over the right of a column (Column B in this example) until the cursor becomes a cross with arrows pointing East and West. Drag right to widen the column.
Or use the Format Panel > Table > Row & Column Size
(You may have to drag the panel up to see this)
I really miss in Numbers is being able to edit cell contents in a formula bar.
Here is the formula bar in Numbers 3.2 after clicking twice on a cell
The formula bar is moveable. Hover over the left of the bar until the cursor changes to a 'hand' and you can drag it.
Resize the formula bar by hovering over any edge and drag
Tricky with a trackpad, easier with a mouse .
Also, the cell contents appear at bottom left of the Numbers window
If you prefer Numbers 2.3, I agree it is much more user-friendly version.
Regards,
Ian. -
CSV to Excel 2013 - Issue with number format
Hi,
I use Excel 2013 to manipulate CSV files. I experienced issue with number format cells. In my CSV file there is one column that presents latitude values in format: 52.05456464. When I open my CSV file in Excel 2013 all values in that column get separator
".", in this case my number is present like this: 52.054.454.464. I tried to change my cell format, and when opened the category was Number, I change it to the General but in that case I lost all "." and got 52054454464.
I also tried to open same file on other machine with Excel 2010 and file is opened correctly without issues and in cell format the category is general by default.
I hope that there is some kind of resolution for this.Hi
According to your description, we may follow these steps:
highlight the column B > Home Tab > Number section > Select Number and choose "More Number Format" > Make sure the Negative number is chosen correctly. If you are using Custom format, we will have to change it.
Hope it helps
Best regards -
I want to put a phone number in to a cell 01273 but the 0 keeps disapearing
i want to put a phone number in to a cell 01273 but the 0 keeps disapearing what am i doing wrong.
Hi Murray,
Numbers has a default format called Automatic and if it sees your input as a numeric value it will try to format it the way it thinks numbers should look. There are several ways to overcome this using various formatting options. The most simple and direct is to pre-format your data area as Text. The most elaborate is to create a Custom Format to automatically insert your choice of punctuation and to treat every zero as significant.
Jerry -
Delimiteddata and number format mask
Hi,
I need to export data from my report to a csv format in reports 6i.
I installed patch 12 so I can use the delimiteddata format.
This works but I do have problems with the number format.
I formatted all of the number fields so they appear as desired in the report when running in C/S mode.
I learned that you can use the number format, date format and cell wrapper variables for delimited and delimiteddata formats.
These parameters do work with delimited output but they don't when generating delimiteddata.
Only when I start the reports builder with numberformatmask=something on the command line then the number format given on the command line will be used. but then you cannot change it (even not in the dialog when generating a delimited format) anymore once reports builder is open.
Is there a solution for this problem or is it fixed in a later patch (I haven't seen anything new in then patch 13 notes).
PietHi Pieter,
This does looks like a Bug. Please contact Oracle Support to assist you in getting the right patch or otherwise.
Regards
Oracle Reports Team.
Maybe you are looking for
-
Audio problem; buzzing noise (HP Spectre XT TouchSmart 15-4011nr)
Hi, I recently bought an HP Spectre XT TouchSmart 15-4011nr Ultrabook. I'm getting this annoying buzzing noise while listening to music or streaming movies. The store change my laptop for another one and after a few minutes listening I got the same b
-
Field names are not coming in file when dloaded frm apserv to prserv
Here i'm dloading data to Appserver..frm there data is dloading to pre server..but fieldnames are downloading...i am working in 4.6c version.same code is working in ECC version...Plzz give me a suggestion... FORM dload_file_from_server USING p_s
-
We have a family of Apple products at home, and with every new one, we learn a new aspect of the Apple Life. After switching to iPhone 5S and struggling between some applications, I've decided it is time to upgrade rest of my older devices requestin
-
Save /ADD Grid Control Columns Data in database
Hello All, Can any one suggest me how we add or save or update the grid control columns fields data into databases. My problem is I have 2 tabs in user defined screen Main and issue tabs . when we click the issue
-
9i (r2) RAC install on Win 2k.
Hi, Is it possible to build a "cheap" Win 2k 2 node RAC environment (similar to the linux environment built using firewire at http://otn.oracle.com/pub/articles/hunter_rac.html). If not what are the options? Thanks, john