ALV Report with Logo .. Print Out Problem
Hello Guys..
I am facing and differerent problem , I have created one Report in ALV contain logo of my company and some other details as per selection screen.
At the time of taking printoput the logo is not coming in print out only report data is coming.
How I take logo and ALV report in one print out .
Please do the needful.
Regards
Swati....
We Can't take logo of ALV in print out.
Similar Messages
-
OO: ALV + Header w/ logo print out
Hi everyone!
I have a container splitted in two: one for a Header area in wich I add a logo and some header texts, and the other split for an ALV Grid.
The problem comes when I call the method PRINT_DOCUMENT from CL_DD_DOCUMENT. It print out only the header, but not the data in ALV Grid. Why is that? Is there any way to archieve this?
Thanx in advance.Have u handled te print_top_of_page?
* Class definition :
* CLASS v_lcl_event_receiver DEFINITION
CLASS v_lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_print_top_of_page FOR EVENT print_top_of_page OF
cl_gui_alv_grid,
handle_top_of_page FOR EVENT top_of_page OF
cl_gui_alv_grid.
ENDCLASS.
* CLASS V_LCL_EVENT_RECEIVER IMPLEMENTATION
CLASS v_lcl_event_receiver IMPLEMENTATION.
METHOD handle_print_top_of_page.
IF sy-pagno = 1.
PERFORM top_of_page.
ENDIF.
ENDMETHOD.
METHOD handle_top_of_page.
PERFORM top_of_page.
ENDMETHOD.
ENDCLASS.
DATA: v_event_receiver TYPE REF TO v_lcl_event_receiver.
FORM top_of_page.
WRITE: text-020,
ENDFORM. " top_of_page
In PBo of the screen
DATA: v_split TYPE REF TO cl_gui_easy_splitter_container,
v_contnr_top TYPE REF TO cl_gui_container,
v_contnr_bot TYPE REF TO cl_gui_container,
v_grid_02 TYPE REF TO cl_gui_alv_grid,
v_html TYPE REF TO cl_dd_document,
v_text20(255) TYPE c,
v_text16(255) TYPE c,
FORM f9000_objects_create.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
Create a container
CREATE OBJECT o_dockingcontainer
EXPORTING
ratio = '95'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-e01."Error in creating Docking container
LEAVE LIST-PROCESSING.
ENDIF.
CREATE OBJECT v_split
EXPORTING
parent = o_dockingcontainer
* ORIENTATION = 0
sash_position = 25
with_border = 0
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
others = 3.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-e01."Error in creating Docking container
LEAVE LIST-PROCESSING.
ENDIF.
* Get the containers of the splitter control
v_contnr_top = v_split->top_left_container.
v_contnr_bot = v_split->bottom_right_container.
CREATE OBJECT o_alvgrid
EXPORTING
i_parent = o_dockingcontainer.
* Create an instance of alv control
CREATE OBJECT o_alvgrid
EXPORTING i_parent = v_contnr_bot.
* Object for display of selection parameters in HTML top container
CREATE OBJECT v_html
EXPORTING
style = 'ALV_GRID'.
* Must be after the SET HANDLER for TOP_OF_PAGE and foreground only
CALL METHOD o_alvgrid->list_processing_events
EXPORTING i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = v_html.
v_text20 = text-020(summary Record counts)Any text.
CALL METHOD v_html->add_gap
EXPORTING
width = 120.
CALL METHOD v_html->add_text
EXPORTING
text = v_text20.
CALL METHOD v_html->new_line.
** Display Text-016
v_text16 = text-016.
CALL METHOD v_html->add_gap
EXPORTING
width = 1.
CALL METHOD v_html->add_text
EXPORTING
text = v_text16.
v_text16 = v_sap_recon.
CALL METHOD v_html->add_gap
EXPORTING
width = 1.
CALL METHOD v_html->add_text
EXPORTING
text = v_text16.
CALL METHOD v_html->new_line.
* Display the data
CALL METHOD v_html->display_document
EXPORTING
parent = v_contnr_top.
* Handle the event
CALL METHOD o_alvgrid->list_processing_events
EXPORTING i_event_name = 'PRINT_TOP_OF_PAGE'.
IN PBO while populating in the output table
FORM f9004_display_data TABLES p_report_tab
p_fieldcat.
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_a
is_layout = w_layout
CHANGING
it_outtab = p_report_tab[]
it_fieldcatalog = p_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i000 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
* Create object
IF v_event_receiver IS INITIAL.
CREATE OBJECT v_event_receiver.
ENDIF.
SET HANDLER v_event_receiver->handle_print_top_of_page FOR o_alvgrid.
SET HANDLER v_event_receiver->handle_top_of_page FOR o_alvgrid. -
Print or download ALV report with sort options
Dear friends,
How i can download into excel or print ALV report with sort options, like customer name column with similar values should not repeat in the print out or download file.
Regards,
Praveen LoboHi Praveen,
Use this code, its working:-
*FOR SORTING DATA
DATA : it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
* SORT W.R.T. CUSTOMER NAME
wa_sort-spos = 1.
wa_sort-fieldname = 'NAME1'. "field customer name
wa_sort-tabname = 'IT_KNA1'. "internal table with records
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
"this will sort the ALV o/p for customer with same name
"now the name will not be repeated
"records with same name will be grouped
* DISPLAY RECORDS IN ALV GRID
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid "report id
it_fieldcat = it_field "field catalog
it_sort = it_sort "sort info
TABLES
t_outtab = it_kna1 "internal table
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
Edited by: Tarun Gambhir on Dec 31, 2008 1:13 PM -
Canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors
canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors
i have prfiled the mac and printer wiht colormunki and uplodated the profile sucessfully
i set the printer to correct icc profile
print out comes out same with glazed colors and missing tones/colors
however when i use the same printer on windows and with light room, following same icc profile, colormunki calibrated profile, the print our are excellent.
i have also tried using printer manage profile using the Mac and Aperture and get same poor prints
can you please assist and thanksI've a Pro9000 and also use Colormunki successfully.
When I use Colormunki, I calibrate both of my monitors and the printer/paper combination. Colormunki saves the generated profiles to the correct places -- I don't load or change any profiles after that as that would mess-up what the Colormunki had just done for me, and this would likely mess-up the prints.
Though I double-check the settings in the print dialogue, the choice for the printer handling things is already grayed-out. Colorsync handles it all just fine. -
Create a Procedural ALV Report with editable fields and save the changes
Hi,
I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
BCALV_TEST_GRID_EDIT_01
BCALV_TEST_GRID_EDIT_02
BCALV_TEST_GRID_EDIT_04_FORMS
BCALV_TEST_GRID_EDITABLE
BCALV_EDIT_01
BCALV_EDIT_02
BCALV_EDIT_03
BCALV_EDIT_04
BCALV_EDIT_05
BCALV_EDIT_06
BCALV_EDIT_07
BCALV_EDIT_08
BCALV_FULLSCREEN_GRID_EDIT
But all these are using OO Concepts.
Please help.
Regards,
SmruthiTABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
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,
line_color(4) TYPE c, "Used to store row color attributes
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.
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-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-edit = 'X'
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-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-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-info_fieldname = 'LINE_COLOR'.
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_pf_status_set = 'STATUS'
i_callback_top_of_page = 'TOP-OF-PAGE'
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.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
DATA: ld_color(1) TYPE c.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekko.
LOOP AT it_ekko INTO wa_ekko.
ld_color = ld_color + 1.
IF ld_color = 8.
ld_color = 1.
ENDIF.
CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
MODIFY it_ekko FROM wa_ekko.
ENDLOOP.
ENDFORM. " DATA_RETRIEVAL
FORM top-of-page *
FORM top-of-page.
WRITE:/ 'This is First Line of the Page'.
ENDFORM.
FORM status *
FORM status USING rt_extab TYPE slis_t_extab. .
SET PF-STATUS 'ALV'.
ENDFORM.
FORM USER_COMMAND *
--> RF_UCOMM *
--> RS *
FORM user_command USING rf_ucomm LIKE sy-ucomm
rs TYPE slis_selfield.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
CASE rf_ucomm.
when 'SAVE'.
get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
endcase.
endform.
ENDFORM.
here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
create a custom PF status and create push buttons and assign your ok codes in your PF status.
if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
Hope this will help you.
Regards,
phani. -
Photoshop 11 Size Print -out Problem
I have recently purchased and installed Photoshop 11 and I am having problems with my print-out. I am specifying an A5 size print, it is being shown on the preview as being 1/2 of A4 but is printing out as a 6" x 4" . I have tried thios several times but I am unable to overcome this problem. Is this a program error or can you offer me a solution for this problem?
Best regards, Evan ThomasMake sure that 'Scale to fit' is not checked in the print-dialogue box, and that the scale is set to 100% (bearing in mind that your document size must be correctly set in Photoshop before you print).
-
ALV Reporting with drill down capabillities
I'm creating a abap custom report using the ALV. I want to drill down to CJ03 which is projects. I know how to do it in regular custom reporting, but I don't seem to be able to get it to work using the ALV. Can anyone help?
Thanks.
LindaHi Linda,
Take a look at this sample program. The logic to handle any interaction with the user is in my "PORCESS_USER_COMMANDS" routine.
This is defined in the "I_CALLBACK_USER_COMMAND" parameter in the ALV FM.
Hope this helps.
Cheers,
Pat.
[code]
Modification History
Date | Author | Chg Req # | Description
15.08.2001| Pat Yee | $TMP | Program Creation
This program is an example of how the ALV Display works.
It will display Customer Data.
This report will also show how to display an ALV report with different
colored lines and icons
REPORT zpat.
Include Programs
INCLUDE <icon>.
Database Tables
TABLES: kna1. "Customer Master
Types
TYPE-POOLS: kkblo.
Structures
Structure to hold the Color Information
DATA: BEGIN OF st_color,
color(3) TYPE c,
END OF st_color.
Structure to hold the Icon Information
DATA: BEGIN OF st_icon,
icon(4) TYPE c,
END OF st_icon.
ALV Field Catalog Structure
DATA: st_fieldcat TYPE slis_fieldcat_alv.
ALV Layout Structure
DATA: st_layout TYPE slis_layout_alv.
Internal Tables
Output Table
DATA: BEGIN OF tbl_kna1 OCCURS 0.
INCLUDE STRUCTURE st_icon. "Icon Structure
INCLUDE STRUCTURE kna1. "Customer Master Structure
INCLUDE STRUCTURE st_color. "Color Structure
DATA: END OF tbl_kna1.
ALV Field Catalog Table
DATA: tbl_fieldcat TYPE slis_t_fieldcat_alv.
Variables
DATA: fieldname(30) TYPE c,
g_repid LIKE sy-repid.
Start of Selection
START-OF-SELECTION.
g_repid = sy-repid.
PERFORM get_data.
End of Selection
END-OF-SELECTION.
PERFORM do_fancy_stuff.
PERFORM get_layout.
PERFORM get_fieldcat.
PERFORM create_report.
*& Form CREATE_REPORT
Learn to read the subroutine name!
FORM create_report.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
i_callback_program = g_repid
i_callback_user_command = 'PROCESS_USER_COMMANDS'
it_fieldcat = tbl_fieldcat
i_default = 'X'
i_save = ' '
is_layout = st_layout
TABLES
t_outtab = tbl_kna1
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. " CREATE_REPORT
*& Form GET_FIELDCAT
Build the Field Catalog
FORM get_fieldcat.
Here the field catalog is created. To display more fields simply
'uncomment' the additional lines and add the field name. Also note
that the field catalog is much more powerful than this. You can
intensify fields, change the colour, assign reference fields, etc.
Look at type slis_fieldcat_alv for more options.
PERFORM write_fieldcat USING 'ICON' 'TBL_KNA1' ' ' 'X' 1 '2' 'X'
PERFORM write_fieldcat USING 'KUNNR' 'TBL_KNA1' 'KNA1' 'X' 2 ' ' ' '
PERFORM write_fieldcat USING 'NAME1' 'TBL_KNA1' 'KNA1' ' ' 3 '10' ' '
'X'.
PERFORM write_fieldcat USING 'STRAS' 'TBL_KNA1' 'KNA1' ' ' 4 ' ' ' '
PERFORM write_fieldcat USING 'TELF1' 'TBL_KNA1' 'KNA1' ' ' 5 ' ' ' '
PERFORM write_fieldcat USING 'ORT01' 'TBL_KNA1' 'KNA1' ' ' 6 ' ' ' '
PERFORM write_fieldcat USING 'PSTLZ' 'TBL_KNA1' 'KNA1' ' ' 7 ' ' ' '
PERFORM write_fieldcat USING 'SORTL' 'TBL_KNA1' 'KNA1' ' ' 8 ' ' ' '
PERFORM write_fieldcat USING 'ERNAM' 'TBL_KNA1' 'KNA1' ' ' 9 ' ' ' '
PERFORM write_fieldcat USING 'SPRAS' 'TBL_KNA1' 'KNA1' ' ' 10 ' ' ' '
perform write_fieldcat using ' ' 'TBL_KNA1' 'KNA1' ' ' 10 ' '.
perform write_fieldcat using ' ' 'TBL_KNA1' 'KNA1' ' ' 11 ' '.
perform write_fieldcat using ' ' 'TBL_KNA1' 'KNA1' ' ' 12 ' '.
ENDFORM. " GET_FIELDCAT
*& Form WRITE_FIELDCAT
Write the Field Catalog data to the Field Catalog Table
-->name Field name
-->tab Table name
-->st Structure Name
-->key Is this field a Key?
-->pos Position Number
-->length Field Length
-->icon Display as Icon
-->hot Hotspot
FORM write_fieldcat USING name tab st key pos length icon hot.
st_fieldcat-fieldname = name.
st_fieldcat-tabname = tab.
st_fieldcat-ref_tabname = st.
st_fieldcat-key = key.
st_fieldcat-col_pos = pos.
st_fieldcat-outputlen = length.
st_fieldcat-icon = icon.
st_fieldcat-hotspot = hot.
APPEND st_fieldcat TO tbl_fieldcat.
CLEAR st_fieldcat.
ENDFORM. " WRITE_FIELDCAT
*& Form PROCESS_USER_COMMANDS
Interactive Reporting Commands
FORM process_user_commands USING syst-ucomm LIKE syst-ucomm
selfield TYPE slis_selfield.
This subroutine is called when there is user interaction in the output
In this case if the user double clicks the Customer Number then the
program will call transaction XD03 and display the Customer Master
Data
CASE syst-ucomm.
WHEN '&IC1'.
get cursor field fieldname.
READ TABLE tbl_kna1 INDEX selfield-tabindex.
SET PARAMETER ID 'KUN' FIELD tbl_kna1-kunnr.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. " PROCESS_USER_COMMANDS
*& Form GET_LAYOUT
set the layout of the ALV.
add color to the row?
FORM get_layout.
st_layout-info_fieldname = 'COLOR'.
st_layout-colwidth_optimize = 'X'.
st_layout-get_selinfos = 'X'.
ENDFORM. " GET_LAYOUT
*& Form get_data
Get some data to play with
FORM get_data.
SELECT * FROM kna1 INTO CORRESPONDING FIELDS OF TABLE tbl_kna1
UP TO 30 ROWS.
ENDFORM. " get_data
*& Form do_fancy_stuff
Do some fancy pants stuff for example changing the color of
lines and adding icons
FORM do_fancy_stuff.
Here we will demonstrate changing the color of ALV Record lines as
well as displaying Icons
LOOP AT tbl_kna1.
All records where NAME1 begins with 'M', will be displayed in Bluish
Green
IF tbl_kna1-name1(1) EQ 'M'.
tbl_kna1-color = 'C41'. "Bluish Green
MODIFY tbl_kna1 TRANSPORTING color.
ENDIF.
All records with no TELF1 will be displayed in White and have a
Warning Icon
IF tbl_kna1-telf1 IS INITIAL.
tbl_kna1-color = 'C00'. "White
tbl_kna1-icon = '@AH@'. "Warning Icon
MODIFY tbl_kna1 TRANSPORTING icon color.
ENDIF.
ENDLOOP.
ENDFORM. " do_fancy_stuff[/code] -
Hi Experts,
I am having problem while taking print out of Alv report format. In that report, 1 column contains Unit Values.
Eg. Unit value - 'LE' , AFTER USING CONVERSION EXIT LOGIC it is converted into 'AU' which is finally displayed in the Alv -Report display format.
while taking Print-out of that report , that field Unit Value 'AU' is Shown in this format "****'.
Please give me your Valuable Suggestions.
Thanks and Regards
BalaNarasimman Mwhile defining filed catalog define the data type also
clear l_fieldcat.
l_fieldcat-fieldname = 'MEINS'.
l_fieldcat-datatype = 'UNIT'.
l_fieldcat-no_out = ' '.
l_fieldcat-do_sum = 'X'.
l_fieldcat-seltext_l = 'UOM'.
append l_fieldcat to p_fieldtab.
may be it would help.
anya -
PROBLEM WITH LOGO PRINTING IN REVERSE DIRECTION
HI,
When Ever I take the print out of the checks, The company logo is getting printed in reverse direction, but if i look at the print preview , it is showing up correctly. even if i take the print out of just the logo from SE78, the logo is getting printed out in reverse direction...I think it is the problem with the printer settings, but i m not sure. Can any one please help me out with this issue,
Regards,
RaghuHi,
Are you trying to get this print directly from the backend or some frondend application triggers your form? As I also faced same problem many a times but then observed that when smartform was triggered from frontend, logo was always in its right position.
Regards,
Shikha -
Download ALV report with layout to application server
Hi Gurus,
I have a problem as follows:
I have one ALV Grid report. This report is very time consuming.
That is why, user wants this to be run in background every night and in the morning when user comes to the office that ALV report should be on user's drive in excel format.
However, it should run with one specific variant and that variant should be dynamically populated. (I have handled this part)
It should also apply specific layout that has many filtering conditions.
As I can not download ALV to excel in background, I decided to download it to the Application server.
My problem is that when run in background, in spool ALV report shows o/p with proper filter conditions that is 5 out of 20 records.
But, when I write this report o/p to Application server, it writes all the records in there, i.e., all 20 records. It does not take into account all the filters. [:(]
I also tried downloading spool to excel, but o/p is not neatly formatted. All columns are fying here and there.
Any suggestion, how can I write ALV o/p to Application server with layout into consideration?
P.S. I have searched forum for this type of query, but no apt responses.
Thanksdid u downloaded the report with standard option provided in the alv and checked the data? that is populating all 20 records?. if so then use coding for achieving the standard one
at the end of selection do like this ..
SET USER-COMMAND ' %PC' .
and in the user-command use like this..
case sy-ucomm.
when ' %PC'.
give the file name ..
do processing ..
endcase. -
ALV REPORT WITH MULTIPLE BLOCKS
To print two blocks in a single ALV report, I have taken the sample and modified to my requirement. I am having the following problems in this code.
1. Columnwise total not appearing.
2. Amount and numbers in all the columns are
left justified instead of right justified.
The code written is given below. Kindly check the same and suggest for corrections.
--- SAMPLE 1--
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'.
PERFORM list_append TABLES IT_CTV
USING '1'
'IT_CTV'.
PERFORM list_append TABLES IT_APP
USING '2'
'IT_APP'.
PERFORM f_list_display.
FORM USER_COMMAND *
FORM user_command USING i_ucomm LIKE sy-ucomm
is_selfield TYPE slis_selfield. "#EC CALLED
ENDFORM. " USER_COMMAND
Form list_append
FORM list_append TABLES ut_table
USING u_no TYPE char1
u_tabname TYPE slis_tabname.
DEFINE m_fieldcat.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = &2.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA :
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
ls_sort TYPE slis_sortinfo_alv,
lt_sort TYPE slis_t_sortinfo_alv. " Sort table
DATA:
lt_events TYPE slis_t_event,
ls_event TYPE slis_alv_event,
ls_layout TYPE slis_layout_alv.
ls_layout-group_change_edit = 'X'.
ls_layout-colwidth_optimize = 'X'.
ls_layout-zebra = 'X'.
ls_layout-cell_merge = 'X'.
ls_layout-detail_popup = 'X'.
ls_layout-get_selinfos = 'X'.
ls_layout-max_linesize = '300'.
CASE u_no.
WHEN '1'.
ls_fieldcat-SELTEXT_L = ' REGION'.
ls_fieldcat-DO_SUM = 'X'.
m_fieldcat 'BZIRK' 'IT_CTV'.
ls_fieldcat-SELTEXT_L = ' CTV STOCK'.
m_fieldcat 'CTVST' 'IT_CTV'.
ls_fieldcat-SELTEXT_L = ' CTV VALUE'.
m_fieldcat 'CTVVL' 'IT_CTV'.
m_sort 'BZIRK'.
ls_fieldcat-DO_SUM = 'X'.
WHEN '2'.
ls_fieldcat-SELTEXT_L = ' REGION'.
m_fieldcat 'BZIRK' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' RFG STK'.
m_fieldcat 'RFGST' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' RFG VAL'.
m_fieldcat 'RFGVL' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' WM STK'.
m_fieldcat 'WMCST' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' WM VAL'.
m_fieldcat 'WMCVL' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' MCCS STK'.
m_fieldcat 'MOVST' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' MCCS VAL'.
m_fieldcat 'MOVVL' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' APP STK'.
m_fieldcat 'APPST' 'IT_APP'.
ls_fieldcat-SELTEXT_L = ' APP VAL'.
m_fieldcat 'APPVL' 'IT_APP'.
m_sort 'BZIRK'.
ENDCASE.
ls_fieldcat-COL_POS = 1.
ls_fieldcat-FIELDNAME = 'BZIRK'.
ls_fieldcat-DO_SUM = 'X'.
ls_fieldcat-FIX_COLUMN = 'X'.
APPEND ls_fieldcat TO lT_fieldcat.
IF u_no CA '13'.
MOVE 'TOP_OF_PAGE' TO ls_event-name.
CONCATENATE 'TOP_OF_PAGE' u_no INTO ls_event-form.
APPEND ls_event TO lt_events.
ELSE.
MOVE 'TOP_OF_LIST' TO ls_event-name.
CONCATENATE 'TOP_OF_LIST' u_no INTO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
it_fieldcat = lt_fieldcat
is_layout = ls_layout
i_tabname = u_tabname
it_events = lt_events
it_sort = lt_sort
TABLES
t_outtab = ut_table
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.
ENDFORM. " LIST_APPEND
Form f_list_display
FORM f_list_display.
DATA ls_print TYPE slis_print_alv.
ls_print-no_print_selinfos = 'X'. " Display no selection infos
ls_print-no_print_listinfos = 'X'. " Display no listinfos
ls_print-reserve_lines = 2. " Lines reserved for end of page
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
is_print = ls_print
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. " F_LIST_DISPLAY
Thanks in advance.
A S VINCENTHai Vincent
Check the following Code
*& Report ZALV_BLOCK *
REPORT ZALV_BLOCK NO STANDARD PAGE HEADING
MESSAGE-ID ZZ.
*..Type Definitions for ALV Report
TYPE-POOLS SLIS.
Table Declarations. *
TABLES: MARA, "Material Master
MARC, "Plant Data for Material
MARD, "Storage Location Data for Material
VBAP, "Sales Document: Item Data
VBUP. "Sales Document: Item Status
Internal table to store sales orders.......
DATA: BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "Sales Document
POSNR LIKE VBAP-POSNR, "Sales Document Item
KWMENG LIKE VBAP-KWMENG, "Cumulative order quantity in sales
" Units
END OF IT_VBAP.
internal table to store final data
DATA: BEGIN OF IT_FINAL OCCURS 0,
WERKS LIKE MARD-WERKS, "Plant
MATNR LIKE MARD-MATNR, "Material Number
LGORT LIKE MARD-LGORT, "Storage Location
LABST LIKE MARD-LABST, "Valuated stock with unrestricted use
INSME LIKE MARD-INSME, "Stock in quality inspection
RETME LIKE MARD-RETME, "Blocked Stock Returns
UMLME LIKE MARD-UMLME, "Stock in transfer
MAKTX LIKE MAKT-MAKTX, "Material description
VBELN LIKE VBAP-VBELN, "Sales Document
POSNR LIKE VBAP-POSNR, "Sales Document Item
KWMENG LIKE VBAP-KWMENG, "Cumulative order quantity in sales
" Units
END OF IT_FINAL.
ALV Type declaration *
*..Field Catalog for Basic List.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
*..Events For Basic List.
DATA : IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT.
*..Layout For Basic List
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
*..Sort Table For Basic List
DATA: IT_SORT TYPE SLIS_SORTINFO_ALV OCCURS 0 WITH HEADER LINE.
DATA DECLARATIONS *
DATA: V_FLAG,
VINDEX TYPE SY-TABIX,
TOTAL TYPE VBAP-KWMENG. "Open order quantity
*..To Store Program Name
DATA: V_REPID TYPE SYREPID.
*..To know whether basic list contains any data
Selection Screen. *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
S_WERKS FOR MARC-WERKS,
S_LGORT FOR MARD-LGORT.
SELECTION-SCREEN END OF BLOCK B1.
Event:Initialization *
INITIALIZATION.
V_REPID = SY-REPID.
AT Selection Screen. *
AT SELECTION-SCREEN.
PERFORM VALIDATIONS.
Event: Start-of-Selection *
START-OF-SELECTION.
To get data from vbap into internal table IT_VBAP
PERFORM FETCH_OPEN_DATA.
To get data into final internal table IT_FINAL
IF V_FLAG = 'X'.
PERFORM FETCH_FINAL_DATA.
ENDIF.
IF V_FLAG = ''.
MESSAGE I010 WITH 'NO DATA TO BE DISPLAYED'.
EXIT.
ELSE.
--Setting the FIELD CATALOG for ALV
PERFORM FILL_FIELDCAT_HEADER.
*-----Setting the LAYOUT for ALV
PERFORM GET_LAYOUT.
*-----Getting the ALV Events
PERFORM GET_EVENT.
*---- To Sort the list
PERFORM DO_SORT.
ENDIF.
Event: End-of-Selection *
END-OF-SELECTION.
*--Generating the ALV LIST DISPLAY
PERFORM DISPLAY_LIST.
FORM DEFINITIONS *
*& Form VALIDATIONS
To validate data in selection screen
--> p1 text
<-- p2 text
FORM VALIDATIONS.
PERFORM VALIDATE_MATNR.
PERFORM VALIDATE_WERKS.
PERFORM VALIDATE_LGORT.
IF NOT ( ( MARA-MATNR IS INITIAL ) AND
( MARC-WERKS IS INITIAL ) AND
( MARD-LGORT IS INITIAL ) ).
SELECT SINGLE MATNR
WERKS
LGORT
FROM MARD
INTO (MARD-MATNR, MARD-WERKS, MARD-LGORT)
WHERE MATNR = MARA-MATNR
AND WERKS = MARC-WERKS
AND LGORT = MARD-LGORT.
ENDIF.
ENDFORM. " VALIDATIONS
*& Form VALIDATE_MATNR
To validate MATNR
--> p1 text
<-- p2 text
FORM VALIDATE_MATNR.
IF NOT S_MATNR[] IS INITIAL.
SELECT MATNR
UP TO 1 ROWS
INTO (MARD-MATNR)
FROM MARA
WHERE MATNR IN S_MATNR.
ENDSELECT.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-001.
ENDIF.
ENDFORM. " VALIDATE_MATNR
*& Form VALIDATE_WERKS
To validate plant
--> p1 text
<-- p2 text
FORM VALIDATE_WERKS.
IF NOT S_WERKS[] IS INITIAL.
SELECT WERKS
UP TO 1 ROWS
INTO (MARD-WERKS)
FROM MARC
WHERE WERKS IN S_WERKS.
ENDSELECT.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-002.
ENDIF.
ENDFORM. " VALIDATE_WERKS
*& Form VALIDATE_LGORT
To validate storage
--> p1 text
<-- p2 text
FORM VALIDATE_LGORT.
IF NOT S_LGORT[] IS INITIAL.
SELECT LGORT
UP TO 1 ROWS
INTO (MARD-LGORT)
FROM MARD
WHERE LGORT IN S_LGORT.
ENDSELECT.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-003.
ENDIF.
ENDFORM. " VALIDATE_LGORT
*& Form FETCH_OPEN_DATA
To get data into internal table IT_VBAP
--> p1 text
<-- p2 text
FORM FETCH_OPEN_DATA.
IF NOT ( ( MARA-MATNR IS INITIAL ) AND
( MARC-WERKS IS INITIAL ) AND
( MARD-LGORT IS INITIAL ) ).
SELECT VBELN
POSNR
KWMENG
INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
FROM VBAP
WHERE MATNR IN S_MATNR
AND WERKS IN S_WERKS
AND LGORT IN S_LGORT.
ENDIF.
LOOP AT IT_VBAP.
SELECT * FROM VBUP
INTO VBUP
WHERE VBELN = IT_VBAP-VBELN
AND POSNR = IT_VBAP-POSNR
AND LFSTA NE 'C'.
ENDSELECT.
ENDLOOP.
IF SY-SUBRC NE 0.
REFRESH IT_VBAP.
MESSAGE E000 WITH TEXT-004.
EXIT.
ELSE.
V_FLAG = 'X'.
ENDIF.
To get sum of all quantities as open order quantity
LOOP AT IT_VBAP.
TOTAL = TOTAL + IT_VBAP-KWMENG.
ENDLOOP.
ENDFORM. " FETCH_OPEN_DATA
*& Form FETCH_FINAL_DATA
To get data into final internal table IT_FINAL
--> p1 text
<-- p2 text
FORM FETCH_FINAL_DATA.
SELECT A~MATNR
A~WERKS
A~LGORT
MAKTX
LABST
INSME
RETME
UMLME
VBELN
POSNR
KWMENG
INTO CORRESPONDING FIELDS OF TABLE IT_FINAL
FROM MARD AS A
INNER JOIN MAKT AS B
ON AMATNR = BMATNR
AND SPRAS = 'E'
INNER JOIN VBAP AS C
ON AMATNR = CMATNR
FOR ALL ENTRIES IN IT_VBAP
WHERE VBELN = IT_VBAP-VBELN
AND POSNR = IT_VBAP-POSNR
AND KWMENG = IT_VBAP-KWMENG
AND A~MATNR IN S_MATNR
AND A~WERKS IN S_WERKS
AND A~LGORT IN S_LGORT.
IF SY-SUBRC NE 0.
V_FLAG = SPACE.
MESSAGE E001 WITH 'No data found IN the selection criteria'.
EXIT.
ELSE.
V_FLAG = 'X'.
ENDIF.
ENDFORM. " FETCH_FINAL_DATA
*& Form FILL_FIELDCAT_HEADER
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT_HEADER .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
LOOP AT IT_FIELDCAT INTO WA_FIELDCAT.
CASE WA_FIELDCAT-FIELDNAME.
WHEN 'KWMENG'.
WA_FIELDCAT-COL_POS = '11'.
WA_FIELDCAT-OUTPUTLEN = '22'.
WA_FIELDCAT-SELTEXT_L = 'Net Value'.
WA_FIELDCAT-DO_SUM = 'X'.
ENDCASE.
MODIFY IT_FIELDCAT FROM WA_FIELDCAT INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " FILL_FIELDCAT_HEADER
*& Form GET_LAYOUT
text
--> p1 text
<-- p2 text
FORM GET_LAYOUT .
WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
ENDFORM. " GET_LAYOUT
*& Form GET_EVENT
text
--> p1 text
<-- p2 text
FORM GET_EVENT .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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.
LOOP AT IT_EVENTS INTO WA_EVENTS.
CASE WA_EVENTS-NAME.
WHEN 'TOP_OF_PAGE'.
WA_EVENTS-FORM = 'FILL_LIST_HEADER'.
WHEN 'USER_COMMAND'.
WA_EVENTS-FORM = 'PROCESS_BASIC_LIST'.
ENDCASE.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " GET_EVENT
FORM FILL_LIST_HEADER *
FORM FILL_LIST_HEADER.
WRITE:2'Report :' , SY-REPID,
: 85 ' Intelligroup Asia Pvt Ltd' CENTERED,
: 159 'Date :' ,SY-DATUM,
:/2'User :', SY-UNAME,
: 82 ' Hyderabad ' CENTERED ,
: 159 'Pg.No :' ,SY-PAGNO,
:/86 ' Stock Report ' CENTERED.
SKIP 2.
ENDFORM. "FILL_LIST_HEADER
*& Form DISPLAY_LIST
text
--> p1 text
<-- p2 text
FORM DISPLAY_LIST .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
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_LIST
*& Form do_sort
text
--> p1 text
<-- p2 text
FORM DO_SORT .
*-- Populating the sort table
IT_SORT-FIELDNAME = 'MATNR'.
IT_SORT-TABNAME = 'IT_FINAL'.
IT_SORT-UP = 'X'.
it_sort-subtot = 'X'.
APPEND IT_SORT.
ENDFORM. " do_sort
Thanks & Regards
Sreenivasulu P -
ALV report with internal in field symbol
Hi Shifu ABAP,
I have ALV report.
My problem is when I tried to do sum using the sum icon. I got a message 'desired operation cannot be performed for column 'Dignostic delay'. Is it because I used field symbol, then when I clicked on the column it didn't recorgnise the field.
FYI.
1)The internal table for my ALV report is stored in field symbol.
2)I dont have a problem to display the report.
3)I had to set 'do_sum' at ALV field category, still doesn't work
My source code to define ALV category.
loop at i_qpcd into wa_qpcd.
CLEAR ls_fieldcat2.
ls_fieldcat2-col_pos = pos2.
ls_fieldcat2-fieldname = wa_qpcd-code.
ls_fieldcat2-reptext_ddic = wa_qpcd-desc.
ls_fieldcat2-just = 'C'.
ls_fieldcat2-do_sum = 'X'.
APPEND ls_fieldcat2 TO gt_fieldcat2.
endloop.
My source code call the ALV FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZMPMR001_Q1OOT'
i_callback_pf_status_set = 'PF_STATUS_SET'
is_layout = ls_layout
it_fieldcat = gt_fieldcat2[]
is_print = ls_print
TABLES
t_outtab = <l_table>
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.
Thanks a lot in advance for your attention.my situation is like this, declare the internal tble
1) data : begin of itab occurs 0,
code like qpcd-code,
desc like QPCT-KURZTEXT,
end of itab.
2) populate the itab like this
code desc
01 desc 1
02 desc 2
03 desc 3
3) take the selected record converted it into new dynamic internal table using field symbol declare as table, now the component of this new table are 01, 02 and 03.
4) populate the new table with some data, so technically my new table structure will be like this
01 02 03
1 0 1
0 0 3
2 2 2
5) display the new table in ALV report, in ALV I tried to sum-up each of column.
6) Question : HOW can I convert the componet 01, 02 and 03 as an integer/numeric field.
Regards
Nislina -
ALV report run in background creates problem
hi All,
i have a ALV report which works fine in foreground but when i run the report in background
(Execute in beackground option) the job always gets cancelled.
As i was thinking that its due to quantity and currency field i passed the below parameters inMY FIELD CAT
w_fieldcat-CFIELDNAME = p_001.
w_fieldcat-CURRENCY = 'WAERS'.
w_fieldcat-CFIELDNAME = p_001.
w_fieldcat-QUANTITY = 'MEINS'.
Still the job gets cancelled always , can anybody help me with this issue?
Please give some useful suggestions?Hi Bhanu
After populating the Grid/List elements, may be you were using 'REUSE_ALV_LIST/GRID_DISPLAY' function module.
As some Function Modules will give problems in background execution,please call the same function module using CL_GUI_ALV_GRID => REUSE_ALV_LIST_DISPLAY for some cases it is the good solution.
Regards,
Sreeram Kumar.Madisetty -
Interactive alv report with migo miro and purchase order
hi all
to make my alv interactive i put the following code....
i dont know whether it is correct or not coz i hav not done alv before
FORM display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
is_layout = wa_layout
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = itab.
ENDFORM. "DISPLAY
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'EBELN'.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
SET PARAMETER ID 'ITAB-EBELN' FIELD ITAB-EBELN.
call transaction 'ME23N' AND SKIP FIRST SCREEN.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
this code is working
but i hav some problems
when ever i double click on PO number
1. it always opne the last PO number of the my alv list
2. I want to open the migo with migo number when i double clik on the migo number
3. and same for the MIRO
plz help its very urgent...
points wil b rewarded.Hi,
Following report will explains how to do interactive list in alv report regarding purchase order. Kindly go through that one.
REPORT YMS_ALVINTERSAMPLE NO STANDARD PAGE HEADING LINE-SIZE 650
MESSAGE-ID ZZ_9838.
TYPE-POOLS: SLIS.
*type declaration for values from ekko
TYPES: BEGIN OF I_EKKO,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
BUKRS LIKE EKKO-BUKRS,
BSART LIKE EKKO-BSART,
LIFNR LIKE EKKO-LIFNR,
END OF I_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
WA_EKKO TYPE I_EKKO.
*type declaration for values from ekpo
TYPES: BEGIN OF I_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF I_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
WA_EKPO TYPE I_EKPO .
*variable for Report ID
DATA: V_REPID LIKE SY-REPID .
*declaration for fieldcatalog
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
declaration for events table where user comand or set PF status will
be defined
DATA: V_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT.
declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
declaration for variant(type of display we want)
DATA: I_VARIANT TYPE DISVARIANT,
I_VARIANT1 TYPE DISVARIANT,
I_SAVE(1) TYPE C.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
DATA: I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM BUILD_FIELDCATLOG.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_REPORT.
*& Form BUILD_FIELDCATLOG
Fieldcatalog has all the field details from ekko
FORM BUILD_FIELDCATLOG.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'AEDAT'.
WA_FIELDCAT-SELTEXT_M = 'DATE.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'LIFNR'.
WA_FIELDCAT-NO_OUT = 'X'.
WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG
*& Form EVENT_CALL
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. "EVENT_CALL
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form data_retrieval
retreiving values from the database table ekko
FORM DATA_RETRIEVAL.
SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
ENDFORM. "data_retrieval
*& Form bUild_listheader
text
-->I_LISTHEADEtext
FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA HLINE TYPE SLIS_LISTHEADER.
HLINE-INFO = 'this is my first alv pgm'.
HLINE-TYP = 'H'.
ENDFORM. "build_listheader
*& Form display_alv_report
text
FORM DISPLAY_ALV_REPORT.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = I_TITLE_EKKO
I_GRID_SETTINGS =
IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'ZLAY1'
I_SAVE = 'A'
is_variant = i_variant
IT_EVENTS = V_EVENTS
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 TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
PERFORM BUILD_FIELDCATLOG_EKPO.
PERFORM EVENT_CALL_EKPO.
PERFORM POPULATE_EVENT_EKPO.
PERFORM DATA_RETRIEVAL_EKPO.
PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_EKPO.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG_EKPO
text
FORM BUILD_FIELDCATLOG_EKPO.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELP'.
WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MENGE'.
WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-SELTEXT_M = 'UOM'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'NETPR'.
WA_FIELDCAT-SELTEXT_M = 'PRICE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG_EKPO
*& Form event_call_ekpo
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL_EKPO.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. "event_call_ekpo
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT_EKPO.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form TOP_OF_PAGE
text
FORM F_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM DATA_RETRIEVAL_EKPO.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
ENDFORM.
FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: HLINE1 TYPE SLIS_LISTHEADER.
HLINE1-TYP = 'H'.
HLINE1-INFO = 'CHECKING PGM'.
ENDFORM.
FORM DISPLAY_ALV_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_EKPO
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT =
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKPO
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.
Thanks,
Sankar M -
hi!
I have a little problem with print out.
I want to print out like this:
about two cm space between each number.
I have 4 columns and 4 rows
for(){
System.out.println(a+" "+b+" "+ d+" "+e);
}How do I write?I think that you mean *\t*. :)
So the code would become:
System.out.println(a + "\t\t" + b + "\t\t" + d + "\t\t" + e);{code}
OR
{code}System.out.printf("%d\t\t%d\t\t%d\t\t%d", a, b, d, e);{code}
Maybe you are looking for
-
How to put 58 columns of data into an array in one shot?
I have a set of data with 58 columns and 5000 rows. However, I need to find offset for all the elements in this 5000x58 set of data. Is there an easier way to put all the data (offset) into an array in one shot other than using build array function?
-
Another techincal system for SRM is getting created in SLD
Hello All, I have a problem with duplicate Technical System being created automatically in our SLD. Since, there is no business system assigned to that, I am deleting that every day though It keeps on getting created every day. I understand that ther
-
Moving Pics Between Albums In Photos?
Is it possible to move a picture taken with the camera from the default album to a custom album, or create a new album on the fly to sort new pics taken with the camera or downloaded from an e-mail attachment or a web page? Seems only logical, but I
-
Adobe Indesign 1.5.2
I am using Windows XP SP2 on a Dell Optiplex 745 and I am having this problem. When I double-click on an InDesign file, the InDesign application starts, but the file doesn't open. I have to "manually" select Open and navigate to the file to open it.
-
Lexmark x4550 printer ink woes
Hi All, I have been wrestling with this printer through Leopard, Snow Leopard and now Lion. The issues are always popping up and I don't know how many times I have re-installed drivers to get this working. All told a miserable experience to date and