2007 Oct 07 7:19 AM
Hi,
Can we assign the size of the character field dynamically at run time?
Thanks,
Smitha.
Hi,
Can we assign the size of the character field dynamically at run time?
Thanks,
Smitha.
2007 Oct 07 7:23 AM
Yes.
Using field symbol you can achieve this.
EX:
FIELD-SYMBOLS: <l_field> TYPE ANY.
<l_field> = <Your dynamic value>.
please reward if this is useful.
Regards,
Siva
2007 Oct 07 7:30 AM
Hi Siva,
I tried filed-symbols. But it did'nt help me.
The requirement is:
Iam trying to output a DME file by changing the Std.Prog as per the requirement. Each record is transfred to a memory buffer which is a long string with line feed at the end of the string. I have declared the string as 100 char. Considering that we have only 50 char to ouput with a line feed at the end of 50 char. It works well, but leaving the other 50 char as spaces which I dont want to display.
I hope Iam clear in explaing you the requirement. If no please let me know.
Thanks,
Smitha.
2007 Oct 07 8:11 AM
Hi Smitha,
While passing the string to the file compress the string and pass it to the file.
I think it will help you.
Reward if useful.
Sastry.
2007 Oct 07 9:35 AM
Hi,
I think you have declared like
DATA : l_text(100) TYPE C.
declare as a string like
Data : l_text TYPE STRING.
if you store l_text = ' Test '.
the l_text will hold 'Test' only. the traling space will be eliminated.
Reward if this is useful.
regards,
Siva
2007 Oct 07 10:36 AM
Siva,
Thanks for the response and was close to the solution and rewarded 6 points too..
Unfortunately STRING is not supported when Iam storing the data in buffer.
It gives SY-SUBRC as 16. Any suggestion why does it do like that? Here is the code that fails. Here (buffer) is the place where I store the STRING as you said:
It was working for CHAR type. I donno why it fails for STRING. Can you throw some light on what is 'C_RSTS_WRITE' and how buffer works????
****************************************************************************
FORM temse_schreiben USING value(buffer).
DATA: _rc(5),
_errmsg(100).
CALL 'C_RSTS_WRITE'
ID 'HANDLE' FIELD hlp_handle
ID 'BUFF' FIELD buffer
ID 'RC' FIELD _rc
ID 'ERRMSG' FIELD errmsg. "#EC CICCALL
IF sy-subrc NE 0. "Fehler beim Schreiben
IF sy-batch EQ space.
MESSAGE a229.
ELSE.
MESSAGE s229.
STOP.
ENDIF.
ENDIF.
ENDFORM. "TEMSE_SCHREIBEN
****************************************************************************
Smitha..
2007 Oct 07 4:14 PM
2007 Oct 07 5:40 PM
Hi,
Iam still confused.
Is that the (buffer) parameter always expects CHAR type? If not why it fails for STRING format. Can anyone please explain?
Thanks,
Smitha.
2007 Oct 23 3:15 AM
2014 Feb 25 2:58 PM
Hello Smitha,
Can you share with me how you solved?
I think I am having same problem. If my datatype is char40 and I am passing 'Test', then 'Test' (and then 34 spaces) and then next comma (delimiter) is appearing.
Thanks,
Ashish
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |