Short Dump for Dynamic Select Query
Hello all,
I get a short dump for my dynamic select query at the end of the code. The error is "The types of operands "dbtab" and "itab" cannot be converted into one another."
My code looks like below.
FORM get_ccnum_2 USING p_tabname TYPE dd03l-tabname.
DATA: p_table(30) TYPE c.
FIELD-SYMBOLS: <dyn_wa>,
<t> TYPE table.
DATA: it_fldcat TYPE lvc_t_fcat.
TYPE-POOLS : abap.
DATA: it_details TYPE abap_compdescr_tab,
wa_details TYPE abap_compdescr.
DATA: ref_descr TYPE REF TO cl_abap_structdescr.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data,
wa_it_fldcat TYPE lvc_s_fcat.
p_table = p_tabname.
ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
it_details[] = ref_descr->components[].
LOOP AT it_details INTO wa_details.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = wa_details-name .
wa_it_fldcat-datatype = wa_details-type_kind.
wa_it_fldcat-intlen = wa_details-length.
wa_it_fldcat-decimals = wa_details-decimals.
APPEND wa_it_fldcat TO it_fldcat .
ENDLOOP.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fldcat
IMPORTING
ep_table = new_table.
ASSIGN new_table->* TO <t>.
CREATE DATA new_line LIKE LINE OF <t>.
ASSIGN new_line->* TO <dyn_wa>.
wa_cond = 'CCNUM <> '' '' '.
APPEND wa_cond TO tab_cond.
SELECT * INTO TABLE <t>
FROM (p_table)
WHERE (tab_cond)
ORDER BY (tab_ord).
ENDFORM. " GET_CCNUM_2
Hi,
I tried to execute the code using table BSEGC and it gave a short dump..
the actual exception that shows in ST22 IS ..UNICODE_TYPES_NOT_CONVERTIBLE..
I think there is something wrong in the internal table creation..
Instead of using the method cl_alv_table_create=>create_dynamic_table to create the dynamic table I used the following and it worked..
CREATE DATA new_table TYPE TABLE OF (p_table).
* Comment begin " Naren
* ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
* it_details[] = ref_descr->components[].
* LOOP AT it_details INTO wa_details.
* CLEAR wa_it_fldcat.
* wa_it_fldcat-fieldname = wa_details-name .
* wa_it_fldcat-datatype = wa_details-type_kind.
* wa_it_fldcat-intlen = wa_details-length.
* wa_it_fldcat-decimals = wa_details-decimals.
* APPEND wa_it_fldcat TO it_fldcat .
* ENDLOOP.
* CALL METHOD cl_alv_table_create=>create_dynamic_table
* EXPORTING
* it_fieldcatalog = it_fldcat
* IMPORTING
* ep_table = new_table.
* Comment End. " Naren
CREATE DATA new_table TYPE TABLE OF (p_table). " New code by naren
Please Try this..
Thanks
Naren
Similar Messages
-
Hi Gurus,
I have a select query as follows:
SELECT
vbap~vbeln
vbap~posnr
vbap~matnr
vbap~arktx
vbap~pstyv
vbap~abgru
vbap~prodh
vbap~netwr
vbap~werks
vbap~kwmeng
vbap~prctr
vbap~ps_psp_pnr
FROM vbap
INTO TABLE i_item_vbap
FOR ALL ENTRIES IN i_reg_vbak
WHERE
vbap~vbeln EQ i_reg_vbak-vbeln AND
vbap~matnr IN s_matnr AND
vbap~werks IN s_werks .
However, when I execute the program, I get the dump saying as:
I get this exception "DBIF_RSQL_INVALID_RSQL", assigned to CLASS "CX_SY_OPEN_SQL_DB"
Please help me in understanding this.
Also, there are only 85 entries in i_reg_vbak, plus not many values are there for s_matnr and s_werks.
I tried executing this query w/o for all entries, but still it gave a dump.
Waiting for your reply, thanks!hello
SELECT
vbap~vbeln
vbap~posnr
vbap~matnr
vbap~arktx
vbap~pstyv
vbap~abgru
vbap~prodh
vbap~netwr
vbap~werks
vbap~kwmeng
vbap~prctr
vbap~ps_psp_pnr
from vbap into corresponding fields of table it_vbap.
if u use any fields of vbap on selection scrren then mention as
eg: where vbeln in s_vbeln etc.
with regards,
sumanth reddy -
Hi,
I need to write a dynamic select query based on the user's selection.
On Selection screen select options provided of fields like Company code, Plant and Sales Organazation.
Now, I have find out how many tables having field company code(If User enters data in this field) from DD03L table. And, based on the data retrieved, how many entries does exists in those tables matching user criteria.
Same thing for Plant and Sales Organization.
Thanks in Advance.
NitinHello Nitin,
I was trying to write a code for your requirement ) I was got this short dump. Basically you need to capture this SQL exception.
DATA:
it_dd03l TYPE STANDARD TABLE OF dd03l,
wa_dd03l TYPE dd03l,
v_tabname TYPE string,
v_tabname1 TYPE tabname.
SELECT * FROM dd03l INTO TABLE it_dd03l
WHERE fieldname = 'BUKRS'.
IF sy-subrc = 0.
LOOP AT it_dd03l INTO wa_dd03l.
v_tabname = wa_dd03l-tabname.
TRY.
SELECT COUNT(*)
FROM (v_tabname)
WHERE bukrs = p_bukrs.
IF sy-subrc = 0.
v_tabname1 = v_tabname.
WRITE: / v_tabname1, 35 sy-dbcnt.
ENDIF.
CATCH cx_sy_dynamic_osql_semantics.
ENDTRY.
ENDLOOP.
ENDIF.
Trust me, it will take hell lot of time to execute this report :-((
BR,
Suhas
Edited by: Suhas Saha on Dec 17, 2008 12:08 PM -
Dynamic select query with dynamic where condition
Hi all,
I want to use the dynamic select query with dynamic where condition. For that I used the below code but I am getting dump when using this code.
Please advice, if there is any other way to achieve this requirement.
Thanks,
Sanket Sethi
Code***************
PARAMETERS: p_tabnam TYPE tabname,
p_selfl1 TYPE edpline,
p_value TYPE edpline,
p_where1 TYPE edpline .
DATA: lt_where TYPE TABLE OF edpline,
lt_sel_list TYPE TABLE OF edpline,
l_wa_name TYPE string,
ls_where TYPE edpline,
l_having TYPE string,
dref TYPE REF TO data,
itab_type TYPE REF TO cl_abap_tabledescr,
struct_type TYPE REF TO cl_abap_structdescr,
elem_type TYPE REF TO cl_abap_elemdescr,
comp_tab TYPE cl_abap_structdescr=>component_table,
comp_fld TYPE cl_abap_structdescr=>component.
TYPES: f_count TYPE i.
FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,
* <ls_outtab> TYPE ANY,
<l_fld> TYPE ANY.
struct_type ?= cl_abap_typedescr=>describe_by_name( p_tabnam ).
elem_type ?= cl_abap_elemdescr=>describe_by_name( 'F_COUNT' ).
comp_tab = struct_type->get_components( ).
comp_fld-name = 'F_COUNT'.
comp_fld-type = elem_type.
APPEND comp_fld TO comp_tab.
struct_type = cl_abap_structdescr=>create( comp_tab ).
itab_type = cl_abap_tabledescr=>create( struct_type ).
l_wa_name = 'l_WA'.
CREATE DATA dref TYPE HANDLE itab_type.
ASSIGN dref->* TO <lt_outtab>.
*CREATE DATA dref TYPE HANDLE struct_type.
*ASSIGN dref->* TO <ls_outtab>.
* Creation of the selection fields
APPEND p_selfl1 TO lt_sel_list.
APPEND 'COUNT(*) AS F_COUNT' TO lt_sel_list.
** Creation of the "where" clause
*CONCATENATE p_selfl1 '= '' p_value ''.'
* INTO ls_where
* SEPARATED BY space.
*APPEND ls_where TO lt_where.
* Creation of the "where" clause
APPEND p_where1 TO lt_where.
* Creation of the "having" clause
l_having = 'count(*) >= 1'.
* THE dynamic select
SELECT (lt_sel_list)
FROM (p_tabnam)
INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>.
* WHERE (lt_where).Hi Sanket,
The above given logic of mine works for you, put the code in the If condition and try-
just like below:
IF NOT P_EBELN IS INITIAL.
lt_where = '& = ''&'' '.
REPLACE '&' WITH p_ebeln INTO lt_where.
REPLACE '&' WITH field_value INTO lt_where.
SELECT (lt_sel_list) INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>
FROM (p_tabnam)
WHERE (lt_where).
ENDIF.
thanks\
Mahesh -
How to create a Type Object with Dynamic select query columns in a Function
Hi Every One,
I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row.
I have tried by
SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE a.country_code = 'US';
c :=DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c,actual_query,DBMS_SQL.NATIVE);
l_status := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt LOOP
DBMS_SQL.DEFINE_COLUMN(c,j,v_val,2000);
END LOOP;
FOR j in 1..col_cnt LOOP
DBMS_SQL.COLUMN_VALUE(c,j,v_val);
END LOOP;
But got stuck, how to iterate the values and assign to a Type Object from the cursor. Can any one guide me how to do the process.
Thanks,
mallikj2Hi Justin,
First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
Thanks in Advance,
mallikj2. -
Dynamic Select query is failing with error "Invalid Table Name"
OPEN rc FOR 'SELECT count(*) from :s' USING tab_name;
fetch rc into rec_count;
CLOSE rc;
my requirement is to build dynamic select query to retrieve the total count of rows in each table ( variable tab_name contains the table_name )
But I am getting stuck by this errror, not sure if there is any alternative !
ORA-00903: invalid table name
ORA-06512: at line 43OPEN rc FOR 'SELECT count(*) from '||tab_name;
fetch rc into rec_count;
CLOSE rc;
-- This will work
1. Create a sql statement.
2. Open ref cursor for that statement. -
Absolute dynamic select query with dynamic join and where
Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
SELECT (FIELDS) INTO TABLE IT_TABLES
FROM ( (ME->TABLE1) inner join ( me->table2 )
on ( on_condition ) )
WHERE (me->where_fields).
Ags.It worked for me in a following way:
select * into corresponding fields of table <result_table>
from (join_string)
where (l_where).
Where the contents of join_string were dynamically build using concatenation. So it will be something like
concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
<...>
add here matching/reference colums, something like
concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
concatenate join_string temp1 '=' temp2 into join_string separated by space.
<...>
concatenate join_string ')' into join_string separated by space.
And then use similar approach for l_where variable. -
FAGLL03 : Submit syntax for dynamic selections
Hi Experts,
My z report contains following fields in selction screen.
1 . G/ L account
2. Comapny code
3. posting date
4. document type
5. layout
In my z report i used following syntax for passing selection screen values to standard program and getting data.
SUBMIT FAGL_ACCOUNT_ITEMS_GL
WITH SD_SAKNR IN S_SAKNR
WITH SD_BUKRS IN S_BUKRS
WITH X_OPSEL EQ ' '
WITH X_CLSEL EQ ' '
WITH X_AISEL EQ 'X'
WITH SO_BUDAT IN S_BUDAT
WITH PA_VARI EQ P_VAR
EXPORTING LIST TO MEMORY
AND RETURN.
The above syntax is not working for dynamic selection field ( document type ), entire document types data is fetching from standard program. I want to fetch document type data based on my z report selection values for document type field.
Expect for document type field , submit syntax is working.
kindly provide submit syntax for my above requirement .
Any suggestions from experts....
thanks & regards,
Hari priya
Edited by: Hari Priya on Aug 24, 2009 4:33 PMHi,
Try like this.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = 'FAGL_ACCOUNT_ITEMS_GL'
tables
selection_table = i_sel[].
Fill your profit center values in i_sel
Submit FAGL_ACCOUNT_ITEMS_GL with selection-table i_sel and return
WITH FREE SELECTIONS TEXPR AND RETURN
Regards,
Shamma -
How to add Document group in t code S_ALR_87012082 for dynamic selection.
Hi Gurus,
I Need to add Document group in t code S_ALR_87012082 for dynamic selection.
Currently here two groups are showing , Vender and Comp Code. i need to add Document group there. Kindly guide me in this.
Thanks in advance.Hi
Pls follow below report
*S_ALR_87012103 - List of Vendor Line Items *
In dynamic selections you can find Document number, there you can give the range
Reg
Vishnu -
Selection variable for dynamic selection in QE51n
Hi All,
I have a scenario were we have a repetitive Manufacturing and we create one insp. lot of origin 13 and keep creating insp. points for days, so my user wants the insp. points to be displayed only for the past 3 days based of the Date Insp. point identifier which is one of dynamic selection criteria under insp. points, I see with other transaction I can do selection variable on dates for dynamic selection fields but I cannot do that in QE51n, I can do the same in QE51 but not in QE51n, can some tell me if there is a OSS or other way to get this working.
I appreciate your help.
Thanks,Hi Srikant,
I think you can meet the requirement in QE51N also.
In the screen for QE51N :Result Recording Work list", Follow this Path,,,,,,,,,
Edit--->Dynamic Selection.
The system will pop-up new small window for "Dynamic selection for insp. lot and operation" here I there is one folder is available named "Inspection point " which is having the selection criteria "Inspection point", double click on it and enter the desired values.
Regards,
Shyamal -
How to use Field-symbol with dynamic select query
Can anybody tell me, how to use field-symbols in the dynamic select query.
FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }.
1. ... typing
2. ... STRUCTURE struc DEFAULT dobj
The FIELD-SYMBOLS statement declares a field symbol <fs>. The name conventions apply to the name fs. The angle brackets of the field symbols indicate the difference to data objects and are obligatory. You can declare field symbols in any procedure and in the global declaration section of an ABAP program, but not in the declaration section of a class or an interface. You can use a field symbol in any operand position in which it is visible and which match the typing defined using typing.
After its declaration, a field symbol is initial - that is, it does not reference a memory area. You have to assign a memory area to it (normally using the ASSIGN statement) before you can use it as an operand. Otherwise an exception will be triggered.
eg.
FIELD-SYMBOLS <fs> TYPE ANY.
DATA: BEGIN OF line,
string1(10) VALUE '0123456789',
string2(10) VALUE 'abcdefghij',
END OF line.
WRITE / line-string1+5.
ASSIGN line-string1+5(*) TO <fs>.
WRITE / <fs>.
output:
56789
56789
reward if helpful
anju -
Submit syntax for dynamic selections for T-code FAGLL03
Hi Experts,
My z report contains following fields in selction screen.
1 . G/ L account
2. Comapny code
3. posting date
4. Profit Center
5. layout
In my z report i used following syntax for passing selection screen values to standard program and getting data.
This is for T-code FAGLL03
SUBMIT FAGL_ACCOUNT_ITEMS_GL
WITH SD_SAKNR IN S_SAKNR
WITH SD_BUKRS IN S_BUKRS
WITH %%DYN001-LOW (Profit Center)
EXPORTING LIST TO MEMORY
AND RETURN.
The above syntax is not working for dynamic selection field ( Profit Center), entire Profit center data is fetching from standard program. I want to fetch profit center data based on my z report selection values .
Expect for profit center field , submit syntax is working.
kindly provide submit syntax for my above requirement .
Any suggestions from experts....
Edited by: PLP REDDY on Nov 25, 2009 8:59 AMIndeed it won't work. Instead of passing parameters one by one use
[SUIBMIT... WITH SELECTION-TABLE rspar|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_3@3@]
Here you add one line per parameter (field KIND = 'P' ) and multiple lines per select options (field KIND = 'S' ). For the latter you need also provide SIGN and OPTIONS, i.e SIGN = 'I' , OPTIONS = 'EQ'
The lin I gave you will explain it more.
Regards
Marcin -
Dynamic Select Query including Dynamic Tables with For all Entries
Hello everyone,
I need to create a select query which involves using of Dynamic Tables.
Suppose I have a dynamic table <d1> which consist of let say 10 records.
Now i need to make a select query putting data into another dynamic table <d2>
CONCATENATE keyfield '=' '<d1>' INTO g_condition SEPARATED BY space.
CONCATENATE g_condition '-' keyfield INTO g_condition.
SELECT * FROM (wa_all_tables-name) INTO CORRESPONDING FIELDS OF TABLE <d1>
FOR ALL ENTRIES IN <d1>
WHERE (g_condition).
But it is giving dump.
Please help me on this....Short text
A condition specified at runtime has an unexpected format.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZNG_CUSTOMWRITE" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
not caught in
procedure "WRITE_ARCHIVE_PROD" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The current ABAP program has tried to execute an Open SQL statement
which contains a WHERE, ON or HAVING condition with a dynamic part.
The part of the WHERE, ON or HAVING condition specified at runtime in
a field or an internal table, contains the invalid value "ZCOURIER-ZCOURIERID".
CONCATENATE keyfield '=' g_header INTO g_condition SEPARATED BY space.
CONCATENATE g_condition '-' keyfield INTO g_condition.
SELECT * FROM (wa_all_tables-name) INTO CORRESPONDING FIELDS OF TABLE <dyn_table1>
FOR ALL ENTRIES IN <dyn_table>
WHERE (g_condition). -
Short Dump for Query in Quality server
Hi Experts,
i have a query, when i execute it in developement server, it successfully execute. But when i execute the same query in Quality,
it gets short dump, giving following error.
ABEND RSBOLAP (000): Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
MSGV1: SAPMSSY1
MSGV3: UNCAUGHT_EXCEPTION
previously it was working fine in quality, but suddenly it gets shortdu while executing.
i transported again, but error still persists.
i tried execute this query in RSRT also, where it stops at a break point.
this query uses a custimer exit variable, but this variable is not the reason for short dump. without this variable also same error occurs.
please help me to resolve this.
Thanks
SaurabhHi,
Please try to provide max input in the variable screen, Don't execute the query based on single selection criteria. And also please perform cube compression before executing the query.
Hope this will solve the issue .
Thanks
PT -
Function short dump - A dynamically specified column name is unknown.
Hello,
I've created BRF fuction according to the Note 1466868 - Dunning by collection strategy with BRFplus. I get short dump during simulation of function with following exception:
"A dynamically specified column name is unknown. "
Runtime Errors SAPSQL_INVALID_FIELDNAME
Exception CX_SY_DYNAMIC_OSQL_SEMANTICS
No. Ty. Program Include Line
Name
19 METHOD CL_FDT_ELEMENT================CP CL_FDT_ELEMENT================CM012 129
CL_FDT_ELEMENT=>GET_VALUES_DDIC
18 METHOD CL_FDT_ELEMENT================CP CL_FDT_ELEMENT================CM011 124
CL_FDT_ELEMENT=>GET_VALUES
17 METHOD CL_FDT_WD_RENDER_VALUE_INPUT==CP CL_FDT_WD_RENDER_VALUE_INPUT==CM00G 139
CL_FDT_WD_RENDER_VALUE_INPUT=>VALIDATE_VALUES
In my opinion there is uncorrect query.
Current version:
. SELECT FIKRS AS VALUE NAME AS TEXT FROM FMBS_BS_T
INTO CORRESPONDING FIELDS OF TABLE lt_value
WHERE LANGU EQ 'E'.
instead of:
. SELECT FM_AREA AS VALUE NAME AS TEXT FROM FMBS_BS_T
INTO CORRESPONDING FIELDS OF TABLE lt_value
WHERE LANGU EQ 'E'.
My sap version:
EHP4 FOR SAP ERP 6.0 / NW7.01
SAP_BASIS 701 0003 SAPKB70103
Do you know any note or solution to resolve this problem.
Best regards,
Jacek WitczakHi, I came back to working on "Dunning by collection strategy with BRFplus". According to your sugestions, I raised the level of components:
SAP_BASIS Level 09
SAP_ABA level 09
PI_BASIS level 09
SAP_BW level 09
But still I have the same short dump.
Shoudl we raise any other components? Maybe you know note, which resolve this problem?
Maybe you are looking for
-
How do I set up e-mail with an exchange server?
My father works as the IT Manager of a small, privately owned company that uses an Exchange Server for e-mail and the like. A co-worker of his recently bought an iPhone 4 and desperately needs him to set up her e-mail to be used on the new phone. Luc
-
IPod Touch and AppleTV "bricks" the Music app
I use the Music app on the iPod Touch to send music to an Apple TV. If I have the iPod Touch transmitting and stop playing music (via "Pause") and I walk away from my wireless connection, I cannot access my Music collection. The page will display w
-
Document ID for attachment in PM Notification
In which table can I find the document id for the PM Notification attachment? Is there even a document id for that?
-
Client Java 6u43 for OAS Version 10.1.2.3.0
Hi Following is our environment Oracle Application Server (Infrastructure/MiddleTier): Version 10.1.2.3.0 Additional Component: WebUtil Client Machine: Windows 7 32-bit Current Java version: 6u11 Issue: Clients complain of Forms hanging sometimes. Al
-
Hello everyone, I am wondering if it's possible to create my own unique url name for my iweb site. I'm thinking of using godaddy.com or yahoo.com's domain hosting services to host my site for 2.99 a year, so that I could create my own domain name. Is