‎2007 Jan 18 9:55 PM
HI EXPERTS,
my write statement is
WRITE:/ 'users',
userid-low.
Now the output is like user id vs1234 ,aj34526 .
but i need the output like user id vs1234,aj34526.
length of user id is 12 chars....
can someone shed some light on this issue....
Thanks in advanse...
SRI
‎2007 Jan 18 10:04 PM
hi declare 3 variables char1(12), char2(12),char3(24).
where char3 holds the final output
data: char1(12), char(12), char3(24).
char1 = userid.
char2 = userid-low.
concatenate char1 char2 into char3.
condense char3 no-gaps.
write:/ char3.
<b>award points if found helpful</b>
‎2007 Jan 18 10:04 PM
hi declare 3 variables char1(12), char2(12),char3(24).
where char3 holds the final output
data: char1(12), char(12), char3(24).
char1 = userid.
char2 = userid-low.
concatenate char1 char2 into char3.
condense char3 no-gaps.
write:/ char3.
<b>award points if found helpful</b>
‎2007 Jan 18 10:07 PM
Hi Rahul,
Thanks alot for your reply
here i mentioned only two user id's, actually i wll get more than 10 userid's in a single line and lenght of the user id may change from one user to other user
how to handle this..?
‎2007 Jan 18 10:12 PM
You man have to store all such userids in an internal table with two fields.
1. user id
2. final result
1. loop at internal table
2. concatenate
3. store in final result
4. modify table
Hope this helps..
Thanks,
Santosh
‎2007 Jan 18 10:13 PM
hi can u post the part of code, i can definitely help in that regard
as far as i understand if u are going to get all the user-id's in a single line then simply use condense statement which remove all the extra spaces..
‎2007 Jan 18 10:14 PM
Hi,
Use:
Write:/5 (user_id1), 20 (user_id2), 35 (user_id3).
This will print all the user ids at the specific columns.
Regards
Subramanian
‎2007 Jan 18 10:16 PM
If you have many userid's..
loop at internal table with the userid's
Declare a variable which is of maximum length of all the userid's.
v_variable.
concatenate userid ',' v_variable to v_variable.
condense v_variable with no-gaps.
endloop.
write : v_variable.
Srini.
‎2007 Jan 18 10:23 PM
‎2007 Jan 18 10:24 PM
Hi,
write will add a trailing space character after every output field. If you do not want this, use the option NO-GAP.
Your example will not output the comma caus e the closing ' is missing - where did that go?
Try
WRITE:/ user id NO-GAP, ',', userid-low.
Regards,
Clemens
‎2007 Jan 18 10:27 PM
Sorry guys I am having only one varibale ie userid-low
I corrected my question... can some one help me now...
‎2007 Jan 18 10:31 PM
ok
char1 = userid-low.
condense char1 no-gaps.
write:/ char1.
This will work, dont forget to award points
‎2007 Jan 18 10:31 PM
in that case just say:
CONDENSE userid-low NO-GAPS.
WRITE:/ userid-low.
Thanks,
Santosh
‎2007 Jan 18 11:05 PM
I am getting the same result again even though i applied the above logic
can u check it out one more time plzzzzz
‎2007 Jan 18 11:42 PM
Hi
If you want to delete the spaces on the left, you should check the how many characters are filled and print only them:
DATA: USER LIKE SY-UNAME VALUE 'id12345',
USER2 LIKE SY-UNAME VALUE 'aaaaa',
USER3 LIKE SY-UNAME VALUE 'bbb',
USER4 LIKE SY-UNAME VALUE 'idaacccc'.
WRITE: 'Users:'.
PERFORM WRITE_USER USING: USER ',',
USER2 ',',
USER3 ',',
USER4 '.'.
*&---------------------------------------------------------------------*
*& Form WRITE_USER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_USER text
*----------------------------------------------------------------------*
FORM WRITE_USER USING P_USER P_SYMB.
DATA: LEN TYPE I.
LEN = STRLEN( P_USER ).
WRITE: P_USER(LEN) NO-GAP, P_SYMB NO-GAP.
ENDFORM. " WRITE_USERMax
‎2007 Jan 18 10:36 PM
Sri,
try in system: WRITE will never output a comma if there is none enclosed in HYPHENS like ','.
If you don't want the trailing space, use addition NO-GAP. If you want the output restricted t the actual length of the username you can specify an output length:
data:
lv_len type sytleng.
lv_len = strlen( userid-low ).
Write: / (lv_len) userid-low, 'is the user's name'.
Another option might be to put the cursor on the WRITE and press F1 - and take some time
Regards,
Clemens
‎2007 Jan 19 12:22 AM
Hi,
My problem partially solved...
Now I want to print this result in alv footer how to do it......
Can anyone plz help me regarding this?
‎2007 Jan 19 12:41 AM
Hi
U've to use the END_OF_PAGE event.
I don't know which kind of ALV you're using, but the way it's always the same.
ALV functions have the parameter where the events are transfered, here u insert the name of the event and the name of the form has to be run in the event:
LS_EVENT-NAME = 'END_OF_PAGE'. "<----- Event name
LS_EVENT-FORM = 'END_OF_PAGE'. "<----- Form name
APPEND LS_EVENT TO GT_EVENTS.
GT_REPID = SY-REPID. "<----- The report where routine is defined
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = gt_repid
it_events = gt_events
.......................................................................
* Form
FORM END_OF_PAGE.
* Here write your code of the footer
ENDFORM.U can use the event END_OF_LIST insted of END_OF_PAGE
In the OO ALV you should find the same events
Max