‎2009 May 26 9:37 AM
Hello,
I need help.
I have the following consultation and I want to control possible dumps in the dynamic consultation:
DATA: BEGIN OF i_campos_select OCCURS 0,
campo TYPE fieldname,
END OF i_campos_select.
FIELD-SYMBOLS : <sucesos> TYPE table.
DATA: BEGIN OF i_where OCCURS 0,
line LIKE rsdswhere-line,
END OF i_where.
SELECT (i_campos_select)
INTO CORRESPONDING FIELDS OF TABLE <sucesos>
FROM (i_tipos_buzon-tabla)
WHERE (i_where).
I want to use TRY ... CATCH and ENDTRY sentences:
The problem is that I don't know wich is the exceptionn will be raised.
Someone can help me, please?
‎2009 May 26 9:49 AM
Try somthing like this
DATA: BEGIN OF i_campos_select OCCURS 0,
campo TYPE fieldname,
END OF i_campos_select.
FIELD-SYMBOLS : <sucesos> TYPE table.
DATA: BEGIN OF i_where OCCURS 0,
line LIKE rsdswhere-line,
END OF i_where.
TRY.
SELECT (i_campos_select)
INTO CORRESPONDING FIELDS OF TABLE <sucesos>
FROM (i_tipos_buzon-tabla)
WHERE (i_where).
CATCH CX_SY_DYNAMIC_OSQL_SYNTAX.
MESSAGE E???.
ENDTRY.
‎2009 May 26 9:49 AM
Hi,
you will get the exception with the FM : POPUP_TO_INFORM
Can use the Exception Handling like this:
DATA: o_field TYPE REF TO cx_root," object to catch exception
text TYPE string. "string variable to store exception text.
TRY.
--- Your logic
*Exception Catching.
CATCH cx_root INTO o_field.
text = o_field->get_text( ).
* Calling Function to give information message regarding Exception
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-t03
txt1 = text
txt2 = text-t04.
LEAVE TO LIST-PROCESSING.
ENDTRY.thanks\
Mahesh
‎2009 May 26 9:49 AM
Try somthing like this
DATA: BEGIN OF i_campos_select OCCURS 0,
campo TYPE fieldname,
END OF i_campos_select.
FIELD-SYMBOLS : <sucesos> TYPE table.
DATA: BEGIN OF i_where OCCURS 0,
line LIKE rsdswhere-line,
END OF i_where.
TRY.
SELECT (i_campos_select)
INTO CORRESPONDING FIELDS OF TABLE <sucesos>
FROM (i_tipos_buzon-tabla)
WHERE (i_where).
CATCH CX_SY_DYNAMIC_OSQL_SYNTAX.
MESSAGE E???.
ENDTRY.
‎2009 May 26 10:10 AM
Hi,
DATA: BEGIN OF i_campos_select OCCURS 0,
campo TYPE fieldname,
END OF i_campos_select.
FIELD-SYMBOLS : <sucesos> TYPE table.
DATA: BEGIN OF i_where OCCURS 0,
line LIKE rsdswhere-line,
END OF i_where.
DATA: BEGIN OF i_tipos_buzon OCCURS 0,
tabla TYPE TABLE, " This statement is giving me error how to declare i_tipos_buzon-tabla
END OF i_tipos_buzon.
SELECT (i_campos_select)
INTO CORRESPONDING FIELDS OF TABLE <sucesos>
FROM (i_tipos_buzon-tabla)
WHERE (i_where).How to declare a Field Symbol table (i_tipos_buzon-tabla).
Regards,
Suneel G