Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need Help regarding text Output

Former Member
0 Likes
1,279

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,244

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

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

9 REPLIES 9
Read only

former_member242255
Active Contributor
0 Likes
1,244

can u explain a bit more clear

Read only

0 Likes
1,244

In Simple

I want to remove Workers from Workers (7).

Read only

Former Member
0 Likes
1,244

Use this code

t503t-ptext+8(3)

Read only

Former Member
0 Likes
1,244

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

Read only

Former Member
0 Likes
1,245

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

Read only

0 Likes
1,244
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.

Read only

0 Likes
1,244

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

Read only

0 Likes
1,244

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

Read only

Former Member
0 Likes
1,244

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