Identify multiple Excel selection ranges passed to VBA.
If I select two ranges of a worksheet from within the worksheet/Excel itself and run a VBA (macro) to perform operations in VBA on the ranges, how do I identify those two selections in the VBA code to work with
them?
In other words, in the work book drag with the mouse to select a range, then Ctrl+drag a second range then call/run the macro/VBA. (For example, right-click drag cells B11 to B14, release, then Ctrl-right-click cell F1 (or F1 to F7). Then run the macro.)
How do I reference those two selected ranges (B11:B14 and F1 or F1:F7from the example) in the VBA code?
I see many example within VBA of selecting multiple ranges, but how do I refer to ones "passed" to the macro? (I'm thinking it would be something like Application.Selection.first and Application.Selection.second, etc but VB doesn't show anything
to choose past Application.Selection .)
Is it even possible to identify that two selections exist or is it all one selection, even if they are disjoint ranges?
If it's all one selection (Application.Selection), how might I identify two non-contiguous ranges from within the selection and "split" them into two?
I just found out that in Excel I can select three non-adjacent cells from any row or column, but I can only copy those three cells if they are on the same row or column. I didn't try more cells.
This is all in Excel 2007.
JimC, you get my ANSWERED vote!
As near as I can tell, it does almost exactly what I need. I tested with four non-contiguous cell selections and the loop displays each one in the order selected.
What it doesn't do is give the range of a contiguous area in the order of selection, meaning selecting e20 to a3 (dragging up to the left) gives range a3 to e20. Essentially, a range bigger than one cell is always identified as lowest order cell
to highest order cell.
I can handle that if needed by selecting individual cells through the range (as long as it's not too many cells) in the order I want to deal with them.
Similar Messages
-
How to identify multiple checkbox selected in JSF
Hi All,
My scenorio is.
I am diplaying records on page using <h:dataTable>
I have one column in dataTable which contains checkboxes which I displayed as,
<h:selectBooleanCheckbox id="abc" />
Also I have button on page.
I want to select 2 check boxes & then click onto button then that 2 records should get deleted.
how to identify that 2 checkbox selected ?
can anybody help ?
Thanks
SandipHi BalusC
Thanks for your reply.
Is there any other approach to do this ?
because as per your approach my code will not work because you are using seperate bean.
If i try to compare your code with my code then I have to do changes in my entity bean which is not possible.
So is there any other way ,
If I want select more than 1 checkbox & delete those records of selected checkboxes .
i.e. I want to find which checkboxes selected on JSP page sothat I will get those selected value on Java side & will delete that record from java side.
Please help.
I am not finding any solution to this.
If any code then it will be a great help for me.
Thanks
Sandip -
Multiple selection ranges reversed when I append on storyline
When I append multiple selection ranges in a clip to the storyline, the order is reversed on the storyline. I've found others with similar issues and no solution aside from deleting FCP preferences in the library and/or reinstalling, both of which i've done to no avail. It is excruciating and doesn't seem to make much sense as to why a shortcut would have been created only to force me to rearrange the clips on the storyline and waste the time that's supposed to be saved. I've also tried it on another computer, and the same issue. Supposedly the clips are arranged in the order of the selections but they are always placed in the reverse order in which I select them. I am trying my best to become accusomted to FCPX after switching to Premiere CS6 by default upon FCPX's release but so far seems to be a waste of a purchase....
AnthonyThank you for your response and attempt to reproduce this issue, i've since pinpointed that I only have the issue when I attempt to append multiple selections I have made in list view in the event browser. Whenever I append these multiple selections in list view, they will always be in the reverse order that my selections were made, but discovered these workarounds:
1) after making the multiple selections in list view, switch views to filmstrip view and then append
2) once the selections are made in list view, press F to rate them, and then select the subclips and append them to the storyline
That is the only way I can get them to appear in the order I intended. I have found users to be polarized on this issue, having found only a few editors on other forums with this issue and finding most who seem like my issue is a freak occurance (even got the great Larry Jordan to respond on his forum and not being able to replicate the issue). So i'm hoping an upgrade will fix the problem in the near future. I've tried deleting preference files however did not uninstall and reinstall on one of my machines since I already tried doing so on another machine to no avail...
Thanks anyways for the response!
Ant -
Exporting selected range only from Excel / Calc
Hi,
I would like to know if it is possible to create a PDF that contains only a selected range of cells, when working in MS Excel or OO.o Calc.
I don't mean just checking the Print only Selection option -- that prints those cells, but into a letter-sized PDF.
What I would like to do is to have the selection and only the selection - with no surrounding white space (except perhaps a small margin) - in the PDF. That is, the PDF would be resized to match the dimensions of the selection.
I guess what I have in mind is similar what you would get if you created the PDF as usual, then cropped out the surrounding white space - but done automatically.
Many thanks in advance.
PS - I am using Adobe Acrobat 9.3 with MS Office 2007 or OO.o 3.2 on Windows 7.I'm not sure this is relevant but I mistakenly wrote above that I was using Excel 2007. Actually, it's Excel from Office 2010 Beta. However, I remember trying this as well in Office 2007 so I don't think that's related.
-
Load Table Data into Excel Specific range
Hi,
I am working with Excel Destination in SSIS, where i have to insert table data into multiple excel sheets with specific range, sheet name same as table name and i should load each table into that particular sheet name in excel.
So Sheet name will decide at run time and i have created one variable to pass complete sheet name (like [DimAge$A16:R1000]) in excel destination, but it is throwing error Here i am facing two complexities
1)Getting error while passing excel sheet name as variable
2) How to insert into excel in specific range of values shown as above.
Ur help in solving this would be appreciatedHi Naveen,
Based on my research, a worksheet or range is the equivalent of a table or view in Excel. The lists of available tables in the Excel Source and Destination editors display only existing worksheets (identified by the $ sign appended to the worksheet name,
such as Sheet1$) and named ranges (identified by the absence of the $ sign, such as MyRange).
So when you use a variable with [DimAge$A16:R1000] or [Select * from DimAge!A$16:R$1000] value in the Excel Destination, the value acts as a worksheet or range name. But there is no such worksheet or range in the excel file, so the error message occurs.
To fix this issue, please select the cell range in your excel sheet, then right-click the range to define a name for the range to create some ranges with the specific ranges in excel file, then in the "Name of the Excel Sheet" drop down box of
"Excel Destination Editor" you can see that Named range. Then simply select the range from the drop-down list or use a variable with the range name as the Excel Destination.
For more information about how to import data to Excel sheet's specific region, please refer to the following blog:
http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
Report help for multiple Date Select options
Hi Friends,
For a particular year wise report, the client wants 12 date select-options which are changeable and informal every year .The report will also be displayed as per the given date selection period wise. Please help me how to fetch the datas from the table as per the given selection period. Currently the report have one date select-option where the user gives selection range as 1.04 to 31.03. It's related to EB power consumption report and hence the new requirement on date selection which are informal and not a fixed date of every year.
Ex:Selection-Screen
Period 1 : 08.04.2008 to 12.05.2008
Period 2: 12.05.2008 to 20.06.2008
Period 3: 21.06.2008 to 28.07.2008
Period 4: 29.07.2008 to 15.08.2008
Period 5: 15.08.2008 to 21.09.2008
Period 6 : 21.09.2008 to 14.10.2008
The data will derive as per the above selection ranges.......
Please advise with example.
thanks & regards
Sankar.>
sankar babu wrote:
> Ex:Selection-Screen
> Period 1 : 08.04.2008 to 12.05.2008
> Period 2: 12.05.2008 to 20.06.2008
> Period 3: 21.06.2008 to 28.07.2008
> Period 4: 29.07.2008 to 15.08.2008
> Period 5: 15.08.2008 to 21.09.2008
> Period 6 : 21.09.2008 to 14.10.2008
Hi,
In this case just derive all records matching dates between 08.04.2008 (low in first select-options) and 14.10.2008(high in last select-options.
Also my advice is to use a single select-options and prompt the user to give the dates as ranges in the multiple entries dialog which can be opened by clicking the button on the right side of the select-options.
Regards
Karthik D -
How do I merge multiple Excel files with more than one tab in each file using PowerQuery?
Hello
I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them.
I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
Cheers
JamesWhat Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
icon in the header and you'll be done.
Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
let
Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
in
ExpandData -
Cant create adobe files from multiple excel or word files
This is the first time I have placed anything on this forum so please forgive me if I am in the wrong p
lace. I have been frustrated by an error message I get when I try to convert multiple excel files or word files to
PDF. The files exist on a network location, and when I select 5 or 6 at random
and then right click and choose "Convert to PDF", the operation bombs with a message that reads:
"The file you selected does not contain any data (zero length file). Please select another file." I can
not find anything on this on Adobe's website, or google. I used to d
o it fine until a few days ago, now it won't convert and I get the above message. Anybody have any idea? I a
m using Windows XP SP3 and Office 2007 SP1. Thanks
Steve SzaboI can copy these files to the local drive and do the operation fine. I can also convert files that are already on the hard drive.
Just cannot convert the ones that are in the network location. I used to be able to do it, but not now.
Steve -
F-44 ZBAPI MULTIPLE LINE SELECTIONS FOR WEB SERVICES
HI TO ALL,
I HAVE WRITTEN ZBAPI FOR POSTING MULTIPLE LINE SELECTIONS FOR TCODE F-44, THE ZBAPI CONSIST OF BDC PROGRAM, WHICH IS WORKING IN SAP SYSTEM PERFECTLY BUT WHEN I AM USING IT IN WEB SERVICES IT IS THROWING A ERROR MESSAGE.
PLEASE CAN ANY ONE TELL ME DOES THIS PROCESS WILL WORK OR NOT, IF YES HOW IS IT POSSIBLEHi Gabriel,
Let me try to answer some of your questions:
1) The "Requires Secure Access" attribute of a resource handler controls whether this handler must be accessed/consumed only over SSL (HTTPS). Oracle Database Cloud Schema Service is only offered over SSL, so this attribute does not have any effect on RESTful services deployed in this environment (because secure access is always required and there is no other way). That said, if you want to access such web service from your own APEX instance, your instance must have Oracle Wallet configured with appropriate SSL certificate.
2) The URI parameters are not required. If your web service returns data for many entities (for example, list of employees in employees/), you may not need a parameter. If your web service returns data for one specific entity (for example, details of one employee in employees/{id}), you may want to identify that entity with a URI parameter.
3) You can have many URI parameters, for example: customers/{id}/orders/{order_id}.
4) Yes, these are the same HTTP methods/verbs you would use from PHP.
5) If you are trying this POST example from your own APEX instance (not Oracle Database Cloud Schema Service) and you are trying to access a web service over SSL, then it is likely that the Oracle Wallet used by your instance does not include the required SSL certificate(s), or the Oracle Wallet is not configured at all.
6) I recommend to check RESTful Web Services for the Oracle Database Cloud white paper and Oracle REST Data Services Developers Guide. Oracle REST Data Services is the technology that enables RESTful services in the Oracle Database Cloud Schema Service.
You can certainly create your own web services in the Oracle Database Cloud Schema Service and consume them from the same environment.
Vlad -
Using Report Catergory and how to Disable 'Select Range button on screen'
Hi All,
I am using logical Database PNPCE and I have created my own report category and I would like to disable the 'Select Ranges'
button that shows to the right of my field for Organization Unit as I would like them to be restricted to only one entry.
thank you,
KWI have tried this in my INITIALIZATION of my program but no luck... how is there a way to accomplish this? Remember I am trying to restrict the range selection on my report category that is attached to my LDB PNPCE.
* Define the object to be passed to the RESTRICTION parameter
DATA lv_restrict TYPE sscr_restrict.
* Auxiliary objects for filling RESTRICT
DATA lv_opt_list TYPE sscr_opt_list.
DATA lv_*** TYPE sscr_***.
* KIND = 'A': applies to all SELECT-OPTIONS
MOVE: 'A' TO lv_***-kind,
'*' TO lv_***-sg_main,
'NOPATTERN' TO lv_***-op_main,
'NOINTERVLS' TO lv_***-op_addy.
APPEND lv_*** TO lv_restrict-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
program = sy-repid
restriction = lv_restrict
* DB = ' '
* EXCEPTIONS
* TOO_LATE = 1
* REPEATED = 2
* SELOPT_WITHOUT_OPTIONS = 3
* SELOPT_WITHOUT_SIGNS = 4
* INVALID_SIGN = 5
* EMPTY_OPTION_LIST = 6
* INVALID_KIND = 7
* REPEATED_KIND_A = 8
* OTHERS = 9
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Edited by: Keith Warnock on Jan 13, 2011 8:30 PM -
How to spool data into multiple Excel sheet if result is more then 65k rows
Hi all,
Wann spool data into multiple excel sheet bocz my resultant no of rows are more then 65k.
Thanks to all in advance.....many choices
1) migrate to a newer version of Excel
2) split the files after spooling
for instance with split
split -l65000 file.txtor with perl, java, vb or what-so-ever
3) do more than one report by using rownum
spool f1
select empno,ename from (select rownum r,empno,ename from emp order by empno) where r<6 ;
spool off
spool f2
select empno,ename from (select * from (select rownum r,empno,ename from emp order by empno) where r<11) where r>5 ;
spool off
spool f3
select empno,ename from (select rownum r,empno,ename from emp order by empno) where r>10 ;
spool off -
BSP: multiple values selection in select-option
Hi,
Our customer requires multiple values selection in BSP pages as he is used to in standard SAP GUI.
I found it's impossible in standard.
Could it be possible to used javascript for this ... each select-option would have its own script that would pass table with selected values as parameter to HTTP request?
thanks
JurajOf course this is possible, you have HTML in the frontend, so you can do as much as HTML allows you. If you know DHTML you can play with it and create almost every layout you want, but then you have to keep in mind that you will have to take care about everything behind, starting from conversions (input/output), formatting, validation and so on.
-
Multiple line selection and then capturing the selected values
Dear all
in my alv program ,i need to capture multiple line selections using checkboxes.
I have appended check boxes by adding it in the internal table & filling in field catalog.
but problem is i'm not able to capture multiple selected check boxes dynamically,
i could capture only the last selected check box,
option i found was to use class method get-selected-rows,but i'm unable to use it properly, could anyone explain in detail
i have already gone through the various examples in sdn but i am not able to work out.
like using parameters etc....
CAN ANY ONE HELP ME WITH THE CODE
help reqired immediately,
Thanks in advance.Hi Ankur,
In the PAI, just after the selection of your user event, button or menu,
add this code before getting the selected records.
<b>CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.</b>
where grid1 TYPE REF TO cl_gui_alv_grid,
Now fetch the selected records.
Check this code for reference
C O M P A N Y C O N F I D E N T I A L **
Care should be taken to prevent its unauthorized use. **
REPORT zfipost MESSAGE-ID f4 NO STANDARD PAGE HEADING .
AUTHOR : Susmitha Susan Thomas
DATE : August 18, 2005
*Abridged Version : This report generates a list in Abap List Viewer of
all the selected records in VBKPF/VBSEG. * *
(TRANSACTION ZPPD:Modified from transaction FBV0)
-- Class definition--
CLASS lcl_event_receiver DEFINITION DEFERRED.
--Tables--
TABLES: vbkpf. " Belegkopf
TABLES: tsp1d, pri_params, spopli.
TYPE-POOLS slis.
---- Global Variables -
DATA: anzkr(6) TYPE n,
lsind LIKE sy-lsind,
no_output(1) TYPE c,
records(1) TYPE c,
xpick(1) TYPE c,
xpickc(1) TYPE c,
xbinp(1) TYPE c,
rc LIKE syst-subrc,
ok_code LIKE sy-ucomm,
index TYPE i,
char_x(1) TYPE c VALUE 'X',
post TYPE c,
ans TYPE n,
user(40) TYPE c.
DATA :BEGIN OF i_doctype OCCURS 0,
blart LIKE vbkpf-blart,
END OF i_doctype.
--AlV Initialization--
DATA: gs_layout TYPE lvc_s_layo,
gt_fieldcat TYPE lvc_t_fcat,
gs_fieldcat TYPE lvc_s_fcat,
gs_index_rows TYPE lvc_t_row,
l_layout TYPE disvariant,
g_repid LIKE sy-repid,
g_max TYPE i VALUE 100,
ws_row_idx TYPE lvc_t_row ,
ws_row_no TYPE lvc_t_roid,
i_excl_func TYPE ui_functions,
ls_prnt TYPE lvc_s_prnt,
refresh TYPE c,
i_fieldcat TYPE lvc_t_fcat,
post(1) TYPE c,
accr_def(1) TYPE c,
rev_cd(3) TYPE c,
ch(1) TYPE c.
DATA: list_index LIKE sy-lsind,
flag TYPE n VALUE 0,
fl TYPE n VALUE 0,
g_container TYPE scrfname VALUE 'GRID_CONTAINER',
grid_container TYPE REF TO cl_gui_docking_container,
grid1 TYPE REF TO cl_gui_alv_grid,
custom_container1 TYPE REF TO cl_gui_custom_container,
event_receiver TYPE REF TO lcl_event_receiver,
gt_vbkpf1 TYPE STANDARD TABLE OF vbkpf WITH HEADER LINE,
i_vbkpf TYPE TABLE OF vbkpf WITH HEADER LINE,
i_ws_row_idx LIKE ws_row_idx WITH HEADER LINE.
---Internal table containing details of selected documents--
DATA : BEGIN OF gt_vbkpf OCCURS 0,
xpick(1) TYPE c,
belnr LIKE vbkpf-belnr,
gjahr LIKE vbkpf-gjahr,
bukrs LIKE vbkpf-bukrs,
blart LIKE vbkpf-blart,
budat LIKE vbkpf-budat,
bldat LIKE vbkpf-bldat,
bktxt LIKE vbkpf-bktxt,
waers LIKE vbkpf-waers,
usnam LIKE vbkpf-usnam,
xblnr LIKE vbkpf-xblnr,
rev_code(3) TYPE c,
rev_rsn(15) TYPE c,
rev_date(10) TYPE c,
linecolor(4) TYPE c,
END OF gt_vbkpf.
--Table to store long text--
DATA : BEGIN OF inline OCCURS 0,
tdformat TYPE tdformat,
tdline TYPE tdline,
END OF inline.
DATA: thead LIKE thead OCCURS 0 WITH HEADER LINE.
-- Records to be posted--
DATA: BEGIN OF tbkpf OCCURS 5.
INCLUDE STRUCTURE vbkpf.
DATA: END OF tbkpf.
---- Constants -
CONSTANTS: awtyp_bkpf TYPE awtyp VALUE 'BKPF '.
CONSTANTS: awtyp_space TYPE awtyp VALUE ' '.
Selection Screen
PARAMETER: funcl LIKE t020-funcl NO-DISPLAY. "P(ost),D(isplay),U(pd)
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS:
p_bukrs FOR vbkpf-bukrs,
p_belnr FOR vbkpf-belnr,
p_gjahr FOR vbkpf-gjahr,
p_budat FOR vbkpf-budat,
p_bldat FOR vbkpf-bldat,
p_blart FOR vbkpf-blart,
p_xblnr FOR vbkpf-xblnr,
p_bktxt FOR vbkpf-bktxt,
p_usnam FOR vbkpf-usnam.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK blk
WITH FRAME TITLE text-010 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-002.
PARAMETER norm_doc TYPE c
RADIOBUTTON GROUP doc DEFAULT 'X' .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-001.
PARAMETER ad_doc TYPE c
RADIOBUTTON GROUP doc .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-003.
PARAMETER all_doc TYPE c
RADIOBUTTON GROUP doc .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK blk.
CLASS lcl_event_receiver DEFINITION
For capturing events on the ALV *
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
to capture all recently changed data.
handle_data_changed FOR EVENT data_changed OF
cl_gui_alv_grid
IMPORTING er_data_changed,
for hot spot
handle_hotspot FOR EVENT hotspot_click OF
cl_gui_alv_grid
IMPORTING e_column_id e_row_id.
ENDCLASS. " lcl_event_receiver (Definition)
CLASS lcl_event_receiver (Implementation)
For capturing events on the ALV *
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM f2200_handle_data_changed USING er_data_changed.
ENDMETHOD.
METHOD handle_hotspot.
PERFORM f2201_handle_hotspot USING e_column_id e_row_id .
ENDMETHOD.
ENDCLASS. " lcl_event_receiver (Implementation)
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
START-OF-SELECTION
START-OF-SELECTION.
---- Colors -
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
-------------------- Status und Title Bar----------------------------*
SET PF-STATUS funcl.
SET TITLEBAR funcl.
-- Read Records--
SELECT * FROM vbkpf INTO TABLE gt_vbkpf1
WHERE bukrs IN p_bukrs
AND ausbk IN p_bukrs
AND belnr IN p_belnr
AND gjahr IN p_gjahr
AND budat IN p_budat
AND bldat IN p_bldat
AND blart IN p_blart
AND bktxt IN p_bktxt
AND xblnr IN p_xblnr
AND usnam IN p_usnam
AND bstat EQ 'V'
AND ( awtyp IN (awtyp_bkpf, awtyp_space) OR
awtyp IS null )
ORDER BY PRIMARY KEY.
----Call the ALV Screen -
PERFORM alv_display.
END-OF-SELECTION.
FORM BELEG_PICKUP *
Indicate changing of the selected external record *
FORM beleg_pickup.
SET PARAMETER ID 'BUK' FIELD vbkpf-bukrs.
SET PARAMETER ID 'GJR' FIELD vbkpf-gjahr.
SET PARAMETER ID 'BLP' FIELD vbkpf-belnr.
CASE funcl.
WHEN 'P'.
IF anzkr IS INITIAL.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_D'
EXPORTING
bukrs = vbkpf-bukrs
belnr = vbkpf-belnr
gjahr = vbkpf-gjahr.
ELSE.
IF sy-ucomm EQ 'BUCH'.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_ALL'
EXPORTING
synch = char_x
bupbi = xbinp
TABLES
t_vbkpf = tbkpf.
ELSE.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_ALL'
EXPORTING
bupbi = xbinp
TABLES
t_vbkpf = tbkpf.
wait up to 3 seconds.
commit work.
ENDIF.
ENDIF.
WHEN OTHERS.
IF sy-tcode = 'ZPPD'.
funcl = 'P'.
ENDIF.
CALL FUNCTION 'ZPRELIMINARY_POSTING_DISPLAY'
EXPORTING
bukrs = vbkpf-bukrs
belnr = vbkpf-belnr
gjahr = vbkpf-gjahr.
ENDCASE.
ENDFORM.
FORM TBKPF_FUELLEN *
Include records for posting in TBKPF *
FORM tbkpf_fuellen.
records = 'X'.
LOOP AT gt_vbkpf.
IF gt_vbkpf-xpick = 'X'.
CLEAR anzkr.
CLEAR records.
IF sy-subrc = 0.
anzkr = anzkr + 1.
MOVE-CORRESPONDING gt_vbkpf TO tbkpf.
APPEND tbkpf.
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM MALL *
Select All documents *
FORM mall.
LOOP AT gt_vbkpf.
gt_vbkpf-xpick = 'X'.
MODIFY gt_vbkpf.
ENDLOOP.
refresh = 'X'.
CALL METHOD grid1->refresh_table_display.
ENDFORM.
FORM EMAL *
Unselect all documents *
FORM emal.
LOOP AT gt_vbkpf.
gt_vbkpf-xpick = ' '.
MODIFY gt_vbkpf.
ENDLOOP.
refresh = 'X'.
CALL METHOD grid1->refresh_table_display.
ENDFORM.
Form alv_display *
To display the details on an ALV. *
FORM alv_display.
CALL SCREEN 100.
ENDFORM. " alv_display
*& Module PB0_100 OUTPUT
MODULE pb0_100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'POSTDOC'.
--To verify that posting is complete.--
---- Setting the layout -
IF grid1 IS INITIAL.
PERFORM fill_table.
-- Initializing the field catalog--
PERFORM fieldcat_init CHANGING i_fieldcat.
-- Initializing the ALV GRID and CONTAINER--
CLEAR gs_layout.
gs_layout-info_fname = 'linecolor'.
gs_layout-grid_title = 'Parked Documents'(100).
gs_layout-zebra = 'X'.
gs_layout-cwidth_opt = 'X'.
gs_layout-sel_mode = 'A'.
gs_layout-edit = 'X'.
l_layout-report = sy-repid.
------ Create a custom container control for ALV Control----
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT grid_container
EXPORTING
dynnr = '100'
ratio = '100'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-007. " Error in object creation
LEAVE LIST-PROCESSING.
ENDIF.
-- Create an instance of alv control--
CREATE OBJECT grid1
EXPORTING
i_lifetime = 1
i_parent = grid_container.
---- Disable all unwanted button in the ALV grid -
PERFORM disable_functions TABLES i_excl_func.
---- Call the display function of ALV grid -
CALL METHOD grid1->set_table_for_first_display
EXPORTING
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
is_print = ls_prnt
it_toolbar_excluding = i_excl_func
CHANGING it_outtab = gt_vbkpf[]
it_fieldcatalog = i_fieldcat.
ENDIF. " IF cl_gui_alv_grid=>offline IS INITIAL
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
---- Create a reciever object to handle events -
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_data_changed FOR grid1.
SET HANDLER event_receiver->handle_hotspot FOR grid1.
CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid1.
ENDIF. " IF grid1 IS INITIAL.
ENDMODULE. " PB0_100 OUTPUT
*& Form fill_table
Fills the data table to be passed to the ALV grid.
FORM fill_table.
LOOP AT gt_vbkpf1.
MOVE-CORRESPONDING gt_vbkpf1 TO gt_vbkpf.
IF ad_doc = 'X' OR all_doc = 'X'.
thead-tdobject = 'BELEG'.
CONCATENATE gt_vbkpf1-bukrs
gt_vbkpf1-belnr
gt_vbkpf1-gjahr INTO thead-tdname.
thead-tdspras = sy-langu.
thead-tdid = '0004'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_code = inline-tdline.
REFRESH inline.
CLEAR inline.
thead-tdid = '0005'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_rsn = inline-tdline.
REFRESH inline.
CLEAR inline.
thead-tdid = '0006'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_date = inline-tdline.
REFRESH inline.
CLEAR inline.
REFRESH inline.
CLEAR inline.
ENDIF.
APPEND gt_vbkpf.
CLEAR gt_vbkpf.
ENDLOOP.
ENDLOOP.
ENDFORM.
*& Form fieldcat_init
Initialize the field catalog
FORM fieldcat_init CHANGING i_fieldcat TYPE lvc_t_fcat.
DATA: i_fldcat TYPE lvc_t_fcat WITH HEADER LINE.
CHECKBOX
CLEAR i_fldcat.
i_fldcat-fieldname = 'XPICK'.
i_fldcat-checkbox = 'X'.
i_fldcat-key = 'X'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-outputlen = '4'.
i_fldcat-scrtext_l = 'ChkB'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BELNR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-hotspot = 'X'.
i_fldcat-outputlen = '15'.
i_fldcat-scrtext_l = 'Document Number'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'GJAHR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'FYear'.
i_fldcat-outputlen = '5'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BUKRS'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'CCode'.
i_fldcat-outputlen = '5'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BLART'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Type'.
i_fldcat-outputlen = '6'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BLDAT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Doc Date'.
i_fldcat-outputlen = '12'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BUDAT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Park Date'.
i_fldcat-outputlen = '12'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BKTXT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Document Header Text'.
i_fldcat-outputlen = '25'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'WAERS'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Curr'.
i_fldcat-outputlen = '7'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'USNAM'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Parked By'.
i_fldcat-outputlen = '13'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'XBLNR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Reference Text'.
i_fldcat-outputlen = '19'.
APPEND i_fldcat TO i_fieldcat.
IF ad_doc = 'X' OR all_doc = 'X'.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_CODE'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'RC'.
i_fldcat-outputlen = '2'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_RSN'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Rev Reason'.
i_fldcat-outputlen = '15'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_DATE'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Rev Date'.
i_fldcat-outputlen = '10'.
APPEND i_fldcat TO i_fieldcat.
ENDIF.
ENDFORM. " fieldcat_init
*& Module PAI_100 INPUT
MODULE pai_100 INPUT.
CASE ok_code.
WHEN 'BACK'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'EXIT'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN '%EX'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'BINP'.
DATA : ws_x TYPE c VALUE 'X'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Posting Documents Via Batch Input'
text_question =
'Are you sure you want to post all the selected documents?'
text_button_1 = 'Yes'
text_button_2 = 'No'
start_column = 25
start_row = 6
IMPORTING
answer = ans.
IF ans = '1'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
xbinp = 'X'.
PERFORM tbkpf_fuellen.
IF records = 'X'.
MESSAGE s999(zv) WITH text-007.
ELSE.
PERFORM beleg_pickup.
ENDIF.
ENDIF.
WHEN 'MALL'.
PERFORM mall.
WHEN 'EMAL'.
PERFORM emal.
WHEN 'RW'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'BUCH'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Posting Document'
text_question =
'Are you sure you want to post all documents selected?'
text_button_1 = 'Yes'
text_button_2 = 'No'
start_column = 25
start_row = 6
IMPORTING
answer = ans.
IF ans = '1'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
perform tbkpf_fuellen.
IF records = 'X'.
MESSAGE s999(zv) WITH text-007.
ELSE.
PERFORM beleg_pickup.
ENDIF.
ENDIF.
WHEN 'PICK'.
DATA : check TYPE n,
no_rec TYPE c.
check = 0.
no_rec = 'X'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
index = 0.
LOOP AT gt_vbkpf.
funcl = 'D'.
index = index + 1.
IF gt_vbkpf-xpick = 'X'.
check = 1.
CLEAR no_rec.
READ TABLE gt_vbkpf1 INDEX index INTO vbkpf.
PERFORM beleg_pickup.
ENDIF.
ENDLOOP.
IF check = 0.
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = ws_row_idx.
IF NOT ws_row_idx IS INITIAL.
CLEAR no_rec.
ENDIF.
LOOP AT ws_row_idx INTO i_ws_row_idx.
READ TABLE gt_vbkpf1 INDEX i_ws_row_idx-index INTO vbkpf.
PERFORM beleg_pickup.
ENDLOOP.
IF no_rec = 'X'.
MESSAGE s999(zv) WITH text-007.
ENDIF.
ENDIF.
WHEN '&RNT_PREV'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&RNT'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '%SC'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&OL0'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&OAD'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&AVE'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&AQW'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&XXL'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '%PC'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&CRTEMPL'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN OTHERS.
do nothing.
ENDCASE.
CLEAR ok_code.
ENDMODULE. " PAI_100 INPUT
*& Form exit_program
Exits from the program after freeing the grid and container *
FORM exit_program.
IF NOT grid_container IS INITIAL.
CALL METHOD grid_container->free.
ENDIF.
IF NOT grid1 IS INITIAL.
CALL METHOD grid1->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
ENDIF.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form f2200_handle_data_changed
To handle event of change in data in ALV.
-->P_ER_DATA_CHANGED text
FORM f2200_handle_data_changed USING ir_data_changed
TYPE REF TO
cl_alv_changed_data_protocol.
DATA : ls_mod_cell TYPE lvc_s_modi ,
lv_value TYPE lvc_value,
lflg_check TYPE i.
DATA : wa_vbkpf LIKE LINE OF gt_vbkpf.
SORT ir_data_changed->mt_mod_cells BY row_id .
LOOP AT ir_data_changed->mt_mod_cells
INTO ls_mod_cell
WHERE fieldname = 'I_PICK'.
IF NOT ls_mod_cell-value IS INITIAL .
CALL METHOD ir_data_changed->modify_cell
EXPORTING
i_row_id = ls_mod_cell-row_id
i_fieldname = ls_mod_cell-fieldname
i_value = ls_mod_cell-value.
READ TABLE gt_vbkpf INTO wa_vbkpf
INDEX ls_mod_cell-row_id.
IF ls_mod_cell-fieldname = 'I_PICK'.
wa_vbkpf-xpick = ls_mod_cell-value.
ENDIF.
MODIFY gt_vbkpf FROM wa_vbkpf
INDEX ls_mod_cell-row_id.
ENDIF .
ENDLOOP .
ENDFORM. " f2200_handle_data_changed
*& Form f2201_handle_hotspot
To handle event of clicking on hyperlink
-->P_E_COLUMN_ID text
FORM f2201_handle_hotspot USING p_e_column_id p_e_row_id.
READ TABLE gt_vbkpf1 INDEX p_e_row_id INTO vbkpf.
funcl = 'D'.
PERFORM beleg_pickup.
PERFORM exit_program.
ENDFORM. " f2201_handle_hotspot
Regards,
Susmitha
Dont forget to reward points for useful answers -
Reading multiple excel workbooks
Hi all,
LabView noobie here. I want to apologize in advance if I have posted this in the wrong spot or if I have not properly searched the forum for existing threads on this issue. My initial search returned tips with excel but nothing I found immediately useful.
I am an engineer who uses labview to run life cycle testing on our products. I did not create the current program we are using, I just inhereted it when the guy who did got let go
We currently measure: time in one column, then amps, volts, and temp in the following columns for each cycle (up or down) and save the runs as seperate excel files. We test our products anywere from 200 to 10000 cycles and record every 10 and 100 cycles (runs) respectively. On average we record over 1000 rows of data for each of the 4 columns for one run. Basically, we record approximately 4000 bits of raw data (in 4000 cells) in each seperate spreadsheet and have upto 500 spreadsheets for one complete test.
Currently, I take a sample of X different spreadsheets and copy/paste the raw data measured by labview into an existing excel template with X different sheets that has been created to perform the calcualtions I require.
What I would like to do is make a VI that can open X different spreadsheets, chosen at my discression, read/copy/paste them into the existing template and save that template with a unique file name based off of some constants that can be entered by the user. For example, If I want to choose the following "runs" to analyze: 1000, 2000, 3000, 4000, and 5000 I would either be prompted to choose those files specifically or (more preferably) I could just type in those numbers into the VI and it would go to those runs and open/copy/paste them into the template. Ultimately, I am trying to make a button on the front panel that when you press it, it prompts the user for either the files or "runs" that you want to compare and saves them to a workbook that can be viewed as a report.
Any and all ideas on getting started would be appreciated.I would like to read/copy from multiple excel files and paste them into a single template with the same amount of sheets as there are files I am reading from. So if I am reading from 10 files I would have 10 sheets in the template so that all of the data from each file can be pasted onto its corresponding sheet in the template.
I have some questions that correspond to the steps you listed (1-5):
1. on the "New Report" VI can the path I provide just be the folder where all of these raw data files are stored and can I make it prompt me for which specific files to choose (or how do I tell it which ones to pull); or am I providing a path to the template?
2. Can the "Excel Easy Table" VI dump the seperate files containing my raw data in the same location but on different sheets of my template? Also, where is this VI located.
3. I do not want it to generate a report for every file that we save. I want to take a sample size of all the runs for a test and compare them to each other to analyze the current draw and time, etc to check for overall performance and degredation. So it will be one report based on let's say 10 of the 500 files for each test. If I only wanted it to read from the cycles I stated earlier (1000,2000,3000,4000,5000) how could a loop handle picking those specific runs opposed to just going through all of them?
4. It would be fine if it saved it after each time data is dumped but I would want 1 file name for all of the sample data that is being saved/dumped on the various sheets of the template (report).
5. When you say "save and dispose to the original spreadsheet" I think you are thinking that I want to just save one file of data on the template, save/close it ,and open a fresh template in order to repeat the process with a different raw data file. What I would like to do is open a raw data file, dump that data into sheet 1 of the template, open another data file, dump that data into sheet 2 of the template, etc until I have 10 sheets worth of data on my template. Afterwards the template can be saved as one single report that can be viewed to determine if a part passes life cycle testing.
I think we are more or less on the same page but you weren't sure if I was using multiple templates and I think you wrote your response under the impression that I was. I am using one template that needs to receive data from more than one file. I hope this helps clarify the issue a little more. -
Multiple Date selection in ADF
Hi Friends,
I am using jdeveloper 10.1.3.3 for development of application.
I have requirement of Multiple Date selection in ADF using in built Date Components.
I have looked at af:selectinputdate and af:choosedate components for this requirement.. I found that we can choose only single date from these components. Is it possible to select more than one date from any of these two components. ??
Please help me in solving this..
thanks in advance..
Thanks,
Ravi.Hi Vervecken,
Please find my requriements below:
Do you want to select multiple individual dates? Is there a maximum number of dates to select?
Yes multiple Individual dates... No max number of dates selection.Do you want to select a "date range"? Do you want to select multiple "date ranges"?
date range i.e from and to is also fine.. but not multiple date range...Do you want to select multiple "data ranges" combined with multiple individual dates?
No.. Not required...Regards
Ravi
Maybe you are looking for
-
Burning tunes and having them marked as played?
I want to set up some random playlists to burn to CD for my travels. The situation I am having is this. I have a Smart playlist set up. The critieria are that 1) they have been added since the beginning of 2010 (so they pick up new stuff) 2) they hav
-
Hello , I have an old version of Cubase VST [4.1],and I would like to use it with my G4 ,just to have fun. Because this software has a protection system with a floppy disk ,I need to use a floppy disk drive with my G4, to authorise my hard disk for u
-
IWeb wont publish, DESPERATE PLEASE HELP!
So i have gotten lots of suggestions on whats wrong with my iweb but nothing is helping and I really need to update my website. I have tried.... 1. Publishing to MobileMe, Does not work, get the message that says can not connect check your connection
-
HT3209 how to find something I bought for later viewing
how do I find a TV show I purchased - Last episode of season2 of Downton Abbey?
-
Can anyone tell me how this photo was done
Hi all, I am really hoping that someone here will be able to help me find out what methods were used in photoshop to achieve this transformation between the original image of the figurine on the left and the image on the right. I have trawled the n