2009 Mar 07 9:33 AM
hi all,
im doing one report in which after using at new conditions the internal table shows ********** values like this in some of fileds ....
plzzz help me out to solve this problem...
thank uuuuu......
2009 Mar 07 9:38 AM
If You are using AT NEW Control Break statement all the fields on the right of the specified table
will appear as *(for Char) and space(for Numeric).
So either Get the Value of sy-tabix for AT NEW.
or Get the row value into a work area everytime.
Or USE alternate to At NEW.
Itab has three Fields F1,F2,F3.
At new is on F3 Say.
Data:W_f3 like Itab-F3
sort Itab by F3.
Loop at itab.
If W_f3 Ne Itab-F3. " Similar to AT NEW
Write : f1,f2,f3.
else.
Write:f1,f2.
endif.
W_f3 = Itab-F3.
Endloop.Regards,
Gurpreet
2009 Mar 07 9:42 AM
Hi,
When you use at new, then * is printed coz the field on which you use at new command contains some other field with multiple entries. And if the row is printed once (for field used in at new) then * is printed for the other field value.
Example:-
field1 field2
10 2
10 3
10 4
If you print simply then it will the same the data in specified as above.
But if using AT NEW, if only one row is printed, then it will print as:
field1 field2
10 *
So make sure that you sort the internal table before using AT NEW command
Hope you get it.
Regards,
Tarun
2009 Mar 07 9:51 AM
>
> Hi,
>
> When you use at new, then * is printed coz the field on which you use at new command contains some other field with multiple entries. And if the row is printed once (for field used in at new) then * is printed for the other field value.
> Example:-
> field1 field2
> 10 2
> 10 3
> 10 4
>
> If you print simply then it will the same the data in specified as above.
> But if using AT NEW, if only one row is printed, then it will print as:
> field1 field2
> 10 *
>
> So make sure that you sort the internal table before using AT NEW command
>
> Hope you get it.
>
> Regards,
> Tarun
it is already sorted.....
2009 Mar 07 9:55 AM
Hi,
Can you please paste your code and internal table data.
Regards,
Tarun
2009 Mar 07 10:01 AM
>
> Hi,
>
> Can you please paste your code and internal table data.
>
> Regards,
> Tarun
loop at itab1.
at end of vbeln.
SUM.
APPEND itab1 TO itab3.
CLEAR itab3.
ENDAT.
endloop.
2009 Mar 07 10:02 AM
Hi,
What is problem with this code, and
what values is it appending to itab3?
Regards,
Tarun
Edited by: Tarun Gambhir on Mar 7, 2009 3:35 PM
2009 Mar 07 10:04 AM
>
> loop at itab1.
> at end of vbeln.
> SUM.
> APPEND itab1 TO itab3.
> CLEAR itab3.
> ENDAT.
> endloop.
check in debugging the value of itab1 inside the at end of... endat
кu03B1ятu03B9к
Edited by: kartik tarla on Mar 7, 2009 3:35 PM
2009 Mar 07 10:15 AM
>
> >
> > loop at itab1.
> > at end of vbeln.
> > SUM.
> > APPEND itab1 TO itab3.
> > CLEAR itab3.
> > ENDAT.
> > endloop.
>
> check in debugging the value of itab1 inside the at end of... endat
>
> кu03B1ятu03B9к
>
> Edited by: kartik tarla on Mar 7, 2009 3:35 PM
when it goes into at end of , some values becomes *********
2009 Mar 07 10:19 AM
Hi,
Say you have data in internal table as:-
EBELN EBELP MATNR MENGE
100001 00010 MAT1 20
100001 00020 MAT2 30
100001 00030 MAT1 40
Now if you use at end of ebeln and use SUM, then it will sum the field MENGE for a group of EBELN and inside this at end..endat, you will have EBELP = ***** and MATNR = ****.
Hope you understand.
Regards,
Tarun
2009 Mar 07 10:21 AM
>
> Hi,
>
> Say you have data in internal table as:-
>
> EBELN EBELP MATNR MENGE
> 100001 00010 MAT1 20
> 100001 00020 MAT2 30
> 100001 00030 MAT1 40
>
> Now if you use at end of ebeln and use SUM, then it will sum the field MENGE for a group of EBELN and inside this at end..endat, you will have EBELP = ***** and MATNR = ****.
>
> Hope you understand.
>
> Regards,
> Tarun
so wats the soltion for this...????
2009 Mar 07 10:22 AM
Hi,
Actually I am not able to understand your requirement, that why are you moving data from itab1 to itab3 in at end...endat
Can you explain.
Regards,
Tarun
2009 Mar 07 10:23 AM
Hi,
Define a WA like you internal table and just before going to AT END of assign the values to that WA and than you will find all values present in the AT END BODY.
Please Reply if any Issue,
Kind Regards,
Faisal
2009 Mar 07 10:26 AM
>
> Hi,
>
> Actually I am not able to understand your requirement, that why are you moving data from itab1 to itab3 in at end...endat
>
> Can you explain.
>
> Regards,
> Tarun
bcoz it has all item data and i want only the sum of all the item data's gross value.
now i hope u'll solve my problem..
2009 Mar 07 10:29 AM
Hi,
In that case try using AT END OF...ENDAT with two fields i.e, order and item and then calculate sum and move data to another internal table.
Hope this solves your problem.
Regards,
Tarun
2009 Mar 07 10:31 AM
>
> Hi,
>
> In that case try using AT END OF...ENDAT with two fields i.e, order and item and then calculate sum and move data to another internal table.
>
> Hope this solves your problem.
>
> Regards,
> Tarun
can u give me a small sample code plzzz....
2009 Mar 07 10:34 AM
Hi,
Try this code:-
LOOP AT itab1.
COLLECT itab1 INTO itab3.
ENDLOOP.
Hope this works well.
Regards,
Tarun
2009 Mar 07 10:35 AM
Hi,
Test the Sample Code Bellow and let me now if any problem,
DATA: BEGIN OF it OCCURS 10,
m(10),
amount1 TYPE i,
amount2 TYPE i,
END OF it.
DATA: it_final LIKE STANDARD TABLE OF it WITH HEADER LINE.
it-m = 'AAA'. it-amount1 = 10. it-amount2 = 20. APPEND it.
it-m = 'AAA'. it-amount1 = 10. it-amount2 = 20. APPEND it.
it-m = 'BBB'. it-amount1 = 10. it-amount2 = 20. APPEND it.
it-m = 'AAA'. it-amount1 = 10. it-amount2 = 20. APPEND it.
it-m = 'BBB'. it-amount1 = 10. it-amount2 = 20. APPEND it.
SORT it BY m.
LOOP AT it.
it_final = it.
APPEND it_final TO it_final.
AT END OF m.
SUM.
it-m = 'Sub Tot'.
APPEND it TO it_final.
ENDAT.
ENDLOOP.
LOOP AT it_final.
WRITE: / it_final-m, it_final-amount1, it_final-amount2.
ENDLOOP.Kind Regards,
Faisal
2009 Mar 07 9:42 AM
hi ,
use sort on that field and read it..
sort itab by field.
read table itab1 with key field = itab-field.
2009 Mar 07 10:00 AM
i dont remember exactly but i think i have tried
Move itab1 to itab2.
and it worked but i dont remember along with this what i have done..
2009 Mar 07 10:09 AM
there is no problem with the table field. both tables have the same structure so dont worry abt values....
2009 Mar 07 10:19 AM
Use sy-tabix value at 'AT END'.Try to use READ TABLE ITAB1 into ITAB3 INDEX SY-TABIX.
Regards,
Gurpreet
2009 Mar 07 10:19 AM
Hi, Nilesh
VBELN Must be on the LEFT Most side other wise it show all the value as * which appear on the left side of VBELN, Hope will help you,
Kind Regards,
Faisal
2009 May 22 7:00 AM