How to enter values to a database table with data type 'LCHR'?
Hello All,
I have created a database table with five fields, of which the last field is 'Value' field in which i have to enter text with a maximum of 1000characters. I have also specified a 'Length' field preceding the 'Value' field.
The datatype specified for the 'Length' field is 'INT2' and for the value field is 'LCHR' with length 1000.
When i tried inserting values to the table through a report, the report is giving an error that 'Literals that take up more than one line are not permitted', which means 255characters.
Also, when i entered a short text which is less than 250 characters to the 'Value' field,, the report is working fine and the table entry is visible.
Can anyone help me in this?
It would be really helpful if you explain how to use 'LCHR' data type in tables and how to enter values to such a field with more than 255characters.
Thanks in Advance,
Shino
Hi shino,
Alternatively,
you can use STRING instead of LCHR.
I too have tried with LCHR and am facing the same issue.. i am not sure why its coming..
i have tried STRING and its working perfectly.
wa-key_field = 'IN4'.
CONCATENATE 'Long text over 200 chars length '
'another Long text over 200 chars length '
'another Long text over 200 chars length '
INTO wa-long_text.
wa-len = strlen( wa-long_text ).
INSERT zshino_table from wa.
SELECT * FROM zshino_table INTO table it.
clear wa.
LOOP AT it INTO wa.
WRITE:/ wa-len, ' ' , wa-long_text.
ENDLOOP.
Also, remember to set the type of the database field as String.
hope this was of some help,
thanks and regards,
Sagar.
Similar Messages
-
How to Copy complete structure of a table with data from one database table to another databse table
I need a sql query to copy structure of table with data from production table of ONLINEBTREKDB database to production table of Archive database.
I tried this query
select * into Archive.dbo.Production from ONLINEBTREKDB.dbo.Production p
but problem is I am able to copy the table schema and data but not able to copy constraints(PK)
Any Help?
seemaYou've multiple options
1. Use generate scripts wizard available in SQL management studio. This is particularly helpful when you want to script out lot of objects. You can also choose to script data as well inside this. This can be launched by right clicking the db, choosing tasks
-> generate scripts and then selecting required options inside the wizard
2. Use object explorer and right click and script out table. You can also use search functionality to find object you want inside object explorer
http://visakhm.blogspot.in/2013/02/object-filtering-using-ssms-object.html
3. Use query based on INFORMATION_SCHEMA views like TABLES,COLUMNS,CONSTRAINT_COLUMN_USAGE etc to generate the script
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Copying database table with data
Dear Team,
I want to copy a database table with all entries of that table. example: if i am copying MARA table as ZMARA i want all the entries of MARA should also exist in ZMARA.
Is it possible to do this without writing any piece of code.
Regards,
N.JainHi,
It is not possible to do the same without coding.
Regards,
Sriram
Edited by: Srirama Murthy Maddirala on Jun 4, 2008 11:14 AM -
Retrieve data on table with data type
Hello,
I want ask, there is query to retrieve data with data type on table SQL Server 2008 R2 ?Please take a look at sp_describe_first_result_set,sp_describe_undeclared_parameters,
and sys.dm_exec_describe_first_result_set. -
Problem creating cache group for a table with data type varchar2(1800 CHAR)
Hi,
I am using TimesTen 7.0 with Oracle 10.2.0.4 server. While creating Cache Group for one of my table I'm getting the following error.
5121: Non-standard type mapping for column TICKET.DESCRIPTION, cache operations are restricted
5168: Restricted cache groups are deprecated
5126: A system managed cache group cannot contain non-standard column type mapping
The command failed.
One of my filed type in oracle table is Varchar2(1800 CHAR). If I change the filed size to <=1000 it (E.g. Varchar2(1000 CHAR)) then the Create Cache command works fine.
MyDatabase Character Set is UTF8.
Is it possible to solve without changing the filed size in the Oracle Table?
Request your help on this.
Thanks,
SunilHi Chris.
The TimesTen server and the Oracle Client is installed on a 32-bit system.
1. ttVersion
TimesTen Release 7.0.5.0.0 (32 bit Linux/x86) (timesten122:17000) 2008-04-04T00:09:04Z
Instance admin: root
Instance home directory: /appl/TimesTen/timesten122
Daemon home directory: /var/TimesTen/timesten122
Access control enabled.
2. Oracle DB details
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Oracle Client - Oracle Client 10.2.0.4 running in a 32 bit Linux/x86
3. ODBC Details
Driver=/appl/TimesTen/timesten122/lib/libtten.so
DataStore=/var/TimesTen/data
PermSize=1700
TempSize=244
PassThrough=2
UID=testuser
OracleId=oraclenetservice
OraclePwd=testpwd
DatabaseCharacterSet=UTF8
Thanks,
Sunil -
How to enter values for newly inserted field for maintenace view table
Hi ,
I have inserted new field for custom table which consits of maintance view..
I want to put some values in to this newly inserted field..
When i try to insert values bu useing se16,iam unable to view this newely inserted field..
Can you please let me know how can i insert values to this newely created field
Thanx,
ParnithHi Parnith,
It is easy to use a table maintainance to enter values to a database table....
if you have a table maintainace generator and you are not able to see the newly added field here is the reason
Everytime you add a new field , the table maintainance needs to be regenerated..The reason is that the screen you are using in the table maintainance is created within a program with respect to the fucntion group and not directly linked to the table..whenever you change the table,the function group is not affected and changes are not reflected in the table maintainance , so you have to regenerate by utilities-> table maintainance generator in sell for that table..once you do it , the function group assigned to the table automatically creates a new one with the latest fields added
Reward if helpful
Regards
Byju -
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya -
How to update database table with key field?
Hello Experts,
I have a database table with following fields
MATNR - Key
SSOUR - Key
KUNNR - Key
MENG1
MENG2
MENG3
And this table contains records like...
MSD50001 R 1000001 5.30 2.30 5.25
MSD50002 R 1000002 5.30 2.30 5.25
MSD50003 R 1000003 5.30 2.30 5.25
MSD50005 R 1000004 5.30 2.30 5.25
MSD50004 R 1000005 5.30 2.30 5.25
I have an internal table with same fields of above database table.
MSD50001 A 1000001 5.30 2.30 5.25
MSD50002 A 1000002 5.30 2.30 5.25
MSD50003 A 1000003 5.30 2.30 5.25
MSD50005 A 1000004 5.30 2.30 5.25
MSD50004 A 1000005 5.30 2.30 5.25
MSD50006 A 1000006 5.30 2.30 5.25
I want to update the DB table with following internal table records.
If internal table records = db table records are same then Update....else insert from internal table to db table.
But here, SSOUR is key field so i am not able to use
MODIFY dbtab from itab.
It results me , entries in internal table are inserted into db table.
So i have double records.
Is there any statement which updates the key field? and if no fields in db table then insert it?
Regards
RHhi,
u cannot update akey field.u can update only non key fields by using key field as a selection criteria.For example if u go to sm30 if u enter any table for inserting values, the key field will always be greyed out it is not succumbed to chnges.but u can insert value into ,if ur inserting and in the insert staemnet if u have key field which is already present in the table it will return sy-subrc = 4 otherwise it will insert the record and return 0.
eg for update :
UPDATE zdm_wtyprof SET upload_status = 'S'
WHERE spart = wa_upd-spart.
here spart is the key field and it will update the status field in the table as S.
if updated succesfully it will return 0.
SIMILARLY U CAN USE select. -
Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.The Oracle documentation has a good overview of the options available
Generating XML Data from the Database
Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
You can also find some information in XML DB FAQ -
What is the use of initial value in a database table?
Hi can anyone help me in knowing what is the use of initial value which is present besides primary key while creating a table?
Initial Value:
Indicator that NOT NULL is forced for this field
Use
Select this flag if a field to be inserted in the database is to be filled with initial values. The initial value used depends on the data type of the field.
Please note that fields in the database for which the this flag is not set can also be filled with initial values.
When you create a table, all fields of the table can be defined as NOT NULL and filled with an initial value. The same applies when converting the table. Only when new fields are added or inserted, are these filled with initial values. An exception is key fields. These are always filled automatically with initial values.
Restrictions and notes:
The initial value cannot be set for fields of data types LCHR, LRAW, and RAW. If the field length is greater than 32, the initial flag cannot be set for fields of data type NUMC.
If a new field is inserted in the table and the initial flag is set, the complete table is scanned on activation and an UPDATE is made to the new field. This can be very time-consuming.
If the initial flag is set for an included structure, this means that the attributes from the structure are transferred. That is, exactly those fields which are marked as initial in the definition have this attribute in the table as well.
hope it helps,
Saipriya -
How to enter values in the fields of standard SAP Infotype e.g. IT0024
Hi,
How to enter values in the fields of standard SAP Infotype?
e.g. I want to enter values in infotype IT0024(Qualifications) in the field AUSPR(Profincy):-
1-Level 1
2-Level 2
3-Level 3
4-Level 4
5-Level 5
Thanks,
AmeetHi Divya,
I checked with the screen and report which is mentioned by you. But I want to modify/make changes that should appear in the screen when you view details for a particualar employee in Qualifications(IT0024).
Please refer the screen 2000 of module pool MP002400 in SE80. In that screen I want to make change as listbox with key.
Can it be achieved in the same way as mentioned by you before by making standard SAP report as Z and then modify using layout editor?
Please help me out. I think I am almost there.
Thanks,
Ameet -
How to configure ActiveSync for a database table in IdM 7.0
Hi All,
Please suggest me the steps to configure ActiveSync in IdM 7.0.
when i try it by resource-->activeSync wizard it gives
"The ActiveSync Wizard has been deprecated in Identity Manager 7.0 in favor of using MetaView and the resource action "Edit Synchronization Policy". "
how to configure ActiveSync for a database table.
Thanx
ShantHi,
You need to a script and run it on os level. Here is an example:-
emcli relocate_targets -src_agent=agentmachine1.domain:3872
-dest_agent=agentmachine2.domain:3872 -target_name=RACDB
-target_type=oracle_database -copy_from_src -force=yes
-changed_param=MachineName:agentmachine2.domain
Regards
Jomon
Edited by: JohnJomon on Nov 17, 2011 2:27 PM -
How to send changes in the Database Table Periodically using Change Pointe
Hi,
How to send changes in the Database Table to the external system Periodically using Change Pointers.
Thanks & Regards,
Gopi.That depends on what table you are referring to.
-
How to modify DataBase Table with an internal Table
Hi, Friends.
I am coping Data from a Database table to an internal table after modifying data in the internal table I want to modify the db table according to the modification in the internal table. can some one help me out in this way, i am doing this modification in Table Control in Screen programing.
My Code is as follow.
MODULE zfsl_stinf_tc_init OUTPUT.
IF tc_copy IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zfsl_stinf FROM zfsl_stinf.
tc_copy = 'X'.
REFRESH CONTROL 'TC_FOR_ZFSL_STINF' FROM SCREEN '0001'.
ENDIF.
ENDMODULE. " zfsl_stinf_init OUTPUT
*& Module zfsl_stinf_tc_move OUTPUT
text
MODULE zfsl_stinf_tc_move OUTPUT.
MOVE-CORRESPONDING wa_it_zfsl_stinf TO zfsl_stinf.
ENDMODULE. " zfsl_stinf_tc_move OUTPUT
*& Module STATUS_0001 OUTPUT
text
MODULE status_0001 OUTPUT.
SET PF-STATUS 'ZFSL_SCREEN_1ONLY'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module zfsl_stinf_tc_modify INPUT
text
MODULE zfsl_stinf_tc_modify INPUT.
MOVE-CORRESPONDING zfsl_stinf TO wa_it_zfsl_stinf.
MODIFY it_zfsl_stinf FROM wa_it_zfsl_stinf INDEX tc_for_zfsl_stinf-current_line.
_*"" here i have the modified internal table " it_zfsl_stinf "*_
ENDMODULE. " zfsl_stinf_tc_modify INPUT
Kind regards,
FaisalHi
Here you are modifying your dbtable in module pool programming
so better to use work area to modify the database table
example:
data: itab type table of zfsl_stinf .
data: wa_itab type itab.
select single * from zfsl_stinf INTO itab WHERE <condition>
(pass your values to wa_itab.)
modify zfsl_stinf from values of wa_itab.
Regards
Srinivasu -
How to store an image into database table
Hi
Can anyone tell me the way, how to store an image into database table.Hello,
May be this thread will help you in your requirement.
[FM for uploading Image to SAP;
Thanks,
Jayant
Maybe you are looking for
-
Grey screen on Macbook Pro boot up
I've got a Macbook Pro 15" laptop (mid-2011) running Mac OS X Lion. It recently broke down and I can't get past the grey screen on bootup. It gets to the Apple logo and the circle loading animation then straight to grey screen. I've tried Safe Mode,
-
How to move form from one account to another
I have bought a second account for another user so that his responses would be confidential. How do I copy existing forms from one account to another. Do not want to have to recreate them. Thanks for your help..
-
Redhat 9 and Java studio enterprise 7
Did anybody install Java Studio Enterprise 7 with sun application server 7 on Red Hat 9.0 Linux. If so do I need to set some special parameters in the environment ? Since I tried, but became unsuccessful. Thank you in advance.
-
User Stamp/Create Stamp Fields
Hi Folks, Following fields setup : Created By [field type : User stamp] Created On [field type : create stamp] Updated On [field type : time stamp ] Updated By [field type : User stamp] On record create - all of these fields are supposed tobe populat
-
Interactive notification BUG for email
I've found a bug with the Interactive Notifications for email messages on my phone:- When the phone is locked and an email message comes up on screen, if I swipe to the left to reveal the options and select "Delete", the phone prompts me for my passc