This website is not affiliated with, sponsored by, or approved by SAP AG.

****s in date result.

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

****s in date result.

Postby geetha_chowdary » Fri Jan 02, 2004 5:47 am

Hi friends,

My internal table is filled in this format.

NO DATE

000001 12/30/2003
000001 12/31/2003
000001 01/02/2004
000002 12/30/2003
000002 12/30/2003
000002 12/31/2003
000002 01/01/2004

result should be:
000001 01/02/2004

des: it has to check for last row of no:1 and last row of no:2.
and should display that record that too when the last record date = sy-datum.

i wrote code like this:

loop at itab.
at end of load_no.
if itab-cr_date = sy-datum.
write: / itab-load_no, 10 itab-cr_date.
endif.
endat.

but iam getting ***** in the date column.
plz give me some solution.

thanks ,
geetha.
geetha_chowdary
 
Posts: 19
Joined: Fri Jan 02, 2004 5:41 am

Postby ramesh255 » Fri Jan 02, 2004 6:59 am

HI Geetha,

Just change your internal table structure and try it.

Create like :

DATE NO
12/30/2003 0000001

Bye, Ramesh.
---------------------------
ramesh255
 
Posts: 19
Joined: Sun Sep 21, 2003 11:35 pm

Postby ramesh255 » Fri Jan 02, 2004 7:09 am

Store the date field in a variable before Control Break statements.
Yhen, write the variable inside the event.

Bye, Ramesh
------------------
ramesh255
 
Posts: 19
Joined: Sun Sep 21, 2003 11:35 pm

Postby VIJAYASEKAR » Fri Jan 02, 2004 7:15 am

When ever u r using at new , at last events u have to sort the internal table with respect to the fields u r using inthe loop.

When the control comes into at new , at end event only that particular field is visible (for other fields values will be ****** ) so u cannot print that......

What u can do?

set a flag variable in at .....endat and check for the flag after that and print other field values ......

Example:

if ur internal table structure is
lno , date......

loop at itab.
at new lno.
flag = 1.
endat.

if flag eq 1.
write itab-date.
clear flag.
endif

endloop.


i hope this solve ur problem........
K Vijayasekar,
SAP Developer,
IBM Global Services.
VIJAYASEKAR
 
Posts: 15
Joined: Mon Apr 28, 2003 6:45 am
Location: Bangalore

Postby geetha_chowdary » Fri Jan 02, 2004 7:18 am

Hi Ramesh,

Thanks alot for your help.
your first reply didt work but second one worked well.
Now it is working fine with your second answer.

thanks you,

Geetha.
geetha_chowdary
 
Posts: 19
Joined: Fri Jan 02, 2004 5:41 am

Postby geetha_chowdary » Fri Jan 02, 2004 7:23 am

Thanks Vijaysekhar,

I think more or less both the solutions are same.

thanks for the help

geetha.
geetha_chowdary
 
Posts: 19
Joined: Fri Jan 02, 2004 5:41 am

Help...

Postby DeadLock » Sun Jan 04, 2004 9:14 pm

Hi geetha,
also, I have add one more solution...to ur Query.
Whenever u r facing some problem hit Second Key from the Top left Corner.
Hope this also helps u in future. :D
Rgds
DDDPPPPPPDDDPPP
Rgds
DeadLock
Image
ABAP Company ...
DeadLock
 
Posts: 123
Joined: Mon Dec 01, 2003 2:30 am
Location: Round the Earth

Postby geetha_chowdary » Mon Jan 05, 2004 12:42 am

Hi DeadLoack,

Thanks for your answer.
But unfortunately, The second key from top left only providing me the left side tree but not the right side details of ABAP documentation.
help me to fix this problem.

awaiting your reply.

thanks,

geetha.
geetha_chowdary
 
Posts: 19
Joined: Fri Jan 02, 2004 5:41 am

Postby vaidyasalil1978 » Mon Jan 05, 2004 4:40 am

Hi

There is one more solution to your question.
When ever you are using loop at itab, you should sort the internal table. Now when you sort the internal table then you will get either * or 0.
To avoid this in your output. Declare a work area of same type as that of the internal table. Move the data from itab to wa. Then print the data using the wa.

eg.

sort itab by date.
loop at itab.

wa = itab.

at last load.
write wa-date.
endat.
endloop.

I think this might help.

Regards
Salil
vaidyasalil1978
 
Posts: 12
Joined: Sat May 10, 2003 1:34 am

Re-install

Postby DeadLock » Wed Jan 07, 2004 2:03 am

Hi geetha,
in that case , u need to re-install ur SAP, ask ur Basis to do so..other wise..if u can pay for me i can install..becaz recently i purchased "Basis in 11 Days Book". :lol:
Rgds
DeadLock
Image
ABAP Company ...
DeadLock
 
Posts: 123
Joined: Mon Dec 01, 2003 2:30 am
Location: Round the Earth

Postby bhintasa » Sun Feb 15, 2004 1:54 pm

use the statement
Read table ITAB index sy-tabix.
after the AT statement,
It will solve the problem.
like
*************
loop at itab.
at end of load_no.
read table itab index sy-tabix. "Addition
if itab-cr_date = sy-datum.
write: / itab-load_no, 10 itab-cr_date.
endif.
endat.
**************

and always try to understand , why it happens??
All the event for AT are normally used for calculations, so the charachter fields are Asterixed out by SAP.
But the Read Statement solves the purpose.
bhintasa
 
Posts: 10
Joined: Thu Feb 13, 2003 7:54 am
Location: London

Postby Prowl » Thu Mar 30, 2006 12:37 am

If you use field-symbols of same structure as the int tab, then use LOOP AT itab ASSIGNING <fs>, then the ***** will disappear.
Prowl
 
Posts: 54
Joined: Thu Feb 13, 2003 3:27 am
Location: Antarctica

In LOOP with int. table, when I am in AT NEW (END etc)

Postby vamsil » Mon Nov 26, 2007 12:29 am

Hi,

your internal table consists of following field.

begin of itab occurs 0,
SrNo,
Date
endif.

sort itab by SrNo Date descending.

delete adjacent duplicates of itab comaparing Srno.
vamsil
 
Posts: 1
Joined: Mon Nov 26, 2007 12:18 am

Postby wiraone » Mon Nov 26, 2007 2:29 am

Oh common guys, this is so simple!!! As suggested, it is in the HELP .. just read the AT control break and you'll know what the problem is..

Solution? Move your entry into temporary work area/structure ..

Code: Select all
loop at lt_struc.
  ls_struc = lt_struc.
...
  at end of whatever.
    write: ls_struc-field1 ...
  endat.
..
endloop.
wiraone
 
Posts: 1419
Joined: Mon Oct 28, 2002 8:54 am
Location: Diawang-awangan

Re: In LOOP with int. table, when I am in AT NEW (END etc)

Postby Rich » Mon Nov 26, 2007 2:56 am

vamsil wrote:Hi,

your internal table consists of following field.

begin of itab occurs 0,
SrNo,
Date
endif.

sort itab by SrNo Date descending.

delete adjacent duplicates of itab comaparing Srno.


errr..... Vamsil.....

Why answer a question that is nearly 4 years old ?

You don't get points on this site....
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Next

Return to ABAP

Who is online

Users browsing this forum: No registered users and 5 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.