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

internal table shows '*' values...

Former Member
0 Likes
1,785

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......

23 REPLIES 23
Read only

Former Member
0 Likes
1,751

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

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

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

Read only

Former Member
0 Likes
1,751

>

> 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.....

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

Hi,

Can you please paste your code and internal table data.

Regards,

Tarun

Read only

Former Member
0 Likes
1,751

>

> 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.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

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

Read only

Former Member
0 Likes
1,751

>

> 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

Read only

Former Member
0 Likes
1,751

>

> >

> > 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 *********

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

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

Read only

Former Member
0 Likes
1,751

>

> 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...????

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

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

Read only

faisalatsap
Active Contributor
0 Likes
1,751

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

Read only

Former Member
0 Likes
1,751

>

> 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..

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

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

Read only

Former Member
0 Likes
1,751

>

> 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....

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,751

Hi,

Try this code:-


LOOP AT itab1.
  COLLECT itab1 INTO itab3.
ENDLOOP.

Hope this works well.

Regards,

Tarun

Read only

faisalatsap
Active Contributor
0 Likes
1,751

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

Read only

former_member203501
Active Contributor
0 Likes
1,751

hi ,

use sort on that field and read it..

sort itab by field.

read table itab1 with key field = itab-field.

Read only

Former Member
0 Likes
1,751

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..

Read only

Former Member
0 Likes
1,751

there is no problem with the table field. both tables have the same structure so dont worry abt values....

Read only

0 Likes
1,751

Use sy-tabix value at 'AT END'.Try to use READ TABLE ITAB1 into ITAB3 INDEX SY-TABIX.

Regards,

Gurpreet

Read only

0 Likes
1,751

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

Read only

Former Member
0 Likes
1,751

ok