‎2008 Nov 25 2:30 AM
HI Guru's,
I have one parameter option as Movement type in report, when i enter the movement type in the selection screen it will display all the material except that movement type correpond to the material.
ex : materia A
materia B
materia C.
if material A and B have same movement type 321 abd c have 300, if i enter 321 in the selection screen report should be show material C only.
can any one pls tell me how to do.
Thanks & Best Regards,
Praveen.
‎2008 Nov 25 3:40 AM
If you want to exclude the movement type that is entered in selection screen which is defined as parameter, you can check for NON EQUALITY.
Eg.,
parameters: p_bwart type bwart obligatory.
select <flds>... into <itab> from <table> where bwart ne p_bwart and (add_cond).~Eswar
‎2008 Nov 25 3:40 AM
If you want to exclude the movement type that is entered in selection screen which is defined as parameter, you can check for NON EQUALITY.
Eg.,
parameters: p_bwart type bwart obligatory.
select <flds>... into <itab> from <table> where bwart ne p_bwart and (add_cond).~Eswar
‎2008 Nov 25 3:50 AM
HI eswar,
i want to display the material that not hit the movement type what i enter in the selection scree.
Ex : Maetrial A
Material B
Material C
if i enter the 321 movement type in the selection screen
suppose material A have the movement type 321 and material B have movement type 321 and 101 etc...
and material C have only 300 movement type at this case i want to display the material C .
Thanks & Best Regards,
Praveen.
‎2008 Nov 25 4:02 AM
You can try it this way:
" Movement Type
PARAMETERS: p_bwart TYPE bwart OBLIGATORY.
" Select Data as per conditions into internal table
SELECT <flds> INTO TABLE <itab> FROM <table>
WHERE (cond).
" Move data to final Output table
<itab_final>[] = <itab>[].
" Delete materials in final output table which have movement type
" entered in selection screen
LOOP AT <itab> INTO <wa> WHERE bwart = p_bwart.
DELETE <itab_final> WHERE matnr = <wa>-matnr.
ENDLOOP.
" Now final output table will have the data excluding the materials
" with movement type entered in selection screen~Eswar
‎2008 Nov 25 4:43 AM
HI eswar,
I was tryed ur sugestion but i didn't get it in bellow is the my coding can u please show me where can i change the coding..
&----
*& Report ZMMR039
*&
&----
*&
*&
&----
report zmmr039 message-id zpraveen1.
tables : mseg,mkpf,makt.
type-pools : slis.
types : begin of t_mseg_mkpf,
matnr like mseg-matnr, " Material Number
lgort like mseg-lgort, " Storage location
bwart like mseg-bwart, " Movement type
erfmg like mseg-erfmg, " Quantity
erfme like mseg-erfme, " Units of Measurements
mblnr like mseg-mblnr, " Material Document
mblnr like mkpf-mblnr, " Material Document
budat like mkpf-budat, " Posting Date
zeile like mseg-zeile, " Item
charg like mseg-charg, " Batch
cputm like mkpf-cputm, " entry time
end of t_mseg_mkpf.
types : begin of t_makt,
matnr like makt-matnr, " Material number
maktx like makt-maktx, " Material Description
end of t_makt.
data : wa_t_mseg_mkpf type t_mseg_mkpf,
it_mseg_mkpf type standard table of t_mseg_mkpf.
data : wa_t_makt type t_makt,
it_makt type standard table of t_makt.
data : wa_output type zsnonmove,
it_output type standard table of zsnonmove.
data : v_page type string,
v_date(10) type c,
wa_heading type slis_listheader,
i_heading type standard table of slis_listheader.
data : so_enste_l1(4) type c,
so_enste_l2(2) type c,
so_enste_l3(2) type c,
so_enste_h1(4) type c,
so_enste_h2(2) type c,
so_enste_h3(2) type c,
so_enste1(10) type c,
so_enste2(10) type c.
*----> start of selection screen.
selection-screen begin of block 001 with frame title text-001.
parameter : pa_lgort like mseg-lgort,
pa_bwart like mseg-bwart. "Movement type
select-options : so_matnr for mseg-matnr, "Material
so_budat for mkpf-budat. "Posting date
selection-screen end of block 001.
*-----> end of selection screen.
*---> start of at selection screen event
**--> start of selection.
start-of-selection.
perform retrivedata.
perform processdata.
perform alv.
&----
*& Form retrivedata
&----
text
----
--> p1 text
<-- p2 text
----
form retrivedata .
select msegmatnr mseglgort msegbwart msegerfmg msegerfme msegmblnr msegzeile msegcharg
mkpfbudat mkpfcputm mkpf~mblnr into corresponding fields of table it_mseg_mkpf
from mseg inner join mkpf
on msegmblnr = mkpfmblnr
where mseg~lgort = pa_lgort and
mseg~bwart ne pa_bwart and
mseg~matnr in so_matnr and
mkpf~budat in so_budat.
select matnr maktx from makt into corresponding fields of table it_makt
for all entries in it_mseg_mkpf where matnr = it_mseg_mkpf-matnr.
endform. " retrivedata
&----
*& Form processdata
&----
text
----
--> p1 text
<-- p2 text
----
form processdata .
loop at it_mseg_mkpf into wa_t_mseg_mkpf.
clear : wa_t_makt.
read table it_makt into wa_t_makt with key matnr = wa_t_mseg_mkpf.
move wa_t_mseg_mkpf-matnr to wa_output-matnr.
move wa_t_makt-maktx to wa_output-maktx.
move wa_t_mseg_mkpf-mblnr to wa_output-mblnr.
move wa_t_mseg_mkpf-bwart to wa_output-bwart.
move wa_t_mseg_mkpf-lgort to wa_output-lgort.
move wa_t_mseg_mkpf-erfmg to wa_output-erfmg.
move wa_t_mseg_mkpf-erfme to wa_output-erfme.
move wa_t_mseg_mkpf-budat to wa_output-budat.
move wa_t_mseg_mkpf-zeile to wa_output-zeile.
move wa_t_mseg_mkpf-charg to wa_output-charg.
move wa_t_mseg_mkpf-cputm to wa_output-cputm.
collect wa_output into it_output.
clear sy-subrc.
endloop.
endform. " processdata
&----
*& Form alv
&----
text
----
--> p1 text
<-- p2 text
----
form alv .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'TOP-OF-PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = 'ZSNONMOVE'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = 'A'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = it_output[].
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
endform. " alv
form top-of-page.
*-> refresh
refresh i_heading.
wa_heading-typ = 'H'.
wa_heading-info = ' Display Non Moving Products'.
append wa_heading to i_heading.
wa_heading-typ = 'S'.
concatenate 'By : ' sy-uname into wa_heading-info separated
by space.
append wa_heading to i_heading.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = i_heading[].
Thanks & Best Regards,
Praveen.
endform. "top-of-page
‎2008 Nov 25 5:29 AM
I havent seen you following my advice in your code.
Anyways, do the following modifications and check:
" Declare a temporary internal table
DATA: it_temp TYPE STANDARD TABLE OF ty_mseg_mkgf,
wa_temp TYPE ty_mseg_mkpf.Comment BWART restriction in where condition:
SELECT mseg~matnr mseg~lgort mseg~bwart mseg~erfmg mseg~erfme
mseg~mblnr mseg~zeile mseg~charg
mkpf~budat mkpf~cputm mkpf~mblnr
INTO CORRESPONDING FIELDS OF TABLE it_mseg_mkpf
FROM mseg INNER JOIN mkpf
ON mseg~mblnr = mkpf~mblnr
WHERE mseg~lgort = pa_lgort AND
* mseg~bwart NE pa_bwart AND " Comment BWART condition
mseg~matnr IN so_matnr AND
mkpf~budat IN so_budat." Move data to temporary internal table
it_temp[] = it_mseg_mkpf[]." For material that have movement entered in the selection delete
" from the output
LOOP AT it_temp INTO wa_temp WHERE bwart EQ pa_bwart.
DELETE it_mkpf_mseg WHERE matnr = wa_temp-matnr.
ENDLOOP.~Eswar
‎2008 Nov 25 6:14 AM