Multiple ALV lists in a single spool of a job
Hi All,
Executing a custom program in background generates 2 lists in two different spools.
First list - ALV Grid displayed as ALV list
Second List - ALV Blocked List.
Though both the Spool request numbers generated during the execution of the program are displayed in the JOB LOG of the background job,only the latest spool(ALV Blocked List) is saved under this job.
We should go to Tx:SP01/02 to view the First list(ALV Grid) generated in the first Spool request.
Can someone tell me how to get both the lists in a single spool request..(Programmatically)
Or let me know if there is a way to display both the spool numbers in the Spool list of the job in SM37.
Thanks in advance.
Hemanth
Hi Hemanth,
maybe you can have a look at the function RSPO_INSERT_SPOOL_CONCATENATE. There is a documentation in the function module transaction.
Regards
Frédéric
Similar Messages
-
How to create Multiple ALV Lists, Each list on one new page
Hi All,
I have a requirement of displayiong data on multiple ALV Lists.
Ex:
I have data in internal table MATNR QTY VALUE
M1 2 3USD
M1 2 3USD
M2 2 3USD
M2 2 3USD
M3 2 3USD
M3 2 3USD
M4 2 3USD
M4 2 3USD
In The above internal table data , i have to displat M1 on one page and M2 on second,M3 on third and M4 on 4th page.....This may go to MN.
I have tried to do this with REUSE_ALV_BLOCK_LIST_APPEND, But if Lists are fixed like 3 or 4 , I can use this method.
Can any one help me on this?
Thanks,
Suresh.Hi Peter,
Yes I think that this is the way we will be probably go but not sure what the correct terms are for what I am looking for. Not sure if you are allowed to post examples of specific commercial plug ins here but if not, what should I search for. I know if sounds daft but it's a real case of not knowing what it is I am looking for. I am a complete InDesign newcomer who uses it at the moment for simple flyers etc so more than happy to find someone who can do the more complex stuff for me. The price lists will need to be done inhouse and on a regular basis.
thanks
Jen -
Writing text above multiple ALV list
Hi,
I have multiple ALV lists and want to add a different text above each one. How can this be achieved? I am using sort to separate the lists. thanks
sort-fieldname = 'MATNR'.
sort-up = 'X'.
sort-group = '*'.
APPEND sort TO it_sort.
CLEAR sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_data
EXCEPTIONS
program_error = 1.
Edited by: Hin Lai on Jan 7, 2011 9:40 PMWell, why not debug FBL5N and see how that transaction does this?
Hmmm....
Debugging may not help. The separate lists are handled by the display variant. You should be able to do the same thing if all of your lists use the same field catalog and are in the same or can be put in the same table.
Rob
Edited by: Rob Burbank on Jan 7, 2011 5:36 PM -
Multiple ALV Grid Panes in single screen
Hi all,
How can we get multiple ALV Grid panes in single output.
Is it possible to get the same without using OOPS.
Thanks in advance.
EswarHi,
You can do this by creating 2 custom controls on the layout of the screen, and then you will also need to create 2 custom containers in your ABAP program, 1 for each ALV.
Ex :
grid TYPE REF TO cl_gui_alv_grid,
custom_container TYPE REF TO cl_gui_custom_container,
grid TYPE REF TO cl_gui_alv_grid,
custom_container TYPE REF TO cl_gui_custom_container,
regards,
Advait -
Sending an ALV List screen output to SPOOL
Hi Guru's,
I am working with a standard transaction FBWE. In this transaction we are displaying a remittance list
using ALV LIST. Now the requirement is I need to send this ALV List output to SPOOL.
1. Please tell me how to send an ALV List output to Spool.
2. This transaction is having only one user exit, as per my investigation I can not use
this user exit. Can anybody tell me the alternative way for this.
Thanks,
RaviYou can using the SUBMIT along with spool options
Read the SUBMIT help. -
ALV lists in background = no spool - why ??
Hi Experts,
I have a quick (probably very simple) issue on programs using ALV grid/lists.
We have a program, dointg some treatmeant.
At end of execution of program we display errors and processing messages viathe ALV grid.
So it is working fine on foreground.
But when we execute it in background we have no spool. nothing. Even in SM37 not the spool icon.
I understood that normally we could have the ALV content in the spool. But I do not understand what is wrong.
Could some experts help me to understand what is wrong and hwo to solve ??
Thanks for your help.
S.NHi Newbie,
The importing parameter IS_PRINT of ALV List will solve your issue. I have tested this.
Data : wa_print type SLIS_PRINT_ALV.
wa_print-print = 'X'.
wa_print-no_print_listinfos = 'X'.
Now you have to make separate call for ALV in foreground and background .
For that,
If sy-batch = 'X'.
call function module by passing IS_PRINT parameter(wa_print).
else.
call function module without IS_PRINT.
endif.
Test the spool using sp01.
Regards
Sreekanth -
Insert items from two different Multiple Select Lists into a single table
I need help. I have a training tracking system that tracks the courses taken by employees.
I have created two multiple select lists, one is SelectEmployees and the other is SelectCourses. I want to insert
the selected item from those two multiple select lists into Training_Record table.
Note, SelectEmployees" is from Employee table and SelectCourses is from Courses table. Those two table has no intersetion.
Train_Record is the table that joins those two together.
Please advice and your help is appreciate.Thank you for your help.
I tried your code and changed the table/field name to my actual table/field name and the iitem name to actual item name.
declare
cursor c_Employees is
select PERSONNEL_NEW.EMPLOYEEID from PERSONNEL_NEW where PERSONNEL_NEW.EMPLOYEEID in (:P15_SELECTEDEMP);
cursor c_Courses is
select COURSES.COURSE_ID from COURSES where COURSES.COURSE_ID in
(:P15_SELECTEDCOUR);
begin
foreach :=r_employee in c_Employees loop
foreach :=r_course in c_Courses loop
insert
into COPYOFTRAINREC ( EMPLOYEEID, COURSEID )
values ( r_employee.EMPLOYEEID, r_course.COURSE_ID );
end loop;
end loop;
end;
I got error message as :
ORA-06550: line 12, column 25: PLS-00103: Encountered the symbol "C_EMPLOYEES" when expecting one of the following: (
Error
OK -
How to spool out put of multiple scripts and get a single spool file output
Hi,
I have one master script that calls three other scripts. The three scripts each produce their own spool files. But I would like to have the master script also produce one single output (in addition to the three indiviual output I mean). How to do that? Can you please help.
Following are the scripts:
--m.sql (master script)
spool c:\m.log
@1.sql
@2.sql
@3.sql
spool off
--1.sql
spool c:\1.log
insert into test values(1);
commit;
spool off
--2.sql
spool c:\2.log
insert into test values(2);
commit;
spool off
spool c:\3.log
insert into test values(3);
commit;
spool off
--table used
SQL> desc test
Name Null? Type
A NUMBERWhen I run the above script m.sql it does produce the other 3 log files (1.log,2.log etc) but m.log (which is master log file which should have output of each of the three calling script) is empty file with 0 byte!
Thanks
Edited by: orausern on May 1, 2011 3:17 AMI have one master script that calls three other scripts. The three scripts each produce their own spool files. But I would like to have the master script also produce one single output (in addition to the three indiviual output I mean). How to do that? Can you please help. Not sure if that's possible directly with sqlplus spool option
When you spool to a different file in a single session, sqlplus stops writing to earlier spool file and redirects the output to the file specified in last spool command.
at the end of the script, however, below may help
host type c:\1.log >> c:\m.log
host type c:\2.log >> c:\m.log
host type c:\3.log >> c:\m.log -
Hello guys,
I want to display 2 ALV grids on the same screen one below another with headings. Can some1 throw light how to do that??
Thanks,use block alv ...
if u want to display one alv grid bellow another......
example code....
REPORT zanid_test MESSAGE-ID zz.
Declarations for BLOCK ALV DISPLAY
*--type pools
TYPE-POOLS:slis.
DATA:x_layout TYPE slis_layout_alv,
t_field TYPE slis_t_fieldcat_alv,
*--field catalog
x_fldcat LIKE LINE OF t_field,
*--to hold all the events
t_events TYPE slis_t_event,
x_events TYPE slis_alv_event,
t_sort TYPE slis_t_sortinfo_alv,
x_sort LIKE LINE OF t_sort ,
*--Print Layout
x_print_layout TYPE slis_print_alv.
*----Macro to add field catalog.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
DEFINE add_catalog.
clear x_fldcat.
x_fldcat-fieldname = &1.
x_fldcat-seltext_m = &2.
x_fldcat-outputlen = &3.
x_fldcat-tech = &4.
x_fldcat-col_pos = &5.
x_fldcat-no_zero = 'X'.
x_fldcat-ddictxt = 'M'.
x_fldcat-datatype = &6.
x_fldcat-ddic_outputlen = &7.
if &6 = 'N'.
x_fldcat-lzero = 'X'.
endif.
*--build field catalog
append x_fldcat to t_field.
END-OF-DEFINITION.
*----- data declerations.
data: v_repid like sy-repid.
data: begin of itab occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
meins like mara-meins,
end of itab.
data: begin of jtab occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of jtab.
select matnr ernam meins
up to 20 rows
from mara
into table itab.
select matnr maktx
up to 20 rows
from makt
into table jtab.
v_repid = sy-repid.
*DISPLAY alv
Initialize Block
call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
i_callback_program = v_repid.
*Block 1:
*INITIALIZE
refresh t_field. clear t_field.
refresh t_events.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
add_catalog:
'MATNR' 'Material' '18' '' '1' 'C' '18',
'ERNAM' 'Created By' '12' '' '2' 'C' '12',
'MEINS' 'Unit' '5' '' '3' 'C' '3'.
*--build table for events.
x_events-form = 'TOP_OF_LIST1'.
x_events-name = slis_ev_top_of_list.
append x_events to t_events.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = x_layout
it_fieldcat = t_field
i_tabname = 'ITAB'
it_events = t_events
it_sort = t_sort
tables
t_outtab = itab
exceptions
program_error = 1
maximum_of_appends_reached = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*--BLOCK 2(SUMMARY REPORT)
*INITIALIZE
refresh t_field. clear t_field.
refresh t_events.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
add_catalog:
'MATNR' 'Material' '20' '' '1' 'C' '18',
'MAKTX' 'Description' '40' '' '2' 'C' '40'.
*--build table for events.
x_events-form = 'TOP_OF_LIST2'.
x_events-name = slis_ev_top_of_list.
append x_events to t_events.
Append table block.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = x_layout
it_fieldcat = t_field
i_tabname = 'JTAB'
it_events = t_events
tables
t_outtab = jtab
exceptions
program_error = 1
maximum_of_appends_reached = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*--CALL FM TO DISPLAY THE BLOCK REPORT.
call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
exporting
is_print = x_print_layout
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.
form top_of_list1.
skip 1.
write: 10 'List 1',
/5 '----
skip 1.
format reset.
endform.
form top_of_list2.
skip 1.
write: 10 'List 2',
/5 '----
skip 1.
format reset.
endform.
Message was edited by: kishan negi -
Problem passing multiple array lists to a single method
Hi, all:
I have written a generic averaging method that takes an array list full of doubles, adds them all up, divides by the size of the array list, and spits out a double variable. I want to pass it several array lists from another method, and I can't quite figure out how to do it. Here's the averager method:
public double averagerMethod (ArrayList <Double> arrayList) {
ArrayList <Double> x = new ArrayList <Double> (arrayList); //the array list of integers being fed into this method.
double total = 0;//the total of the integers in that array list.
for (int i = 0; i < x.size(); i++) {//for every element in the array list,
double addition = x.get(i);//get each element,
total = total + addition; //add it to the total,
double arrayListSize = x.size();//get the total number of elements in that array list,
double average = total/arrayListSize;//divide the sum of the elements by the number of elements,
return average;//return the average.
}And here's the method that sends several array lists to that method:
public boolean sameParameterSweep (ArrayList <Double> arrayList) {
sameParameterSweep = false;//automatically sets the boolean to false.
arrayList = new ArrayList <Double> (checker);//instantiate an array list that's the same as checker.
double same = arrayList.get(2); //gets the third value from the array list and casts it to double.
if (same == before) {//if the third value is the same as the previous row's third value,
processARowIntoArrayLists(checker);//send this row to the parseAParameterSweep method.
sameParameterSweep = true;//set the parameter sweep to true.
if (same != before) {//if the third value is NOT the same,
averagerMethod(totalTicks);//go average the values in the array lists that have been stored.
averagerMethod(totalNumGreens);
averagerMethod(totalNumMagentas);
sameParameterSweep = false;
before = same; //problematic!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
return sameParameterSweep;
}Obviously, the problem is that I'm not passing the array lists from this method to the averager method the right way. What am I doing wrong?Encephalopathic wrote:
There are several issues that I see, but the main one is that you are calculating average results but then just discarding them. You never assign the result to a variable.
In other words you're doing this:
averagerMethod(myArrayList); // this discards the resultinstead of this:
someDoubleVariable = averagerMethod(myArrayList); // this stores the resultAlso, do you wish to check for zero-sized array lists before calculating? And what would you return if the array list size were zero?So in solving that problem, I've come up with another one that I can't figure out, and I can't fix this problem until I fix that.
I have several thousand lines of data. They consist of parameter sweeps of given variables. What I'm trying to do is to store pieces of
data in array lists until the next parameter adjustment happens. When that parameter adjustment happens, I want to take the arraylists
I've been storing data in, do my averaging thing, and clear the arraylists for the next set of runs under a given parameter set.
Here's the issue: I'm having the devil of a time telling my application that a given parameter run is over. Imagine me doing stuff to several variables (number of solders, number of greens, number of magentas) and getting columns of output. My data will hold constant the number of soldiers, and for, say, ten runs at 100 soldiers, I'll get varying numbers of greens and magentas at the end of each of those ten runs. When I switch to 150 soldiers to generate data for ten more runs, and so forth, I need to average the number of greens and magentas at the end of the previous set of ten runs. My problem is that I can't figure out how to tell my app that a given parameter run is over.
I have it set up so that I take my data file of, say, ten thousand lines, and read each line into a scanner to do stuff with. I need to check a given line's third value, and compare it to the previous line's third value (that's the number of soldiers). If this line has a third value that is the same as the previous line's third value, send this line to the other methods that break it up and store it. If this line has a third value that is NOT the same as the previous line's third value, go calculate the averages, clear those array lists, and begin a new chunk of data by sending this line to the other methods that break it up and store it.
This is not as trivial a problem as it would seem at first: I can't figure out how to check the previous line's third value. I've written a lot of torturous code, but I just deleted it because I kept getting myself in deeper and deeper with added methods. How can I check the previous value of an array list that's NOT the one I'm fiddling with right now? Here's the method I use to create the array lists of lines of doubles:
public void parseMyFileLineByLine() {
totalNumGreens = new ArrayList <Double>();//the total number of greens for a given parameter sweep
totalNumMagentas = new ArrayList <Double>();//the total number of magentas for a given parameter sweep.
totalTicks = new ArrayList <Double>();//the total number of ticks it took to settle for a given parameter sweep.
for (int i = 8; i < rowStorer.size() - 2; i++) {//for each line,
checker = new ArrayList <Double>();//instantiates an array list to store each piece in that row.
String nextLine = rowStorer.get(i); //instantiate a string that contains all the information in that line.
try {
Scanner rowScanner = new Scanner (nextLine); //instantiates a scanner for the row under analysis.
rowScanner.useDelimiter(",\\s*");//that scanner can use whitespace or commas as the delimiter between information.
while (rowScanner.hasNext()) {//while there's still information in that scanner,
String piece = rowScanner.next(); //gets each piece of information from the row scanner.
double x = Double.valueOf(piece);//casts that stringed piece to a double.
checker.add(x);//adds those doubles to the array list checker.
catch (NoSuchElementException nsee) {
nsee.printStackTrace();
//System.out.println("checker contains: " + checker);
processARowIntoArrayLists(checker);//sends checker to the method that splits it up into its columns.
} -
Multiple ALV GRID reports on a single page
hi all
I have an urgent requirement where I need to show 2-3 alv grids on a single page. Please let me know if it is possible to do so. If yes how. Sample code would be very helpful.
thanks in advance.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 16, 2008 1:45 PMHI,
Create multiple custom containers and call the method CALL METHOD sap_grid->set_table_for_first_display multiple times.
This will display multiple ALV grids on a single page.
Code Below:
MODULE create_objects OUTPUT.
CREATE OBJECT g_custom_container
EXPORTING
PARENT =
container_name = 'CUST_CRTL'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE e143(z1).
ENDIF.
*Create object for sap grid
CREATE OBJECT sap_grid
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = g_custom_container
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e144(z1).
ENDIF.
CREATE OBJECT g_custom_container1
EXPORTING
PARENT =
container_name = 'CUST_CRTL1'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE e143(z1).
ENDIF.
*Create object for sap grid
CREATE OBJECT sap_grid1
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = g_custom_container1
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e144(z1).
ENDIF.
CREATE OBJECT g_custom_container2
EXPORTING
PARENT =
container_name = 'CUST_CRTL2'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE e143(z1).
ENDIF.
*Create object for sap grid
CREATE OBJECT sap_grid2
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = g_custom_container2
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e144(z1).
ENDIF.
ENDMODULE. " create_objects OUTPUT
*& Module fill_fcat OUTPUT
text
MODULE fill_fcat OUTPUT.
CONSTANTS : lc_x TYPE c VALUE 'X',
lc_a TYPE c VALUE 'D'.
*Prepare field catalog for all Summary Report
wa_field-fieldname = 'BUKRS'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '12'.
wa_field-col_pos = '1'.
wa_field-coltext = text-002. "'Company Code'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'CURR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '10'.
wa_field-col_pos = '2'.
wa_field-coltext = text-022."'Currency'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'KUNNR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '10'.
wa_field-col_pos = '3'.
wa_field-coltext = text-005."'Customer Number'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'NAME1'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '4'.
wa_field-coltext = text-007."'Customer Name'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'KLIMK'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '12'.
wa_field-col_pos = '5'.
wa_field-coltext = text-008. " 'Credit Limit'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'DMBTR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '16'.
wa_field-col_pos = '6'.
wa_field-coltext = text-009. "'Current Balance Calculated'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'BLNC'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '23'.
wa_field-col_pos = '7'.
wa_field-coltext = g_bal_date. "'Balance b/f @ (Date taken from Z table) '.
wa_field-fix_column = 'X'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'DATE'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '8'.
wa_field-col_pos = '7'.
wa_field-coltext = text-021. "'Balance b/f Date @ Z Table balance'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'INVOICES'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '8'.
wa_field-coltext = text-012. "'Invoices'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'PAYMENTS'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '9'.
wa_field-coltext = text-013. "'Payments'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'DMBTR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '23'.
wa_field-col_pos = '10'.
wa_field-coltext = g_bal_date1. "'Balance c/f @ (Date of Lodgement from selection screen)'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'CHECK'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '11'.
wa_field-coltext = text-020. "'CHECK'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR g_layout.
g_layout-zebra = lc_x.
g_layout-sel_mode = lc_a.
*Prepare field catalog for all Invoice Extract
wa_field1-fieldname = 'BUKRS'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '12'.
wa_field1-col_pos = '1'.
wa_field1-coltext = text-002. "'Company Code'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'KUNNR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '2'.
wa_field1-coltext = text-005."'Customer Number'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'NAME1'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '3'.
wa_field1-coltext = text-007."'Customer Name'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'GJAHR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '7'.
wa_field1-col_pos = '4'.
wa_field1-coltext = text-015. " 'Fiscal Year'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'BELNR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '10'.
wa_field1-col_pos = '5'.
wa_field1-coltext = text-016. "'Invoice Number'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'CURR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '8'.
wa_field1-col_pos = '6'.
wa_field1-coltext = text-022."'Currency'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'DMBTR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '7'.
wa_field1-coltext = text-017. "'Invoice Amount '.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'BLDAT'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '12'.
wa_field1-col_pos = '8'.
wa_field1-coltext = text-018. "'Date of Shipment'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'DUEDT'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '9'.
wa_field1-coltext = text-019. "'Due Date Calculated'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR g_layout1.
g_layout1-zebra = lc_x.
g_layout-sel_mode = lc_a.
*Prepare field catalog for all Payment Extract
CLEAR wa_field2.
wa_field2-fieldname = 'BUKRS'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '12'.
wa_field2-col_pos = '1'.
wa_field2-coltext = text-002. "'Company Code'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'KUNNR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '2'.
wa_field2-coltext = text-005. "'Customer Number'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'NAME1'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '3'.
wa_field2-coltext = text-007. "'Customer Name'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'GJAHR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '11'.
wa_field2-col_pos = '4'.
wa_field2-coltext = text-015. "'Fiscal Year'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'BELNR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '5'.
wa_field2-coltext = text-016. "'Invoice Number'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'CURR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '11'.
wa_field2-col_pos = '6'.
wa_field2-coltext = text-022."'Currency'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
wa_field2-fieldname = 'DMBTR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '7'.
wa_field2-coltext = text-017. "'Invoice Amount'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR g_layout2.
g_layout2-zebra = lc_x.
g_layout-sel_mode = lc_a.
ENDMODULE. " fill_fcat OUTPUT
*& Module display_data OUTPUT
text
MODULE display_data OUTPUT.
g_layout3-variant = g_save.
CALL METHOD sap_grid->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'gt_display'
is_variant = g_layout3
i_save = 'A'
i_default = 'X'
is_layout = g_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = t_bsid_bsad
it_fieldcatalog = fcat
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE e145(z1).
ENDIF.
g_layout4-variant = g_save1.
CALL METHOD sap_grid1->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'gt_display1'
is_variant = g_layout4
i_save = 'A'
i_default = 'X'
is_layout = g_layout1
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = t_invoice
it_fieldcatalog = fcat1
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE e145(z1).
ENDIF.
g_layout5-variant = g_save2.
CALL METHOD sap_grid2->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'gt_display2'
is_variant = g_layout5
i_save = 'A'
i_default = 'X'
is_layout = g_layout2
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = t_payment
it_fieldcatalog = fcat2
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE e145(z1).
ENDIF.
ENDMODULE. " display_data OUTPUT
*& Module exit INPUT
text
MODULE exit INPUT.
CALL METHOD g_custom_container->free.
CLEAR t_bsid_bsad[].
CALL METHOD g_custom_container1->free.
CLEAR t_invoice[].
CALL METHOD g_custom_container2->free.
CLEAR t_payment[].
LEAVE PROGRAM.
ENDMODULE. " exit INPUT
*& Module user_command_1100 INPUT
text
MODULE user_command_1100 INPUT.
MOVE g_ok_code TO g_saveok_code.
CLEAR g_ok_code.
CASE g_saveok_code.
*on BACK leave program
WHEN 'BACK'.
CALL METHOD g_custom_container->free.
CALL METHOD g_custom_container1->free.
CALL METHOD g_custom_container2->free.
CLEAR: g_custom_container,
g_custom_container1,
g_custom_container2.
LEAVE PROGRAM.
SET SCREEN 1000.
CALL TRANSACTION 'Z5172'.
CALL SELECTION-SCREEN 1000.
set screen 0.
leave screen.
*on CANCEL leave program
WHEN 'EXIT'.
CALL METHOD g_custom_container->free.
CALL METHOD g_custom_container1->free.
CALL METHOD g_custom_container2->free.
LEAVE PROGRAM.
*on CANCEL leave program
WHEN 'CANCEL'.
CALL METHOD g_custom_container->free.
CALL METHOD g_custom_container1->free.
CALL METHOD g_custom_container2->free.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " user_command_1100 INPUT -
Display Multiple ALV layouts on one screen
Hi,
I have created 4 ALV Catalogues named: ALVCAT1, ALVCAT2, ALVCAT3, ALVCAT4
I have also created the corresponding internal tables with data for each catalogue: ALVITAB1, ALVITAB2, ALVITAB3, ALVITAB4
I have so far used the following function to generate each of the catalogues above:
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-CPROG
I_INTERNAL_TABNAME = 'ALVITAB1'
I_INCLNAME = SY-CPROG
CHANGING
ct_fieldcat = ALVCAT1[].
And I have used the following function module to display the table as ALV:-
*DISPLAYING REPORT AS ALV GRID
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
IT_FIELDCAT = ALVCAT1[]
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = ALVITAB1.
How can I now using the above function modules or similar function modules to DISPLAY multiple ALV layouts on a single SCREEN. Each layout should be treated separately with their own ALV tool bar etc.
In this case i need to display 4 screens but I have scenarios where i need to also display 5.
Would be really grateful for your guidance with source code to achieve this.....
Thnx
Salman
Edited by: Salman Akram on Sep 20, 2010 2:47 PMHi
Try this [Link|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=61243570] or the below program
BCALV_TEST_GRID_DRAG_DROP
or else
Try to use splitter container to display multiple ALVs on one screen
here is the demo program RSDEMO_SPLITTER_CONTROL
the below code will help you to call grid using splitter control
EXPORTING
container_name = 'CUSTOM'.
CREATE OBJECT splitter
EXPORTING
parent = container
rows = 1
columns = 1
align = 15.
CALL METHOD splitter->set_row_height
EXPORTING
id = 1
height = 1.
CALL METHOD splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = container_1.
CREATE OBJECT grid1
EXPORTING
i_parent = container_1.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
is_layout = gss_layout
is_variant = lwa_variant
i_save = 'A'
CHANGING
it_outtab = gt_report_list
it_fieldcatalog = gtt_fld_cat.
Regards
Edited by: Anesht on Sep 20, 2010 11:49 PM -
Multiple Lines Header and Records in ALV List
Dear All,
I am faced with a wierd user requirement to print multiple line header in ALV. Currently we have a classical report where we are displaying a huge text for example 400 characters in a single cell of a column of the report.
Now we will have to convert this to ALV report where I need to show that data in a single cell. I am wondering how is it possible in ALV list/grid. Please let me know if you guys have any clue.
Regards,
BikramjitHi,
Did you find a solution for this?, I am also having a similar requirement.
If you have any work around please share.
Thanks. -
Hi everyone,
How can I increase the width of the spool when i use the ALV List?
I know the limit usually is 255, but i need to see at the spool 600!
Have someone set up a new format paper like 65 X 600 and put it on the printer parameters?
Do you think it would be work properly?
regards,
AlexandreHello Ken,,
CAn you please let me know of the graphical view of the spool(where the display in single line for spool row raather than wrapping around ) as in the other systems of my client we haven't created any format or device type. We use X_65_255 format for printer say LOCL or LPO1 and this works fine for us except in one system.
I have opened a thread
Display spool output i.e a single row in a single line
if you know please reply to this <REMOVED BY MODERATOR>
regards
Sachin
Edited by: Alvaro Tejada Galindo on Apr 22, 2008 12:21 PM -
ALV list display in a Background job - Spool output
Hi,
We are currently working on a report scheduled to be run in the background job, and the ALV list is displayed in the spool output.
ALV list in the spool does not look the same as front run job, the column headers are all crowded together, and there is no grid in-between different columns or rows. It's hard to read.
Is there a way to add grid for this kind of output?
Thanks!Hi Deepak:
I expanded your report into two rows display, and the grid in the spool display simply gone!
report zzscratch line-size 120 no standard page heading.
type-pools slis.
tables pa0001.
data : li_field type standard table of slis_fieldcat_alv,
gi_events type standard table of slis_alv_event,
gr_layout_bck type slis_layout_alv,
gr_save like disvariant,
gr_events type slis_alv_event.
types : begin of gtt_emp,
pernr type persno,
ename like pa0001-ename,
uname like pa0001-UNAME,
end of gtt_emp.
data : lr_field type slis_fieldcat_alv.
data : lc_rep like syst-repid.
data : li_emp type standard table of gtt_emp,
lr_emp type gtt_emp.
data : gv_ref_table type lvc_rtname.
gv_ref_table = 'CATSDB'.
lr_field-fieldname = 'PERNR'.
lr_field-ref_tabname = gv_ref_table.
lr_field-inttype = 'N'.
lr_field-outputlen = 8.
lr_field-seltext_l = 'EMPLOYEE Number'.
append lr_field to li_field.
lr_field-fieldname = 'ENAME'.
lr_field-ref_tabname = 'PA0001'.
lr_field-inttype = 'C'.
lr_field-outputlen = 40.
lr_field-seltext_l = 'EMPLOYEE Name'.
append lr_field to li_field.
lr_field-fieldname = 'UNAME'.
lr_field-ref_tabname = 'PA0001'.
lr_field-inttype = 'C'.
lr_field-outputlen = 12.
lr_field-seltext_l = 'User Name'.
lr_field-row_pos = 2.
lr_field-col_pos = 1.
append lr_field to li_field.
lc_rep = sy-repid.
gr_layout_bck-edit_mode = 'D'.
gr_save-report = sy-repid.
lr_emp-pernr = '00000001'.
lr_emp-ename = 'abc'.
lr_emp-uname = 'testus'.
append lr_emp to li_emp.
lr_emp-pernr = '00000002'.
lr_emp-ename = 'def'.
append lr_emp to li_emp.
lr_emp-pernr = '00000003'.
append lr_emp to li_emp.
lr_emp-pernr = '00000004'.
append lr_emp to li_emp.
lr_emp-pernr = '00000005'.
append lr_emp to li_emp.
lr_emp-pernr = '00000006'.
append lr_emp to li_emp.
lr_emp-pernr = '00000007'.
append lr_emp to li_emp.
lr_emp-pernr = '00000008'.
append lr_emp to li_emp.
end-of-selection.
Function module for ALV grid display
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = lc_rep
is_layout = gr_layout_bck
it_fieldcat = li_field
i_save = 'A'
is_variant = gr_save
it_events = gi_events
TABLES
t_outtab = li_emp[]
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
clear gr_messages.
message e023 into gr_messages.
append gr_messages to gi_messages.
endif.
Maybe you are looking for
-
SRM PO creation classic scenario
Hi, I have some requirements & need direction Scenario#1 Classic scenario: SC created for multiple lines with multiple product categories. This fetches corrosponding P Groups based on the config. When PO is created it creates multiple POs based on P
-
Does Apple TV support wireless connection to the MacBook Pro retina display in an extended display mode? What is the output resolution and is sound also transmitted across?
-
How to parse XML using SAX Parser sequencially
I have a requirement to parse XML file sequencially. But I need to stop the parsing in-between for doing some processing. Let me explain with example I have a file with following structure. <InputFile> <Invoice> <InvoiceNo = "Inv1"/> <InvoiceDt
-
How to add a link button in system form?
how to add a link button in system form in the edit text?
-
Hi, I am just wondering if there is a limitation on using the <IN>-tag in a CAML-Query on external lists. Whenever I try to use it, I get this error: Original error: Microsoft.SharePoint.SPException: Search could not be performed. The underlying CAML