Conversion type X to type C
Hi,
It sounds easy but I can't find a solution right now.I have read a pdf document into a variable of type "xstring". Now I want to use "REPLACE" on the XSTRING.
It should look like this:
DATA: v_xstring type xstring,
REPLACE ALL OCCURRENCES OF 'XXXNAME' IN
v_xstring WITH 'myname'.
Hw do I convert a readable string into its related X-type?
Thanks
Hi,
You can try this
DATA: <FS1> TYPE X,
CHAR(100) TYPE C.
ASSIGN X TO <FS1> CASTING TYPE C.
MOVE <FS1> TO CHAR.
REPLACE ALL OCCURRENCES OF 'XXXNAME' IN CHAR WITH 'NAME'.
Regards,
Satish
Similar Messages
-
Conversion of a data object of type "C" to type "l" is not supported
Experts:
i have below code in my FM; defined as remote-enabled module.
when i execute i get the error analysis as:
You attempted to move one data object to another.
This is not possible here because the conversion of a data object
of type "C" to type "l" is not supported.
This at the line move <FS2> TO <wwa_mdm_name_value_pair>-VALUE .
what are the steps to debug this? Thanks!
DATA: tt_mdm_name_value_pair_table TYPE mdm_name_value_pair_table.
FIELD-SYMBOLS : <wwa_mdm_name_value_pair> LIKE LINE OF tt_mdm_name_value_pair_table.
FIELD-SYMBOLS <FS1> TYPE ANY.
FIELD-SYMBOLS <FS2> TYPE any.
data:st_mdm_name_value_pair type mdm_name_value_pair.
assign st_mdm_name_value_pair to <wwa_mdm_name_value_pair>.
assign st_mdm_name_value_pair-code to <FS1>.
assign st_mdm_name_value_pair-value to <FS2>.
clear wa_ZSTRESULT.
loop at T_UPDATE into wa_ZSTRESULT.
assign wa_ZSTRESULT-field to <FS1>.
<wwa_mdm_name_value_pair>-CODE = <FS1>.
assign wa_ZSTRESULT-VALUE to <FS2>.
move <FS2> TO <wwa_mdm_name_value_pair>-VALUE .
append <wwa_mdm_name_value_pair> to tt_mdm_name_value_pair_table.
endloop.resolved using GET REFERENCE.. code looks as below: Thanks!
DATA: tt_mdm_name_value_pair_table TYPE mdm_name_value_pair_table.
FIELD-SYMBOLS : <wwa_mdm_name_value_pair> TYPE LINE OF mdm_name_value_pair_table.
FIELD-SYMBOLS <FS1> TYPE ANY.
FIELD-SYMBOLS <FS2> TYPE DATA.
TYPES t_dref TYPE REF TO DATA.
DATA dref TYPE REF TO DATA.
DATA: TT_UPDATE TYPE ZTYRESULT.
FIELD-SYMBOLS : <WA_UPDATE> LIKE LINE OF TT_UPDATE.
data: st_mdm_name_value_pair type mdm_name_value_pair.
assign st_mdm_name_value_pair to <wwa_mdm_name_value_pair>.
assign st_mdm_name_value_pair-code to <FS1>.
assign st_mdm_name_value_pair-value to <FS2>.
clear wa_ZSTRESULT.
TT_UPDATE = T_UPDATE.
loop at TT_UPDATE assigning <WA_UPDATE>.
assign <WA_UPDATE>-FIELD to <FS1>.
<wwa_mdm_name_value_pair>-CODE = <FS1>.
assign <WA_UPDATE>-VALUE to <FS2>.
GET REFERENCE OF <WA_UPDATE>-VALUE INTO dref.
* MOVE dref TO <wwa_mdm_name_value_pair>-VALUE.
<wwa_mdm_name_value_pair>-VALUE = dref.
append <wwa_mdm_name_value_pair> to tt_mdm_name_value_pair_table.
endloop. -
Conversion of type "u" to type "v" not supported (cl_abap_tabledescr)
Help! I am struggling with implementing a solution using cl_abap_tabledescr.
At below statement :
<f_interim_data> = <f_ref_data>.
I get the error:
Conversion of type "u" to type "v" not supported.
Coding:
DATA:
l_r_tabledescr TYPE REF TO cl_abap_tabledescr,
l_r_itab type ref to data,
l_r_data_ref type ref to data,
l_r_data type ref to data.
field-symbols:
<gt_itab> TYPE ANY TABLE,
<gt_itab_BCCMP07> TYPE STANDARD TABLE.
field-symbols:
<f_ref_data> type any,
<f_new_data> type any,
<f_interim_data> type any.
go_tdescr ?= cl_abap_tabledescr=>describe_by_data( i_th_ref_data ).
go_sdescr ?= go_tdescr->get_table_line_type( ).
gd_tabnam = 'I_TH_REF_DATA'.
loop at go_sdescr->components INTO gs_component.
" Build fieldname
CONCATENATE gd_tabnam gs_component-name INTO gd_tabfield
SEPARATED BY '-'.
CLEAR: gs_comp.
gs_comp-name = gs_component-name.
gs_comp-type ?= cl_abap_datadescr=>describe_by_data( gd_tabfield ).
APPEND gs_comp TO gt_components.
endloop.
Begin create dynamic standard table copy of I_TH_REF_DATA
" Create instances of dynamic structure and dynamic internal table
go_sdescr_new = cl_abap_structdescr=>create( P_COMPONENTS = gt_components p_strict = abap_false ).
go_tdescr = cl_abap_tabledescr=>create( go_sdescr_new ).
" Create data refence followed by table creation
CREATE DATA gdo_handle TYPE HANDLE go_tdescr.
ASSIGN gdo_handle->* TO <gt_itab_BCCMP07>.
End create dynamic standard table copy of I_TH_REF_DATA
"Generate ref record
create data l_r_data_ref like line of <gt_itab_BCCMP07>.
assign l_r_data_ref->* to <f_interim_data>.
loop at i_th_ref_data assigning <f_ref_data>.
<f_interim_data> = <f_ref_data>.
append <f_interim_data> to <gt_itab_BCCMP07>.Hi ,
Check the code below which is similar to waht you are doing. It gets the existing fields from a structure and then adds some extra fields to it ( decimals 3 )and creates a dyn table. If you need it with decimals 2 then use WTGXXX data element
DATA:lf_startdate TYPE sy-datum,
li_index(2) TYPE n,
la_datum TYPE type_date.
DATA:i_comp TYPE cl_abap_structdescr=>component_table,
i_tot_comp TYPE cl_abap_structdescr=>component_table,
lf_struct TYPE REF TO cl_abap_structdescr,
lf_element TYPE REF TO cl_abap_elemdescr,
la_comp LIKE LINE OF i_comp,
lf_new_type TYPE REF TO cl_abap_structdescr,
lf_new_tab TYPE REF TO cl_abap_tabledescr.
CLEAR: lf_startdate,li_index,la_datum,i_comp[],i_tot_comp[].
*--Getting Compoents from existing type
lf_struct ?= cl_abap_typedescr=>describe_by_name( 'TYPE_PUT' ).
i_comp = lf_struct->get_components( ).
APPEND LINES OF i_comp TO i_tot_comp.
*--Adding weekly bukets fields based on date in selection screen
DO.
li_index = sy-index.
IF lf_startdate GT s_lfdat-high.
EXIT.
ENDIF.
IF li_index EQ 1.
PERFORM get_first_day_of_week USING s_lfdat-low
CHANGING lf_startdate.
la_datum-dat = lf_startdate .
*--Element Description
lf_element ?= cl_abap_elemdescr=>describe_by_name( 'MESXXX' ).
CONCATENATE 'MES0' li_index INTO la_comp-name.
la_datum-field = la_comp-name.
*--Field Type
la_comp-type =
cl_abap_elemdescr=>get_p( p_length = lf_element->length
p_decimals = lf_element->decimals ).
APPEND la_comp TO i_tot_comp.
CLEAR: la_comp.
APPEND la_datum TO i_datum.
CLEAR: la_datum.
CONTINUE.
ENDIF.
lf_startdate = lf_startdate + 6.
la_datum-dat = lf_startdate .
lf_element ?= cl_abap_elemdescr=>describe_by_name( 'MESXXX' ).
CONCATENATE 'MES0' li_index INTO la_comp-name.
la_datum-field = la_comp-name.
la_comp-type =
cl_abap_elemdescr=>get_p( p_length = lf_element->length
p_decimals = lf_element->decimals ).
*--Fill the component table
APPEND la_comp TO i_tot_comp.
CLEAR: la_comp.
APPEND la_datum TO i_datum.
CLEAR: la_datum.
ENDDO.
*--Create type
TRY.
lf_new_type = cl_abap_structdescr=>create( i_tot_comp ).
CATCH cx_sy_struct_creation . "#EC NO_HANDLER
ENDTRY.
*--Create Table type
TRY.
lf_new_tab =
cl_abap_tabledescr=>create( p_line_type = lf_new_type
p_table_kind = cl_abap_tabledescr=>tablekind_std p_unique = ' ' ).
CATCH cx_sy_table_creation . "#EC NO_HANDLER
ENDTRY.
*--data to handle the new table type
CREATE DATA wf_data TYPE HANDLE lf_new_tab.
*--data to handle the work area
CREATE DATA wf_str TYPE HANDLE lf_new_type.
*--Assign to fs
ASSIGN wf_data->* TO <fs_tab>.
ASSIGN wf_str->* TO <fs_line>. -
Conversion away from column type may result in sub-optimal query plan
Hello all,
I have the following select statement in a cursor compiled in a package.
SELECT id
FROM table
WHERE TRUNC(ts) >= TRUNC(SYSDATE - p_days)
However I get 4 warnings that read:
PLW-07204: conversion away from column type may result in sub-optimal query plan
Does anyone know of a way to rewrite the query to avoid the compilation warnings?
I'm just trying to compare the date without the time...
Thanks in advance
DanFor what it is worth, whenever you compare a date column to either sysdate or any built-in function returning a date you will get that warning.
SQL> desc t
Name Null? Type
ID NUMBER
DT DATE
SQL> SELECT DUMP(dt), DUMP(trunc(dt)), dump(sysdate)
2 FROM t;
DUMP(DT) DUMP(TRUNC(DT)) DUMP(SYSDATE)
Typ=12 Len=7: 120,107,7,12,15,16,43 Typ=13 Len=8: 7,215,7,12,0,0,0,0 Typ=13 Len=8: 7,215,7,12,14,16,11,0But,
SQL> CREATE FUNCTION f(p_v IN VARCHAR2) RETURN DATE AS
2 BEGIN
3 RETURN TO_DATE(p_v, 'dd-mon-yyyy');
4 END;
5 /
Function created.
SQL> SELECT DUMP(f('01-jan-2000')) FROM dual;
DUMP(F('01-JAN-2000'))
Typ=12 Len=7: 120,100,1,1,1,1,1John -
Conversion Exit for data type FLTP
Can someone suggest me a conversion Exit for data type FLTP?
Hi,
CHAR_FLTP_CONVERSION
FLTP_CHAR_CONVERSION
Have a look at the function module documentation.
Regards,
Reema.
PS. pl. award points to useful answers. -
PLW-07204: conversion away from column type may result in sub-optimal query
I have the following query in the package that created using sql developer. I am receiving the error 'PLW-07204: conversion away from column type may result in sub-optimal query plan' when try to compile the package. The issue is happen to be in the last line where the date is. Any help? Thanks
select count(*) into n_cnt
from tmp_order
where sgn_off_dt is null and cmt_dt is not null
and sysdate - cmt_dt > 90;Sy:
Try doing as a procedure instead of an anonymous block. It looks like warnings do not apply to blocks.
SQL> create table tmp_order(sgn_off_dt date,cmt_dt date);
Table created.
SQL> alter session set plsql_warnings='ENABLE:ALL';
Session altered.
SQL> create procedure p as
2 n_cnt number;
3 begin
4 select count(*) into n_cnt
5 from tmp_order
6 where sgn_off_dt is null and
7 cmt_dt is not null and
8 sysdate - cmt_dt > 90;
9 end;
10 /
SP2-0804: Procedure created with compilation warnings
SQL> show err
Errors for PROCEDURE P:
LINE/COL ERROR
8/18 PLW-07204: conversion away from column type may result in
sub-optimal query planlindalop:
In this case, you can ignore the warning, as it is not correct. Sysdate and a date column have different internal data types (note the type 13 for sysdate and type 12 for the date column), and whatever internally generates the warnings seems to just compare the type number.
SQL> insert into tmp_order values(sysdate, sysdate);
1 row created.
SQL> commit;
Commit complete.
SQL> select dump(sysdate) sdate, dump(cmt_dt) cmt_dt from tmp_order;
SDATE CMT_DT
Typ=13 Len=8: 7,219,2,3,15,44,4,0 Typ=12 Len=7: 120,111,2,3,16,44,12However, Oracle is perfectly capable of using an index on a date column with sysdate as a predicate. I would agree with Sy's suggestion to re-work the predicate to be something like cmt_dt < sysdate - 90.
John -
PLW-07202: bind type would result in conversion away from column type
Got this error, "PLW-07202: bind type would result in conversion away from column type", when compiling in the stored procedure editor.
CREATE OR REPLACE
procedure test_proc (at_incoming varchar)
as begin
insert into test2(itemname) values (substr('1234',1,2));
end;
The table test2 was created like this:
CREATE TABLE "DMSCO"."TEST2"
( "ITEMNAME" VARCHAR2(30),
"ITEM2" VARCHAR2(10),
"ITEMNUM" NUMBER(10,0)
Removed the substr, and it compiles.
CREATE OR REPLACE
procedure test_proc (at_incoming varchar)
as begin
insert into test2(itemname) values ('1234');
end;
In sqlplus it compiles fine even with the substr.PLW-07202: is a warning. There's a bug that it's showing as an error.
-kris -
Conversion from string "" to type 'Double' is not valid
We're using BPC 7.5 MS and on patch level 111.02
There's two front-end servers and one back-end. we have about 100 users but concurrency is likely in the 50 range.
We've been running extremely well for about 4 years but are now starting to run into problems.
There are about 5-6 applications but none greater than 10 million records. We optimize regularly.
However over the past two months admin processes seem to take a lot longer. Optimization now times out after about 1.25 hours and none used to take greater than 15 minutes.
Today after processing dimensions we checked the application status and we were not able to check if it was available or not. We got a pop up box saying
conversion from string "" to type 'Double' is not valid
I've processed dimensions and applications since and still this error persists.
We're attempting a reboot to see if that helps but I've never seen this before and in combination with the slower admin processing I'm wondering if there's something drastic going to happen.
MichaelHi Michael,
for the poor performances you have to check the guides about performance on bpc if you have scheduled regurarly optimize during day and night (just verify that never factwb reach 50.000 and fac2 500.000 records) maybe you need to change some parameter on the server as MaxThreads.
For the conversion string error on admin console see please this note 1803092 - Set application set status error
Regards
Roberto -
Help - Business Partner "Error in conversion Customizing for address types"
Hi Experts,
I am encountering an error with maintaining the Payer/ee in the Payment Details (SI) tab under Counterparty company code.
The error message I get is below --
*Error in conversion Customizing for address types (-> note 594871, III)
Message no. FTBU800*
I need your kind help please to troubleshoot this issue.. I receive the same error when i book deals and try to view the "Payment Details" tab during TX01 or TM01. I am not sure anymore what could be causing this problem.
Thanks,
DavidHello Raj,
Impliment the correction as specified in the sap Note 594873.. sect III.
You can take the help of your basis team for downloading it Using Tcode "SNOTE" and if you have sufficient authorizations you can do it your self..
another option is to down load the Note from the service market place and get the correction implimented manually by a technical consultant.
Wish you success.
M. Naveen Kumar -
Item Conversion to GMD YIELD TYPE does not exist for the item/items in this Recipe/Batch. Cannot
scale/create batch.
While auto shipping the above error i am getting. Please somebody help on this.
Thanks.Hi,
Could you please let us know which Oracle Product was installed and it complete 5 digit version.
Regards,
Prakash. -
Conversion from type 'CalculatedFieldWrapperImpl' to type 'Integer' is not valid._
Hi,
I'm using SSRS 2008 to create a relatively simple report with a stored procedure as the dataset. The SP runs fine (no errors) but when I try to run the report I get "Conversion from type 'CalculatedFieldWrapperImpl' to type 'Integer' is not valid. "
error message. The data type is declared as int in SQL. I'm using several other int fields in the report without a problem. Anyone familiar with this error? Thanks.
Robert BocconeHmm, my research also suggests multi-value parameters may be the cause, but you say there aren't any in the report. These sings can sometimes be generated automatically though, even if you haven't knowingly created one. You could try checking the .rdl
file directly (if you're using BIDS, just go to View > Code, otherwise load the report into wordpad or similar) and searching for the term 'Parameter' to see if there is anything there. Otherwise, I'm afraid I'm getting a bit lost for ideas
too.I work to UK time. If this post, or another, answers your question, please click the 'Mark as answer' button so others with the same problem can find a solution more easily. -
Currency conversion issue for condition type
Hello,
I am creating two invoice document.
1. Customs Invoice (ZCDS)
2. Inter company invoice.(IVA)
both the invoices should be similar. Same pricing procedure is used to create both the documents but in Customs invoice YUMU condition type is not getting converted whereas in IVA the condition type is getting converted. Can anyone tell me the possible reason for this?
ZCDS
IVA
Regards,
JagjeetHi Jagjeet,
For IVA invoice type -(For condition type- YUMU)
Below highlighted part of code is changing KSTEU from 'E' to 'C' for IVA invoice using std prog RVIVAUFT.
For ZCDS Invoice Type -(For condition type- YUMU)
Program RVIVAUFT is not called since ZCDS is not trigerried using Output type unlike IVA.
Hence KSTEU is not getting updated from 'E' to 'C' in case of ZCDS.
To solve your problem write code in User exit - userexit_pricing_copy to change konv-ksteu to 'C' for YUMU condition type at runtime.This will definately solve your problem.This will ensure you get correct/same condition value for IVA and ZCDS...:)
Regards,
Vikas Mulay. -
SQL types over PLSQL types while using Oracle Applications adapter in BPEL
Use SQL types over PL/SQL types while using Oracle Applications adapter
in BPEL/ ESB
This document will be focusing on Oracle Applications adapter. However Database adapter is much like OA adapter (even OA adapter uses DB Adapter), so the readers who are interested to explore DB adapters, can relate things with this document and go further as well.
Some Guidelines for writing PL/SQL APIs for OA Adapter
As we know when we create a partner link from the OA adapter wizard it sometimes writes some wrapper script supportive to the OA Adapter WSDL which contains below
* Object type for PL/SQL RECORD
* Nested table of the given type for PL/SQL TABLE. For example, the nested table of NUMBER.
* INTEGER substituted for PL/SQL BOOLEAN
* Wrapper Script for converting above three set of data types . (PLSQL to SQL and SQL to PLSQL conversion functions)
In runtime this wrapper script for converting PL/SQL to SQL and SQL to PL/SQL is an extra overhead.
So the first advice would be to avoid the use of the below as parameters of PLSQL API being called by OA Adapter.
* PL/SQL RECORD
* PL/SQL TABLE. For example, the nested table of NUMBER.
* PL/SQL BOOLEAN
In other way we can say we should try to use only SQL data types in arguments if we are planning to call any PL/SQL API from the OA Adapter.
If the requirement is to use a table or record uses the Object type. In place of BOOLEAN better to use VARCHAR or INTEGER what ever fulfills your requirement. Following this guideline we can reduce a huge number of Line of codes to be run each time the adapter being called.
Generally, Oracle E-Biz standard APIs use PL/SQL record types and table types so when there is a requirement to call these API’s from OA Adapter (this is a common requirement in development), and if we directly browse the API in OA Adapter Configuration Wizard and create the partner link, again a huge number of code is written by the wizard in the wrapper script (a number of extra mapping of fields which are not being used in the interface).
In this case better would be to create an Object type with only the required fields which are being used in that call and use them as parameters for the PLSQL API.Find the complete document
http://www.4shared.com/file/167171882/29525116/Use_SQL_types_over_PLSQL_types.html -
EDI 821 and EDI 823 field mapping file and basic IDOC type and message type
Hi All,
We are facing some issues regarding EDI 821 and EDI 823 file mappings.
We are mapping EDI 821 and EDI 823 transactions into SAP using IDOCs. Currently we are using the below entries
EDI 823 - Lock Box
Basic IDOC type - FINSTA01
Message type - FINSTA
Process Code - FINS
The problem is we are able to get the IDOC into SAP with status red and the various errors were due to not able to create the lockbox entry in SAP and once we got yellow status also but the lock box entry was not created and the errors are like No Conversions,no header etc.
EDI 821 -
Basic IDOC type - PEXR2002
Message type - PAYEXT OR REMADV
Process Code - PEXC OR REMA
We are facing the same problem here also and the internal payment order is not creating in SAP and IDOC was generated with yellow status and red status.
We are trying different combinations but nothing is working so far.
I need the following things to proceed furthur.
1)Are the IDOC , Message and process codes are correct that I am using now for both EDI 821 and EDI 823
2)If those are not correct, can you please let me know the correct entries
3) Please provide me the field mapping if any one of you have worked earlier for both the above IDOC and message type or new ones and we have one field mapping now but if you can send it to me then I can re check it.
4) Do we have to create any configuraion or customizing in SAP to create the IDOC in green status and if so please let me know the customizing steps and procedures for both EDI 821 and EDI 823.
thanks in advance for all your help.
Please let me know if my question is not clear.
Thanks,
Ramesh.Hi Ramesh,
I believe you are using those interfaces with the business partner type as Bank, Whatever idoc type, message type and process code you have used are perfectly correct.
First of all did you enable your bank for EDI, the house bank has to be EDI enabled first then only your idoc's can be processed, talk to your fi functional consultant and he might help you.
Are you can give me the exact error and i can help you as well.
Thanks,
Mahesh. -
What means narrow type and wider type? Can we find any narrow tpe that we can give values of a wider type?
if i m not wrong, then you were asking about implicit and explicit conversion of different data types rite? Which asking whether a smaller memory allocated data type can accept/fit in a larger memory allocated data type. Example a conversion of Double into Integer ....
-
Diff b/w reference type and elementary type
hi all
can any one what is the diff b/w reference type and elementary type in data element ....
thanks
lokeshThe data type attributes of a data element can be defined by:
Specifying a domain whose attributes are copied by the data element.
Specifying a build-in type where the data type, number of places, and possibly decimal places can be directly specified.
Specifying a reference type, i.e. reference to a class, an interface, a type defined in the Dictionary, a built-in type, or a generic reference to ANY or DATA.
In the maintenance screen you can set the option you require by setting the appropriate flag (domain, built-in type, reference type) and filling in the corresponding input fields.
A reference type is a reference to another type. There are the following kinds of reference types:
Reference to a class or an interface
Reference to a type defined in the Dictionary
Generic reference to ANY, OBJECT, or DATA
Reference to a built-in Dictionary type with specification of the length and possibly also the decimal places
You can use a reference type to define the data type properties for a data element, or for typing the component of a structure or the line type of a table type.
In the field Referenced type, enter the name of a class, an interface, the generic references DATA, OBJECT, ANY, or the name of a type defined in the Dictionary. If the reference type is to be a predefined Dictionary type, choose the reference to the predefined type. Enter the number of characters and, if required, the number of decimal places.
where as
The data class describes the data format at the user interface.
If a table field or structure field or a data element is used in an ABAP program, the data class is converted to a format used by the ABAP processor. When a table is created in the database, the data class of a table field is converted to a corresponding data format of the database system used.
You can find a detailed description of the data classes allowed in the ABAP Dictionary in Overview of the Data Classes.
Maybe you are looking for
-
How to change the resolution of a page in iWeb
Hi, I'm making a website for a project, and I decided to do it in iWeb. The brief of mt project says the resolution has to be 1024*768, however, when I change the resolution to this, the page instantly looks horrible with a white border to the right
-
SAP PI 7.0 SAML v1.1
Hi, We need to develop a Web Service Receiver with SAP PI 7.0 and add a SAML v1.1 header in the SOAP request. How can we do it in SAP PI 7.0? Is it compatible with this PI version? Thanks in advance, Joan
-
I have purchased a iPhone 4 from a well known auction site and it has been working reasonably well but every so often it would pop up a window stating there was no service and it would have to be restored. I have tried a few permutations that have be
-
ASM disk group and multiple databases
Hi, I want to create a second database on my RAC cluster. Can the ASM diskgroups I have defined for use with the first database , service the second database or do I have to create another set of ASM diskgroups for the second dataabase? Thanks, Anne
-
How to install LiveCycle Forms ES2
Hi, We are using adobe LiveCycle ES2 with SP2. after installing the LiveCycle ES2 and applying the patch, we noticed that we forgot to check the LiveCycle Forms ES2 to be installed!, now we need this module my question is how to install this module