Enter command in Classical Report
Hi ,
I have a classical report with one of the fields editable , when the user modifed one of the rows and presses enter i want to do some processing , how can this be implemeted. i.e. how can i handle ENTER command in a classical report.
Regards,
Arun
Hi Arun,
You have to set your own GUI staus and then set the function code for enter key in Function key of the GUI STATUS .After that write the code in At user-command event to handle the user-input in the list.
The following code change the color of the list line in which user has entered the telephone no for vendor.
START-OF-SELECTION.
SET PF-STATUS 'GUI_LIST1'.
SELECT * FROM lfa1 INTO TABLE it_lfa1 WHERE lifnr IN s_lifnr.
FORMAT COLOR 2 ON.
LOOP AT it_lfa1 INTO x_lfa1.
val = sy-tabix MOD 2.
IF val = 0.
FORMAT INTENSIFIED ON.
ELSE.
FORMAT INTENSIFIED OFF.
ENDIF.
WRITE :/2 x_lfa1-sel AS CHECKBOX,6 x_lfa1-lifnr,17 x_lfa1-name1,
46 x_lfa1-telf1 INPUT.
HIDE: x_lfa1-sel,x_lfa1-lifnr.
ENDLOOP.
AT USER-COMMAND.
CASE sy-ucomm .
WHEN 'ENTER'.
CLEAR cnt.
DO.
READ LINE sy-index FIELD VALUE x_lfa1-sel x_lfa1-lifnr x_lfa1-telf1.
IF sy-subrc = 0 .
MODIFY LINE sy-index FIELD VALUE x_lfa1-sel LINE FORMAT COLOR 4 INTENSIFIED ON.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDCASE.
Similar Messages
-
How to set the number of rows displayed in a classical report at runtime?
Hi,
Our customer has several standard client hardware configuration and would like to enable end users to choose their 'display profile' at login time. This 'display profile' would contain predefined values for these hardware configurations and supposed to set various paramters that should define the number of rows displayed in a classical report region.
I tried to provide parameters on the report region but it refused to accept anything but numerical values. Is it possible to do this?
Regards, TamasThe link is to the closest linkable point in the documentation to the description of the Number of Rows (Item) attribute.
It sounds like you have been trying to enter—unsuccessfully—an item name or substitution string into the Number of Rows attribute. The Number of Rows (Item) attribute is the one that actually allows you to do this. Click on the flashlight icon beside it to get a list of items from the application. -
How to create a dynamic action from link column in classic report
I Have an apex page that display a modal window utilizing jquery. In the modal window I have a classic report with a link column that I want to capture its click event.
I was thinking I could create a dynamic action with selection type=jquery selector. Not for sure if I need to do anything on link column and do not know the syntax
for jquery selector. Would appreciate any help or direction???Thank you for your response. I am very new to Jquery so don't understand all that well.
What I did:
I created a dynamic action
Event: Click
Selection Type: jQuery Selector
jQuery Selector: tdheaders
Created True Actions
I created an alert to see if this is being executed.
Alert 'I made it here'
What I have:
I created a report region with the following query:
Select empno, ename, 'SELECT' from emp
where (ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
or :P2_SEARCHPU is null)
I created 'SELECT' column as Link Column
Report Attributes
Link Text Select
Target Page in this Application
Page 2
Region Header
<div id="ModalForm2" title="Employee List" style="display:none">
Region Footer
</div>
This report is displayed in a modal form when a button is clicked.
Code for modal window in Page Header
<script type="text/javascript">
$( function() {
$('#ModalForm2').dialog(
{ modal : true ,
autoOpen : false ,
buttons : {
Cancel : function() {
closeForm2();
function openForm2()
$('#ModalForm2').dialog('open');
function closeForm2()
$('#ModalForm2 input[type="text"]').val('');
$('#ModalForm2').dialog('close');
</script>
I am trying to capture the click event on the link column of the report in the modal form. I want to pass a couple of column values
back to the main form and close the modal window. I do not want to do the submit that happens if I click on the link column and link back to the main page(2)
If I let the submit to happen, all other entered fields are cleared on my main form.
Just don't understand the jQuery selector. I have no problem catching the button clicks on the modal form. -
Hi everybody,
to say it first, I'm a newbie to apex because my lack of experience with it.
I've to create an application that searches for keywords inside textfields of a table using instant search(I'm using the clarifit plugin for that).
Therefore I have to use a classic report not an interactive report due to requirements from my boss.
He wants something like the live search used by google - now the problem is that if more than one keywords separated by whitespace are entered, the search looks for all of them eg.: "keyword1 keyword2" and not "keyword1" AND "keyword2".
Does anybody know how this can be done ? Do I've to split the search string using ajax or do I'have to implement a row filtering using variables (which variable name does the content of the search box have)
Anybody got a hint for me please ?
Thanks in advance
Kr
Michael.
Edited by: user553848 on Dec 10, 2011 11:22 PM
Edited by: user553848 on Dec 11, 2011 10:32 AM
Edited by: user553848 on Dec 12, 2011 11:51 AMMichael,
If you are going to start getting into advanced searching like that then you should have a look at Oracle Text.
http://docs.oracle.com/cd/B28359_01/text.111/b28303/overview.htm
Short of that, you could write your own package to parse text input and return a where clause but I really would not recommend that.
Cheers,
Tyson Jouglet -
Increasing Font in Classical Report
Hi friends,
I need a small help.
Can we increase the font size of ABAP Classical Report ?
I have tried the PRINT-CONTROL FUNCTION 'SF000'.
But,of no use.
Can we really increase the font size of ABAP Classical Report ?
Regards,
Imran.Be aware that the PRINT-CONTROL is not supported in SAP Enterprise 4.7
For your information, SAP cannot provide any support to error caused by print control command (see SAP OSS notes 66478). * Parameters for function below should be taken from your printer
configuration in SAP - check SPAD transaction -
standard print control
print-control position 1 function: 'CI006', 'SF015'.
Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com
REPORT ZFONT NO STANDARD PAGE HEADING LINE-SIZE 80 LINE-COUNT 65.
Start of print-control
NEW-PAGE PRINT ON.
PRINT-CONTROL FUNCTION 'SF000'.
WRITE: / 'This is CPI 20'.
SKIP.
PRINT-CONTROL FUNCTION 'SF020'.
WRITE: / 'This is CPI 6'.
SKIP.
PRINT-CONTROL FUNCTION 'SF008'.
WRITE: / 'This is CPI 12'.
Depending on your SAP printer device, this may also work
PRINT-CONTROL FONT 1 LPI 6.
you can try to change font and LPI numbers
WRITE: / 'font 1 lpi 6'.
PRINT-CONTROL FONT 2 LPI 6.
WRITE: / 'font 2 lpi 6'.
PRINT-CONTROL FONT 3 LPI 6.
WRITE: / 'font 3 lpi 6'.
End of print-control
NEW-PAGE PRINT OFF.*--- End of Program
Reward points if helpful
Message was edited by:
taranam dhindsa -
Exporting Classical Report to Excel
Hi,
I have a classical report in which I am adding a Button "Export to Excel". Now, if I click that button, I should be able to export my Classical Report to excel. Can somebody please help me on this.
Thanks,
Venkat.You can do it with the FM GUI_DOWNLOAD.
Do like this:
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXCEL'.
DATA: BEGIN OF it_fieldnames occurs 0, "saving the log file structure
l_f(256) TYPE c,
END OF it_fieldnames.
it_fieldnames = 'Field1'.
Append it_fieldnames.
it_fieldnames = 'Field2'.
append it_fieldnames.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = P_FNAME
filetype = 'DATE'
TABLES
data_tab = IT_DATA " << data tab
fieldnames = it_fieldnames " << for header
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Error File Write Error: ' sy-subrc.
ENDIF.
ENDCASE.
Regards,
Naimesh Patel -
hi friends i need help on classical reports,
sold-party,
material
sales and distrubitutation channel ,division,
incoming orders,order number,invoice ,credit,
i need sub totals and final total of invoice and each customer should display in new page .Hi
Use the Tables KNA1,VBAk,VBAP,VBRK and VBRP and design the report
see the sample report using KNA1,VBAK and VBAP.
REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
HEADING.
*TABLES DECLARATION
TABLES : KNA1, VBAK, VBAP.
*SELECT OPTIONS
SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
*INITIALIZATION
INITIALIZATION.
CUST_NO-LOW = '01'.
CUST_NO-HIGH = '5000'.
CUST_NO-SIGN = 'I'.
CUST_NO-OPTION = 'BT'.
APPEND CUST_NO.
*SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN ON CUST_NO.
LOOP AT SCREEN.
IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
MESSAGE E001(ZTJ1).
ENDIF.
ENDLOOP.
*BASIC LIST SELECTION
START-OF-SELECTION.
SELECT KUNNR NAME1 ORT01 LAND1 INTO
(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
FROM KNA1
WHERE KUNNR IN CUST_NO.
WRITE:/1 SY-VLINE,
KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
KNA1-NAME1 UNDER 'NAME',
61 SY-VLINE,
KNA1-ORT01 UNDER 'CITY',
86 SY-VLINE,
KNA1-LAND1 UNDER 'COUNTRY',
103 SY-VLINE.
HIDE: KNA1-KUNNR.
ENDSELECT.
ULINE.
*SECONDARY LIST ACCESS
AT user-command.
IF SY-UCOMM = 'IONE'.
PERFORM SALES_ORD.
ENDIF.
IF SY-UCOMM = 'ITWO'.
PERFORM ITEM_DET.
ENDIF.
*TOP OF PAGE
TOP-OF-PAGE.
FORMAT COLOR 1.
WRITE : 'CUSTOMER DETAILS'.
FORMAT COLOR 1 OFF.
ULINE.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'NAME',
61 SY-VLINE,
63 'CITY',
86 SY-VLINE,
88 'COUNTRY',
103 SY-VLINE.
ULINE.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR SECONDARY LISTS
TOP-OF-PAGE DURING LINE-SELECTION.
*TOP OF PAGE FOR 1ST SECONDARY LIST
IF SY-UCOMM = 'IONE'.
ULINE.
FORMAT COLOR 1.
WRITE : 'SALES ORDER DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'SALES ORDER NO.',
40 SY-VLINE,
42 'DATE',
60 SY-VLINE,
62 'CREATOR',
85 SY-VLINE,
87 'DOC DATE',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR 2ND SECONDARY LIST
IF SY-UCOMM = 'ITWO'.
ULINE.
FORMAT COLOR 1.
WRITE : 'ITEM DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'SALES ORDER NO.',
40 SY-VLINE,
42 'SALES ITEM NO.',
60 SY-VLINE,
62 'ORDER QUANTITY',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*END OF PAGE
END-OF-PAGE.
ULINE.
WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
SY-PAGNO.
SKIP.
*& Form SALES_ORD
*& FIRST SECONDARY LIST FORM
FORM SALES_ORD .
SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
FROM VBAK
WHERE KUNNR = KNA1-KUNNR.
WRITE:/1 SY-VLINE,
VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
40 SY-VLINE,
VBAK-ERDAT UNDER 'DATE',
60 SY-VLINE,
VBAK-ERNAM UNDER 'CREATOR',
85 SY-VLINE,
VBAK-AUDAT UNDER 'DOC DATE',
103 SY-VLINE.
HIDE : VBAK-VBELN.
ENDSELECT.
ULINE.
ENDFORM. " SALES_ORD
*& Form ITEM_DET
*& SECOND SECONDARY LIST FORM
FORM ITEM_DET .
SELECT VBELN POSNR KWMENG INTO
(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
FROM VBAP
WHERE VBELN = VBAK-VBELN.
WRITE : /1 SY-VLINE,
VBAP-VBELN UNDER 'SALES ORDER NO.',
40 SY-VLINE,
VBAP-POSNR UNDER 'SALES ITEM NO.',
60 SY-VLINE,
VBAP-KWMENG UNDER 'ORDER QUANTITY',
103 SY-VLINE.
ENDSELECT.
ULINE.
ENDFORM. " ITEM_DET
REPORT demo_list_at_pf.
START-OF-SELECTION.
WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
AT pf5.
PERFORM out.
AT pf6.
PERFORM out.
AT pf7.
PERFORM out.
AT pf8.
PERFORM out.
FORM out.
WRITE: 'Secondary List by PF-Key Selection',
/ 'SY-LSIND =', sy-lsind,
/ 'SY-UCOMM =', sy-ucomm.
ENDFORM.
After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
Secondary List by PF-Key Selection
SY-LSIND = 14
SY-UCOMM = PF06
Example for AT USER-COMMAND.
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE: 'Basic List',
/ 'SY-LSIND:', sy-lsind.
TOP-OF-PAGE.
WRITE 'Top-of-Page'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'TEST'.
WRITE 'Self-defined GUI for Function Codes'.
ULINE.
ENDCASE.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
PERFORM out.
sy-lsind = sy-lsind - 1.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'FC1'.
PERFORM out.
WRITE / 'Button FUN 1 was pressed'.
WHEN 'FC2'.
PERFORM out.
WRITE / 'Button FUN 2 was pressed'.
WHEN 'FC3'.
PERFORM out.
WRITE / 'Button FUN 3 was pressed'.
WHEN 'FC4'.
PERFORM out.
WRITE / 'Button FUN 4 was pressed'.
WHEN 'FC5'.
PERFORM out.
WRITE / 'Button FUN 5 was pressed'.
ENDCASE.
sy-lsind = sy-lsind - 1.
FORM out.
WRITE: 'Secondary List',
/ 'SY-LSIND:', sy-lsind,
/ 'SY-PFKEY:', sy-pfkey.
ENDFORM.
When you run the program, the system displays the following basic list with a the page header defined in the program:
You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status.
Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton.
For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1.
Reward points for useful Answers
Regards
Anji -
How to print watermark in classical reports?
How to display the watermark in classical reports?
hi
go to se78 graphics -> enter
BMAP(BITMAP IMAGES)
Name MYBMP
select radio button
color ->import
filename: c:\pictures\123.bmp.
name : mybmp
description : BMP ->continur ->save.(activate it)
now go to se71->choose the prog -> layout ->right click ->create graphics.
utilities -> printing test -> output device -> LP01.
Hope this helps
if it helped, you can acknowledge the same by rewarding
regards
dinesh -
Hi Experts,
I have written a classical report with write statements and when i am downloading in excel the format is mismatching and now i want to convert into PDF format.
How to convert into PDF format from Classical report ?
YusufHi yusuf,
please find the below report,,
please make two include programs before executing it,
there codes are pasted below,
INCLUDE zimpr_data_declaration.
INCLUDE zimpr_performs_wrap.
REPORT zimpr_word_wrap NO STANDARD PAGE HEADING LINE-SIZE 115..
INCLUDE for DATA DECLARATION *
INCLUDE zimpr_data_declaration.
INCLUDE for all performs. *
INCLUDE zimpr_performs_wrap.
TOP-OF-PAGE--
TOP-OF-PAGE.
PERFORM f_top_page. "TOP OF THE REPORT PAGE,I.E. HEADER.
START-OF-SELECTION.
SET PF-STATUS 'SEL_SCREEN'. "PF-STATUS OF THE SELECTION SCREEN.
PERFORM f_data_retrieval. "PERFORM FOR ALL SELECT STATEMENTS.
PERFORM f_report_display. "REPORT DISPLAY,WRITE STATEMENTS.
--Define the actions to be performed for pf-status-----
AT USER-COMMAND.
wf_ok_code = sy-ucomm.
wf_save_ok = wf_ok_code.
CLEAR wf_ok_code.
CASE wf_save_ok.
WHEN 'PDF'. "WHEN PDF ICON IS CLICKED,REPORT WILL CONVERT INTO PDF.
loc_repid = sy-repid. "PROGRAM NAME
--THIS FM SETS THE PARAMETERS FOR LAYOUT OF PDF OUTPUT--
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
layout = loc_paart "LANDSCAPE LAYOUT
line_size = loc_linsz "CHARACTER WIDTH OF REPORT
no_dialog = 'X'
user = sy-uname "USERNAME
IMPORTING
out_parameters = loc_print_parms "OUTPUT PARAMETERS WILL BE COLLECTED HERE.
valid = loc_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
--FOR GENERATING THE SPOOL NUMBER--
NEW-PAGE PRINT ON NO DIALOG PARAMETERS loc_print_parms. " This allocates the spool no
"to the screen without the dialog screen.
PERFORM f_top_page.
PERFORM f_report_display.
NEW-PAGE PRINT OFF. "This marks the end of the screen for which the spool no was generated.
wf_id = sy-spono. " This assign the spool no of the screen to the variable.
--PERFORM FOR GETTING THE PDF OUTPUT--
PERFORM f_pdf_display.
--PERFORM FOR DOWLOADING FILE TO A LOCAL DISK--
PERFORM f_download_local.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
include data declaration----
*& Include ZIMPR_DATA_DECLARATION
TYPE-POOLS : shlp.
DATA : wf_ordert TYPE aufk-auart. "ORDER TYPE
DATA : wf_order TYPE aufk-aufnr. "ORDER NUMBER
DATA : wf_bdate TYPE afko-gstrp. "BASIC START DATE
DATA : wf_status(4) TYPE c ."rihea-i_astatin. "STATUS
DATA : wf_objnr TYPE jest-objnr VALUE 'OR%'. "Object number
DATA : wf_aufnr TYPE aufk-aufnr.
DATA : wf_name TYPE thead-tdname. "NAME TO PASS IN FM READ_TEXT
DATA : wf_date1(12) TYPE c. "DATE
DATA : wf_i1(3) TYPE n,wc_i1(3) TYPE n VALUE '1'. "COUNTERS FOR REPORT DISPLAY
DATA : wf_i2(3) TYPE n,wc_i2(3) TYPE n VALUE '1'.
DATA : wf_kopf TYPE tdid VALUE 'KOPF',wf_aufk TYPE tdobject VALUE 'AUFK'.
DATA : wf_save_ok TYPE sy-ucomm ,wf_ok_code TYPE sy-ucomm.
DATA: wf_id TYPE tsp01-rqident , " For storing Spool request number
wf_bytes TYPE i . " For storing the bytes of data to be converted to PDF.
DATA : wf_langu(2) TYPE c VALUE 'EN'.
DATA: wf_pripar TYPE pri_params, " Structure for Passing Print Parameters
wf_rcpar TYPE arc_params. " ImageLink structure
DATA : wf_statu TYPE dfies-fieldname VALUE 'STATUS',
wf_field TYPE help_info-dynprofld VALUE 'S_STATUS'.
&--SELECTION SCREEN--
SELECTION-SCREEN BEGIN OF BLOCK b_1 WITH FRAME TITLE text-000.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: s_ordert FOR wf_ordert . "ORDER TYPE
SELECT-OPTIONS: s_order FOR wf_order OBLIGATORY. "ORDER NUMBER
SELECT-OPTIONS: s_bdate FOR wf_bdate. "BASIC START DATE
SELECT-OPTIONS: s_status FOR wf_status matchcode object zei_sys . "SYSTEM STATUS
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN END OF BLOCK b_1.
*--INTERNAL TABLES--
TYPES : BEGIN OF ty_aufk,
aufnr TYPE aufk-aufnr, "OREDR NUMBER
auart TYPE aufk-auart, "ORDER TYPE
objnr TYPE aufk-objnr, "OBJECT NUMBER
ktext type aufk-ktext, "SHORT TEXT
gstrp TYPE afko-gstrp, "BASIC START DATE
END OF ty_aufk.
TYPES : BEGIN OF ty_tj02t,
objnr TYPE aufk-objnr, "OBJECT NUMBER
txt04 TYPE tj02t-txt04, "STATUS
istat TYPE tj02t-istat, "Object status
spras TYPE tj02t-spras, "LANGUAGE KEY
END OF ty_tj02t.
TYPES : BEGIN OF ty_temp,
objnr TYPE aufk-objnr,
status(300) TYPE c,
END OF ty_temp.
TYPES : BEGIN OF ty_wrap,
line(54) TYPE c, "LONG TEXT
END OF ty_wrap.
TYPES : BEGIN OF ty_wrap2,
line(25) TYPE c, "STATUS
END OF ty_wrap2.
TYPES : BEGIN OF ty_f4,
txt04 TYPE tj02t-txt04,
txt30 TYPE tj02t-txt30,
END OF ty_f4.
types : begin of ty_sta,
istat type tj02t-istat,
objnr type jest-objnr,
end of ty_sta.
data : int_sta type table of ty_sta with header line.
DATA : int_f4 TYPE TABLE OF ty_f4 WITH HEADER LINE.
DATA: int_pdf TYPE TABLE OF tline WITH HEADER LINE. "TABLE FOR PDF CONVERSION
DATA: int_wrap TYPE TABLE OF ty_wrap WITH HEADER LINE. "TABLE FOR LONGTEXT
DATA: int_wrap2 TYPE TABLE OF ty_wrap2 WITH HEADER LINE. "TABLE FOR STATUS
DATA: int_temp TYPE TABLE OF ty_temp WITH HEADER LINE. "Table for concatenation of system status.
DATA: int_aufk TYPE TABLE OF ty_aufk WITH HEADER LINE.
DATA: int_tj02t TYPE TABLE OF ty_tj02t WITH HEADER LINE.
DATA: int_tline TYPE STANDARD TABLE OF tline WITH HEADER LINE. "TABLE FOR READ_TEXT.
DATA : int_fld TYPE TABLE OF dfies ,wa_fld LIKE LINE OF int_fld. " Field Type for FM for F4 help
DATA :int_return TYPE TABLE OF ddshretval WITH HEADER LINE .
DATA:
loc_print_parms LIKE pri_params, "PRINT PARAMETERS
loc_valid(1) TYPE c,
loc_file type SDOK_CHTRD,
loc_bytecount TYPE i, "NUMBER OF BYTES TRANSFERRED
loc_length TYPE i, "LINE-LENGTH
loc_rqident LIKE tsp01-rqident, "SPOOL NUMBER
loc_rq2name(12) TYPE c.
DATA: loc_filename LIKE rlgrap-filename. "FILENAME
DATA:loc_repid LIKE sy-repid, " Report to execute
loc_linsz LIKE sy-linsz VALUE 115, " Line size
loc_paart LIKE sy-paart VALUE 'X_65_132'. " Paper Format
Include ZIMPR_PERFORMS_WRAP----
*& Include ZIMPR_PERFORMS_WRAP
*& Form f_top_page
top-of the page
--> p1 text
<-- p2 text
FORM f_top_page .
*--HEADER--
FORMAT COLOR 1 .
WRITE : text-010.
FORMAT COLOR 1 OFF.
WRITE : / text-011,sy-datum NO-GAP.
WRITE : / text-012,sy-uzeit NO-GAP,90 text-013,101 sy-uname.
ULINE .
FORMAT COLOR 1 INTENSIFIED OFF .
WRITE : 1 sy-vline, "HEADINGS
2 text-014 NO-GAP,
7 sy-vline,
8 text-015 NO-GAP,
20 sy-vline,
21 text-016 NO-GAP,
76 sy-vline,
77 text-017 NO-GAP,
88 sy-vline,
89 text-018 NO-GAP,
115 sy-vline.
WRITE : /1 sy-vline,
2 text-019 NO-GAP,7 sy-vline,
20 sy-vline,76 sy-vline,77 text-020 NO-GAP,88 sy-vline,115 sy-vline.
ULINE.
FORMAT COLOR 1 OFF.
ENDFORM. " f_top_page
*& Form f_data_retrieval
select statements
--> p1 text
<-- p2 text
FORM f_data_retrieval .
SELECTING ORDER TYPE,ORDER NO.,OBJECT NO. AND BASIC START DATE
SELECT p~aufnr
p~auart
p~objnr
p~ktext
r~gstrp
FROM ( aufk AS p INNER JOIN afko AS r ON raufnr = paufnr )
INTO TABLE int_aufk
WHERE p~aufnr IN s_order AND
p~auart IN s_ordert AND
r~gstrp IN s_bdate AND
p~objnr LIKE wf_objnr.
IF sy-subrc <> 0.
MESSAGE s101(zipm). "no values found for selection criteria.
STOP.
ENDIF.
SORT int_aufk BY aufnr.
DELETE ADJACENT DUPLICATES FROM int_aufk.
SELECT q~istat
p~objnr
FROM ( jest AS p INNER JOIN tj02t AS q ON pstat = qistat )
INTO TABLE int_sta
FOR ALL ENTRIES IN int_aufk
WHERE p~objnr = int_aufk-objnr
AND q~txt04 IN s_status and
q~spras = wf_langu and
p~inact = ''.
IF sy-subrc <> 0.
MESSAGE s101(zipm). "no values found for selection criteria.
STOP.
ENDIF.
SORT int_sta BY objnr.
DELETE ADJACENT DUPLICATES FROM int_sta.
*--SELECTING OBJECT NO.,STATUS AND LANGUAGE--
IF int_sta[] IS NOT INITIAL.
SELECT p~objnr
q~txt04
q~istat
q~spras
FROM ( jest AS p INNER JOIN tj02t AS q ON pstat = qistat )
INTO TABLE int_tj02t
FOR ALL ENTRIES IN int_sta
WHERE p~inact = '' AND
p~objnr = int_sta-objnr AND
q~spras = wf_langu AND
q~txt04 IN s_status AND
p~objnr LIKE wf_objnr.
IF sy-subrc <> 0.
MESSAGE s101(zipm). "no values found for selection criteria.
STOP.
ENDIF.
ENDIF.
ENDFORM. " f_data_retrieval
*& Form f_report_display
report display
--> p1 text
<-- p2 text
FORM f_report_display .
LOOP AT int_tj02t. "concatenating the status into a internal table
AT NEW objnr.
CLEAR int_temp-status.
ENDAT.
CONCATENATE int_temp-status int_tj02t-txt04 INTO int_temp-status SEPARATED BY space.
AT END OF objnr.
int_temp-objnr = int_tj02t-objnr. "key field.
APPEND int_temp.
CLEAR int_temp.
ENDAT.
CLEAR int_tj02t.
ENDLOOP.
LOOP AT int_aufk.
CONCATENATE sy-mandt int_aufk-aufnr INTO wf_name . "concatenating client number and order number
*--THIS FM CAPTURES THE LONG TEXT AND STORES IT IN INTERNAL TABLE--
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = wf_kopf "TEXT ID
language = sy-langu "LANGUAGE
name = wf_name "TEXT NAME
object = wf_aufk "TEXT OBJECT
TABLES
lines = int_tline "LINES OF LONG TEXT.
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
int_tline-tdline = int_aufk-ktext.
APPEND int_tline.
CLEAR :int_tline.
ENDIF.
LOOP AT int_tline.
*--THIS FM WRAPS THE LONG TEXT INTO 54 CHARACTERS EACH--
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = int_tline-tdline "LONG TEXT LINE
outputlen = 54 "OUTPUT LENGTH
TABLES
out_lines = int_wrap "INTERNAL TABLE
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR :int_tline.
ENDIF.
ENDLOOP.
*-- THIS FM WRAPS THE STATUS INTO 25 CHARACTERS EACH--
READ TABLE int_temp WITH KEY objnr = int_aufk-objnr.
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = int_temp-status
outputlen = 25
TABLES
out_lines = int_wrap2
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
IF NOT int_wrap2[] IS INITIAL.
ULINE AT (115).
ENDIF.
DESCRIBE TABLE int_wrap LINES wf_i2. "COUNTING THE NO. OF LINES FOR TABLE INT_WRAP
DESCRIBE TABLE int_wrap2 LINES wf_i1. "COUNTING THE NO. OF LINES FOR TABLE INT_WRAP2
WHILE ( wc_i1 LE wf_i1 OR wc_i2 LE wf_i2 ).
IF ( wc_i2 LE wf_i2 ).
READ TABLE int_wrap INDEX wc_i2 . "READING THE INTERNAL TABLE INT_WRAP WITH INDEX
wc_i2 = wc_i2 + 1.
ENDIF.
IF ( wc_i1 LE wf_i1 ).
READ TABLE int_wrap2 INDEX wc_i1 . "READING THE INTERNAL TABLE INT_WRAP2 WITH INDEX
wc_i1 = wc_i1 + 1.
ENDIF.
*--THIS FM CONVERTS THE DATE FROM SYSTEM FORMAT TO OUTPUT FORMAT--
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = int_aufk-gstrp
IMPORTING
output = wf_date1.
IF NOT int_wrap2[] IS INITIAL .
*--REPORT DISPLAY--
WRITE : /1 sy-vline, 2 int_aufk-auart COLOR = 4 INTENSIFIED OFF NO-GAP ,
7 sy-vline ,8 int_aufk-aufnr COLOR = 4 INTENSIFIED OFF NO-GAP,
20 sy-vline,21 int_wrap-line,
76 sy-vline ,77 wf_date1 ,
88 sy-vline ,89 int_wrap2-line,
115 sy-vline.
*--CLEARING THE VARIABLES--
wf_date1 = ''.
CLEAR: int_aufk,int_temp,int_wrap2-line,int_wrap-line.
ENDIF.
ENDWHILE.
wc_i1 = 1.
wc_i2 = 1.
CLEAR :int_wrap,int_wrap2.
REFRESH : int_wrap,int_wrap2,int_tline.
ENDLOOP.
ULINE AT (115).
ENDFORM. " f_report_display
*& Form F_PDF_DISPLAY
pdf conversion
--> p1 text
<-- p2 text
FORM f_pdf_display .
*--THIS FM CONVERTS THE SPOOL REQUEST INTO PDF REPORT--
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = wf_id "SPOOL NUMBER
no_dialog = space
pdf_destination = 'X'
IMPORTING
pdf_bytecount = loc_bytecount "NUMBER OF BYTES TRANSFERRED
TABLES
pdf = int_pdf "TABLE FOR PDF REPORT
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
ENDFORM. " F_PDF_DISPLAY
*& Form f_download_local
download to local system
--> p1 text
<-- p2 text
FORM f_download_local .
---------------------THIS FM DOWNLOADS THE PDF REPORT INTO LOCAL MACHINE
data loc_ret TYPE iwerrormsg.
CALL FUNCTION 'IW_C_GET_SAPWORKDIR'
IMPORTING
SAPWORKDIR = loc_file
ERROR_MSG = loc_ret
loc_filename = loc_file.
if loc_ret is initial.
concatenate loc_filename '\work order header long text_ ' sy-timlo '.pdf' into loc_filename.
endif.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = loc_bytecount "NO. OF BYTES
filename = loc_filename "DEFAULT FILE NAME
filetype = 'BIN'
IMPORTING
act_filename = loc_filename
TABLES
data_tab = int_pdf.
ENDFORM. " f_download_local
if you have any doubts,,
please revert
Regards,
Talwinder -
How to print the data as a bold letters in classical report
Hi Friends,
I want to print the some data in the classical report as a BOLD letters. What is the way to do..
Thanks and Regards,
SuryaHi Surya,
Am pasting some data from help.sap.com , I think the addition of LINE to the command as shown below might be necessary:
REPORT demo_list_print_control LINE-SIZE 60.
TABLES spfli.
PRINT-CONTROL FUNCTION: 'SABLD' LINE 1,
'SAOFF' LINE 2,
'SAULN' LINE 3.
GET spfli.
WRITE: / spfli-carrid, spfli-connid, spfli-cityfrom,
spfli-airpfrom, spfli-cityto, spfli-airpto.
If in table T02DD, the printer control characters for the print-control codes SABLD, SAOFF, and SAULN are defined as in the figure above, the system formats the output as follows:
1996/03/13 SPFLI 1
AA 0017 NEW YORK JFK SAN FRANCISCO SFO
AA 0064 SAN FRANCISCO SFO NEW YORK JFK
DL 1699 NEW YORK JFK SAN FRANCISCO SFO
DL 1984 SAN FRANCISCO SFO NEW YORK JFK
LH 0400 FRANKFURT FRA NEW YORK JFK
The print format for the first line is set to bold, using the print-control code SABLD. The print-control code SAOFF turns off bold style, starting from the second line. Using the print-control code SAULN, the system underlines all lines starting from line 3.
Cheers,
Aditya -
Bug in Classic Report based on Function?
As a simple example, suppose I want a classic report in which I can change the sort field by selecting from the item P1_SORTFIELD. In Apex 4.2 I was able to implement the report using the PL/SQL function
return 'select ENAME, SAL from EMP order by ' || :P1_SORTFIELD;
I cannot do this in Apex 5 on my apex.oracle.com workspace. I either get an "SQL command not property ended" runtime error if I use generic column names, or "not all variables bound" parse error if I don't.
My real application uses generic column names, so I am most interested in a solution to that. For example, I tried creating a report having the source
return 'select ENAME from EMP order by ENAME';
If I run it using generic column names I still get the "SQL Command not properly ended" runtime error.
Is this a bug??
Ed ScioreEd Sciore wrote:
As a simple example, suppose I want a classic report in which I can change the sort field by selecting from the item P1_SORTFIELD. In Apex 4.2 I was able to implement the report using the PL/SQL function
return 'select ENAME, SAL from EMP order by ' || :P1_SORTFIELD;
I cannot do this in Apex 5 on my apex.oracle.com workspace. I either get an "SQL command not property ended" runtime error if I use generic column names, or "not all variables bound" parse error if I don't.
My real application uses generic column names, so I am most interested in a solution to that. For example, I tried creating a report having the source
return 'select ENAME from EMP order by ENAME';
If I run it using generic column names I still get the "SQL Command not properly ended" runtime error.
I cannot reproduce the same error messages in my workspace on apex.oracle.com.
The basic problem here is that the function body will not return a syntactically correct SQL query if the session state value of P1_SORTFIELD is not a valid sort expression for the query. This will always be the case when the region source is validated in the App Builder, and also if P1_SORTFIELD is null at runtime. The solution is to ensure that the function body always returns a valid query irrespective of the value of P1_SORTFIELD:
return 'select ENAME, SAL from EMP' || nullif(' order by ' || :p1_sortfield, ' order by ');
Here is another weird thing. I looked at my Apex 4.2 application that got transferred over to Apex 5. The region that does the dynamic sorting still works. But now I just created a new region on that page that has the same source, and as far as I can tell, exactly the same properties. And this region gives me the runtime error. The URL is apex.oracle.com/pls/apex/f?p=80034:33 if that helps.
Given that I can't reproduce your results based on the information provided, I think we'd need access to the app in your workspace in debug mode to investigate this fully. -
Hi Experts,
I have developed classical report.in my internal table, i have 24 records.
my question is, in ALV report,we can display colors as zebra color autometically by function module.
but in classical report.how can we set zebra color for my 24 records.
Thanks in advance.
Regards.
Sudheer.
Moderator message: very basic, please search for available information before asking, please use more descriptive subject lines when posting.
locked by: Thomas Zloch on Sep 2, 2010 11:03 AMHi,
Use FORMAT command. Look for F1 on Format.
Regards,
Srini. -
Hi,
I found that when creating classic report through the create application wizard (add new report page and choose report type as classic), the report is slightly different from the ones created through the normal create page wizard.
The difference is report created with the creating application wizard contain filters (which searches and highlight all columns containing the keywords), a select list which allows user to select how many rows should be displayed and pagination.
But once you create the application and wanted to add a new report, it doesn't seem to have the above functions.
I was just wondering if it is possible to create a report page with all these functionalities through a normal report wizard? or is it something that we have to do manually once the application is created?
Any help would be appreciated.
Thanks,
CandyCandy,
While creating the report, all you have to do is enable report search. After entering sql query, next screen is Report Attribute. Select "Yes" in Enable Search and you can see the rows selector and search text box before your report region. Also if you want to add similar functionality to an existing report , all you have to do is add a static select list with values like 10,20,50,100.. and edit the report attribute-->Layout and Pagination-->Number of Rows (Item) --> enter the above select list name. .
If you want to include the search functionality , you can create a text box and modify report query something like
instr(upper(report_column),upper(nvl(:Page_item,report_column))) > 0
The best way to approach this is to create a dummy page and Add a report region with simple query and enable the report search and see the items and report attributes generated by wizard. If you closely look at them you can add similar functionality to any existing report without any issue.
Hope these helps. Thanks.
Regards,
Manish -
Adding button in classical report
Hi All,
I have a requirement to add a button in the Classical report.
Iam new to abap.can anyone please guide me regarding this?
Thanks in advancehi,
if you use reuse alv grid. you can define your button at pf status. here the example :
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'MY_PF_STATUS'
i_callback_user_command = 'MY_USER_COMMAND'
then :
FORM my_pf_status USING it_extab TYPE slis_t_extab.
SET PF-STATUS 'MY_PF_STATUS'.
ENDFORM. "MY_PF_STATUS
FORM my_user_command USING ip_ucomm TYPE sy-ucomm
ip_selfield TYPE slis_selfield.
CASE ip_ucomm.
WHEN 'VBELN'.
SET PARAMETER ID 'AUN' FIELD ip_sellfield-value.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.
CLEAR : ip_ucomm.
ip_selfield-refresh =
ip_selfield-col_stable =
ip_selfield-row_stable = 'X'.
ENDFORM.
if you use : write for output.
START-OF-SELECTION.
SET PF-STATUS 'DENEME'.
WRITE : 'EXAMPLE'.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'EXAM'.
BREAK-POINT.
ENDCASE.
if you use Class for ALV u can find more info at here : [OO ALV Reference|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907] -
Refresh Classical report/basic list
Hi,
I have created a classical report/basic list where user can select check boxes and adjacent rows should be deleted. But after the action, I wish to refresh the report and remove the selected lines from displaying.
Please let me know how to achieve this.
Thanks in advance.
NitinHi Nitin,
Check the following program.
Here on pressing the delete push button(FCODE: DELETE) it will delete all
rows which has adjacent checkboxes checked.
REPORT ztest_list_processing NO STANDARD PAGE HEADING .
TYPES: BEGIN OF ty_tab,
delete,
f1(3) TYPE c,
f2(3) TYPE c,
f3(3) TYPE c,
END OF ty_tab.
DATA: it_tab TYPE TABLE OF ty_tab,
wa_tab TYPE ty_tab.
DATA: w_delete TYPE c,
w_lines TYPE i,
w_ind TYPE i.
wa_tab-f1 = '111'.
wa_tab-f2 = 'ABC'.
wa_tab-f3 = '123'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '222'.
wa_tab-f2 = 'DEF'.
wa_tab-f3 = '456'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '333'.
wa_tab-f2 = 'GHI'.
wa_tab-f3 = '789'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '444'.
wa_tab-f2 = 'JKL'.
wa_tab-f3 = '987'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '555'.
wa_tab-f2 = 'MNO'.
wa_tab-f3 = '654'.
APPEND wa_tab TO it_tab.
SET PF-STATUS '100'. "Contains Delete button
PERFORM print_output.
"Logic which you can implement
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'DELETE'.
DESCRIBE TABLE it_tab LINES w_lines.
DO w_lines TIMES. "To read all rows
CLEAR: wa_tab.
READ LINE w_ind FIELD VALUE wa_tab-delete
wa_tab-f1. "Getting the values
IF wa_tab-delete EQ 'X'. "Delete when check box is 'X'
DELETE it_tab WHERE f1 = wa_tab-f1.
ENDIF.
ADD 1 TO w_ind."Index for next line
ENDDO.
IF it_tab IS INITIAL.
WRITE: / 'There are no data in the table'.
ELSE.
PERFORM print_output. "Reprint the updated data(like refreshing)
ENDIF.
"Modified the existing Back button in standard Toolbar so that on
"pressin the back button it will come to program and not to
"previous displayed list
WHEN '&BACK'.
LEAVE SCREEN.
ENDCASE.
*& Form print_output
* text
* --> p1 text
* <-- p2 text
FORM print_output.
LOOP AT it_tab INTO wa_tab.
WRITE:/ wa_tab-delete AS CHECKBOX INPUT ON, "Display as checkbox
wa_tab-f1,
wa_tab-f2,
wa_tab-f3.
IF sy-tabix EQ 1.
w_ind = sy-linno. "Get the line position of first row
ENDIF.
ENDLOOP.
Hope this helps you.
Regards,
Manoj Kumar P
Maybe you are looking for
-
Urgent: Error in Inbound Proxy in SCM system
Hi All Please give your inputs to solve following problem I am facing. I am working on XI first time so please help me out to solve the following problem. Please let me know if you need any more info. Thanks a lot for your help guys. I am sending ORD
-
SQL to FILE interface with column headers
Hi All, I have designed an interface to extract the data from Oracle to flat file (.txt file ) . 1) I am getting the column headers in the output file(. txt file) but I don't want to see any column headers 2) While creating the data source in data Mo
-
How can I add the date to my home page screen, maybe next to the time.
mini IPAD 8.2 . I would like the date to apprear on my home screen just like the time . Is there a way to do this?
-
How to use Crystal Reports to report on Microsoft Sharepoint Lists?
I am attempting to report on the items in Microsoft Sharepoint lists. I have created a new data connection (web service) and selected the following options: Use Web Service Data Source Use HTTP(S) WSDL HTTP(S) WSDL URL: http://sitename.com/sites/my
-
How to Debug the DMEE exit function module
Hi All, I wants to Debug the DMEE tree exit function module. Could you please guide me. Regards, Seshadri