ALV cell format
Hi!
I'm beginning with ALV's and i have a problem when saving the content of a grid to a Z table that i built.
So...i have one collum that is of type mseg-menge ( i declared like this: zfield like mseg-menge). When i fill in the ALV this cell (for example, with the number 10000) and then hit the save button (wich i control at user_command) it changes that value to 10,000 and saves to the Z table like '*00'.
Does anybody knows how can i solve this problem?
Regards,
RT.
Why don't you see if the following code in the field catalog (assume structure is wa) does what you want. It suppresses the conversion exit.
wa-no_convext = abap_true.
Your target field may also be too narrow. You should make sure it is wide enough.
Similar Messages
-
Need help with Report Generation Toolkit: Excel Set Cell Format.vi
Hi people,
I've been searching and found this old thread of someone asking what is the input parameter "Number format". And I dont know what should I put in there. I've tried so many possibilities, but nothing works so far, such as:
0,0
0,?
0,#
#,0
?,0
and also with @, doesnt works. Where would I find help about this parameter?
I'm using Excel2003, german version, thus local decimal separator is a comma.
I also found this help from NI, but seems doesnt help me either. Do I miss something important?
thanks,
Yan.Hi,
I've used your suggestion and some numbers in excel doesnt need to get "right click, change to numbers" anymore (green indicators on the left-top side in some cells are gone). But, I think its still not a number, because I cant use a simple formula, such as in cell A10 I type "= A1/2" (cell A10 equals cell A1 divided with 2) . I got error which says its not a number.
Well, but other thing is found, any format-string I put in the input of Excel Set Cell Format.vi, such as #,########, will be shown the same as "customize #,########" if I right click in a cell in excel and click "Zellen formatieren" (formatting cell). But however, the numbers are still depends on the input of the format I put in the Append Table to Report.vi.
regards,
Yan. -
How can I copy cell formatting from one range to another?
How can I copy cell formatting from one range to another, including text fonts, colours, borders, etc., so that, for example, I can reuse a formatted reconciliation table again in different parts of a sheet?
Hi George,
Wayne found the Spinning Beachball of Death, and you will find it too.
Numbers is not good at handling large datasets. Might I suggest that you group your data into smaller sets (each month, perhaps?) and save each group in a separate Numbers document. Numbers will not link between documents, but you could have a summary Table within each document. Then comes the "clunky" bit of copying all those summary tables into a master document where you do the final processing of the data.
Regards,
Ian. -
How to print the data in ALV list format using an existing layout
Hi all
Iam displaying the output in ALV list format and I saved the layout with some name
now my requirement is i have to provide a field to select the layout name with F4 help and if i execute the program it should show the output with that layout format
I tried this iam getting F4 help for that layout and selecting the layout but iam not getting the output with that layout iam getting the normal basic layout
Can anyone send me a sample program code or what to do to get that
Thank youHi,
refer this code.
DATA : wa_variant TYPE disvariant, "Work area for variant
wa_variant1 TYPE disvariant, "Work area for variant
wa_layout TYPE slis_layout_alv, "Work area for layout
*& Form sub_get_default_variant *
This form will initialize the variant *
FORM sub_get_default_variant .
*--Clear
CLEAR wa_variant.
*--Pass the report name
v_repid = sy-repid. "Report ID
wa_variant-report = v_repid.
*--Call the function module to get the default variant
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = c_save
CHANGING
cs_variant = wa_variant1
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
*--Check Subrc
IF sy-subrc = 0.
p_varnt = wa_variant-variant.
ENDIF.
ENDFORM. "sub_get_default_variant
*& Form sub_f4_for_variant *
This form will display the List of Variants *
FORM sub_f4_for_variant .
*--Local Variables
DATA: lv_exit(1) TYPE c. "ALV exit
*--Call the function module to display the list of Variants
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = c_save
IMPORTING
e_exit = lv_exit
es_variant = wa_variant1
EXCEPTIONS
not_found = 1
program_error = 2.
*--Check Subrc
IF sy-subrc <> 2 AND lv_exit IS INITIAL.
p_varnt = wa_variant1-variant.
ENDIF.
ENDFORM. "sub_f4_for_variant
*& Form sub_check_variant *
This form will check the variant *
FORM sub_check_variant .
IF NOT p_varnt IS INITIAL.
CLEAR wa_variant1.
MOVE wa_variant TO wa_variant1.
MOVE p_varnt TO wa_variant1-variant.
*--Call the function module to check the variant exist
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = c_save
CHANGING
cs_variant = wa_variant1.
wa_variant = wa_variant1.
ENDIF.
ENDFORM. "sub_check_variant
Regards,
Prashant -
How to express cell format in Numbers?
In Numbers on Mac, I want all positive numbers in cells to display in blue with comma separators and a leading + sign. Example: the value 4135 should appear as +4,135
I want all negative numbers in cells to display in red with comma separators and a leading - sign. Example: the value 2167 should appear as -2,167
I know how to create this in Excel with the custom format [Blue]+#,##0;[Red]-#,##0
When I create a spreadsheet in Excel, then open the spreadsheet in Numbers, this cell format is not recognized by Numbers. Does anyone know how to create this cell format in Numbers? ThxHi pomme4moi,
You can get the "+", the "-" and the commas in the custom format menu.
For you colors you need conditional formatting as shown by Wayne.
quinn -
Issue in cell format when exporting data to excel
Hello there,
I have an ABAP program that selects data from tables into an internal table and writes the data in CSV (excel) file.
I have a very weird issue when writing the file: The data is written properly, though the dates in my data, which is written in yyyymmdd format, has different cell format in the csv file itself. I'll expain:
Let's say I've written into CSV file a table with name and birthdate, and I have 2000 records. From record 1 to 1475, when I right-click on the date cells in those lines, and choose "cell format", I can see it's in "general" format. From line 1476 on, when I do that I see that the date cells are in format of "custom" with pattern 'yyyymmdd'.
I want all the cells to be "general". How do I do that?
Thanks in advanceHi Daniel,
Try using these Function Module......................
Before filling final internal table write those condition.................................
Data: gv_date TYPE mch1-vfdat,
gv_vdate(10) TYPE c.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = gv_date
IMPORTING
date_external = gv_vdate
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF. -
Dear All,
There is t code called MB51 which the user use, we recommend them to execute that report in the background using this method -- t code-- execute in background--- enter the printer name and generate the temporary spool to veiw the report, however when we veiw that report using spo2, the <b>tool bar</b> (that comes when we execute in the foreround) is missing, which is used to veiw it in the ALV grid format, actually the user easily select the feilds in that format and download them to excel sheets, in the background that <b>" Details"</b> <b>option</b> is not there, is there any work around for this.
Thanks,..
Ravi.Hi Clemens,
Thanks for that valuable suggestion, atleast I got a direction to think about, so from here on its gotta be xml...
But, since I have no idea about xml coding, also I went through those 2 links you had sent, but I'm still unable to understand the following points:
1.How do I generate the xml code, relevant to formatting that I did in ALV Grid using the FM "REUSE_ALV_GRID_DISPLAY"?
2. How do I go about saving the xml file onto the Application server?
3. Can you please provide any sample ALV report code, where such XML formatting has been used?
Thanks in advance.
Regards,
Azeem Ahmed Matte -
Regarding downlaod the output from ALV grid format
Hi
i want to download the output ALV grid format into excel sheet .
but condition is when ever user press the button (&ZDL) the should be downloaded.
and also how to convert the output into CSV format.hi,
when '&ZDL'.
use this condition
check this one for down loading
try to download an ALV report in excel format using (list ->export -> local file-> soread sheet )
Re: advantages of alv reports
Excel Download to ALV report
hi this is full program
REPORT ZCR_BOMPLANT_DOWNLOAD.
TABLES : MAST , "Material to BOM Link
STKO , "BOM Header
MARA . "General Material Data
TYPES : BEGIN OF TY_MASTER ,
MATNR TYPE MAST-MATNR , "Material Number
WERKS TYPE MAST-WERKS , "Plant
STLAN TYPE MAST-STLAN , "BOM Usage
STLNR TYPE MAST-STLNR , "Bill of material
STLAL TYPE MAST-STLAL , "Alternative BOM
ANDAT TYPE MAST-ANDAT , "Date record created on
AEDAT TYPE MAST-AEDAT , "Date of Last Change
AENAM TYPE MAST-AENAM , "Name of Person Who Changed Object
STLST TYPE STKO-STLST , "BOM status
ZPLP1 TYPE MBEW-ZPLP1 , "Future Planned Price 1
DWERK TYPE MVKE-DWERK , "Delivering Plant (Own or External)
END OF TY_MASTER .
TYPES : MY_TYPE(20) TYPE C.
DATA : IT_MASTER TYPE STANDARD TABLE OF TY_MASTER,
WA_MASTER TYPE TY_MASTER .
DATA : IT_HEADER TYPE TABLE OF MY_TYPE.
DATA : W_PTH TYPE RLGRAP-FILENAME.
DATA : W_FILE TYPE RLGRAP-FILENAME.
*--- Add Header Fields to Header Table ---
APPEND 'Material Number' TO IT_HEADER .
APPEND 'Plant' TO IT_HEADER .
APPEND 'BOM Usage' TO IT_HEADER .
APPEND 'Bill Code' TO IT_HEADER .
APPEND 'Alternative BOM' TO IT_HEADER .
APPEND 'Created On' TO IT_HEADER .
APPEND 'Changed On' TO IT_HEADER .
APPEND 'Changed By' TO IT_HEADER .
APPEND 'BOM Status' TO IT_HEADER .
APPEND 'Planned Price' TO IT_HEADER .
APPEND 'Delivery Plant' TO IT_HEADER .
IF SY-MANDT = '700'.
W_PTH = '
lkdb01\ISD\IS\Software Developments\Developments\Data Files\SAP Dumps\BOM_Available\'.
ELSE.
W_PTH = 'C:\'.
ENDIF.
START-OF-SELECTION.
*--- Load Data to Internal Table ---
SELECT MASTMATNR MASTWERKS MASTSTLAN MASTSTLNR MASTSTLAL MASTANDAT MASTAEDAT MASTAENAM STKO~STLST
INTO TABLE IT_MASTER
FROM MAST
INNER JOIN STKO ON STKOSTLNR EQ MASTSTLNR
AND STKOSTLAL EQ MASTSTLAL
INNER JOIN MARA ON MARAMATNR EQ MASTMATNR
WHERE MARA~MTART LIKE 'ZFG%'
AND STKO~LKENZ NE 'X'
AND STKO~LOEKZ NE 'X'
AND STKO~STLST EQ '1'.
SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST MBEW~ZPLP1 MVKE~DWERK
INTO TABLE IT_MASTER
FROM MAST
INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
AND STKO~STLAL EQ MAST~STLAL
INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
INNER JOIN MBEW ON MBEW~MATNR EQ MAST~MATNR
AND MBEW~BWKEY EQ MAST~WERKS
INNER JOIN MVKE ON MVKE~MATNR EQ MAST~MATNR
WHERE MARA~MTART LIKE 'ZFG%'
AND STKO~LKENZ NE 'X'
AND STKO~LOEKZ NE 'X'
AND STKO~STLST EQ '1'.
IF SY-SUBRC <> 0.
MESSAGE I014(ZLOAD).
ENDIF.
*--- Set Path to Function Module ---
CONCATENATE W_PTH SY-DATUM ' - ' 'BOM_AVAILABLE_PLANT.XLS' INTO W_FILE.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = W_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_MASTER
FIELDNAMES = IT_HEADER
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_EIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC = 0.
SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
MESSAGE I023(ZLOAD) WITH text-001.
ELSE.
MESSAGE I022(ZLOAD) WITH W_FILE. "Errors while downloading.
ENDIF.
END-OF-SELECTION.
SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N. -
Currency cell format does not export to excel doc
Hi
i am using new numbers on my macbook also on new OSX mavrics
i have a invoice template that i have used for a good few years
it has a fair amount of formulas and cell formats running
the company i contract to uses windows based (office) system so i save the spreadsheet as an exel compatible file to send to them no problems
untill now
when i export to excel in ether .xls or .xlsx and open the document ether in numbers or on a windows pc on office 2007 all of the currency related cells are changed to 5 digits eg -£8295.00 instead of £25 and the cell format show custom
if i higlight the cell and change to curency the entrys chnge to the correct value
has any one witnessed this ?
it also is the same saving an excel sheet as a mac format CSV file and open that in numbers
please helpI am having exactly the same problem. Need to send invoices for work. Desperate for someone to help with a solution!!! thanks Stuart
-
Allowing a User to choose the ALV layout format on selection-screen
Hi all,
I would like to know how i can add a parameter to my selection-screen which would allow the User to choose a saved ALV layout format before pressing F8 rather than after. As used in CO15 or MB51.
Thanks femi.yes , You can check the program BCALV_TEST_FULLSCREEN_LAYOUT to check how F4 help is to be used .
to check existene of variant is pretty simple.
Pass the variant name in the ALV display FM . -
I hav an internal table with 35 fields. I want to get the output in the ALV grid format.
How can i Pl help meHi
Dont bother about how many fields are there in internal table just write your coding in a simple and easy way such that there should not be any performance issue
Check this sample report
*& Report ZALVGRID_WITH_RADIOBUTTONS *
REPORT ZALVGRID_WITH_RADIOBUTTONS .
TYPE-POOLS: abap, icon. " INCLUDE <icon>. for releases < 6.20
TYPES: BEGIN OF ty_s_sflight.
INCLUDE TYPE sflight.
TYPES: button1 TYPE iconname.
TYPES: button2 TYPE iconname.
TYPES: button3 TYPE iconname.
TYPES: button4 TYPE iconname.
TYPES: END OF ty_s_sflight.
DATA:gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
gs_layout TYPE lvc_s_layo,
gt_fcat TYPE lvc_t_fcat.
DATA:gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid TYPE REF TO cl_gui_alv_grid.
*icon_wd_radio_button_empty TYPE REF TO icon_wd_radio_button_empty.
* 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.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
* define local data
FIELD-SYMBOLS:
<ls_entry> TYPE ty_s_sflight,
<ld_fld> TYPE ANY.
READ TABLE gt_sflight ASSIGNING <ls_entry> INDEX es_row_no-row_id.
CHECK ( <ls_entry> IS ASSIGNED ).
* Set all radio buttons "unselected"
<ls_entry>-button1 = icon_wd_radio_button_empty.
<ls_entry>-button2 = icon_wd_radio_button_empty.
<ls_entry>-button3 = icon_wd_radio_button_empty.
<ls_entry>-button4 = icon_wd_radio_button_empty.
ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE <ls_entry>
TO <ld_fld>.
IF ( <ld_fld> IS ASSIGNED ).
* Set selected radio button "selected".
<ld_fld> = icon_wd_radio_button.
ENDIF.
* Force PAI followed by refresh of table display in PBO
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFRESH'
* IMPORTING
* RC =
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
* MAIN *
START-OF-SELECTION.
PERFORM select_data.
PERFORM init_controls.
PERFORM build_fieldcatalog.
PERFORM set_layout.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
* i_structure_name = 'SFLIGHT'
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fcat
it_outtab = gt_sflight.
* Link docking container to dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
lifetime_dynpro_dynpro_link = 3
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.
CALL SCREEN 100.
END-OF-SELECTION.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
ENDMODULE. "PBO OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
* Leave report
CASE gd_okcode.
WHEN 'BACK' OR
'EXIT' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* Refresh table display
WHEN 'REFRESH'.
PERFORM refresh_display.
WHEN OTHERS.
* do nothing
ENDCASE.
CLEAR gd_okcode.
ENDMODULE. "PAI INPUT
*& Form BUILD_FIELDCATALOG
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog .
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'ICON'
* 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.
DELETE gt_fcat WHERE ( fieldname <> 'NAME' ).
* NOTE: field ICON-NAME has data element ICONNAME.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'SFLIGHT'
* 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.
READ TABLE gt_fcat INTO ls_fcat
WITH KEY fieldname = 'NAME'.
IF ( syst-subrc = 0 ).
DELETE gt_fcat INDEX syst-tabix.
ENDIF.
ls_fcat-fieldname = 'BUTTON4'.
ls_fcat-coltext = ls_fcat-fieldname.
ls_fcat-icon = 'X'.
ls_fcat-hotspot = 'X'.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON3'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON2'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON1'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
* Renumbering of the columns
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG
*& Form SELECT_DATA
* text
* --> p1 text
* <-- p2 text
FORM select_data .
* define local data
DATA:
ls_sflight TYPE ty_s_sflight.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
ls_sflight-button1 = icon_wd_radio_button. " selected radiobutton
ls_sflight-button2 = icon_wd_radio_button_empty.
ls_sflight-button3 = icon_wd_radio_button_empty.
ls_sflight-button4 = icon_wd_radio_button_empty.
* Alternatively: create icons using function module 'ICON_CREATE'
* on SAP releases where these icons are not available.
MODIFY gt_sflight FROM ls_sflight
TRANSPORTING button1 button2 button3 button4
WHERE ( carrid IS NOT INITIAL ).
ENDFORM. " SELECT_DATA
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
CHECK ( go_docking IS NOT BOUND ).
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
* REPID =
* DYNNR =
* SIDE = DOCK_AT_LEFT
* EXTENSION = 50
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
ratio = 90
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
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.
* Size of container = full screen size
CALL METHOD go_docking->set_extension
EXPORTING
extension = 99999
EXCEPTIONS
cntl_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.
* Create ALV grid instance
CREATE OBJECT go_grid
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = go_docking
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
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 for event HOTSPOT_CLICK
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR go_grid.
ENDFORM. " INIT_CONTROLS
*& Form REFRESH_DISPLAY
* Refresh table display after switching the radiobuttons
* --> p1 text
* <-- p2 text
FORM refresh_display .
* define local data
DATA:
ls_stable TYPE lvc_s_stbl.
ls_stable-row = abap_true.
ls_stable-col = abap_true.
CALL METHOD go_grid->refresh_table_display
EXPORTING
is_stable = ls_stable
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 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. " REFRESH_DISPLAY
*& Form SET_LAYOUT
* Set layout for ALV list
* --> p1 text
* <-- p2 text
FORM set_layout .
CLEAR: gs_layout.
gs_layout-cwidth_opt = abap_true. " optimize column width
gs_layout-zebra = abap_true.
ENDFORM. " SET_LAYOUT
Reward all helpfull answers
Regards
Pavan -
OLE2. How to set cell format to percentage
hi,
how can I set the cell format to percentage? I tried with
ole2.set_property (cell, 'NumberFormat', '%');
OLE2.set_property(cell, 'Formula', '=A1/B1');
but this only print a '%' at the end of the cell. Really, the cell format is not percentage, and formula is not calculated.solved.
ole2.set_property (cell, 'NumberFormat', '0,00%'); -
Hide row and cell by cell formatting
Hello,
I am new to both diadem and VBS and I am having difficulties in translating calculations between excel and diadem. I know that diadem doesn't have the same cell by cell formatting that excel does but is there a way to either hide rows that do not meet a certain condition or a way to say use an equation of the form
=IF(H5> 0,J5+M4,0), where H is the conditional column and M is the resultant column?
Thank youHello ccimac,
You might want to look at the IIF function to help you solve that particular problem,
Example:
Call Calculate("Ch(""ResultNV"")=IIf( Ch(""Channel1"")>1,Ch(""Channel1""),NoValue)" )
This will create a NEW data channel called ResultNV that checks (in this example) whether a channel called Channel1 is larger than 1 or not. If it is, the value will the the actual channel value, if the values are smaller than 1 the software will replace the values with a NoValue - which is DIAdem's way of saying that a "cell" contains invalid values.
Does that work for your question? Feel free to ask if you have further questions,
Otmar
Otmar D. Foehner
Business Development Manager
DIAdem and Test Data Management
National Instruments
Austin, TX - USA
"For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary." -
I have a programme that sorts through test results and picks out the rejects according to its "delta" value. I've noticed now that some rejects weren't picked up for some reason. As a fail safe I want to be able to highlight any cell whose value is above a certain limit in two columns.
Any ideas?
Solved!
Go to Solution.
Attachments:
Matching Dual Devices.vi 35 KBHello Kevin,
Here is a Quick diagram that should help you get started on highlighting the data you want. It looks at the column "7" data and compares it to a requirement then changes the Cell formating to a green color if the equals is true. As you can probably guess the Flase case changes the cell color to red.
I hope this helps. -
Hi,
i need a help from you my dear friend I'm providing you the following information in which i have extract some of the fields from two internal tables and i have to display it in the alv grid format. All the work was done successfully but the problem is the values from internal table are moved but the values are not coming in output in ALV grid format. so pleease try to solve my problem.
Thanking you
TABLES: J_1IEXCHDR, J_1IEXCDTL.
type-pools: slis.
DATA: ITAB1 TYPE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
DATA: ITAB2 TYPE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
DATA: ITAB3 TYPE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
DATA: OK_CODE LIKE SY-UCOMM,
GT_SFLIGHT TYPE TABLE OF itab,
G_CONTAINER TYPE SCRFNAME VALUE 'BCALV_GRID_DEMO_0100_CONT1',
GRID1 TYPE REF TO CL_GUI_ALV_GRID,
G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
DATA: G_TABNAME TYPE SLIS_TABNAME VALUE 'RTAB_ALV'.
data: fieldcat type slis_t_fieldcat_alv.
data: begin of itab occurs 0,
lifnr type j_1iexchdr-lifnr,
docno type j_1iexchdr-docno,
exyear type j_1iexchdr-exyear,
budat type j_1iexchdr-budat,
exbed type j_1iexcDTL-exbed,
rdoc1 type j_1iexcDTL-rdoc1,
ecs type j_1iexcDTL-ecs,
exbas type j_1iexcDTL-exbas,
end of itab.
start-of-selection.
perform get_data.
perform call_alv.
form get_data.
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.
append itab.
endform.
CALL_ALV
form call_alv.
perform build_field_catalog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
IT_SORT = gt_sort
it_fieldcat = fieldcat[]
TABLES
t_outtab = itab
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.
Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
tables
t_outtab = itab.
endform.
form build_field_catalog.
clear: fieldcat. refresh: fieldcat.
data: tmp_fc type slis_fieldcat_alv.
tmp_fc-reptext_ddic = 'Vendor No'.
tmp_fc-fieldname = 'lifnr'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'docno'.
tmp_fc-fieldname = 'docno'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'exyear'.
tmp_fc-fieldname = 'exyear'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'budat'.
tmp_fc-fieldname = 'budat'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'exbas'.
tmp_fc-fieldname = 'exbas'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'exbed'.
tmp_fc-fieldname = 'exbed'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'rdoc1'.
tmp_fc-fieldname = 'rdoc1'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
tmp_fc-reptext_ddic = 'ecs'.
tmp_fc-fieldname = 'ecs'.
tmp_fc-tabname = 'itab'.
tmp_fc-outputlen = '10'.
append tmp_fc to fieldcat.
endform.
*loop at itab.
*WRITE: / ITAB-LIFNR,
ITAB-DOCNO,
ITAB-EXYEAR,
ITAB-BUDAT,
ITAB-EXBAS,
ITAB-EXBED,
ITAB-RDOC1,
ITAB-ECS.
*endloop.Hi Praveen,
In the field cat internal tabel for fieldname you have to pass the values in caps.look at the followig eg:
tmp_fc-fieldname = 'LIFNR'.
let me know if you still have a problem after this change.
regards,
Raju
Maybe you are looking for
-
PC to MAC - OK; MAC to PC - no connection
Description: 1. I have a LAN network in my neighborhood. I'm not the administrator but as far as I know there is a router. 2. I have settled the internet on my MacBook and it is much better then the PC desktop. faster... 3. I have set all the needed
-
MOSS 2007 Custom Theme Images Invisible to Users
Hi, Our MOSS 2007 Site uses Custom Theme and the theme uses image for styling navigation background. The issue is the when a user logs in to site he is not able to view the navigation background image whereas when a user with full control logs in to
-
Use of Variable in Script Logic
Dear All, We are working on a BPC Script Logic involving depreciation calculation, which calls an implementation of the BAdI BADI_UJ_CUSTOM_LOGIC. We are passing some parameters from the script logic to the BAdI. There are two parameters to be passed
-
I have a 3B2 document with me. I need to convert the 3B2 document to InDesign. Can someone help me out to convert the document or is there any tool available on the website?
-
What all-in-one should I buy?
I hardly ever print or scan anything any more, but sometimes it's essential (monthly accounts, etc). I'd say I print something once or twice a week. I need an all-in-one that works perfectly, is cheap, looks nice, doesn't use gallons of ink, has a dr