2009 Sep 02 8:00 AM
Hello Experts,
I am working on a requirement where I need to trigger a SMS to customer when billing document is saved. While I am coding my user exit, I have created a custom 'Z' table to capture SMS related data. Here I also have the actual SMS as the link, followed by the text.
for eg: http://127.0.0.1/send_sms?user=amit&pswd=amit123&sender=client&text=hihoware+you&phonenumber=9123456789
I am facing 2 issues here.
1) While I create my 'Z' table to hold the above link, I declare a field of type string. But while i declare my internal table like
TYPES: BEGIN OF IT_SMS.
INCLUDE STRUCURE ZSMS_DATA.
TYPES: END OF IT_SMS.
It gives me an error(flat structures allowed,etc).
I changed the table data type to CHAR(255), which is the max allowed, but my link in the program is a STRING.
when I write
wa_sms-sms = sms.
OR
move sms to wa_sms-sms.
It is moving only the 1st line shown in the string under debugger mode, and table is also updated that way.
I want the whole URL to be saved in the 'Z' table.
Please help.
Regards,
Amit
2009 Sep 02 8:04 AM
Hello Experts,
I am working on a requirement where I need to trigger a SMS to customer when billing document is saved. While I am coding my user exit, I have created a custom 'Z' table to capture SMS related data. Here I also have the actual SMS as the link, followed by the text.
for eg: http://127.0.0.1/send_sms?user=amit&pswd=amit123&sender=client&text=hihoware+you&phonenumber=9123456789
I am facing 2 issues here.
1) While I create my 'Z' table to hold the above link, I declare a field of type string. But while i declare my internal table like
TYPES: BEGIN OF IT_SMS.
INCLUDE STRUCURE ZSMS_DATA.
TYPES: END OF IT_SMS.
It gives me an error(flat structures allowed,etc).
I changed the table data type to CHAR(255), which is the max allowed, but my link in the program is a STRING.
when I write
wa_sms-sms = sms.
OR
move sms to wa_sms-sms.
It is moving only the 1st line shown in the string under debugger mode, and table is also updated that way.
I want the whole URL to be saved in the 'Z' table.
Please help.
Regards,
Amit
2009 Sep 02 8:04 AM
2009 Sep 02 8:07 AM
Hi,
CHAR1250 in table or program?
My error msg is as follows:
"ZSMS_DATA" must be a flat structure. You cannot use internal tables,
strings, references, or structures as components. -
IF I DECLARE THE TABLE FIELD TYPE AS STRING.
Regards,
Amit
Edited by: Amit Iyer on Sep 2, 2009 12:40 PM
2009 Sep 02 8:12 AM
both
you can just directly write:
data: itab type starndard table of ztable,
is type ztable.pass values to itab.
and
modify ztable from table itab.
2009 Sep 02 8:27 AM
Hi Soumya,
Now my program is working fine and in wa_sms-sms it shows up the complete URL as a string.
But when I write
INSERT zsms_data FROM TABLE it_sms.
COMMIT work.
The table is updated but it doesnt show the complete URL.
Regards,
Amit
2009 Sep 02 8:29 AM
how have you defined the ztable (in data dictionary/SE11)
what is the type of the field for URL?
is it string?
string can only take up 255 chars. you can take a bigger data type like char1250
2009 Sep 02 8:34 AM
Hi Soumya,
My SMS field is declared as string in the 'z' table.
I assume.
CHAR takes value from 0-255.
STRING should take any value of variable length.
I am not able to declare the data type as RAW.
ERROR: Field SMS (Length > 255 for RAW only allowed for non-DB tables)
Regards,
Amit
2009 Sep 02 8:42 AM
Hi Amit ,
for SMS purpose. You have to create text in tcode S010 using the function module CREATE_TEXT and store the Text-ID in the custom 'Z' table.
when you want to retrieve the SMS for display purpose. you pick the TEXT-ID from the 'Z' table and pass the same to function module READ_TEXT and get the long text.
use table to store limited data for better performance and more readability. for long text you have to use SO10 tcode.
Hope it shall be useful
Regards
Santosh
2009 Sep 02 10:20 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |