02-18-2009 7:10 AM
Hi All,
Here is my table entries :
Internal table 1.
Infnr Text 100 test1 100 test2 100 test3 101 test4 102 test5 I need to update tthe text throught create_text. I have consolidate the text for common infnr and i need to post. Can any one please let me know whether AT New or AT End of will do my requirement. Appreciate ur inputs. Thanks.
02-18-2009 7:23 AM
try this:
data: consolidated_text type string.
loop at it.
concatenate consolidated_text it-text
into consolidated_text.
at end of Infnr.
create_text with consolidated_text
clear consolidated_text.
endat.
endloop.
02-18-2009 7:23 AM
try this:
data: consolidated_text type string.
loop at it.
concatenate consolidated_text it-text
into consolidated_text.
at end of Infnr.
create_text with consolidated_text
clear consolidated_text.
endat.
endloop.
02-18-2009 7:38 AM
Hi
Thanks for your inputs.
When i checked it in debugger i am getting value in text like this *******************************
Any suggestions plz..
Thanks
02-18-2009 8:19 AM
>
> When i checked it in debugger i am getting value in text like this *******************************
>
Hi,
When you use the control break statements like AT NEW, AT END OF , AT FIRST etc..
It is a standard behavior of ABAP that it puts '*' to all the fields that are on the right hand side of the field that you mentioned in the control break statment.
To overcome this , you will have to copy the contents of the work area to an auxilary work area and then process your data as you want.
loop at itab into wa
wa_aux = wa.
at new field.
" Here you concatenate the fields from wa_aux to the string.
endat.
endloop.
Hope this helps.
regards,
Advait
02-18-2009 8:55 AM
02-18-2009 9:56 AM
Hi rahul,
Simply use the above code but instead of doing the processing in AT END so the same outside ,simply use the fla that is set in the AT END and clear in the AT NEW.
data: consolidated_text type string.
loop at it.
concatenate consolidated_text it-text
into consolidated_text.
at end of Infnr.
create_text with consolidated_text
clear consolidated_text.
endat.
endloop.
just add the below code in this :
DATA : l_flag type i default 0.
AT NEW ifnr.
l_flag = 0.
clear consolidate_text."clear the text here
endat.
"do same processing of concatenate ect.
AT END infnr.
l_flag =1.
endat.
if l_flag = 1.
"do the create_text processing here
endif.
Now you'll able to get the data in the string.
Pooja
Edited by: Pooja Gupta on Feb 18, 2009 10:58 AM
02-18-2009 1:13 PM
Its standard behaviour of ABAP. My suggestion is, maintain a loop counter and inside AT NEW, read internal table with this loop counter so that your internal table headr has latest value.
LOOP AT ITAB.
loop_counter = loop_counter + 1.
AT NEW.
read table ITAB index loop_counter. """Now your header will not have *********
****Do whatever is your requirement.
ENDAT.
ENDLOOP.
Hope this helps!!!
Ramesh.
02-18-2009 7:44 AM
Hi,
I think AT NEW will help you print text instead of asterixs.
Thanx,
Pritha.
02-18-2009 8:51 AM
Hi Radhu,
Try this...
DATA: create_text type string.
LOOP AT itab INTO wa.
AT NEW infnr. "Every time a new Infnr comes
WRITE: / create_text. "Display the concatenated texts
ULINE.
clear create_text. "clear it for the next set of Infnr
ENDAT.
CONCATENATE create_text ', ' sflight_wa-connid into create_text. "concatenate the texts
AT LAST. "Display for the last one
WRITE: / create_text.
ULINE.
clear create_text.
ENDAT.
ENDLOOP.
Hope this was of some help,
Best Regards,
Sagar.
02-18-2009 10:00 AM
hi,
Use of
ON CHANGE OF <data_obj>
----
ENDON
would also suffice your requirement.
Thanks
Sharath
02-25-2009 12:38 AM