Call global class exception to report prog
Hi expert,
In global class, i write a method in that one exception can be raised. that exception can be called in
report program. please can you help me.
Thank you,
dinesh.
Hello Dinesh
If your method has just exceptions defined in its signature and NOT exception classes then you can handle them like you do for function module exceptions.
However, I assume your method has one or more exception classes defined in its signature. Then you can use the TRY...CATCH...ENDTRY block:
" Here we are in your report:
DATA: lo_error TYPE REF TO cx_root.
DATA: ld_msg TYPE bapi_msg.
TRY.
CALL METHOD go_myclass->method_with_exceptionclass( ). " e.g. ZCX_MY_EXCEPTION
CATCH zcx_my_exception INTO lo_error.
ld_msg = lo_error->get_longtext( ).
MESSAGE ld_msg TYPE 'I'.
ENDTRY.
Regards
Uwe
Similar Messages
-
How to call Global Abstract Class in Report Program
Hi All,
Can Anyone tell me how call global abstract class created in SE24.
Thanks,
RevanthHi Revanth,
What are you trying to do in abstract class?
Are you inherit and trying to create object?
Regards,
A Vadamalai. -
Is it possible to call a subscreen/modal dialog box from the global class
Hi,
Is it possible to call a subscreen or modal dialog box from the global class ..
or is there any option to display a pop screen or subscreen in order to get the values from user which as to be implemented
in the global class..
thanks and regards,
Poornima.Hi Poornima,
you should follow Uwe's suggestion. The only alternative I can imagine is dynamic document in a dialog container. But I don't know any standardized classes to make use with minimum effort. Have a look at report DD_ADD_FORM_INPUT. Here they put the input field in a container control in a screen; you can put the container control on a dialog container (CL_GUI_DIALOGBOX_CONTAINER).
We will not get rid of any screen for the time being, but if your application is started from any screen, the DIALOGBOX_CONTAINER can start from there.
Regards,
Clemens -
EJB is not throwing exception to calling Action class in Unix environment
Hi
We are using Weblogic Server 9.2.3.0.
One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
Somehow the EJB is swallowing the exception.
any idea? I suspect it may be environmental issue?
thank youHi
We are using Weblogic Server 9.2.3.0.
One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
Somehow the EJB is swallowing the exception.
any idea? I suspect it may be environmental issue?
thank you -
Calling Instance Method in a Global Class
Hi All,
Please can you tell me how to call a instance method created in a global class in different program.
This is the code which I have written,
data: g_cl type ref to <global class>.
call method g_cl -> <method name>
I am not able to create Create object <object>.
It is throwing the error message " Instance class cannot be called outside...."
Please can anybody help me..
*Text deleted by moderator*
Thanks
SushmithaHi susmitha,
1.
data: g_cl type ref to <global class>.
2.
Create object <object>.
3.
call method g_cl -> <method name>.
if still you are getting error.
then first check that method level and visibility in se24.
1.if level is static you can not call it threw object.
2. if visibility is protected or private then you can not call it directly.
If still you are facing same problem please paste the in this thread so that i can help you better.
Regards.
Punit
Edited by: Punit Singh on Nov 3, 2008 11:54 AM -
Global class event handler not called
I am having a problem where I created a function module that instatiates an application log class. This application log class has methods ON_* for public events of other classes.
The function module then processes its routines and as a result some of these events are raised. Ex: The function module creates a Purchase order and in that class I have a public even PO_CREATED that is raised upon succesfull creation of the PO. The global class APPLICATION_LOG I created has a method ON_PO_CREATED for event PO_CREATED of class ZCL_MAT_PO.
I put a break point in the APPLICATION LOG method but is os not called.
ANy idea of what Iam doing wrong or missing?
Thanks,
LeoHi Leo, did you set the handler method?
SET HANDLER <method_name> FOR <object>.
Regards,
Rich Heilman -
Call Include program in a report class prg
Hi Oo gurus..
Hi want to call include program in my report class program
how can i do that ?
I also used include in a report program and its work fine, but when i tried to use in a class then its not work
please post solution and example,
Advance Thanks..
NirajOk i solve it....
Thanks -
Access global data of report in global class methods?
Hi all,
I have defined one global class in SE24 and i am using methods of this class in report program.
Can i access global data of my report program in class methods directly without declaring it as IMPORT
parameter?
Thanks,
ApitaHi,
Well, now you did confuse me: first you asked about using global data of a report program in global class (created in SE24), and the answer is: no, you can't directly access the global data of another program in a method of global class (yes, you should pass them via importing parameters), and you shouldn't even consider using indirect means of doing so via special form of ASSIGN statement reserved for internal use by SAP. The ASSIGN will not work if someone reuses the global class elsewhere in the system without loading your report. Don't ever program such atrocious dependencies in global class...
And now you ask about the use "in method implementation in report program"..? Just to be sure - you can't program the implementation of a global class method in a report program.
You can program a local class inheriting from a global class and redefine/re-implement methods of such global super-class in a report program. Global data of report program, including the selection screen, would be directly accessible to such local class. It would still not be a good idea to use this access:
Conversely, within an encapsulated unit, that is, within a class, you should avoid accessing more global data directly. Within methods, you should generally modify attributes of the class only. Write access to global data outside the class is not recommended. Accessing data in this way should only be done using specially marked methods, if at all. The use of methods of a class should not evoke any side effects outside the class itself.
cheers
Jānis
Message was edited by: Jānis B -
Is there any posibility to call a dynpro with a method of a global class?
regards, AnjaHi,
you cannot define a screen within a class pool. Therefore, you can not call a screen from a method of a global class.
A way around this could be to define the screen within a function group and then call a function module. This will also work with a cross perform on a subroutine that calls the screen.
Regards Rudi -
Event handling in global class (abap object)
Hello friends
I have 1 problem regarding events in abap object... how to handel an event in global class in se24 .
Regards
Reema jain.
Message was edited by:
Reema JainHello Reema
The following sample report shows how to handle event in principle (see the § marks)..
The following sample report show customer data ("Header"; KNB1) in the first ALV list and sales areas ("Detail"; KNVV) for the selected customer (event double-click) in the second ALV list.
*& Report ZUS_SDN_TWO_ALV_GRIDS
REPORT zus_sdn_two_alv_grids.
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
"§1. Define and implement event handler method
" (Here: implemented as static methods of a local class)
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
* IS_ROW_ID =
* IS_COLUMN_ID =
is_row_no = es_row_no.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = '1000'.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_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.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
"§2. Set event handler (after creating the ALV instance)
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1. " Or:
" SET HANDLER: lcl_eventhandler=>handle_double_click FOR all instances.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
is_layout = gs_layout
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gs_layout-grid_title = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
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.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* User has pushed button "Display Details"
WHEN 'DETAIL'.
PERFORM entry_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM entry_show_details .
* define local data
DATA:
ld_row TYPE i,
ls_knb1 TYPE knb1.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr = ls_knb1-kunnr.
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe -
Creating a class in a report (URGENT)
Hi !!
Do we create Local/Global classes in real time? or we use standard classes !!
if so Please mail me a complete real time scenario of a class utilized in report... please
it should be for resume point of view.
points will be definitely given
Thanks a lot in advance
regards
babuHi Rambabu,
We create local / global classesdepending upon the situation. As you seem to be new to abap objects best thing to claim is OO ALV. we use some standard classes here.
Here is the simple program on oo alv.
*& Report ZGS_SIMPLE_ALV
REPORT zgs_simple_alv.
DATA : it_mara TYPE TABLE OF mara.
DATA : container TYPE REF TO cl_gui_custom_container,
grid TYPE REF TO cl_gui_alv_grid.
SELECT * FROM mara INTO TABLE it_mara UP TO 10 ROWS.
CREATE OBJECT container
EXPORTING
* PARENT =
container_name = 'CONTAINER'
* STYLE =
* LIFETIME = lifetime_default
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* others = 6
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = container
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD grid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
i_structure_name = 'MARA'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
it_outtab = it_mara
* IT_FIELDCATALOG =
* IT_SORT =
* IT_FILTER =
* EXCEPTIONS
* INVALID_PARAMETER_COMBINATION = 1
* PROGRAM_ERROR = 2
* TOO_MANY_LINES = 3
* others = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 100.
Pleasse reward points and keep going .. all the best in your trials.
Thanks & Regards,
Aleem. -
Error while usind Private Method of a global class
HI All..
I created a global class (ZLINE_GLOBAL) which has TOT_DATA private method. I have to call this private method in my report, I know that using Friend class we can do this.
But it is not working and showing the same error " METHOD "TOT_DATA" is unknown or Private or Public..
code i tried is
CLASS c2 DEFINITION DEFERRED.
CLASS ZLINE_GLOBAL DEFINITION FRIENDS c2.
PUBLIC SECTION.
METHODS : m1.
PRIVATE SECTION.
METHODS: m2.
ENDCLASS.
CLASS ZLINE_GLOBAL IMPLEMENTATION .
METHOD m1.
WRITE : 'Public Method C1'.
ENDMETHOD. "M1
METHOD m2.
WRITE : 'Private Method C1'.
ENDMETHOD.
ENDCLASS.
CLASS c2 DEFINITION FRIENDS ZLINE_GLOBAL. "my friends are here, allow them access to my (C2's) private components
PUBLIC SECTION.
METHODS :m3.
ENDCLASS.
CLASS c2 IMPLEMENTATION.
METHOD m3.
DATA : obj TYPE REF TO ZLINE_GLOBAL.
CREATE OBJECT obj.
CALL METHOD obj->TOT_DATA. "here Iam calling Private method of global class
ENDMETHOD. "M3
ENDCLASS.
START-OF-SELECTION.
DATA obj_c2 TYPE REF TO c2.
CREATE OBJECT obj_c2.
obj_c2->m3( ).
can anybody help me on this..
MurthyHi Murthy,
Replace TOT_DATA with M2, you do not have any method by name "TOT_DATA" in your code.
CLASS c2 DEFINITION DEFERRED.
CLASS ZLINE_GLOBAL DEFINITION FRIENDS c2.
PUBLIC SECTION.
METHODS : m1.
PRIVATE SECTION.
METHODS: m2.
ENDCLASS.
CLASS ZLINE_GLOBAL IMPLEMENTATION .
METHOD m1.
WRITE : 'Public Method C1'.
ENDMETHOD. "M1
METHOD m2.
WRITE : 'Private Method C1'.
ENDMETHOD.
ENDCLASS.
CLASS c2 DEFINITION FRIENDS ZLINE_GLOBAL. "my friends are here, allow them access to my (C2's) private components
PUBLIC SECTION.
METHODS :m3.
ENDCLASS.
CLASS c2 IMPLEMENTATION.
METHOD m3.
DATA : obj TYPE REF TO ZLINE_GLOBAL.
CREATE OBJECT obj.
CALL METHOD obj->M2. "here Iam calling Private method of global class
ENDMETHOD. "M3
ENDCLASS.
START-OF-SELECTION.
DATA obj_c2 TYPE REF TO c2.
CREATE OBJECT obj_c2.
obj_c2->m3( ).
Regards,
Chen -
Calling a class from another one (newbie)
(cib; 2003-oct28)
Hi,
PLugin for JSPWIKI;
Error when calling a class from a plugin.
Why is it wrong to call the class :
public class XercesChecker {
public static void main(String[] args) {
by:
String filepath = (fileList.getPath());
XercesChecker xc = new XercesChecker(filepath);
---COMPILATION ERROR MESSAGE-------*
javac -classpath"../;E:\prog\Tomcat41\webapps\JSPWiki\WEB-INF\lib\JSPWiki.jar"
XercesCheckerLoopPlugin.java
XercesCheckerLoopPlugin.java:40: cannot resolve symbol
symbol : constructor XercesChecker (java.lang.String)
location: class vendo.XercesChecker
XercesChecker xc = new XercesChecker(filepath);
^
1 error
---XercesCheckerLoopPlugin.java------*
package vendo;
import vendo.XercesChecker;
import java.io.*;
import java.io.Writer;
import java.io.File;
import com.ecyrd.jspwiki.WikiContext;
import java.util.Map;
import com.ecyrd.jspwiki.plugin.WikiPlugin;
import com.ecyrd.jspwiki.plugin.PluginException;
public class XercesCheckerLoopPlugin implements WikiPlugin
StringBuffer output = new StringBuffer();
public String execute(WikiContext context,
Map params)
throws PluginException
String message="";
// Get the names of the directory to loop through
String dirName = (String)params.get( "dir" );
String monresult="";
try {
File dirObj = new File (dirName);
if (dirObj.exists() == true) {
if (dirObj.isDirectory() == true) {
// Create an array of File objects, one for each file or directory in
dirObj.
File [] fileList = dirObj.listFiles();
// Display Source Directory Name.
output.append("Source Directory: "+dirName);
// Loop through File array and display.
for (int i = 0; i < fileList.length; i++) {
// Print the path to each file.
String filepath = (fileList[i].getPath());
output.append ("<br />D�b:" + fileList[i].getPath() + "Fin<br />" );
XercesChecker xc = new XercesChecker(filepath);
//output.append (xc(filepath));
} // for loop
} else { output.append (dirName+" is not a directory."); }
} else { output.append ("Directory "+dirName+" does not exist."); }
monresult = output.toString();
catch(Exception e){}
return monresult;
----------XercesChecker------------*
package vendo;
import org.apache.xerces.parsers.DOMParser;
import org.xml.sax.SAXException;
import java.io.IOException;
//http://www.ibiblio.org/xml/books/xmljava/chapters/ch09s06.html
public class XercesChecker {
public static void main(String[] args) {
if (args.length <= 0) {
System.out.println("Usage: java XercesChecker URL");
return;
String document = args[0];
DOMParser parser = new DOMParser();
try {
parser.parse(document);
System.out.println(document + " is well-formed.");
catch (SAXException e) {
System.out.println(document + " is not well-formed.");
catch (IOException e) {
System.out.println(
"Due to an IOException, the parser could not check "
+ document
Thanks for any help
webmaster.cib(at)laposte.netI do not see a constructor in the XercesChecker class that accepts a String.
-
Hi all,
I am working on handling events in global classes.
but my event is not triggererd,i m not able to find where it's going wrong.
Below is my code.
Global Class:ZCL_TEST_EVENT
events :EXCEEDEDRANGE
methods:CHECKRANGE,DISPLAYVENDOR.
Checkrange is event handler for exceededrange.
below is the code for methods.
method checkrange.
write:/ 'Vendor not within the range'(001).
exit.
endmethod.
method displayvendor.
DATA : exlfa1 TYPE lfa1.
IF imlifnr NOT BETWEEN 1000 AND 2000.
RAISE EVENT exceededrange.
ENDIF.
SELECT SINGLE * FROM lfa1
INTO exlfa1
WHERE lifnr = imlifnr
IF sy-subrc = 0.
WRITE : / exlfa1-lifnr,exlfa1-name1.
ELSE.
WRITE : / 'No vendor found'(002).
ENDIF.
endmethod.
below is the report I developed.
REPORT ztest_113.
parameters :plifnr type lfa1-lifnr obligatory.
data : obj type ref to ZCL_TEST_EVENT.
START-OF-SELECTION.
CREATE OBJECT obj.
CALL METHOD obj->displayvendor
EXPORTING
imlifnr = plifnr
Please helpYes, you do need to write the SET HANDLER statement. As per your current design, you can set the event handler in your method CONSTRUCTOR. Like:
method constructor.
SET HANDLER me->CHECKRANGE FOR me.
endmethod.
Regards,
Naimesh Patel -
How can I call the Class and have a PDF appear in seperate window?.
I would like to call the class/interface ZCL_UIU_PRN_ACCOUNT2, method Collect_data and have a Smartform executed to produce a PDF document in a Seperate window.
Where I have an issue is in opening another window to display the PDF.
I know the Standard PDF Facsheet does exactly this, but that is triggered via the Web browser and calls a Java script, avoiding and events and round-server trip processing. I would have changed the button values so that when pressed it does process the various events and eventually ends up at EH_ONPREVIEW for the BP_HEAD/Overview. I know just need to open a new window and call the process to create the PDF via Smartform.
Any suggestions would be more than welcome. I have spent so much time on this, and have gained no real ground, so far.
JasonHi,
in the method
data: zcontrol TYPE SSFCTRLOP.
zcontrol-device = 'PRINTER'.
zcontrol-langu = sy-langu.
zcontrol-no_dialog = 'X'.
zcontrol-getotf = 'X'.
data: job type SSFCRESCL.
data: devtype type RSPOPTYPE.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
IMPORTING
e_devtype = devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
data: output_options type SSFCOMPOP.
output_options-tdprinter = devtype.
call function FM_NAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = zcontrol
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = output_options
* USER_SETTINGS = 'X'
IMPORTING
* DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = job
* JOB_OUTPUT_OPTIONS =
TABLES
t_texto = t_texto
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
endif.
data: DOCTAB_ARCHIVE type TABLE OF DOCS,
LINES type TABLE OF TLINE.
*CALL FUNCTION 'CONVERT_OTF_2_PDF'
** EXPORTING
** USE_OTF_MC_CMD = 'X'
** ARCHIVE_INDEX =
** IMPORTING
** BIN_FILESIZE =
* TABLES
* otf = job-otfdata
* doctab_archive = doctab_archive
* lines = lines
* EXCEPTIONS
* ERR_CONV_NOT_POSSIBLE = 1
* ERR_OTF_MC_NOENDMARKER = 2
* OTHERS = 3
data: l_pdf_len type i,
l_pdf_xstring type XSTRING.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = l_pdf_len
bin_file = l_pdf_xstring
TABLES
otf = job-otfdata
lines = lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc is initial.
DATA: cached_response TYPE REF TO cl_http_response.
CREATE OBJECT cached_response
EXPORTING add_c_msg = 1.
l_pdf_len = XSTRLEN( l_pdf_xstring ).
cached_response->set_data( data = l_pdf_xstring
length = l_pdf_len ).
cached_response->set_header_field(
name = if_http_header_fields=>content_type
value = 'application/pdf' ).
cached_response->if_http_response~set_status( code = 200
reason = 'OK' ).
cached_response->if_http_response~server_cache_expire_rel(
expires_rel = 180 ).
data guid type GUID_32.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = guid.
data display_url type string.
CONCATENATE url '/' guid '.pdf' INTO
display_url.
cl_http_server=>server_cache_upload( url = display_url
response = cached_response ).
*GV_DISPLAY_URL & GV_PRINTON are class attributes
CLEAR: gv_display_url, gv_printon.
MOVE display_url TO gv_display_url.
gv_printon = 'X'.
ENDIF.
Send me you e-mail i cannot post the code that is used in the view.htm.
Best Regards,
Caíque Escaler
Edited by: Caíque Escaler on Nov 26, 2010 5:00 PM
Maybe you are looking for
-
Help setting up BTinternet email with Apple Mail
Hello everyone, I need help setting up a btinternet email account with Apple's Mail sofware. I am setting it up on behalf of my aunt and uncles new macbook pro so I hope i get some solutions quick because Im leaving their place by the end of the week
-
Can I have more than one Apple ID associated with my profile?
We bought an iPod and an iPad for my wife to use. She shares them with me. I recently bought an iMac, which I use alone. And we both bought iPhones. Can we share a profile? The iPod and an iPad are associated with her apple ID. The iMac is regi
-
How to save a form in a different file name?
Hello All, I have a form which has 7 pages. I have 3 buttons which are for submitting PDF,XML and print button. I do not want to keep SaveAs button. What I need : When the user completes all the required fields and clicks on SubmitAsPDF or SubmitAsXM
-
Bpm Experts , Did any one used the Pre-built Virtual Machine for SOA Suite and BPM Suite 11g to avoid the installation locally ? how difficult it is
-
Hi Experts, We are customizing IC WinClient for CRM 5.0 and would like to know the difference between the subfolders Planned Bus. Transactions and Planned Activities that are shown in the workspace IC_WORKLIST (Agent Inbox). Are the Business Ac