06-11-2012 11:24 AM
Hi all.
I have created a standard text in transaction SO10: 'Z_MSG_IMPUESTO'
*Spanish law require us to apply the &D_IVA& tax when the equipment remains in the country*
And D_IVA is a variable which I have to fill in program. I have put the next code in program:
DATA:
lt_text TYPE STANDARD TABLE OF tline,
D_IVA TYPE char3.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = nast-spras
name = 'Z_MSG_IMPUESTO'
object = 'TEXT'
TABLES
lines = lt_text.
* Se informa la variable que hay en el texto
d_iva = komvd-kbetr / 10.
concatenate d_iva komvd-koein into d_iva.
REPLACE ALL OCCURRENCES OF '&D_IVA&' IN TABLE lt_text WITH D_IVA.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MENSAJE'
element = 'MSG_IVA'.
I have tried with functions 'TEXT_SYMBOL_REPLACE' and 'REPLACE_TEXTSYMBOL' to fill the variable but they don't work.
In program, table lt_text is right and &D_IVA& is substituted by 16%, but when I call to element of form, in the form 16% doesn't appear.
Is code OK? Am I doing something wrong? Could you help me?
Thanks a lot.
Marta.
04-04-2013 8:30 AM
Hi Marta,
when creating standard texts with variables (&D_IVA& in your case) for SapScripts you can use the following approach:
Please let me know (and reward me with points) if this solution worked for you
04-04-2013 8:30 AM
Hi Marta,
when creating standard texts with variables (&D_IVA& in your case) for SapScripts you can use the following approach:
Please let me know (and reward me with points) if this solution worked for you