2009 Jan 05 3:13 PM
Hi all,
I have a requirement wherein i have to display some columns in my output table.
These all values are fetched froma single table MSEG
Among them one of the column is material number and other is unit of entry.
For the same material number there clould be multiple entries conataining different
unit of entry. I want all these entries in single row for the same material number.
Is it possible by using field symbol or any other way.
Please respond as soon as possible.
Thanks in advance.
Hi all,
I have a requirement wherein i have to display some columns in my output table.
These all values are fetched froma single table MSEG
Among them one of the column is material number and other is unit of entry.
For the same material number there clould be multiple entries conataining different
unit of entry. I want all these entries in single row for the same material number.
Is it possible by using field symbol or any other way.
Please respond as soon as possible.
Thanks in advance.
2009 Jan 05 4:35 PM
Hi,
Sort the internal table by MATNR.
Looping through the internal table, Use the control break statements AT NEW Matnr. you can write the same material number and different unit of entry in one row.
Regards
Sravan
2009 Jan 07 4:28 PM
Could you provide me a sample code for the same.
I don't know how to use the control break statement.
2009 Jan 07 6:30 PM
Hi, Sumit
The Sample code for the Control Break Statement is as follow,
loop at it1_eobi_ded into wa_it1_eobi_ded.
at new year.
check_year = 'X'.
clear wa_year_total.
endat.
if check_year = 'X'.
clear check_year.
else.
wa_it1_eobi_ded-year = ''.
endif.
add: wa_it1_eobi_ded-p_staff to wa_year_total-p_staff,
wa_it1_eobi_ded-p_ded to wa_year_total-p_ded,
wa_it1_eobi_ded-dw_staff to wa_year_total-dw_staff,
wa_it1_eobi_ded-dw_ded to wa_year_total-dw_ded,
wa_it1_eobi_ded-total_ded to wa_year_total-total_ded.
append wa_it1_eobi_ded to it2_eobi_ded.
at end of year.
wa_year_total-month_name = 'Year T'.
append wa_year_total to it2_eobi_ded.
endat.
at last.
sum.
wa_it1_eobi_ded-month_name = 'Grand T'.
append wa_it1_eobi_ded to it2_eobi_ded.
endat.
endloop.Please Replay if you need more help regarding Control Break Statement.
Kind Regards,
Faisal.
2009 Jan 05 5:06 PM
2009 Jan 07 4:37 PM
Hi,
If you want to display each unit of entry then you need to use Field Symbols or if you need to display it in one column separated by comma or colon etc the you can use Control break statement. As there could be different number of line items in each Material Document and not static.
Thanks,
Prashanth
2009 Jan 07 4:41 PM
Hi Prashanth,
I need this in the ALV format.
As of now I have completed in the most crude manner,
but still I want to know it for further use.
If you could provide me with some sample code it
would be a great help
Thanks.
Sumit
2009 Jan 07 4:53 PM
Hi,
can you give me the output layout i.e your ALV Report Structure, with one example record so i can see how could it be done as i have also not done it earlier but could help you with the logic or code if possible.
Thanks,
Prashanth
2009 Jan 07 4:57 PM
create an internal table of type tline and append ur all entries which u want in a single row to that internal table. like itab-tdlines = field1 + field2 .......
then dispaly it
2009 Jan 08 9:41 AM
Hi Prashanth,
I have got the sample code I was looking for through the answers of others.
In anycase your answer provided me with some help though its not the same
logic that I have used.
Thanks anyways.
2009 Jan 07 7:22 PM
Sumit,
This can be done something like this.
Create an internal table with first filed as MATNR.
data : begin of itab occurs 0,
matnr like mseg-matnr,
uom like mseg-meins,
end of itab.
data : uom_str(100).
Then sort the itab - sort itab by matnr uom.
loop at itab.
concatenate uom_str itab-uom into uom_str.
at end of matnr.
write : /iatb-matnr,uom_str.
endat.
clear uom_str.
endloop.
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:23 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |