2009 May 15 10:22 AM
Dear gurus.
I need help regarding formatting of a text.
I want to format a employee sub group text.
im getting a text workers (7) from a table t503t having field ptext.
i want to show only (7) in the output not the whole text how can i do this ?
Please help
regards
Saad.Nisar
2009 May 15 10:32 AM
hi,
Do you mean that from the string 'text workers (7)' you want only '(7)' ?
Will the number be always be in the end in the text?
In that case you can use the split statement.
Split the text at space into an internal table and get the number.
Please be more specific in your query.
Regards,
Ankur Parab
hi,
Do you mean that from the string 'text workers (7)' you want only '(7)' ?
Will the number be always be in the end in the text?
In that case you can use the split statement.
Split the text at space into an internal table and get the number.
Please be more specific in your query.
Regards,
Ankur Parab
2009 May 15 10:30 AM
2009 May 15 10:31 AM
2009 May 15 10:32 AM
2009 May 15 10:32 AM
use offsetting inorder to restrict text
wf_text = '123456789'.
write:/ wf_text+0(5). output is- 12345
write:/ wf_text+2(3) . output is- 234
Edited by: Lavanya K on May 15, 2009 11:34 AM
2009 May 15 10:32 AM
hi,
Do you mean that from the string 'text workers (7)' you want only '(7)' ?
Will the number be always be in the end in the text?
In that case you can use the split statement.
Split the text at space into an internal table and get the number.
Please be more specific in your query.
Regards,
Ankur Parab
2009 May 15 10:40 AM
DATA: BEGIN OF itab_odoe OCCURS 0,
department_text LIKE t527x-orgtx,"Holds the short text for department
department_no LIKE pernr-orgeh,
pernr LIKE pernr-pernr,
ename LIKE pernr-ename,
grade like t503t-ptext, "THIS AREA GET ME TEXT OF EMPLOYEE SUBGROUP"
* department_text LIKE t527x-orgtx,"Holds the short text for department
current_year LIKE sy-datum,
wt0001 LIKE q0008-betrg,"Basic Pay
wt1101 LIKE q0008-betrg," COLA
wt3002 LIKE p0015-betrg,"Overtime
per_basic type p DECIMALS 2,"Overtime percentage on basic
per_basic_sum type p decimals 2,"Overtime Sum Division
overtime_sum LIKE p0015-betrg,"holds sum of overtime
basic_sum like q0008-betrg,"holds sum of basic
END OF itab_odoe.Im using the select statement to get the employee subgroup from the table
select single ptext
from t503t
into itab_odoe-grade
where persk eq pernr-persk
AND SPRSL eq 'EN'.now in itab_odoe-grade the values comes is Workers (7) , Snr Mgt (M3)
i want to show only the text in Brackets.
2009 May 15 10:43 AM
now in itab_odoe-grade the values comes is Workers (7) , Snr Mgt (M3)
Workers(7) = itab_odoe-grade+8(1)
iSnr Mgt(M3) = tab_odoe-grade+8(2)
Edited by: Lavanya K on May 15, 2009 11:44 AM
2009 May 15 11:04 AM
Hi,
If you are sure that the data in brackets will appear just once in the main text then use SPLIT statement.
Split the text at '(' into 2 strings.
The number will then appear in the 2nd string with the remaining bracket.
Again split the new text into 2 by spliting it at ')'.
In this way you will be able to get the data which is in the brackets.
Regards,
Ankur Parab
2009 May 15 10:45 AM
Hi,
Consider "Mthly dir. AdSI AR" is the value of ptext.
use a local variable g_ptext type T503T-PTEXT.
g_ptext = T503T-PTEXT + 0(6).
or declare a local variable g_ptext(7) type c.
then assign,
g_ptext = T503T-PTEXT . it takes first 7 characters.
Regards,
vino
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |