How to handle SYS_REFCURSOR in Pro*C
Hi,
I am calling a Store procedure in Pro*c ,but that store procedure has an OUT parameter as SYS_REFCURSOR.
How to handle this issue in pro*c.
store procedure sample:
proc_SS(PV_I_ACC IN NUMBER,PV_CUR_O OUT SYS_REFCURSOR)
Any one help this issue ...how to handle sys ref cursor in Pro*c
Similar Messages
-
How to handle SYS_REFCURSOR?
I created table in oracle 11g like below,
CREATE TABEL family(
EMP_ID VARCHAR(255),
EMP_PASSWD VARCHAR(255),
EMP_NAME VARCHAR(255),
PRIMARY KEY(EMP_ID) )
And I inserted a few data. commit command was successful.
I made a stored procedure to call data. The sp is
CREATE OR REPLACE PROCEDURE SP_SELECT_ORA (
id_input IN VARCHAR2 ,
my_cursor OUT SYS_REFCURSOR
IS
BEGIN
OPEN my_cursor FOR
SELECT EMP_ID, EMP_PASSWD, EMP_NAME
FROM family
WHERE EMP_ID = ID_INPUT;
END;
But the stored procedure threw error. Stored procedure was created successfully but error was thrown when running.
I need your advice. Thanks in advance!
Best regards.It works for me
SQL> create table family
2 (
3 emp_id varchar(255),
4 emp_passwd varchar(255),
5 emp_name varchar(255),
6 primary key(emp_id)
7 );
Table created.
SQL> create or replace procedure sp_select_ora
2 (
3 id_input in varchar2 ,
4 my_cursor out sys_refcursor
5 )
6 is
7 begin
8 open my_cursor
9 for
10 select emp_id, emp_passwd, emp_name
11 from family
12 where emp_id = id_input;
13 end;
14 /
Procedure created.
SQL> insert into family (emp_id, emp_passwd, emp_name) values (1, 'abc', 'karthick');
1 row created.
SQL> insert into family (emp_id, emp_passwd, emp_name) values (2, 'abc', 'karthick');
1 row created.
SQL> commit;
Commit complete.
SQL> var rc refcursor
SQL> exec sp_select_ora(1, :rc)
PL/SQL procedure successfully completed.
SQL> print rc
EMP_ID
EMP_PASSWD
EMP_NAME
1
abc
karthick
SQL> -
How to handle exceptions in web dyn pro
Hi Frndz....
Can any one kindly xplain how to handle exceptions in web dyn pro..like we hav exceptionhandling in java ....so is there any for NWDS
THANKS & REGARDS
RajeshHi,
Web Dynpro Java is basically java only.i.e You program in java. Hence exceptions are supported in the same way as in java i.e. via try,catch and finally block.
Additionally,
In 04/04s if you create a method in any controller in web dynpro you cann't specify exception that can be thrown in the method. This is now possible in new programming web dynpro model in CE.
Hence when creating a method you can also specify custom or core java (lib)excetions.
Regards,
Ashwani Kr Sharma -
How to handle images (or let say mimes)
Dear MDM Gurus,
I want to start a discussion on how to handle MIMEs in MDM best.
Szenario is MDM as a SRM Catalog System - Some million products(records) and as many mimes.
- Import or linking?
- What are the pros and cons of these two ways?
- If I link images can MDM Server deliver them or do I need a seperate Webserver?
- If I import them how will the DB Size extend?
- If I "only" link the does it make a difference while lookup at import?
Maybe some of you have more questions and hopefully some of you have a kind of best-practice help for us.
Best regards
RomanHi Roman,
Its a nice discussion you have started. According to me
Advantage of linking
1. You can store the millions of images in the separate machine so the disk space on which SQL Server is installed can be used to store other data.
Disadvantage of linking
1. It may take some time to load the repository or in accessing the MDM clients because system has to actually search the location and fetch the mimes where they are stored.
Advantage of Storing
1. Loading and Opening of MDM Clients time can be reduced since all the images are stored in the repository itself
Disadvantage of Storing
1. If there are millions of images as you have said then majority of drive space will be used by these mimes and hence we can create less MDM records
Note: Sounds, Videos when stored in the repository cannot be played directly from the MDM Data manager they are first saved some where then only we can play them while this is not the case with linking
Regards,
Jitesh Talreja -
Sys_Refcursor in Pro*C
I am calling the procedure from pro*C code and procedure is using sys refcusror as out paramter.
While calling the procedure from pro*C it's giving error as wrong number of aruguments or return type.
The following out parameter is used in pro*C and this is working for user defined ref cursor except sys refcursor.
Please explain how to handle sys refcursor variable in pro*C
EXEC SQL BEGIN DECLARE SECTION;
sql_cursor ref_cur;
EXEC SQL END DECLARE SECTION;Any one help this issue ...how to handle sys ref cursor in Pro*c
-
How resilient is the macbook pro unibody from scratches?
How resilient is the macbook pro unibody from scratches? I get a little OCD about these things lol
It scratches easily. Handle it with care.
-
How to handle duplicate price creation while using RV_CONDITION_COPY
Hi,
I using FM RV_CONDITION_COPY in my BAPI to create the price but if the same record is being passed again either with same validation date or different validation dates then system pops up a window with message "The validity period of the condition created overlaps with conditions with shorter validity periods. These conditions will be deleted when you save." and other detail. This screen is same as when we try to create price using VK11.
Does anybody know how to handle this issue.
Thanks and Regards,
Seemathis may helps you.
Look at the below thread ....
Check if the below code can help you:
U can try like this
CONSTANTS:
CON_A(1) TYPE C VALUE 'A',
CON_B(1) TYPE C VALUE 'B',
CON_C TYPE C VALUE 'C',
CON_D TYPE C VALUE 'D',
CON_E TYPE C VALUE 'E',
CON_F TYPE C VALUE 'F',
CON_G TYPE C VALUE 'G',
CON_K TYPE C VALUE 'K',
CON_T TYPE C VALUE 'T',
CON_S(1) TYPE C VALUE 'S',
CON_V LIKE T681A-KAPPL VALUE 'V',
CON_X TYPE C VALUE 'x',
CON_XX TYPE C VALUE 'X',
CON_T074 LIKE T681-KOTABNR VALUE '074',
CON_PREF LIKE T685A-KSCHL VALUE 'PREF',
CON_ULTIMO LIKE RV13A-DATAB VALUE '99991231',
CON_DATA_LOG_NAME(8) TYPE C VALUE 'PREF',
CON_ERROR_LOG_NAME(8) TYPE C VALUE 'ERROR',
CON_CUSTOM_LOG_NAME(8) TYPE C VALUE 'P_CUSTOM'.
Verkaufsmengeneinheit
PERFORM f3_vkme_ermitteln.
Hauswährung
IF t001w-werks NE cstmat-werks.
PERFORM f3_waehrung_ermitteln USING cstmat-werks.
ENDIF.
pro Zollgebiet Konditionssatz anlegen
LOOP AT t_matwerte.
CHECK t_matwerte-noupd_cond IS INITIAL.
CLEAR: komk,
komp,
komg,
w_komv.
REFRESH w_komv.
Schlüssel füllen
komg-werks = w_marc-werks.
komg-matnr = w_marc-matnr.
komg-gzolx = t_matwerte-gzolx.
komg-land1 = t001w-land1. "101298
Preisinfo füllen
w_komv-kappl = 'V '.
w_komv-kschl = con_pref.
IF t_matwerte-kp = kp_max.
w_komv-kpein = 1.
MOVE kp_max TO w_komv-kbetr.
ELSE.
w_komv-kpein = pm_peinh.
COMPUTE w_komv-kbetr = t_matwerte-kp * pm_peinh / hlp_ameng.
ENDIF.
IF w_komv-kbetr = 0.
COMPUTE w_komv-kbetr = 1 / 100 * -1.
ENDIF.
w_komv-waers = t001-waers.
w_komv-kmein = hlp_ame.
APPEND w_komv.
CHECK f3_kz_update_cond IS INITIAL OR
NOT pm_simu IS INITIAL.
IF NOT pm_mdmps IS INITIAL.
MOVE komg-werks TO bg_kond-werks.
MOVE komg-matnr TO bg_kond-matnr.
MOVE komg-gzolx TO bg_kond-gzolx.
MOVE w_komv-kpein TO bg_kond-kpein.
MOVE w_komv-kbetr TO bg_kond-kbetr.
MOVE w_komv-kmein TO bg_kond-kmein.
MOVE w_komv-waers TO bg_kond-waers.
*{ REPLACE D20K904946 1
APPEND bg_kond.
Siemens: Fehlerkorektur SAP-Standard
READ TABLE BG_KOND TRANSPORTING NO FIELDS
WITH KEY WERKS = BG_KOND-WERKS
MATNR = BG_KOND-MATNR
GZOLX = BG_KOND-GZOLX
BINARY SEARCH.
INSERT BG_KOND INDEX SY-TABIX.
*} REPLACE
ENDIF.
CHECK f3_kz_update_cond IS INITIAL.
CALL FUNCTION 'RV_CONDITION_COPY'
EXPORTING
application = con_v
condition_table = con_t074 "Konditionstabelle
condition_type = con_pref "Konditionsart
date_from = sy-datlo "Von jetzt an
date_to = con_ultimo "Bis Ultimo
enqueue = 'X' "Sperren ist besser
i_komk = komk
i_komp = komp
key_fields = komg "Schlüssel
maintain_mode = 'A' "Lieber A als B
no_authority_check = 'X' "X wie nix
keep_old_records = ' '
OVERLAP_CONFIRMED = 'X'
IMPORTING
e_komk = komk
e_komp = komp
new_record = i_new_record
TABLES
copy_records = w_komv
EXCEPTIONS
enqueue_on_record = 01
invalid_application = 02
invalid_condition_number = 03
invalid_condition_type = 04
no_authority_ekorg = 05
no_authority_kschl = 06
no_authority_vkorg = 07
no_selection = 08
table_not_valid = 09.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE A???
ENDCASE.
CALL FUNCTION 'RV_CONDITION_SAVE'.
CALL FUNCTION 'RV_CONDITION_RESET'.
ENDLOOP. -
How do I 'buy' Quicktime Pro?
I am new to Mac and trying to set up the new Mac for Video Editing.
I tried buying Quicktime from the Apple site - but it wont accept my Australian phone number, I tried everything but it would not take my money. Finally I called some friends and they said it was because of different pricing arrangements and said I had to load my software from the Australian shop. What the? - so instead of paying $29, I went to the Australian online shop - which charges $49. Ok, I got over that after some ranting.
Then it says when I 'buy' it, it will send me a password to enter into Quicktime 7 Preferences - but First it says I need to download Quicktime 7. So I did that, but it refuses to load this, as the Mac says to me that there is ALREADY Quicktime X loaded on my machine. So I look - and yes I have Quicktime 10.
So if I have ten and I cant get 7, how do I upgrade to Pro?
The entire object is to set up Final Cut Pro - however I need to convert all the other types of movies that FCP cant handle. And I am led to believe Quicktime PRO 7 does that to at least some of the videos I have.
I have heaps I need to use - and they are
.3gp
.avi (which I want to use Quicktime Pro to convert)
.DIF
.flv
.mpg
.mpeg
.m2v
.mp4
.mov
.wmv
But - to start with - how do I get PRO to load?According to the various support notes - if I have FCP installed first (I have) and then I install QT7, it should automatically become PRO. It doesnt. So now what?
Any ideas?
Re-run the FCP installation. I believe it has to "see" QT 7 while installing before the FCP installer will upgrade the QT 7 Player to QT 7 Pro. (Same solution if the automatic "Pro" registration is lost during OS upgrade/installation.)
With Regard to QT 7 registration, if you actually purchased a QT 7 "Pro" key and did not receive the email with registration name and key number, then contact customer service at the online Apple store where you purchased the key. (Be sure to have purchaser order information available.) Non-receipt of confirmation email may indicate the "key" was not properly generated. If they can confirm this, then your money should be refunded and, since you no longer need the key with FCP use, you should be good to go... -
How noisy is the Mac Pro?
How noisy is the Mac Pro - say compared to an iMac?
Hello Pagemakers2,
First,I doubt you'll get a definitive answer to this kind of question because there's significant variability in the "intensity of use" among Mac Pro owners. I mean of course, some users need to run apps and process file types which naturally require more cooling of hard-running cpus and that will cause more fan noise.
I'm almost embarrassed to admit: the most "intense" task my Mac Pro handles (video encoding) uses only about 65% of processing capacity. So... I never hear the fans at all, the Mac Pro does not even put out "warm air" from the exhaust ports. I work in a quiet environment (home) where, sometimes, I have to play music on iTunes or at least turn on the tv in the next room - just to have a little background noise. Meanwhile, the fan in my eMac can be heard when I wake it from sleep - but never unpleasantly.
I'm pretty sure most users will agree: when idling (surfing the web, even running filters on big digital files with Photoshop™) the Mac Pro is pretty quiet.
Oh, another factor to consider is: Whether or not you run heavy apps with a heavy work load "continuously." I mean for example: running those video conversions may take a few minutes on the Mac Pro (Intel). But I may run one file to burn to DVD on any given day. (On average, less than once a day.)
Burning: the original Sony OPTIARC drive which came factory installed made "moderate noise" (for about 2-3 minutes of burn time) but the noise was "annoying." I replaced that with (eventually) two Samsung units: these both make audible noise, but it seems less and certainly doesn't annoy me like the Sony unit did.
Just to be clear: I didn't replace the Sony drive due to noise, I did so because that model didn't (1) handle DVD-DL and (2) I wanted DVD drives which provide the Lightscribe disk labeling software. The "more pleasant sound" was a bonus. -
How to handle exception CX_SY_REF_IS_INITIAL
hi experts,
im working on a test scenario for abap mapping in SAP XI im getting this error
An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference
i understand that i need to catch this exception in the abap coding but i'm not familiar with oops concepts
can any one please suggest me how to handle this exception for the following code...
method IF_MAPPING~EXECUTE.
break x1149.
* initialize iXML
TYPE-POOLS: ixml.
class cl_ixml definition load.
** Instances & Variable declaration =======================
* instance main factory
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
* instance input stream factory
l_streamfactory TYPE REF TO if_ixml_stream_factory,
* instance input stream
l_istream TYPE REF TO if_ixml_istream,
* instance input document
l_document TYPE REF TO if_ixml_document,
* instance parse input document
l_parser TYPE REF TO if_ixml_parser,
* instance for elements within the nodes
node TYPE REF TO if_ixml_node,
*instance of nodemap
nodemap TYPE REF TO if_ixml_named_node_map,
* instance for iterator
iterator TYPE REF TO if_ixml_node_iterator,
name TYPE string,
value TYPE string,
* instance main factory
o_ixml TYPE REF TO if_ixml,
* instance output document
o_document TYPE REF TO if_ixml_document,
* instance output stream
o_istream TYPE REF TO if_ixml_ostream,
* instance parse output document
o_parser TYPE REF TO if_ixml_parser,
* instance fot renderer
renderer type ref to if_ixml_renderer,
irc type i,
l_xml_size TYPE i,
*ROOT ELEMENT
l_element_MT_DEMANDTEC_COST TYPE REF TO if_ixml_element,
*NEXT CHILD ELEMENT FROM THE ABOVE PARENT
l_element_DT_DEMANDTEC TYPE REF TO if_ixml_element,
*CHILDREN1 ELEMENT FOR DT_DEMANDTEC
l_element_DT_WHSE TYPE REF TO if_ixml_element,
*CHILDREN2 ELEMENT FOR DT_DEMANDTEC
l_element_DT_DC TYPE REF TO if_ixml_element,
*CHILDREN3 ELEMENT FOR DT_DEMANDTEC
l_element_DT_PLANT TYPE REF TO if_ixml_element,
*CHILDREN4 ELEMENT FOR DT_DEMANDTEC
l_element_DT_QTY TYPE REF TO if_ixml_element.
*saving the xml document
DATA: l_xml_table TYPE TABLE OF t_xml_line.
types: begin of t_source,
whse(5),
dc(4) ,
plant(4),
qty type i,
end of t_source.
types: tt_source TYPE STANDARD TABLE OF t_source.
data: wa_source type t_source.
data: it_source TYPE tt_source,
ivalue type string.
* Procedures and business logic =======================================
* Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
* Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
* create input stream
l_istream = l_streamfactory->create_istream_xstring( source ).
* initialize input document
l_document = l_ixml->create_document( ).
* Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
* parse input document
l_parser->parse( ).
* Validate a document
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
* Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
refresh : it_source.
node ?= l_document.
CHECK NOT node IS INITIAL.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WHEN if_ixml_node=>co_node_text.
* text node
value = node->get_value( ).
if name eq 'DT_WHSE'.
wa_source-whse = value.
ELSEIF name eq 'DT_DC'.
wa_source-DC = value.
ELSEIF name eq 'DT_PLANT'.
wa_source-PLANT = value.
ELSEIF name eq 'DT_QTY'.
wa_source-QTY = value.
COLLECT wa_source INto it_source.
CLEAR wa_source.
ENDIF.
endcase.
node = iterator->get_next( ).
endwhile.
ENDIF.
loop at it_source into wa_source .
at first.
* Creating a ixml factory
o_ixml = cl_ixml=>create( ).
* Creating the dom object model
o_document = l_ixml->create_document( ).
endat.
* Build and Fill root node MT_DEMANDTEC_COST
AT FIRST.
l_element_MT_DEMANDTEC_COST =
O_document->create_simple_element(
name = 'MT_DEMANDTEC_COST'
parent = o_document ).
ENDAT.
* Build and Fill Child node DT_DEMANDTEC for parent
* MT_DEMANDTEC_COST
l_element_DT_DEMANDTEC = O_document->create_simple_element(
name = 'DT_DEMANDTEC'
parent = l_element_MT_DEMANDTEC_COST ).
* Build and Fill Child node1 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-WHSE.
l_element_DT_WHSE = O_document->create_simple_element(
name = 'DT_WHSE'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node2 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-DC.
l_element_DT_DC = O_document->create_simple_element(
name = 'DT_DC'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node3 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-PLANT.
l_element_DT_PLANT = O_document->create_simple_element(
name = 'DT_PLANT'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node4 DT_QTY for parent DT_DEMANDTEC
ivalue = wa_source-QTY.
l_element_DT_QTY = O_document->create_simple_element(
name = 'DT_QTY'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
endloop.
* render document ======================================================
* create output stream
o_istream = l_streamfactory->create_ostream_xstring( result ).
* Connect internal XML table to stream factory
o_istream = l_streamfactory->create_ostream_itable( table =
l_xml_table ).
renderer = o_ixml->create_renderer( ostream = o_istream
document = o_document ).
irc = renderer->render( ).
* how do i catch the exception for type CX_SY_REF_IS_INITIAL ...?
endmethod.
full reward points for answers.
Thanks & Regards,
Uday Kumar.
Edited by: UDAY on May 6, 2008 9:32 PMHi Uday,
Its occurs because you're trying to access a objects with null reference. Or you forgot to create an instance or an error occurs during the instance creation. So You should put all your "Procedures and business logic" inside a Try/catch block. as follow.
" Define a class exception object to get error message......
DATA o_exception TYPE REF TO cx_sy_ref_is_initial.
"// Use the statment Try block to catch the error.
TRY.
* Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
* Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
* create input stream
l_istream = l_streamfactory->create_istream_xstring( source ).
* initialize input document
l_document = l_ixml->create_document( ).
* Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
* parse input document
l_parser->parse( ).
* Validate a document
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
* Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
refresh : it_source.
node ?= l_document.
CHECK NOT node IS INITIAL.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WHEN if_ixml_node=>co_node_text.
* text node
value = node->get_value( ).
if name eq 'DT_WHSE'.
wa_source-whse = value.
ELSEIF name eq 'DT_DC'.
wa_source-DC = value.
ELSEIF name eq 'DT_PLANT'.
wa_source-PLANT = value.
ELSEIF name eq 'DT_QTY'.
wa_source-QTY = value.
COLLECT wa_source INto it_source.
CLEAR wa_source.
ENDIF.
endcase.
node = iterator->get_next( ).
endwhile.
ENDIF.
loop at it_source into wa_source .
at first.
* Creating a ixml factory
o_ixml = cl_ixml=>create( ).
* Creating the dom object model
o_document = l_ixml->create_document( ).
endat.
* Build and Fill root node MT_DEMANDTEC_COST
AT FIRST.
l_element_MT_DEMANDTEC_COST =
O_document->create_simple_element(
name = 'MT_DEMANDTEC_COST'
parent = o_document ).
ENDAT.
* Build and Fill Child node DT_DEMANDTEC for parent
* MT_DEMANDTEC_COST
l_element_DT_DEMANDTEC = O_document->create_simple_element(
name = 'DT_DEMANDTEC'
parent = l_element_MT_DEMANDTEC_COST ).
* Build and Fill Child node1 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-WHSE.
l_element_DT_WHSE = O_document->create_simple_element(
name = 'DT_WHSE'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node2 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-DC.
l_element_DT_DC = O_document->create_simple_element(
name = 'DT_DC'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node3 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-PLANT.
l_element_DT_PLANT = O_document->create_simple_element(
name = 'DT_PLANT'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node4 DT_QTY for parent DT_DEMANDTEC
ivalue = wa_source-QTY.
l_element_DT_QTY = O_document->create_simple_element(
name = 'DT_QTY'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
endloop.
* render document ======================================================
* create output stream
o_istream = l_streamfactory->create_ostream_xstring( result ).
* Connect internal XML table to stream factory
o_istream = l_streamfactory->create_ostream_itable( table =
l_xml_table ).
renderer = o_ixml->create_renderer( ostream = o_istream
document = o_document ).
irc = renderer->render( ).
" The Statement CATCH define a block that catches the exceptions of the
" exception class cx_sy_ref_is_initial
CATCH cx_sy_ref_is_initial INTO o_exception.
" If you need to get the error message text do as follow
DATA errorMsg type string.
" Get the message text
errorMsg = o_exception->GET_TEXT( ).
" Display the error information
MESSAGE errorMsg TYPE 'I'.
ENDTRY.
The TRY block defines a guarded area whose class-based exceptions can be caught in the subsequent CATCH blocks. If no exception occurs in the TRY block and it reaches its end, the system continues the processing after ENDTRY. If a class-based exception occurs in the TRY block, the system searches for an exception handler in the same or an external TRY control structure.
Font: SAP Help
You can see a how to create and use an exception in this example [ ABAP Objects - Defining a Class-based exceptions|https://wiki.sdn.sap.com/wiki/x/19w] .
Best Regards.
Marcelo Ramos -
How to handle null values in RTF templates
Hi - I have two groups in a report for different SQL and two formulas for each group, CF_ELE_CNT and CF_ELE_CNT1. In the template I use the below code to print or not print a section.
<?if:number(CF_ELE_CNT +CF_ELE_CNT1) >0?>
The problem is when there is no data in the second group its not creating the XML tag for CF_ELE_CNT1, though CF_ELE_CNT has 13, it still does not print that partucular section. If I remove CF_ELE_CNT1 from the condition it works fine. I was wondering how to handle this.
Any help would be appreciated!!
Thanks,
RavHey Rav,
You can add a check to identify it the element/tag is present or not
<?if:(CF_ELE_CNT1)?> will give true, if the element is present otherwise falsesince you are adding the two elements, you have to add a or condition.
<?if:(CF_ELE_CNT and number(CF_ELE_CNT) >0 ) or ( CF_ELE_CNT1 and CF_ELE_CNT1 >0)?> -
How to handle file on application server without coading?
HI all,
can anybody tell me How to handle file on application server without coading? Is there any solution?
Thanks in advance.> can anybody tell me How to handle file on application server without coading? Is there any solution?
what is that you want to handle. what you do if you don't code ... -
How to connect my macbook pro to an older tv that has rca cable?
How to connect my macbook pro to an older tv thas has rca cables?
The yellow RCA jack is called "NTSC Analog Composite Video", or "Video" for short. You need an adapter to "Video".
Exactly which MacBook Pro (or which output Display Port) do you have? -
How to connect my macbook pro to my car cd player
hello how to connect my macbook pro to my car cd player
If the CD player has audio line outputs, you could tap the audio input port of your MBP. I do question the practicality of doing so.
Ciao. -
How to connect my macbook pro to a computer-to-computer network?
how to connect my macbook pro to a computer-to-computer network? My home computer is a Window 8 OS. Thx.
The easiest way, and it may work from scratch, is to share the folders/drives you want access to on your pc, noticing what are the default parameters (eg "workgroup" etc.).
Then, you can connect your mac directly by ethernet, for instance, and, in Finder, go to > Network, you should see the folders/drives. You may be asked to provide user/password.
Don't get confused by regular/crossed ethernet cable, as mac can cross by software, so a regular cable will be ok.
Anyway, either you isd modem has the ability to connect several devices (multiple ethernet sockets, or wifi), or you can buy a router, which isn't expansive.
Maybe you are looking for
-
A whole bunch of issues here. I can't install any software. It started when iPlayer stopped working at all. This led me to try to update software versions such as Adobe Air to 3.5 (Failed) then quicktime player 7.6.6 as recommended (Failed) then the
-
Query In SP runs 10x slower than straight query - NOT Parameter Sniffing Issue
Hi Everyone, I have a real mystery on my hands that appears to be a parameter sniffing issue with my SP but I think is not. I have tried every parameter sniffing workaround trick in the book ( local variables, option recompile, with recompile, optimi
-
I have tried setting my homepage to Google and to Bing but Firefox closes as soon as the page loads. Starting it a second time works with no problems.
-
Adding Standard Infotype fields to Custom Infotype
Hi, I have a Requirement where I've created a Custom Infotype. Now, client needs to add Standard KOSTL and Email Address fileds to it. Whenever, someone tries to create / change this Custom Infotype for any Employee, the Pernr's KOSTL and Email Addr
-
I have just bought a new 6120 phone and I cannot see how to set the time date bar that acts as a screen saver. It seems to appear for a short time and then dissapear. The bar is a slim line that moves position up and down the screen with time and dat