how to write itab fields in one line seperated by space
Moderators: Snowy, thx4allthefish, YuriT, Gothmog
how to write itab fields in one line seperated by space
Hi Guys
I have a question may be simple but my stupid brain is not wroking.
I have an internal table with data and I want to write this internal table onto application server seperated by space.
Here you go.
types : begin of costcenter,
kokrs type csks-kokrs,
kostl type csks-kostl,
end of costcenter.
data : t_costcenter type standard table of costcenter initial size 0,
wa_costcenter type costcenter.
loop at t_costcenter into wa_costcenter.
transfer wa_itab to 'xxxxxxxfile'.
endloop.
This code writes wa_costcenter onto file but I want to write with space seperation between fields. Here in this example I have 2 fields but in reality I have like 20-30 fields.
I can concatenate these fields into string or another variable seperated by space but I am looking for any simple solution.
Thanks a lot in advance
Vasu
I have a question may be simple but my stupid brain is not wroking.
I have an internal table with data and I want to write this internal table onto application server seperated by space.
Here you go.
types : begin of costcenter,
kokrs type csks-kokrs,
kostl type csks-kostl,
end of costcenter.
data : t_costcenter type standard table of costcenter initial size 0,
wa_costcenter type costcenter.
loop at t_costcenter into wa_costcenter.
transfer wa_itab to 'xxxxxxxfile'.
endloop.
This code writes wa_costcenter onto file but I want to write with space seperation between fields. Here in this example I have 2 fields but in reality I have like 20-30 fields.
I can concatenate these fields into string or another variable seperated by space but I am looking for any simple solution.
Thanks a lot in advance
Vasu
types : begin of costcenter_space,
kokrs type csks-kokrs,
filler,
kostl type csks-kostl,
filler2,...
end of costcenter.
wa_costcenter_space type costcenter_space.
clear wa_costcenter_space.
loop at t_costcenter into wa_costcenter.
move-corresponding wa_costcenter to wa_costcenter_space.
transfer wa_costcenter_space.
endloop.
regards.
kokrs type csks-kokrs,
filler,
kostl type csks-kostl,
filler2,...
end of costcenter.
wa_costcenter_space type costcenter_space.
clear wa_costcenter_space.
loop at t_costcenter into wa_costcenter.
move-corresponding wa_costcenter to wa_costcenter_space.
transfer wa_costcenter_space.
endloop.
regards.
-
- Posts: 1398
- Joined: Thu Dec 04, 2003 8:16 am
- Location: Stuck in a pagoda with Tricia Toyoda
I see the cop-paste fairy has worked her magic here...
Terrible. You'd have to change the code if a field was added or removed. And what about any non-charachter fields? I really hope you don't code like that for real.Anonymous wrote:types : begin of costcenter_space,
kokrs type csks-kokrs,
filler,
kostl type csks-kostl,
filler2,...
end of costcenter.
First he pinches my sig, Now he's cribbing my posts too!
Re: I see the cop-paste fairy has worked her magic here...
Hi Hognoxious 
Could you please show your solution?
Thanks for your patience
Regards

If a field has to be added or removed in an internal table you likely have to change the code...hognoxious wrote:
Terrible. You'd have to change the code if a field was added or removed.
What's the problem with non-character fields?hognoxious wrote:
And what about any non-charachter fields?
Could you please show your solution?
Thanks for your patience

Regards
Re: I see the cop-paste fairy has worked her magic here...
Not if you use field symbolsAnonymous wrote:Hi Hognoxious
If a field has to be added or removed in an internal table you likely have to change the code...hognoxious wrote:
Terrible. You'd have to change the code if a field was added or removed.
Oscar.
Re: I see the cop-paste fairy has worked her magic here...
Could we please have your salary? After all, we seem to be doing your job.Anonymous wrote: Could you please show your solution?
It's been asked before: use the f^&%%* search already!
-
- Posts: 6197
- Joined: Mon Oct 21, 2002 3:04 am
- Location: Darlington
- Contact:
This topic will be locked if the abuse level gets any worse than above. Please note that masked profanity is no better than open profanity and will be treated as such.
Kind Regards
Rosie Brent
Please remember to search the forum and check the FAQ before posting questions, thank you.
Tuly Idiot most of the time, part-time Guru
Rosie Brent
Please remember to search the forum and check the FAQ before posting questions, thank you.
Tuly Idiot most of the time, part-time Guru

Re: I see the cop-paste fairy has worked her magic here...
I'd do if I couldSearch user man wrote:Could we please have your salary?Anonymous wrote: Could you please show your solution?

Really? It seems to me you're wasting time...Search user man wrote: After all, we seem to be doing your job.
You haven't read the entire post or you haven't understand it. It's up to you.

Best regards.