2007 Oct 11 7:33 AM
hi,
im having material number and plant in my selection screen..
now after entering values for those fields in selection screen ,,i have to display the values in list output <b>for watever i have selected in the selection screen</b> for matnr and werks via select-options..
and also i have to display the number of <b>material and plant combinations</b> in the output..
thanx
jay
hi,
im having material number and plant in my selection screen..
now after entering values for those fields in selection screen ,,i have to display the values in list output <b>for watever i have selected in the selection screen</b> for matnr and werks via select-options..
and also i have to display the number of <b>material and plant combinations</b> in the output..
thanx
jay
2007 Oct 11 7:38 AM
Hi,
After getting the data into your internal table.
before display the output.
do this way
delete itab where not matnr in s_matnr.
delete itab where not werks in s_werks.
2007 Oct 11 7:41 AM
Hi Jay,
First definr the selection screen,
SELECT-OPTIONS : MATNR FOR MARA-MATNR,
PLANT LIKE MARA-WERKS.
Then write the select Querry to get the Data's to Internal table.
Thanks.
2007 Oct 11 7:42 AM
Hi
this is the logic for number of records
LV_COUNT = 0.
LOOP AT IT_OUTPUT INTO WA_OUTPUT.
LV_COUNT = LV_COUNT + 1.
WA_OUTPUT-COUNT = LV_COUNT.
APPEND WA_OUTPUT TO IT_OUTPUT_1.
ENDLOOP.
REFRESH IT_OUTPUT.
IT_OUTPUT = IT_OUTPUT_1.
2007 Oct 11 7:43 AM
write a select stmt with all the data that u want but in WHERE clause write
SELECT ....WHERE matnr in s_matnr AND werks in s_werks.
For getting the output combinations
The table in which u fetch all the data from above SELECT clause suppose it_tab
write a DESCRIBE stmr on it
data: N type I.
DESCRIBE TABLE it_tab LINES N.
This will give u the number of o/p combinations in N
Hope it answers ur query
Reward if helpful
2007 Oct 11 7:43 AM
Hi,
check the sample code..
&----
*& Form get_selection_screen
&----
Subroutine to get the user selection on selection screen
----
FORM get_selection_screen .
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-repid
TABLES
selection_table = i_seltable
EXCEPTIONS
not_found = 01
no_report = 02.
IF sy-subrc NE 0.
REFRESH i_seltable.
ENDIF.
ENDFORM. " get_selection_screen
In the seltable u will get the selected material number and plant and then pass them to below FM..it will display in the output..
&----
*& Form display_selection_criteria
&----
Subroutine to display the selction criteria in the output
----
FORM display_selection_criteria .
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = sy-repid
seltext = c_x
newpage = space
TABLES
sel_tab = i_seltable
EXCEPTIONS
sel_tab_empty = 1
OTHERS = 2.
IF sy-subrc <> 0.
REFRESH i_seltable.
ENDIF.
reward if helpful.
Regards,
Nagaraj
2007 Oct 11 7:44 AM
select matnr werks from ur database table into itab
where matnr in s_matnr
and werks in s_werks.
im assuming that ur plant is not a paramter but a select option.
i didnt get the last part of ur question
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |