‎2006 Sep 26 1:32 PM
Hi experts,
I would like to replace text variable from a sapscript document created with SE61.
Therefor I use function module 'TEXT_SYMBOL_REPLACE' in a way described below:
call function 'TEXT_SYMBOL_REPLACE'
exporting
ENDLINE = sy-tabix
header = ls_docu_head
PROGRAM = lv_repid
REPLACE_STANDARD = 'X'
REPLACE_TEXT = 'X'
STARTLINE = 1
tables
lines = lt_tline.
ITAB lt_tline contains the text lines from the sapscript document:
--> Purchase order &GS_SELDAT-EBELN&.
The problem is that the text will be replaced but not with the right values. After calling the FM the ITAB lt_tline is empty.
The following manner I would like to have:
If have selected some data from table ekko and hold this data in a internal table gt_seldat and the workarea gs_seldat.
Now I would like to fullfill the text variable from sapscript document (&GS_SELDAT-EBELN&) with the data from the internal table gt_seldat.
lv_repid contains the name of the current calling program where the text should be replaced.
Can anybody help solving this problem?
Regards,
Cornelius
‎2006 Sep 26 1:41 PM
Hi cornelius,
1. Make sure sy-tabix contains
the last line number of your internal table.
2. also make sure ls_docu_head
contains all fields in the structure.
3. also,
your variables which contain the value
to be replaced in sapscript,
should be global in the calling program.
(In your case, if it is an internal table,
the HEADER LINE containing the value,
will finally get into the sapscript
at the time of calling this FM
)
4. Rest, the FM functions perfectly well.
regards,
amit m.
‎2006 Sep 26 1:41 PM
Hi cornelius,
1. Make sure sy-tabix contains
the last line number of your internal table.
2. also make sure ls_docu_head
contains all fields in the structure.
3. also,
your variables which contain the value
to be replaced in sapscript,
should be global in the calling program.
(In your case, if it is an internal table,
the HEADER LINE containing the value,
will finally get into the sapscript
at the time of calling this FM
)
4. Rest, the FM functions perfectly well.
regards,
amit m.
‎2006 Sep 26 2:06 PM
Hi amid,
I checked all points you mentioned but it doesn't works.
I can't find the error.
Can you give me a simple example how to use (to call) the function module?
Maybe the text variable in den sapcript formular is defined in a wrong way?
I don't understand how the program which is calling the FM replaces the variables in the text.
Thank you.
Cornelius