Printing a Table Control AND ALV grid from same report
Hello,
I am trying to figure out how to print the output of my report, which consist of a table control and a OO-driven ALV grid under it. i tried several possibilities but I only get the ALV in my spool....?
Answers will be rewarded !
Keep a break point in that method. Press print in the ALV, check it stops in the break point. If yes then you can use write statement, the values what ever u r writing it come in the print-out. If the control doesn't stop in the break point then there is some problem in the method declartion.
Check my code - I written every thing in the global declaration.
ALV Class Definition
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_top_of_list
FOR EVENT print_top_of_list OF cl_gui_alv_grid,
handle_end_of_list
FOR EVENT print_end_of_list OF cl_gui_alv_grid.
ENDCLASS. "lcl_event_receiver DEFINITION
DATA: o_event_receiver TYPE REF TO lcl_event_receiver.
ALV Class Implementation
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_top_of_list.
DATA: lws_top1(20) TYPE c,
lws_top2(150) TYPE c,
lws_top3(150) TYPE c,
lws_len_file TYPE i,
lws_file(80) TYPE c,
lws_file1(100) TYPE c,
lws_file2(100) TYPE c,
lws_file3(100) TYPE c.
WRITE: / text-001.
*Date
CONCATENATE text-008 ws_date INTO lws_top1 SEPARATED BY space.
WRITE : /1 lws_top1.
Source File Name
WRITE: / text-009.
lws_len_file = STRLEN( p_upload ).
IF lws_len_file < 80.
MOVE p_upload TO lws_top2.
WRITE : /1 lws_top2.
ELSE.
MOVE p_upload TO lws_file.
MOVE p_upload+80(48) TO lws_file1.
DO.
IF lws_file+79(1) EQ '\'.
EXIT.
ELSE.
CONCATENATE lws_file+79(1) lws_file2 INTO lws_file2.
SHIFT lws_file RIGHT.
ENDIF.
ENDDO.
IF lws_file2 IS INITIAL.
MOVE lws_file TO lws_top2.
WRITE : /1 lws_top2.
WRITE : /1 lws_file1.
ELSE.
CONDENSE lws_file.
MOVE lws_file TO lws_top2.
WRITE : /1 lws_top2.
CONCATENATE lws_file2 lws_file1 INTO lws_file3.
WRITE : /1 lws_file3.
ENDIF.
ENDIF.
ENDMETHOD. "handle_top_of_list
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
Regards,
Prakash.
Similar Messages
-
Maximum number of character we can print in a column uing ALV grid display
Hi frnds,
My requirment is to print 500 charcter data in a column using ALV grid display.
Could any body tell me is it possible and the maximum character it can i print in a column using ALV grid dispaly.
Regards,
SandipanHi Sandipan,
refer notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters.
857823 - ALV grid: Strings with a maximum of 128 characters
Symptom
Entries in cells of the type CHAR or string are truncated after 128
characters in the SAP GUI.
also refer,
ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
(Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
Cause and Prerequisites
The data table that is sent to the front end only allows character values
with the length 128.
Solution
This is the standard system behavior and cannot be changed. -
Differences between the alv's and alv grid dispaly
hi guys
.........please send the differences between the alv's and alv grid display.
thanks....Hi Midathala,
Plz go through the links might be useful to you.
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
Check the program in the following link:
http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
13. Top-of-page in ALV
selection-screen and top-of-page in ALV
14. ALV Group Heading
http://www.sap-img.com/fu037.htm
How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
15. ALV output to PDF conversion
It has an example code for PDF Conversion.
http://www.erpgenie.com/abap/code/abap51.htm
converting the output of alv in pdf
Thanks
Mohinder Singh Chauhan -
How to insert row in table control and save the data in tables
Hi,
I have one table control i am displaying data into table control ,
my problem is : i want to display data into read mode in table control.
but when i click on insert button on the same screen i want one blank line should inserted into table control , then i want to insert some data into table control on that row , when i click the save button . the new data inserted into the table control is insert that data into ztable ,
please give me solution
main problen is how can know inserted line in table control and pass that data into ztable.Hi,
Follow the below logic,
PROCESS BEFORE OUTPUT.
MODULE STATUS_0001.
MODULE POPULATE_TABLE_CONTROL. --> Get the data from table store in
ITAB
LOOP AT GT_CTRL_LP_D516 INTO GS_WA_CTRL_LP_D516
WITH CONTROL CTRL_LP_D516
CURSOR CTRL_LP_D516-CURRENT_LINE.
The following module moves data to control
MODULE MOVE_TO_CONTROL.--> Move data from ITAB to table control
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT GT_CTRL_LP_D516.
ENDLOOP.
MODULE EXIT AT EXIT-COMMAND.
MODULE USER_COMMAND_0001. --> Here you have to take out the values from table control and update database table
Reward points if helpful.
Thanks and regards,
Mallareddy Rayapureddy,
Munich, Germany. -
What are the uses of table control and tabstrip control
can anyone tell me the uses of table control and tabstrip control
Hi,
table control is more comfortable for customizing.scroll bars all possible in this.where as it is not possible in step loops.
check this example.
PROGRAM ZBHTCTRL.
TABLES: LFA1, EKKO.
DATA: OKCODE1 LIKE SY-UCOMM,
OKCODE2 LIKE SY-UCOMM.
CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.
DATA: BEGIN OF ITAB OCCURS 0,
MANDT LIKE EKKO-MANDT,
EBELN LIKE EKKO-EBELN,
BSTYP LIKE EKKO-BSTYP,
BSART LIKE EKKO-BSART,
END OF ITAB.
MODULE USER_COMMAND_1000 INPUT.
CASE OKCODE1.
WHEN 'BACK'.
SET SCREEN 0.
WHEN 'NEXT'.
SET SCREEN 1001.
SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE
LIFNR = LFA1-LIFNR.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 INPUT
MODULE MOVE_DATA OUTPUT.
EKKO-MANDT = ITAB-MANDT.
EKKO-EBELN = ITAB-EBELN.
EKKO-BSTYP = ITAB-BSTYP.
EKKO-BSART = ITAB-BSART.
ENDMODULE. " MOVE_DATA OUTPUT
MODULE USER_COMMAND_1001 INPUT.
CASE OKCODE2.
WHEN 'BACK'.
SET SCREEN 1000.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 OUTPUT
MODULE STATUS_1001 OUTPUT.
SET PF-STATUS 'MENU'.
SET TITLEBAR 'TIT'.
ENDMODULE. " STATUS_1001 OUTPUT
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'DMENU'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1000 OUTPUT
FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.
CALL METHOD CMENU->LOAD_GUI_STATUS
EXPORTING
PROGRAM = ' ZBHTCTRL'
STATUS = 'CMENU'
MENU = CMENU.
CALL METHOD CMENU->ADD_FUNCTION
EXPORTING
FCODE = 'RX'
TEXT = 'RECIEVE'.
ENDFORM.
FLOW LOGIC:
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
PROCESS BEFORE OUTPUT.
MODULE STATUS_1001.
LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.
MODULE MOVE_DATA.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1001.
LOOP AT ITAB.
ENDLOOP.
for more info check this link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
thanks
Ashu. -
Table control and a selection screen
Hi,
I have a requirement where I am supposed to be designing a screen that has a table control with fields
w/selection column label 1(non-editable) i/o field(from) i/o field(to)
w/selection column label 2(non-editable) i/o field(from) i/o field(to)
On searching the forum threads, I found related threads as to how to implement a selection screen (as the I/O fields are similar to select-options) in module pool programming. But mine requires the use of table control and a kind of selection screen embedded into it. Please guide me through this requirement.Hi
If you need to implement a table control on selection screen u need to use a tabstrip as graphic element supports the table control.
So
1 - Step: define a tabstrip with 1 tab only:
SELECTION-SCREEN BEGIN OF BLOCK 3.
SELECTION-SCREEN BEGIN OF TABBED BLOCK MAX FOR 22 LINES.
SELECTION-SCREEN TAB (25) TABS1 USER-COMMAND UCOMM1
DEFAULT SCREEN 100.
SELECTION-SCREEN END OF BLOCK MAX.
SELECTION-SCREEN END OF BLOCK 3.
2 - Step design the subscreen (in my sample the dynrpo 100) and insert the table control there:
PROCESS BEFORE OUTPUT.
MODULE INIT_CTRL.
LOOP WITH CONTROL T_CTRL.
MODULE DISPLAY_DATA.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL T_CTRL.
MODULE UPDATE_DATA.
ENDLOOP.
In the module DISPLAY_DATA and UPDATE_DATA u need to implement the code to transfer the data from internal table to table control and from table control to internal table, in order to display and update the data.
Max -
HI Gurus,
i have to following requirement,
i have to make a screen in which there would be four fields
name xxx
age x
date xx.xx.xx
time xx xx xx
the screen fields are to by filled by the user at the run time and this data should be saved in the data base table(say ztable)
so as far i have understood i need to create a screen with a table control and a database table to save the data of the table control (after the user press save buttom)
please help me how to create a table control
and also
help me with the logic of calling the screen(this screen with table control)
also the logic of save butoom too
please help as soon as possible
points will be surely awarded ..
thanks in advance
anujuse this eg to your requirement
PROGRAM YTABLEDML .
TABLES : KNA1.
DATA : ITAB LIKE KNA1 OCCURS 0 WITH HEADER LINE.
CONTROLS : VCONTROL TYPE TABLEVIEW USING SCREEN '100'.
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'INSERT'.
MOVE KNA1 TO ITAB.
APPEND ITAB.
INSERT INTO KNA1 VALUES ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'INSERTED'.
ELSE.
MESSAGE E001(0) WITH 'NOTINSERTED'.
ENDIF.
WHEN 'UPDATE'.
MOVE KNA1 TO ITAB.
APPEND ITAB.
UPDATE KNA1 FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'NOTUPDATED'.
ENDIF.
WHEN 'DELETE'.
MOVE KNA1 TO ITAB.
APPEND ITAB.
DELETE FROM KNA1 WHERE KUNNR = ITAB-KUNNR.
MESSAGE I000(0) WITH 'DELETED'.
IF SY-SUBRC = 0.
ELSE.
MESSAGE E001(0) WITH 'NOTDELETED'.
ENDIF.
ENDCASE.
ENDMODULE.
MODULE USER_EXIT INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
CALL TRANSACTION 'SE38'.
ENDCASE.
ENDMODULE.
*PROCESS BEFORE OUTPUT.
*LOOP WITH CONTROL VCONTROL.
*ENDLOOP.
MODULE STATUS_0100.
*PROCESS AFTER INPUT.
*LOOP WITH CONTROL VCONTROL.
MODULE USER_COMMAND_0100.
ENDLOOP.
*MODULE USER_EXIT.
TCODE IS YDMLTAB. -
How do I click on a cell in a table control, and display the value in a string?
What I would like to do is to click on a cell in a table control, and have the value of the cell be displayed in a string indicator. What ever cell I click on, I would like the value to be displayed in the indicator.
Thank you!
Solved!
Go to Solution.... or
Event >>> ouse down for table.
Use Coords" to feed invoke node "point To Row Column" and returned "Cell Postion" can be unbundled to produce the row and column tht can be used to index out the value.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
what are the differances between table controls and step loops?
Hi
It's only graphic diff. managed by diff. ways (of course):
in steploop there isn't a table control so in PBO and PAI it has only the stataments LOOP/ENDLOOP or LOOP AT ITAB/ENDLOOP.
The step loop is way older than table control to display the data of a table.
check this
Re: step loops, table controls
-charitha. -
Fetch Table name and field name from a given entry
Hi ,
i know the entry which is present in the database .But i don't know the table name and field name which has that entry .
i have to fetch the table name and field name from a given entry .
Can anyone suggest me how will i fetch the table name and field name for a given entry .
thanks in advance.Hi ,
i know the entry which is present in the database .But i don't know the table name and field name which has that entry .
i have to fetch the table name and field name from a given entry .
Can anyone suggest me how will i fetch the table name and field name for a given entry .
thanks in advance.
Few more options to scan specific text in entire DB:
http://www.mssqltips.com/sqlservertip/1525/scan-a-sql-server-database-for-objects-and-columns-containing-a-given-text-value/
http://solutioncenter.apexsql.com/quickly-search-for-sql-database-data-and-objects/
Cheers,
Vaibhav Chaudhari
[MCTS],
[MCP] -
Field symbol has not yet been defined-ALV Grid Display in Report
Hi all,
Iam calling a Function module for ALV grid display in Report programming. Its throwing the Error message Field Symbol has not yet defined. Can any one suggest what i have to do regarding it?Hi,
<li> This is problem with fieldcatalog.
<li> Check field names or table name in small letters in quotes while building fieldcatalog internal table
<li> Check the fieldcatalog internal table , whether it has same fields as in data table which is shown using GRID_DISPLAY function module.
Thanks
Venkat.O -
What is the use of table control in bdc is it same in module pool table con
Hi,
What is the use of table control in bdc is it same in module pool table control?
regards
eswarHi,
Table control means it contains as table and it will scroll in vertical and horizontal.
In module pool by using screen we can create new table control.
But BDC table control means here we can populate the data into the table control.
i.e.if you take VA01 for sales order creation in the belwo of VA01 screen there is table control for the filling of material details so here we will write the code to populate the data into the table control screen.
Thanks and regards,
shyla -
Has anyone used switch control and siri at the same time?
Has anyone used accessibility switch control and siri at the same time?
Using Xmarks and Sync simultaneously will create a mess.
You can create a new profile, import the bookmarks from your main profile, and set up Sync for the new profile.
The flip side is, bookmarks from your main profile would not get synced with your new profile.
Alternatively, Xmarks is also available for Android.
https://play.google.com/store/apps/details?id=com.xmarks.android&hl=en -
How can you create a playlist on Ipod touch with music and music video, and play those from same playlist through Apple TV? I can download, create a playlist with both music and music video, stream that through the Apple TV with no problem. The sound and the information show up on the TV, but when it gets to a music video, it only shows the information and "artwork".
I also have a video playlist - videos play fine through the Apple TV, but will not shuffle through all videos - continues to repeat the same one. I have most definitely selected shuffle in both locations - from the playlist and on the ipod video screen while video is playing.I finally got it... had to sync the photos with the music in iMovie, arrange the voiceover in GarageBand then export to iTunes, and then I was able to put it all together in iMovie and burn in iDVD... had a few glitches along the way but finally finished : )
Message was edited by: jpewald -
While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट. Word file generated of the same report have correct hindi इ matra position and also pdf generated from this word file also contains the same.
Maybe you are looking for
-
How to use Site collection url in feature xml
Hello Experts, I think i am asking a very simple question but this question has realy desturbed me. I want to deploy 2 script files using modules in style library. here is elements.xml file of module. <?xml version="1.0" encoding="utf-8"?> <Elements
-
HT4972 I cannot update ios5 in my ipad?
IN the settings when i select general the con softwre updates do not appear
-
Categories missing from transactions (Employee Requests)
Hi, We are on SAP 5.0, using EIC scenario We have an issue, 1) User create a employee request and select 4 level categories defined 2) Saves the document, does some activity like changing the partners or so on and comesback using bread crumps Problem
-
hi when doing goods inward getting error: profit centrer xxx doesnt exist for 3.12.2007. we assigned prifit centre in material but showing error with other proft center doesnt exist. plz give me solution urgent, advance thanks, reddy
-
Hi I want to spool output based on a column name from a select query. Based on another post, I wrote the script below, but it prompts be for a file name. I have tried moving the spool command to after the select statement, but it only seems to write