2008 Jan 15 8:58 AM
Hello gurus,
how can I store a string field (user input) in a database table (r 4.6c)?
Thanks in advance,
Alej!
PS: * Points will be rewarded * !
2008 Jan 15 9:08 AM
Hi Alej,
Just remember the maximum length a single field in a DB table can be defined to is 255, hence you will have to guess the maximum length the user can enter and create those many number of fields of length 255 in your DB table and then break up the data when updating in DB from string and reverse, build back the string when retrieving from DB.
Regards,
Aditya
Hi Alej,
Just remember the maximum length a single field in a DB table can be defined to is 255, hence you will have to guess the maximum length the user can enter and create those many number of fields of length 255 in your DB table and then break up the data when updating in DB from string and reverse, build back the string when retrieving from DB.
Regards,
Aditya
2008 Jan 15 9:06 AM
you can create data element with char type and define its length (equivalent to max. length ur string can hold).
2008 Jan 15 9:08 AM
Hi,
you can do this way,
just create the table field with string,so that you can use it
to have string values in it.
DATA: text_buffer TYPE string VALUE `Text`,
value assigns it a default value to it ,in the above statement
it gives TEXT to text_buffer string.
plz reward if helpful,
regards,
srikanth tulasi.
Edited by: srikanth tulasi on Jan 15, 2008 10:14 AM
2008 Jan 15 9:08 AM
Hi Alej,
Just remember the maximum length a single field in a DB table can be defined to is 255, hence you will have to guess the maximum length the user can enter and create those many number of fields of length 255 in your DB table and then break up the data when updating in DB from string and reverse, build back the string when retrieving from DB.
Regards,
Aditya
2008 Jan 17 7:45 PM
2008 Jan 15 9:26 AM
Hi,
Kindly refer the sample program for the same.
Here yff_test is a table with three fields fname (char15), lname (char15) and year (char4).
Sample code:
REPORT ynrd_test_text_move.
TABLES yff_test.
PARAMETER: p_name TYPE char15.
START-OF-SELECTION.
UPDATE yff_test SET lname = p_name.
This program would set the last name to the string entered on the screen by user.
The direct updation of tables is not recommeded. We need to update tables via BAPI or FM.
Pls Reward if useful.
Regards,
Farheen.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |