2007 Aug 28 11:09 AM
Hello,
I face some problems...
I want to work with FUNCTION 'SM02_ADD_MESSAGE'....so I need to give it an expiration date... I declared it :
parameters p_expd TYPE temsg-emtext.
This because I want to assign it dynamicaly , like :
REPLACE '$TUE' IN p_expd WITH next_tuesday.
Where next_tuesday is calculated in the report .
As far I could see , the parameter I must declar as a text, but when I call the function , it must be the type temsg-timdel, which is in fact a date .
<b>So I need to convert the text to date , before I call the function.
Any help?</b>
Thank you .
2007 Aug 28 11:15 AM
Hi,
here is the example program
data: emtext like TEMSG-EMTEXT.
data: exp_time like TEMSG-TIMDEL.
* Messages have the same format as the dialog transaction --
* a maximum of 3 lines each with a maximum of 60 characters. Only the first line
* must contain a message.
emtext = "Bitte abmelden. Backup in 2 minutes.
* Enter the expiration time as shown. Use either 12 or 24
* Hour format, as in user master record, under which the program
* is running.
* If only time is specified, todays date is assumed.
The print program can .
* Always specify a time.
exp_time = '230000'.
CALL FUNCTION 'SM02_ADD_MESSAGE'
EXPORTING
MESSAGE = emtext " 1. message line
MESSAGE2 = " 3. line
MESSAGE3 = " 3. line
SERVERNAME = " Server
EXPIRATION_DATE = SY-DATUM " expiration date with
EXPIRATION_TIME = '230000' " time
DELETE_DATE = ' ' " deletion date with
DELETE_TIME = '230000' " time
CLIENT = ' ' " client
IMPORTING
MESSAGE_ID =
EXCEPTIONS
EMPTY_MESSAGE = 1
SERVER_NOT_AVAILABLE = 2
CLIENT_NOT_AVAILABLE = 3
NOT_AUTHORIZED = 4
OTHERS = 5
Regards
Sudheer
Hello,
I face some problems...
I want to work with FUNCTION 'SM02_ADD_MESSAGE'....so I need to give it an expiration date... I declared it :
parameters p_expd TYPE temsg-emtext.
This because I want to assign it dynamicaly , like :
REPLACE '$TUE' IN p_expd WITH next_tuesday.
Where next_tuesday is calculated in the report .
As far I could see , the parameter I must declar as a text, but when I call the function , it must be the type temsg-timdel, which is in fact a date .
<b>So I need to convert the text to date , before I call the function.
Any help?</b>
Thank you .
2007 Aug 28 11:14 AM
If your text contains the date in proper format you can use FM CONVERT_DATE_TO_INTERNAL
if not, you have to build it from your data to ensure the date has format YYYYMMDD (this is easy with a concatenate statement)
2007 Aug 28 11:15 AM
Hi,
here is the example program
data: emtext like TEMSG-EMTEXT.
data: exp_time like TEMSG-TIMDEL.
* Messages have the same format as the dialog transaction --
* a maximum of 3 lines each with a maximum of 60 characters. Only the first line
* must contain a message.
emtext = "Bitte abmelden. Backup in 2 minutes.
* Enter the expiration time as shown. Use either 12 or 24
* Hour format, as in user master record, under which the program
* is running.
* If only time is specified, todays date is assumed.
The print program can .
* Always specify a time.
exp_time = '230000'.
CALL FUNCTION 'SM02_ADD_MESSAGE'
EXPORTING
MESSAGE = emtext " 1. message line
MESSAGE2 = " 3. line
MESSAGE3 = " 3. line
SERVERNAME = " Server
EXPIRATION_DATE = SY-DATUM " expiration date with
EXPIRATION_TIME = '230000' " time
DELETE_DATE = ' ' " deletion date with
DELETE_TIME = '230000' " time
CLIENT = ' ' " client
IMPORTING
MESSAGE_ID =
EXCEPTIONS
EMPTY_MESSAGE = 1
SERVER_NOT_AVAILABLE = 2
CLIENT_NOT_AVAILABLE = 3
NOT_AUTHORIZED = 4
OTHERS = 5
Regards
Sudheer
2007 Aug 28 11:16 AM
declare a variable of type date and move the date from text field to this variable.
move p_expd to zdate.
plz reward points if it helps
2007 Aug 28 11:19 AM
C14W_CHAR_NUMBER_CONVERSION
regards,
srinivas
<b>*reward for useful answers*</b>
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |