Read-Host Multiple lines
Hi,
I am writing a script which waits for user input initially, actually i want user to enter multiple emailids through read-host and i want to save that in a file in specific location. Below is the code
read-host " Enter the email ids to which you want to send alerts" > C:\mydrive\tomail.txt
$lines=(Get-Content C:mydrive\tomail.txt)
$newcontent = foreach ($line in $lines) { $line.Trim()}
$newcontent | out-file C:mydrive\tomail.txt
What i am doing here is , i am getting the emailds and trimming it and storing in a file.
When i execute the above script in ISE , i can use Shift enter to enter multiple email ids, however when i run the script in powershell console it doesnt work, any ideas?
If you want something a little bit more fun:
add-type -assembly System.Windows.Forms
$form=New-Object System.Windows.Forms.Form
$form.StartPosition='CenterScreen'
$btn=New-Object System.Windows.Forms.Button
$btn.Text='Save'
$btn.DialogResult='Ok'
$btn.Dock='bottom'
$form.Controls.Add($btn)
$btnCancel=New-Object System.Windows.Forms.Button
$btnCAncel.Text='Cancel'
$btnCancel.DialogResult='Cancel'
$btnCancel.Dock='bottom'
$form.Controls.Add($btnCancel)
$tb=New-Object System.Windows.Forms.Textbox
$tb.Multiline=$true
$tb.Dock='Fill'
$form.Controls.Add($tb)
$form.add_load({$tb.Select()})
if($form.ShowDialog() -eq 'Ok'){
$tb.lines
}else{
Write-Host 'Cancelled' -fore red
¯\_(ツ)_/¯
Similar Messages
-
Read Key (Multiple Lines) Help
Hello! Is it possible to read multiple lines using read key VI? I'm only reading the first line right now but it would be nice if I can view the first line's explanations too.
Please see attach. Thanks in advance.
KowdTek
LabVIEW 2009
One Step At A Time, Maybe Two...
Attachments:
IDE_Read_Key.vi 20 KB
ICD3_Error_Codes.ini 9 KBGet inside the Read Key.vi. There you will find Get Key.vi. Get inside this vi. It has two outputs (excluding some others) - value and comment. But the vi itself returns only the value and the comment is left unused. Please check if that "comment" output is the "explanations" you need. If so, you could manually wire that output for your benefit.
Remember to save the vi with a different name if you will edit it.
Message Edited by Giedrius.S on 02-11-2010 10:02 PM
While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that...
Chart zoom with "Mouse Over" effect -
Reading Multiple lines in a file Using File Adapter
Hi All,
Iam new to this technology.How to read multiple lines in a file using file adapter.Brief me with the methodology.I didn't look at anything else but if you want to write more than one line ever to your file you should change this
out = new FileOutputStream("Calculation.log");to this...
out = new FileOutputStream("Calculation.log",true);A quick look at the API reveals the follow constructor FileOutputStream(File file, boolean append) append means should I add on the end of the file or over-write what is there.
By default you over-write. So in our case we say true instead which says add on to what is there.
At the end of that little snippet you shoudl be closing that stream as well.
So where you have
p.close();You should have
p.close();
out.close(); -
StringTokenizer to read multiple lines
I've been struggling to make my program to read multiple lines from the input text
input5.txt:
-.1 -2.3 -45.678 -90
.1 .23 .45678 .90
1 2.3 4.56
0
and the program will stop reading when it sees 0 in the line. What i got was a nullPointerException, it reads a single line fine, but when it comes to multiple lines, it messes up. Heres a portion of my program code:
while (info1 != null && !end)
tokenizer = new StringTokenizer(info1, " \t\r\n");
while ((info1 = stdin.readLine()) != null && info1.length() != 0)
if (tokenizer.hasMoreTokens())
// temp is a dummy String to help for counting limit.
temp = tokenizer.nextToken();
dummy [limit] = temp;
limit++;
numbers = new float [limit];
while (count < limit)
while (tokenizer2.hasMoreTokens() && num1 != 0.0 && num1 != 0)
num1 = Float.parseFloat(dummy[count]);
numbers[count] = num1;
count++;
end = true;
}You need to move the "new StringTokenizer" into the following while loop
John -
How to read multiple lines using 'REUSE_ALV_GRID_DISPLAY'
Hi,
In ALV report the FM 'REUSE_ALV_GRID_DISPLAY' used.
EXPORTING
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
How to read multiple lines in the following dynamic subroutine ?
I am able to read single value through p_selfld.
Nut the requirement is to change the values in more than 1 row for a fld (edit mode)
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
endform
Thanks in advanceYou can get the reference by a dirty assign, but this is not offcially supported...
But if you have some limitations.
FORM user_command USING fuw_ucomm LIKE sy-ucomm
fuw_selfield TYPE slis_selfield.
FIELD-SYMBOLS: <lfs_grid> type ref to cl_gui_alv_grid,
<lfs_row> type LVC_S_ROW.
data: li_rows type lvc_t_row.
assign ('(SAPLSLVC_FULLSCREEN)GT_GRID-GRID') to <lfs_grid>.
check sy-subrc is initial.
call method <lfs_grid>->get_selected_rows
IMPORTING
et_index_rows = li_rows.
endform. "user_command -
How to read multiple lines from a command prompt?
I usually read from a command prompt like this:
String answer;
System.out.println("Please enter the required data");
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
answer = reader.readLine();
reader = null;
} catch (Exception e) {
System.out.println("There was an exception trying to read " + e);
answer = "";
This has worked fine for years when all I wanted was one line answers.
Now I am trying to prompt for multiple line answers. Is there a way to read into a string array rather than just a string? What class would I use for that?
Thanks a lot!The easiest approaches would be to read a line at a time until you've read enough lines, whether by a known fixed line count, or a token count, or by reading some sentinel toek, OR read a token at a time using Scanner.next() until you've determined you're done. Which one is more appropriate depends on your situation.
-
How to read multiple lines from an external file to the Oracle data base
Hi Guys,
I have an external file which contains multiple lines and I want to read it to the data base .I have done it for the file if it contains one line.
Please guide me how to retrieve all the lines into the data base.And also tell me how Oracle will come to know the end of the line in the file
Thanks,
PrafullaHi,
try this
CREATE TABLE ab
a VARCHAR2(1 BYTE),
b VARCHAR2(2 BYTE),
c VARCHAR2(10 BYTE),
d VARCHAR2(11 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY dir_name
ACCESS PARAMETERS
( records delimited by newline
fields (
a POSITION(*) CHAR(1),
b POSITION(*) CHAR(2 ),
c POSITION(*) CHAR(10 ),
d POSITION(*) CHAR(11 )
LOCATION (dir_name:'filename.txt')
REJECT LIMIT UNLIMITED
NOPARALLEL
NOMONITORING;
Regards,
Simma.... -
Hosting Multiple SSL Sites on Separate IP Addresses
Hosting Multiple SSL Sites on Separate IP Addresses
I currently have a web server (XServe) hosting a number of different sites from its main IP address on port 80 using Apache 1.3. This has been working great, the ServerAdmin GUI has been pretty good about creating the appropriate Apache configs, and everybody is happy.
I have one particular site that I want to use SSL with so I decided to purchase a cert (from GoDaddy). Since I have one other cert on the server assigned to the main server IP, I understand that the appropriate way to setup additional SSL certificates is to bind another IP address to the XServe and use that IP. I was unable to use ServerAdmin to install my new certificate (not surprisingly) probably since it is a chain certificate, however I have been able to do it by hand and it seems to be working as intended…mostly.
This is where my problem begins. The site that I wanted to add SSL to is currently hosted on the main IP address (x.x.x.173:80) and the SSL certificate is working on the newly bound IP address (x.x.x.178:443). Fundamentally it would seem appropriate to change the IP address of the non-SSL site to match the new IP, except on port 80 – So I can achieve a seamless blend between standard and SSL (when necessary). The problem is that I can’t get Apache to work this way. Maybe I am missing a step, or overlooking something.
Excerpt from current, working (non-SSL) config: (Names have been changed to protect the innocent.)
<VirtualHost x.x.x.173:80>
ServerName www.site.com
ServerAdmin [email protected]
DocumentRoot "/Library/WebServer/Documents/www.site.com"
</VirtualHost>
Excerpt from current, working (SSL) config:
<VirtualHost x.x.x.178:443>
ServerName www.site.com
ServerAdmin [email protected]
DocumentRoot "/Library/WebServer/Documents/www.site.com"
</VirtualHost>
changing the first entry’s ip address to match the second one causes the site to be unresponsive (using the IP address to point the browser to the site) but the SSL version keeps working. Any suggestions would be greatly appreciated.
Thanks,
Jake
PowerBook, XServe G5 Mac OS X (10.4.6)Thanks for your reply Roger, here are the results that you’ve requested:
I deleted a few lines that were redundant and unrelated (no errors)
Results of apachectl configtest:
Processing config directory: /etc/httpd/sites/*.conf
Processing config file: /etc/httpd/sites/0012x.x.x.173_80www.site.com.conf
Processing config file: /etc/httpd/sites/0016x.x.x.178_443www.site.com.conf
Processing config file: /etc/httpd/sites/virtualhostglobal.conf
[Thu Apr 6 09:06:27 2006] [warn] module mod_php4.c is already added, skipping
Syntax OK
Results from netstat -a -n | egrep 178:
tcp4 0 0 x.x.x.178.53 . LISTEN
udp4 0 0 x.x.x.178.123 .
udp4 0 0 x.x.x.178.53 .
Results from tail -f /var/log/httpd/error_log
/etc/httpd/sites/0012x.x.x.173_80www.site.com.conf
Processing gonfig file:
/etc/httpd/sites/0016x.x.x.178_443www.site.com.conf
Processing config file: /etc/httpd/sites/virtualhostglobal.conf
[Thu Apr 6 09:21:10 2006] [warn] module mod_php4.c is already added, skipping
[Thu Apr 6 09:21:10 2006] [notice] Apache/1.3.33 (Darwin) PHP/4.3.11 mod_ssl/2.8.24 OpenSSL/0.9.7i configured -- resuming normal operations
[Thu Apr 6 09:21:10 2006] [notice] Accept mutex: flock (Default: flock)
When I try to hit the site on port 80 http://x.x.x.178 there are no results, https://x.x.x.178 works great.
Thanks again for your help, hopefully this can shed some light on my problem,
Jake
PowerBook, XServe G5 Mac OS X (10.4.6)
PowerBook Mac OS X (10.4.6) -
Help? Ichat: share my screen & host multiple person vc.
I just recently bought this macbook pro like two weeks ago,
and on ichat i keep trying to host multiple video chats but it wont allow me or share my own screen, but for some reason other people can invite me to multiple video chats and share their own screen. On my system preferences file sharing/screen sharing is all checked and it also is checked on my ichat preferences so i dont know what to do?If you are on Leopard (10.5.8) go to the System Preferences > QUicktime > Streaming tab and set the Drop dwon to read 1.5Mbps
Restart iChat if Open so it "Sees" the new setting/speed.
10:35 PM Wednesday; October 7, 2009
Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat" -
How do i add multiple lines in a cell (like a list) in Excel for MAC?
I'm trying to add multiple lines (in the form of a list) in a individual cell in Excel for MAC. I used ALT Enter on my PC but that doesn't work on the iMac. Does anyone know how to do this?
Thanks!It's been a while but I think you hold SHIFT while typing a page break (RETURN) to make a new line without shifting to another cell.
However, as Excel isn't an Apple product, I am sure you will get a faster and more current answer by using Microsoft's Office:Mac forums here:
Office for Mac forums
They are very good. -
Setting the value of a single attribute for multiple line items
Hi all,
I am working on a Web Dynpro application, I have created this applicaion for an accounting document so it has header data and multiple line item data. As per the requirement I have to put the following logic:
1. When a user enters a value in the field KBLNR on the line item, all the other fields like cost centerm fund, functional area should populate from a database table based on the value of the KBLNR. to get this I have put the following code:
TYPES: BEGIN OF t_kblp,
fipos TYPE kblp-fipos,
kostl TYPE kostl,
END OF t_kblp.
DATA lv_kblnr TYPE wd_this->element_t_bseg-kblnr.
DATA: lt_kblp TYPE STANDARD TABLE OF t_kblp,
wa_kblp LIKE LINE OF lt_kblp,
lt_bseg TYPE STANDARD TABLE OF bseg,
wa_bseg TYPE bseg.
DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
DATA: ls_t_bseg TYPE wd_this->element_t_bseg,
lo_api_controller TYPE REF TO if_wd_controller,
lo_message_manager TYPE REF TO if_wd_message_manager,
lo_nd_tbseg TYPE REF TO if_wd_context_node,
lo_el_tbseg TYPE REF TO if_wd_context_element,
lt_el_tbseg TYPE wdr_context_element_set,
lv_bseg TYPE bseg.
lo_nd_t_bseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
lo_nd_tbseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
lt_el_tbseg = lo_nd_tbseg->get_elements( ).
LOOP AT lt_el_tbseg INTO lo_el_tbseg.
lo_el_tbseg->get_static_attributes(
IMPORTING static_attributes = lv_bseg ).
IF lv_bseg-kblnr NE ' '.
SELECT belnr
fipos
kostl
PSPNR
geber
saknr
fkber
grant_nbr
gsber
FROM kblp
inTO corresponding fields of wa_kblp
WHERE belnr = lv_bseg-kblnr and
saknr = lv_bseg-saknr.
ENDSELECT.
lo_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
* get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
lo_el_tbseg->set_static_attributes(
EXPORTING static_attributes = wa_kblp ).
CLEAR: lv_bseg, wa_kblp.
ENDLOOP.
everything is working fine but now the problem is couple of fields that I have in wa_kblp are with different names in bseg table and hence they are not updating... I tried putting the following logic within the loop :
lo_el_t_bseg->set_attribute(
name = `PROJK`
value = wa_kblp-pspnr ).
but it's only setting the value of the first line item and not working for the multiple line items, can you please tell me how can do this?
Thanks,
Rajat Garg
Edited by: rajatg on Jun 24, 2011 5:09 PMHi Chris,
I tried your code and it worked fine but after I put this code I am getting another issue. within the loop I had a code to make the fields non modifiable on the screen and was working fine but now what's happening is it's making the all the lines uneditable except the one with data on it (which is completely opposite), this is what I have coded:
LOOP AT lt_el_tbseg INTO lo_el_tbseg.
lo_el_tbseg->get_static_attributes(
IMPORTING static_attributes = lv_bseg ).
IF lv_bseg-kblnr NE ' '.
SELECT belnr
fipos
kostl
PSPNR
geber
saknr
fkber
grant_nbr
gsber
FROM kblp
inTO corresponding fields of wa_kblp
WHERE belnr = lv_bseg-kblnr and
saknr = lv_bseg-saknr.
ENDSELECT.
move: wa_kblp-belnr to wa_bseg-kblnr,
wa_kblp-fipos to wa_bseg-fipos,
wa_kblp-kostl to wa_bseg-kostl,
wa_kblp-pspnr to wa_bseg-projk,
wa_kblp-geber to wa_bseg-geber,
wa_kblp-saknr to wa_bseg-saknr,
wa_kblp-fkber to wa_bseg-fkber,
wa_kblp-grant_nbr to wa_bseg-grant_nbr,
wa_kblp-gsber to wa_bseg-gsber,
lv_bseg-dmbtr to wa_bseg-dmbtr.
append wa_bseg to lt_bseg.
lo_nd_edit_property = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG.EDIT_PROPERTY` ).
get element via lead selection
lo_el_edit_property = lo_nd_edit_property->get_element( ).
lo_el_edit_property->set_attribute(
name = `EDIT_FIELD`
value = 'ABAP_TRUE' ).
lo_el_edit_property->set_attribute(
name = `EDIT_WBS`
value = 'ABAP_TRUE' ).
endif.
endloop.
o_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
CALL METHOD lo_nd_t_bseg->bind_table
EXPORTING
new_items = lt_bseg.
Can you please see what I am doing it wrong here.... -
Not able to generate multiple lines for headers in report
Hi,
I am new to BI publisher and not able to generate multiple lines for headers. Please help me to resolve.
I am using RTF template, data source as PS Query and XML file (system generated from the data source)
When I am using system generated 'First XML' file, I am getting output in the follwoing format.
TEAM_MEMBER, PROJECT_ID, NAME, START_DT
e.g.
EMP1 , 71000, Sample, 01-Jan-2010
EMP1 , 72000, Sample, 01-Feb-2010
EMP1 , 73000, Sample, 01-March-2010
But I want the report to be generate with multiple projects for one employee like below format , for that I used 'Second XML' file but I am getting blank report.
In short if there is one to many case, how to show in reports??? Please correct if I am going wrong.
TEAM_MEMBER
PROJECT_ID, NAME, START_DT
PROJECT_ID, NAME, START_DT
PROJECT_ID, NAME, START_DT
e.g.
EMP1
71000, Sample, 01-Jan-2010
72000, Sample, 01-Feb-2010
73000, Sample, 01-March-2010
**********First XML**************System generated XML ****************************
<?xml version="1.0"?>
<query numrows="2" queryname="SY_EMP_PROJECT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
<row rownumber="1">
<TEAM_MEMBER>TEAM_MEMBER </TEAM_MEMBER>
<PROJECT_ID>PROJECT_ID samp</PROJECT_ID>
<NAME>NAME sample data</NAME>
<START_DT>2010-08-25</START_DT>
</row>
<row rownumber="2">
<TEAM_MEMBER>TEAM_MEMBER</TEAM_MEMBER>
<PROJECT_ID>PROJECT_ID samp</PROJECT_ID>
<NAME>NAME sample data</NAME>
<START_DT>2010-08-25</START_DT>
</row>
</query>
**********Second XML**************Manually created XML and using to show multiple projects for one employee****************
<?xml version="1.0"?>
<TEST numrows="2" queryname="SY_EMP_PROJECT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
<TEAM_MEMBER rownumber="1">
<TEAM_MEMBER>1</TEAM_MEMBER>
<EMPLOYEE_NAME>SAMPLE</EMPLOYEE_NAME>
<PROJECT>
<PROJECT_ID>1111</PROJECT_ID>
<PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
<START_DATE>01012010</START_DATE>
</PROJECT>
<PROJECT>
<PROJECT_ID>1112</PROJECT_ID>
<PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
<START_DATE>01022010</START_DATE>
</PROJECT>
</TEAM_MEMBER>
<TEAM_MEMBER rownumber="2">
<TEAM_MEMBER>2</TEAM_MEMBER>
<EMPLOYEE_NAME>SAMPLEC</EMPLOYEE_NAME>
<PROJECT>
<PROJECT_ID>1111</PROJECT_ID>
<PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
<START_DATE>01012010</START_DATE>
</PROJECT>
<PROJECT>
<PROJECT_ID>1112</PROJECT_ID>
<PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
<START_DATE>01022010</START_DATE>
</PROJECT>
</TEAM_MEMBER>
</TEST>
Edited by: ganeshtw on Aug 25, 2010 12:14 AMHi,
With your first xml you can print like
EMP1
71000, Sample, 01-Jan-2010
72000, Sample, 01-Feb-2010
73000, Sample, 01-March-2010While creating the RTF template you can use the Group by option.
<?for-each-group:ROW;./columnname> then print the column name
<?columnname?>
--Then your table format
71000, Sample, 01-Jan-2010
72000, Sample, 01-Feb-2010
73000, Sample, 01-March-2010
<?end for-each-group?>
Thanks. -
How to select multiple lines in ALV report
hi gurus,
I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
Regards,
Satyajithi,
try like this
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
TYPES: BEGIN OF t_ekko,
sel, "stores which row user has selected
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
DATA : BEGIN OF det_tab OCCURS 0,
ebeln LIKE ekpo-ebeln,
END OF det_tab.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
gd_layout-box_fieldname = 'SEL'.
"set field name to store row selection
gd_layout-edit = 'X'. "makes whole ALV table editable
gd_layout-zebra = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_STAT'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
TABLES
t_outtab = it_ekko
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. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
* FORM USER_COMMAND *
* --> R_UCOMM *
* --> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Check function code
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'EBELN'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN 'DET'. "button add by me
CLEAR det_tab.
REFRESH det_tab.
LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
MOVE-CORRESPONDING wa_ekko TO det_tab.
APPEND det_tab.
ENDLOOP.
PERFORM build_cat.
PERFORM dis_data.
ENDCASE.
ENDFORM. "user_command
*& Form set_stat
* text
* -->RT_EXTAB text
FORM set_stat USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
ENDFORM. "set_stat
*& Form build_cat
* text
FORM build_cat.
CLEAR fieldcatalog1.
REFRESH fieldcatalog1.
fieldcatalog1-fieldname = 'EBELN'.
fieldcatalog1-tabname = 'DET_TAB'.
fieldcatalog1-seltext_m = 'Order No.'.
fieldcatalog1-outputlen = 10.
APPEND fieldcatalog1 TO fieldcatalog1.
CLEAR fieldcatalog1.
ENDFORM. "build_cat
*& Form dis_data
* text
FORM dis_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST_DS'
it_fieldcat = fieldcatalog1[]
i_save = 'X'
TABLES
t_outtab = det_tab.
ENDFORM. "dis_data
here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
here u can select morethan one line using control(ctrl)
reward if usefull... -
Multiple lines for field description in ALV
Hi ,
Is there any way to display the field description in multiple lines in ALV grid .
Regards,
PradiptaHi pradipta,
1. No its not possible.
2. At the most, we can set the WIDTH of the
column, to ACCOMODATE the field description.
3. We cannot do WRAP as u require.
regards,
amit m. -
Single/ Consolidated GR/IR entry for a PO having multiple line items
Hi,
In a PO there are couple of line items for materials of similar type and class. While making the Goods Receipt, the Accounting Document is making two no of line items for GR/IR accounts as credit and two no of inventory accounts as debit. Same is happening to GR/IR account while making Invoice Receipt document also.
Informatively, both the materials above have been assigned to one GR/IR account in the OBYC table.
My question is, is it possible to consolidate the value of both these materials and post one line item for GR/IR account. This is required as in our case in a PO, normally, we do have multiple line items and hence it is resulting multiple no of GR/IR and inventory accounts in a single accounting document. As we are getting details of the line item from PO history, we do not require it in the accounting document.
Requested to kindly help.
Regards
B.MohantyHi
This is not possible (you will compleet los the link between the Invoice and GR)
The reason is that when you receive an invoice that this is based on a G/R line and the way arround when you receive first the invoice(s).
The system need this for the automatecly clearing from the G/R - I/R account, that is based on PO an PO line item number.
Maybe you are looking for
-
How to extract sub string value from a string?
Hi, I need to know how can i extract sub strings from a main string, something like this: main variable-------->"2087-5E2SE-19-JG7BC" i want to split it into like this: sub_main_1 variable---------> "2087" sub_main_2 variable---------> "5E2SE" sub_ma
-
I have created a dynamic form in LC8.0. Distributed it to our server via Acrobat Pro 8.o. The users have Reader 8.0. There are two subforms on the page, both of which are tables which can be expanded using an addInstance button. Everything works well
-
Input Ready Query does'nt work
Hi Experts, Thanks for your time ..Input query does'nt allow input data through Web application... Following steps that I have done 1) Created a Real time cube. 2) Created Aggregation level . 3) Included all characteristics that are'
-
Monitor the OEM 10g from Windows or Solaris
Hi, I would like to monitor one instance Oracle 10g that is running on Solaris 5.10. I toolk the url (INFO: >>>>>>>>>>> The Database Control URL is http://zzzzzzzzzzzzzzz:1158/em <<<<<<<<<<<) on the file emca_2010-08-27_05-32-20-PM.log. Here my two q
-
How to add books to a Collection directly
The way the software seems to work, you add books to the library, then add them to a collection. This will not work for me, as I have thousands of books, all neatly sorted in directories. If I add them all, I will have to manually figure out which co