‎2007 Jan 22 8:48 AM
Hi all,
I have provided 5 material number in the selection screen for the field s_material.
Now while displaying the alv output i want to display all the material numbers in the header part of the alv grid display.
Now i am able to display only the lower limit and upper limit of s_material.
Please tell me how to display all the material numbers in the header part.
‎2007 Jan 22 8:51 AM
hi Shwetha,
Try including them in the multiple entries button of your select-option statement. else Use Ranges ...
Regards,
Santosh
‎2007 Jan 22 8:51 AM
hi Shwetha,
Try including them in the multiple entries button of your select-option statement. else Use Ranges ...
Regards,
Santosh
‎2007 Jan 22 8:52 AM
Hi Shwetha
FYI, select-option is treated as an internal table. So loop at S_MATERIAL to get and display.
Am not sure, how you need to display when the user selects in the following ways:
1. Materials for Exclusion.
2. Combined when Range and Individual Materials are selected.
Maybe the best approach would be the list the materials selected i.e in your final output internal table.
Kind Regards
Eswar
‎2007 Jan 22 11:18 AM
Hi Eswar,
Thank you very much.
I have done according to your sugeestions.now i am displaying all the materials.
But there is problem.
the material are displaying in the header as follows
material : 00000000000010584
material : 00000000000010585
material : 00000000000010586
material : 00000000000010587
If they print like this it is ok when material numbers are less but when there are more materials this type of displaying becomes problem.
So i want to display them as
material : 00000000000010584 00000000000010585 00000000000010586
00000000000010587
How to do this one.
‎2007 Jan 23 1:08 AM
Hi Shwetha
As Shibha adviced, CONCATENATE the materials into one or multiple lines and then use them to display in the header.
Even by this approach you still have the restriction. Suppose the report is executed for whole plant which has some thousands of materials the scenario you were saying earlier might still creep up.
Please inform the same to the concerned people and proceed.
Kind Regards
Eswar
‎2007 Jan 22 8:53 AM
do one thing just fetch all the material numbers from the table in between tht low and high range into an internal table having one fiel das material number only.
see below -
select matnr into table itab from DBTAB where matnr in s_material.
now ur all material numbers are in ITAB,u can use them.
amit
‎2007 Jan 22 8:56 AM
Hi Shweta,
U r getting the Materials based on ur selection criteria into one Internal table. By looping that int.table pass Material to ALV Header.
Regards,
Balavardhan.K
‎2007 Jan 22 9:10 AM
Hi shweta,
<b>data :begin of it_mat occurs 0,
matnr like mara-matnr,
end of it_mat.
First u pass all the 5 materials to an internal table say, it_mat.
now it_mat contains u r materials.
data: lt_list_commentary type slis_t_listheader.
perform build_comment using
lt_list_commentary.
form build_comment using
pt_list_commentary type slis_t_listheader.
data: ls_line type slis_listheader.
loop at it_mat.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = it_mat-matnr.
append ls_line to pt_list_commentary.
endloop.
endform.
In Function module,
it_list_commentary = lt_list_commentary
NOTE : ls_line-typ = 'H'.
Here u have various options like 'H' , 'A' , 'S'.
use as per u r requirement </b>
‎2007 Jan 22 9:20 AM
Select option parameters acts like internal tables and have four columns.
SIGN, OPTION, LOW, HIGH
Option has values like EQ (Equal), NE(Not Equal), BT(Between), LE, GE, GT, LT
you can control this field add to your header which you want.
Try this.
select-options : s_matnr for mara-matnr.
loop at <b>s_matnr</b>.
if s_matnr-option eq 'EQ'.
move s_matnr-low to ALV_HEADER.
append ALV_HEADER.
endif.
endloop.
‎2007 Jan 22 9:33 AM
in alv grid top of page form.
take the value in itab from your display int tab(i.e. which table you are passing in grid display).
sort itab by matnr.
delete adjacent duplicates from itab.
loop at itab.
wlistheader-info = itab-matnr.
wlistheader-type = 'S'.
append wlistheader to ilistheader.
endloop.
now call reuse_alv_commentary_write.
regards
shiba dutta
‎2007 Jan 22 11:24 AM
in output write as
loop at s_matnr.
write:/ s_matnr-low.
endloop.
‎2007 Jan 22 11:42 AM
you have to use concatenate but i am not sure how much maxm limit is there
data : cmatnr(255).
loop at itab.
concatenate : cmatnr itab-matnr into cmatnr.
endloop.
wlistheader-info = cmatnr.
wlistheader-typ = 'S'.
append wlistheader to ilistheader.
regards
shiba dutta