Handling line by line Processing in OPPS ALV
Hi All,
Could You please tell hwo to handle line by line processing in ALV using OPPS.
I want to make some fields editable and not editable based on some other field value and show in output.
Thanks in Advance.
Regards,
Deepak
Declare one of the field of output table as , celltab TYPE lvc_t_styl.
Types : begin of t_output,
field 1....
field 2....
celltab TYPE lvc_t_styl, " Cell Properties
end of t_output.
Data : i_output type standard table of t_output, "internal table to display output
wa_output like line of i_output.
i_celltab TYPE lvc_t_styl, "internal table to enable or disable the fields
wa_celltab TYPE lvc_s_styl.
According to your condtion fill the i_celltab table.
wa_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
wa_celltab-fieldname = g_field. "Here pass the name of the field you want to disable
INSERT wa_celltab INTO TABLE i_celltab.
MOVE i_celltab TO wa_output-celltab.
WHILE PREPARING A LAYOUT ,PUT
grid_layout-stylefname = 'CELLTAB'.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
is_layout = grid_layout
is_variant = g_variant
i_save = 'A'
CHANGING
it_outtab = i_output[]
it_fieldcatalog = i_fieldcat.
Similar Messages
-
Possible to mark and unmark every line of the list (ALV
Hi Experts,
I would like to develop stock compensation report for a client my requirement as below.
It must be possible to mark and unmark every line of the list (ALV). On top of the list a button (Create Sales Document) is needed. Pressing this button starts the creation of the sales documents for every line of the list which is marked. The button is only active when the simulation flag is initial!
Since this is a working list it must be possible to double-click on each line and see the line item details. The line item details should be shown as a ALV list as well. The list contains the following fields:
u2022 Sold-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018AGu2019)
u2022 Name of sold-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018AGu2019 ADRC-NAME1)
u2022 Ship-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018WEu2019)
u2022 Name of ship-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018WEu2019 ADRC-NAME1)
u2022 Material number (VBRP-MATNR)
u2022 Material description (VBRP-ARKTX)
u2022 Old Price List (determination see above)
u2022 New Price List (determination see above)
u2022 Compensation Value List (determination see above)
u2022 Compensation Quantity List (determination see above)
u2022 New Compensation Quantity List (determination see above)
After pressing the creation button a sales document for every marked line is created. When this is finished a log is issued for every line. The log shows the following information:
u2022 Sold-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018AGu2019)
u2022 Name of sold-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018AGu2019 ADRC-NAME1)
u2022 Ship-to (VBPA-KUNNR u2013 VBPA-PARVW = u2018WEu2019)
u2022 Name of ship-to (VBPA- ADRNR u2013 VBPA-PARVW = u2018WEu2019 ADRC-NAME1)
u2022 Sales document number or error message if no document is created
How to create check boxes for eachline in the ALV output for mark or unmark purpsoe and how to create create sales document button in the output and how to create the sales order process . please help me out.
Moderator message: more "spec dumping", please work yourself first on your requirement.
Edited by: Thomas Zloch on Mar 29, 2011 4:32 PMhi
i have a code for drop down list use this
this code is for selection-screen deop-down list yu can add this same code in ALV
REPORT ZCHETANA_PRAC10 .
Type-pools: VRM.
data: name type vrm_id,
list_month type vrm_values,
list_year type vrm_values,
value type vrm_value.
selection-screen: begin of block b with frame.
parameter: p_year(10) type c as listbox visible length 10,
p_month(10) type c as listbox visible length 10.
selection-screen: end of block b.
at selection-screen output.
value-key = 'JAN'.
value-text = 'JAN'.
append value to list_month.
value-key = 'FEB'.
value-text = 'FEB'.
append value to list_month.
value-key = 'MAR'.
value-text = 'MAR'.
append value to list_month.
value-key = 'APR'.
value-text = 'APR'.
append value to list_month.
value-key = '1998'.
value-text = '1998'.
append value to list_year.
value-key = '1999'.
value-text = '1999'.
append value to list_year.
value-key = '2000'.
value-text = '2000'.
append value to list_year.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_MONTH'
VALUES = list_month
EXCEPTIONS
ID_ILLEGAL_NAME = 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 FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_YEAR'
VALUES = list_year
EXCEPTIONS
ID_ILLEGAL_NAME = 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.
start-of-selection.
write:/ p_year,
p_month. -
How to give no of lines per page in alv report
hi
could anybody tell me
how to give no of lines per page in alv report
i need bottom of page too
if possible plz send the code too
it ll be very helpful to me
thanx
kals.Hi,
This is possible, using some of the events in the ALV.
You could use AFTER_LINE_OUTPUT event and call you form after say, a certain line count is reached on the list output.
MOVE 'AFTER_LINE_OUTPUT' TO gw_event-name.
MOVE 'AFTER_LINE_OUTPUT' TO gw_event-form.
APPEND gw_event TO gt_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_events = gt_events[]
and define the form for each event as follows - this would be a dynamic call by the ALV.
*& Form after_line_output
* Form for the After Line Output Event in the internal table
* --> rs_lineinfo
FORM after_line_output USING rs_lineinfo TYPE slis_lineinfo.
IF sy-linno eq v_linno. "Defaulted value for line count
perform write_footer.
NEW-PAGE.
ENDIF.
ENDFORM. " after_line_output
For lines per page:
rs_lineinfo-tabindex would give you the index of the current line in the list, which you could use to read the t_outtab table, and reduce the line count of items displayed on the earlier page.
There are a few other events too, like BEFORE_LINE_OUTPUT and END_OF_LIST which you can use as required and print the data.
Regards,
Anil. -
Multiple Lines in a Single ALV Grid Cell
Is there any way to Display Multiple Lines in a Single ALV Grid Cell.
This can be accomplished by Sorting the First 3 fields and Make it Looks like below displayed format.
But My problem is while downloading also it should be Displayed in the same format.
All inputs are highly appreciated.there was a post similar to this some days back... search it..
any ways...
what u can do is...
arrange ur final internal table so that it will look like same line...
like...lets say ur internal table is :
A1 B1 C1 D1 123
A1 B1 C2 D2 123
A1 B2 C1 D1 123
A1 B2 C2 D2 123
and u can rearrange ur table to be like
A1 B1 C1 D1 123
C2 D2 123
A1 B2 C1 D1 123
C2 D2 123
what i mean to say is dont pass the fields if they are same in the previous line... try it out..
and then pass it two ur ALV.
it will look like they are in one line
Edited by: soumya prakash mishra on Jun 17, 2009 1:31 PM -
Hi,
1) What is the maximum line size for OO ALV?
Or in the other way round, how is the maximum column size for OO ALV when i using the method below:
DATA: r_grid TYPE REF TO cl_salv_form_layout_grid.
CREATE OBJECT r_grid.
r_grid->create_text(
row = 2
column = 2
text = sy-mandt ).
2) Another question, how to change the below time format:
223801 -> 22:38:01?
When I try to use sy-uzeit to display the header in ALV like below:
CREATE OBJECT r_grid.
r_grid->create_text(
row = 2
column = 2
text = sy-uzeit ).
The ALV will be displaying 223801. How i can convert to format 22:38:01 and display it in ALV?
Thanks.Hi,
For your second qn.,try by declaring an extra field of type character of length 10 in the structure you are using for ALV.
After that ,after you appended the records,just try the follg...
loop at itab into wa.
concatenate f10(2) ':' f12(2) ':' f1+4(2) into f2.
modify itab from wa transporting f2 index sy-tabix.
endloop. -
Asset Lines Processing(pa_client_extn_asset_creation)
Hi Gurus,
I have a requirement on my project where the client requires the assets lines built and created should be grouped individually based on expenditure organizations in the Invoice distributions which are matched to the Purchased Orders. The Date placed is service for the Asset should be the date the Invoice is paid. The CIP Account generated for the assets lines should be based on the locations in the Expenditure.
For Example. If a user wants to creates a PO for different locations he navigates to the Po distributions window and selects the Project Tab. He selects the same project number but uses different expenditure location as he wants to send the products to different locations. This PO is invoiced and paid. When the CIP is built and assets are created they get created based on the project organization instead of the expenditure orgs. Also the assets are tied to the just one asset name instead of differentiating with orgs.
So for the above requirement we would lke to build a Asset Lines Processing client extension which would create project assets and asset assignments prior to the creation of asset lines, based on transaction data (such as inventory issues or supplier invoices) entered for the project.
Please provide your experience inputs and helpful documents to build this client extension. If there is any sample code to be used then please advise.
Thanks you for all your help in advance.
Asad.Hi,
You can make use of the Asset client extensions PA_PROJECT_ASSETS_PUB.ADD_PROJECT_ASSET and PA_PROJECT_ASSETS_PUB.ADD_ASSET_ASSIGNMENT and add your custom logic there.
Hope this helps !
Sathish Raju
www.projectsaccounting.com -
How to display 2 lines of fieldcat in alv
hi,all.
I wonder how to display 2 lines of fieldcat in alv,no matter grid,list ,oo. whatever.
thanks in anvance.Hi,
it's only possible in alv-list (3 lines).
A. -
How to display multi line headings in procedural alv report
Hi experts,
How to display multi line heading in alv( procedural alv report) report.
some columns single line and some columns multi line in the same report.
ex:
solvent consumed solvent recovered
fresh | recovery recovery | spent batch no storage
I am using procedural alv .pls give me idea.Hi Ram,
Check the sample report [how to display multi line headings in procedural alv report|http://sample-code-abap.blogspot.com/2008/01/printing-multiple-line-header-and.html]
Thanks,
Duy -
Any API to get handle to Outbound BPEL process endpoint activation?
Hi,
we are developing both inbound and outbound BPEL processes using a custom JCA 1.5 based adapter. For the inbound BPEL process deployment/undeployment, we have the ResourceAdapter's endpointActivate() endpointDeactivate() methods called in and so we can post process, like clean up endpoints when these methods get called. Is there somethign simillar that we can use as an API to get a handle to the outbound process endpoints deactivate/activate, so that we can clean up these too, or does the oracle adapter framework internally clean these up?
Also even though we undeploy all processes before stopping the adapter (from the bpel console), after that if we redeploy the adapter rar, from then on any new BPEL process deployment (through jdeveloper) always throws a "500 Internal Server Error". Only after restarting the SOA, then on any new deployments go through fine. This is a serious limitation for us.. Any idea why this is happening and how to resolve this?
Thanks
PramodhHi Pramodh,
That's a nice requirement.
The inbound (ActivationSpec) properties can only be set dynamically (typically via the BPEL console) if their values are bound via property values defined in bpel.xml for the particular JCA Activation Agent in question. This is fundamentally as per the JCA 1.5 design where EndpointActivation (which receives an instance of ActivationSpec) takes place when the BPEL process starts up, i.e. only once. More often than not the BPEL process will have to be bounced (Off/On) for ActivationSpec attribute changes to take effect (thereby allowing the JCA 1.5 inbound message endpoint to be restarted/reinitialized). Some adapters do look dynamically for changes to bpel.xml bound values (subscribed to via the adapter framework) and will react appropriately without the need for bumping the process (e.g. adjusting a timeout or retryCount or other secondary attribute which doesn't change the first order attributes of the endpoint, such as e.g. the database host name etc). An example of an activation property which requires the adapter to restart is the JMS adapter MessageSelector property.
Having said that, please try using the activation agent properties set in the outbound PL and see if that works!
Cheers
A -
Error:Assign handling Unit from one Process order to another process order
Hi Experts,
I am facing different issues in assigning handling unit from one process order to another.
Business process:
1. Two similar Process Orders are existing in the system
2. Delivery is created for first process order using LP10 for one or more components
3. TO is created in foreground using VL06P
4. TO is confirmed by providing in stock available Handling Unit (HU) / storage Unit details Using LT12
5. Customized transaction is used to reassign newly created HU (created in previous step) from first process order to second process order. As a result many steps are performed in background for delinking the HU from first process order to second process order (including creation of different TOs)
I am facing different issues in the process:
1. Sometimes while confirming the TO in step 4: error is received as "Reservation item 0065 with material 4013959300300 does not exist" OR "Reservation item with material does not exist"
2. If the TO is confirmed in step 4. I am facing error in step 5 as "Warehouse number does not exist (new selection required)"
Both these errors are standard errors and I could not find much information on them in SCN also.
If anyone can throw light on any of them then it would be great.
Please let me know if any additional information is required.
Thanks
Harsh AggarwalHi Manish
Thanks for your response. Actually, the customized program is used only in fifth step and not till TO confirmation so that error is not related to Customized program. However, in some cases I am able to do the confirmation but the error is received in 5th step i.e. Warehouse number does not exist (new selection required)"
Any further guidance you can provide. I will ask ABAP to check the customized program but the error seems to be a standard error. -
Handling exceptions at Sub-Process Level
Can we handle exceptions at Sub-Process level itself? Or do we need to transfer the exceptions to the main process and then only the admin user can handle them?
The same thing applies to subprocesses. A subprocess is just a process that has been invoked by another process and the same exception handling rules apply to it.
You can catch exceptions in any process using:
<li> logic at the activity level using a try/catch block
<li> an activity using an Exception transition
<li> a Group in the process using an Exception transition
<li> the process using an Exception Handler
At a minimum, catch the "Others" exception using the Exception Handler. This ensures uncaught exceptions are not sent to the End activity (the default) and the instances are not lost. This simple best practice will save you days of debugging and several calls to customer support to resolve.
Dan -
How to handle line break embeded inside CSV column
Hi there,
I am under the pressure to make it work. I already put this question on APEX forum, but on second thought, I think it relates more to PL/SQL rather than APEX since APEX 4.1 already have utility to handle CSV Upload.
If you read it already in APEX forum, please ignore.
I am sorry for that. Thanks for reading.
I need to develop an app that allows user to upload CSV file to a interface table.
The APEX version at my workplace is 4.0.2.
I used the code from
http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:11000346061523
It all works well till recently I find out
If a column in a CSV file cotain a line break (or new line) e.g. (The tester copy and paste this text which has line break into a column in a spreadsheet)
This is the first sentence.
This is the second sentence.
It will break the “This is the second sentence”. To a new column.
The contents of the CSV viewed in Notepad look as below
Assessment Date,Scheduled Date,Assessment Provider,Assessor Name,Court,First Name,Middle Name,Last Name,PRN Person Record Number,NHI Number,Defendant Attended Y/N,Is Dependent Y/N,Notes,Primary Ethnicity,"Ethnicity Other, please specify",Gender,Currently in Treatment Y/N,Substance of Concern 5,Other Substance Specified
22/09/2012,,Provider Co Name,Warren Edgley,Wellington,,,Salty,2545554,dgsdf,ergerg,,"This is the first sentence.
This is the second sentence.",Japanese,,Female,b,,
Here is the code from the CSV UTIL, please help me to find out how can I replace the line break to a space so that the uploading process is correct.
CREATE OR REPLACE PACKAGE BODY "CSV_UTIL"
AS
--strip the beginning and the end quotes, then replace double quotation with single
FUNCTION de_quote (p_str IN VARCHAR2, p_enc_by IN VARCHAR2)
RETURN VARCHAR2
IS
v_str VARCHAR2(32767) := p_str;
BEGIN
IF (p_enc_by IS NULL)
THEN
RETURN p_str;
ELSE
IF SUBSTR(p_str,-1) = p_enc_by THEN
v_str := SUBSTR(p_str,1,LENGTH(p_str)-1);
END IF;
IF SUBSTR(p_str,1,1) = p_enc_by THEN
v_str := SUBSTR(v_str,2);
END IF;
RETURN REPLACE (v_str,
p_enc_by || p_enc_by,
p_enc_by
END IF;
END de_quote;
PROCEDURE parse (p_str IN VARCHAR2, p_enc_by IN VARCHAR2, p_sep IN VARCHAR2)
IS
l_n NUMBER DEFAULT 1;
l_in_quote BOOLEAN DEFAULT FALSE;
l_ch NCHAR (1);
l_len NUMBER DEFAULT NVL (LENGTH (p_str), 0);
BEGIN
IF (l_len = 0)
THEN
RETURN;
END IF;
g_words := g_empty;
g_words (1) := NULL;
FOR i IN 1 .. l_len
LOOP
l_ch := SUBSTR (p_str, i, 1);
IF (l_ch = p_enc_by)
THEN
l_in_quote := NOT l_in_quote;
END IF;
IF (l_ch = p_sep AND NOT l_in_quote)
THEN
l_n := l_n + 1;
g_words (l_n) := NULL;
ELSE
g_words (l_n) := g_words (l_n) || l_ch;
END IF;
END LOOP;
g_words (l_n) := de_quote (g_words (l_n), CHR(10));
g_words (l_n) := de_quote (g_words (l_n), CHR(13));
FOR i IN 1 .. l_n
LOOP
g_words (i) := de_quote (g_words (i), p_enc_by);
END LOOP;
END parse;
Author: Oleg Lihvoinen
Company: DbSWH
Changes:
10.02.2011, There was a miscalculation of the file line last position in case it is the end of file
PROCEDURE upload (p_file_name VARCHAR2, p_collection_name VARCHAR2, p_enc_by IN VARCHAR2, p_sep_by IN VARCHAR2, p_rows NUMBER)
IS
v_blob_data BLOB;
v_clob_data CLOB;
v_clob_len NUMBER;
v_position NUMBER;
v_char NCHAR (1);
c_chunk_len NUMBER := 1;
v_line VARCHAR2 (32767) := NULL;
v_data_array vcarray;
v_rows NUMBER := 0;
n_seq NUMBER := 1;
dest_offset NUMBER := 1;
src_offset NUMBER := 1;
amount INTEGER := DBMS_LOB.lobmaxsize;
blob_csid NUMBER := DBMS_LOB.default_csid;
lang_ctx INTEGER := DBMS_LOB.default_lang_ctx;
warning INTEGER;
l_sep VARCHAR2(100) := CASE WHEN p_sep_by = '\t' THEN chr(9) ELSE p_sep_by END;
BEGIN
htmldb_collection.create_or_truncate_collection
(p_collection_name => p_collection_name);
-- Read blob from wwv_flow_files
SELECT blob_content
INTO v_blob_data
FROM wwv_flow_files
WHERE NAME = p_file_name;
v_position := 1;
DBMS_LOB.createtemporary (lob_loc => v_clob_data,
CACHE => TRUE,
dur => DBMS_LOB.SESSION
DBMS_LOB.converttoclob (v_clob_data,
v_blob_data,
amount,
dest_offset,
src_offset,
blob_csid,
lang_ctx,
warning
v_clob_len := DBMS_LOB.getlength (v_clob_data);
IF v_clob_len = 0 THEN
RETURN;
END IF;
WHILE (v_position <= v_clob_len + 1)
LOOP
v_char := DBMS_LOB.SUBSTR (v_clob_data, c_chunk_len, v_position);
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When the whole line is retrieved and not end of file or end of file
IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
THEN
parse (p_str => v_line, p_enc_by => p_enc_by, p_sep => l_sep);
v_data_array := g_words;
FOR i IN 1..g_words.count LOOP
IF i <= 50 THEN
v_data_array(i) := g_words(i);
ELSE
exit;
END IF;
END LOOP;
FOR i IN g_words.count + 1..50 LOOP
v_data_array(i) := null;
END LOOP;
v_rows := v_rows + 1;
-- exit if uploaded specified number of rows
IF p_rows IS NOT NULL AND v_rows > p_rows THEN
EXIT;
END IF;
-- Store data to collection
n_seq :=
htmldb_collection.add_member
(p_collection_name => p_collection_name,
p_c001 => v_data_array
(1),
p_c002 => v_data_array
(2),
p_c003 => v_data_array
(3),
p_c004 => v_data_array
(4),
p_c005 => v_data_array
(5),
p_c006 => v_data_array
(6),
p_c007 => v_data_array
(7),
p_c008 => v_data_array
(8),
p_c009 => v_data_array
(9),
p_c010 => v_data_array
(10),
p_c011 => v_data_array
(11),
p_c012 => v_data_array
(12),
p_c013 => v_data_array
(13),
p_c014 => v_data_array
(14),
p_c015 => v_data_array
(15),
p_c016 => v_data_array
(16),
p_c017 => v_data_array
(17),
p_c018 => v_data_array
(18),
p_c019 => v_data_array
(19),
p_c020 => v_data_array
(20),
p_c021 => v_data_array
(21),
p_c022 => v_data_array
(22),
p_c023 => v_data_array
(23),
p_c024 => v_data_array
(24),
p_c025 => v_data_array
(25),
p_c026 => v_data_array
(26),
p_c027 => v_data_array
(27),
p_c028 => v_data_array
(28),
p_c029 => v_data_array
(29),
p_c030 => v_data_array
(30),
p_c031 => v_data_array
(31),
p_c032 => v_data_array
(32),
p_c033 => v_data_array
(33),
p_c034 => v_data_array
(34),
p_c035 => v_data_array
(35),
p_c036 => v_data_array
(36),
p_c037 => v_data_array
(37),
p_c038 => v_data_array
(38),
p_c039 => v_data_array
(39),
p_c040 => v_data_array
(40),
p_c041 => v_data_array
(41),
p_c042 => v_data_array
(42),
p_c043 => v_data_array
(43),
p_c044 => v_data_array
(44),
p_c045 => v_data_array
(45),
p_c046 => v_data_array
(46),
p_c047 => v_data_array
(47),
p_c048 => v_data_array
(48),
p_c049 => v_data_array
(49),
p_c050 => v_data_array
(50)
-- Clear the line
v_line := NULL;
END IF;
END LOOP;
END;
END;In my apps, I save these straight into a table rather than an APEX collection because the number of columns can be longer than 50.
I want to find out how can replace these line break inside a column to a space.
If any one has any ideas, please let me know.
Thanks a lot in advance.
AnnAnn586341 wrote:
I think the code split the whole thing by this line
-- When the whole line is retrieved and not end of file or end of file
IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
THEN
Yes, exactly. That piece of code believes all CHR(10) occurences are record delimiters.
It is not smart enough to recognize that a CHR(10) within quotation marks are part of the data.
Optimally a solution should keep the CHR(10) rather than replacing with spaces, but that will be a bigger rewrite of the UTL_CSV code ;-)
If you are happy with replacing with spaces, a "simple" solution could be something like:
Declare a boolean variable in upload procedure:
v_within_text_column boolean := false;And use it like this:
WHILE (v_position <= v_clob_len + 1)
LOOP
v_char := DBMS_LOB.SUBSTR (v_clob_data, c_chunk_len, v_position);
IF v_char = '"' THEN
v_within_text_column := NOT v_within_text_column;
ELSIF v_char = CHR(10) AND v_within_text_column THEN
v_char := ' ';
END IF;
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When the whole line is retrieved and not end of file or end of file
IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
THEN
v_within_text_column := false; -- To be safe always set this on "true" linebreaks
{code}
+(This is untested code just written here in the text editor.)+
It should work by toggling a flag whether you are "within" the quotes or not and then replacing CHR(10) with a space if you are within a text column.
This way we avoid having to go through the clob more than once (it is enough that this code walks the clob one character at a time...)
It will not handle if the clob contains situations like:
{code}
abc,123,"This is a text with a quote from a man who said \"To Be,
or Not To Be\" some hundred years ago",123,xyz
{code}
Escaped quotes would need separate attention ;-) -
How to disable line selection functionality in ALV.
Hallo guys,
I need to disable the ALV functionality to select one(or more) lines.
How to hide this push button on the right side?
Thanks.hi
good
check this
*& Report ZDEMO_ALVGRID_SELROW *
*& Example of a simple ALV Grid Report *
*& The basic ALV grid, Enhanced to display capture each row a user has *
*& selected *
REPORT zdemo_alvgrid_selrow .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
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.
*ALV data declarations
data: fieldcatalog 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.
*Start-of-selection.
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.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
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'.
fieldcatalog-col_pos = 8.
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_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
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'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN '&DATA_SAVE'. "user presses SAVE
loop at it_ekko into wa_ekko.
if wa_ekko-sel EQ 'X'.
Process records that have been selected
endif.
endloop.
ENDCASE.
ENDFORM.
thanks
mrutyun^ -
Two line column heading in ALV Report
Hi Experts,
My requirement is that I have to create an ALV report with columns having two lines of headings. Like a main heading called Consultants under which 5 to 10 columns of departments(Dept Num, Num of Ppl , Manager etc. ) and then Contractors(Name, Address Etc ) underwhich there would be 5 to 10 departments. Right now my report has the depts of...
How can i do that . If u would suggest by CL_SALV_TABLE then it would be great.
Thanks a lot !
Saui don't think you can do it using cl_gui_alv_grid or cl_salv_table.
-
How to insert line with values in ALV (CL_GUI_ALV_GRID)?
Hi,
Does anyone know how to get control of new line inserted in ALV (I am using class CL_GUI_ALV_GRID) before the new line is shown to the user. What I want the user to see is not a completely blank line, but a new line with certain fields filled with data.
I have tried with ALL events in CL_GUI_ALV_GRID but without any luck. If I create my own user command and insert it in the alv menu I get control, but not with the standards. Why?
Please help
Kind regards - Keld GregersenHi,
I created a nice work around...
CLASS lcl_event_handler DEFINITION.
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_toolbar.
DATA:
l_toolbar TYPE stb_button.
Here I replace SAP standard functions with own functions
READ TABLE e_object->mt_toolbar INTO l_toolbar
WITH KEY function = '&LOCAL&APPEND'.
IF sy-subrc = 0.
l_toolbar-function = 'OWN_APPEND'.
MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
ENDIF.
READ TABLE e_object->mt_toolbar INTO l_toolbar
WITH KEY function = '&LOCAL©_ROW'.
IF sy-subrc = 0.
l_toolbar-function = 'OWN_COPY_ROW'.
MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
ENDIF.
ENDMETHOD. "handle_toolbar
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'OWN_APPEND'.
CALL METHOD ref_alv->check_changed_data
IMPORTING
e_valid =
CHANGING
c_refresh = 'X'
CREATE YOUR OWN CODE HERE
CALL METHOD ref_alv->refresh_table_display
EXPORTING
is_stable = 'X'
i_soft_refresh =
EXCEPTIONS
finished = 1
others = 2
ENDMETHOD. "handle_user_command
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Kind regards
Keld Gregersen
Maybe you are looking for
-
How to mirror 2006 MacBook OS 10.5 using AppleTV wirelessly?
I have a 2006 MacBook Pro (2.16GB Intel Processor) that I need to connect wirelessly to AppleTV. Currently running OS 10.5.8. Any work arounds?
-
Color correcting certain parts of a video
Hello, I am sorta new to Premiere, having come from Final Cut pro. I have a video that has spots that neec color correction. How do I correct those spots, without correcting the whole video? Any help is appreciated.
-
Massive bip 11g download/upload
Hi i have to move all our reports (data models and rtf templates) from our test environment to production. As there are a lot of objects i'm wondering if there is a way to do a massive download and upload instead of doing one by one. Thanks
-
Why can't I install VS 2013 with update 4 after acquiring successfully?
I downloaded VS 2013 with update 4 source (iso file) in VisualStudio.com After extracting, I ran this command: vs2013.4.exe /layout It worked and displayed the result. Setup completed! All specified components have been acquired successfully. A folde
-
Get text selection and properties
Hi All, I need to get the text selection in my active document so that I can access the properties of selected text like paragraphs, font styles, colors etc. I wrote the following script to get text selection, var objDoc = app.activeDocument; var obj