12-05-2014 11:12 AM
Dear All,
I have created a z-report by copying MB51. and added material group (mara-matkl). but its not working. I have a final table 'list'. and i have another internal table it_mara. so in it_mara i have 7 entries as per material group. I need to delete entries of matnr from 'list' (final internal table) where material number is matching with it_mara table.
Kindly Advice.
Thanks and Regards
Jai
12-05-2014 11:17 AM
Hi,
What was the reason for copying it?
You did check the online documentation of MB51 and scrolled down to the example explaing what to do when you want to add an extra field?
Kind regards, Rob Dielemans
12-05-2014 11:21 AM
Hi Rob,
Actually that was our requirement to create MB51 for general items.so that we can prevent some users to use MB51 directly.
Thanks and Regards
Jai
12-05-2014 11:19 AM
Hi,
Loop at it_mara table and delete from final table where matnr = ls_mara-matnr.
That should do it.. If the requirement is something different, please elaborate on the issue.
Ninad
12-05-2014 11:34 AM
Hi Mr. joshi,
I have already tried the same but its not working.
I am having it_mara as below.
So, I need to delete entries of ''list''(Final Internal Table) where these material number are not existing.
I need to show the data for these material number only.
Thanks and Reagrds
Jai
12-05-2014 11:44 AM
12-05-2014 11:48 AM
Since the matnr field of IT_MARA table has leading 0's, the matnr field of final table should also have leading 0's. otherwise the delete statement may fail.
please check using debugger.
Ninad
12-05-2014 11:24 AM
Use this.
loop at it_mara into wa_mara.
delete i_list where matnr = wa_mara-matnr.
endloop.
Regards,
Saddam.
12-05-2014 11:39 AM
Hi Saddam,
I have already tried this.
But its not working.
Thanks and Regards
Jai
12-05-2014 11:50 AM
Hi Jayaprakash,
Can you share the content of i_list and check if MATNR is having leading zeroes in i_list.
Thanks
12-05-2014 11:53 AM
Hi,
This is the code that i have written.
LOOP AT it_mara INTO wa_mara.
READ TABLE it_mara INTO wa_mara WITH KEY matnr = list-matnr BINARY SEARCH.
* If sy-subrc = 0.
list-matkl = wa_mara-matkl.
DELETE list WHERE matnr NE wa_mara-matnr.
ENDLOOP.
Thanks and Reagrds
Jai
12-05-2014 11:57 AM
Hi Jai,
This wont work.
Try the below code
loop at list into ls_list.
read table it_mara transporting no fields with key matnr = list-matnr.
if sy-subrc NE 0.
delete list from ls_list.
endif.
endloop.
12-05-2014 12:35 PM
Hi Mr. Joshi,
Actually "list" is a structure, so this is not working as well.
Thanks and Regards
Jai
12-05-2014 12:38 PM
Hi,
This is the declaration part.
DATA: BEGIN OF list OCCURS 0.
INCLUDE STRUCTURE itab.
DATA: maktx LIKE makt-maktx,
* MAA EhP4 -Start ------------------------------------------"MAA EhP4
* the fields for the multi account assignment "MAA EhP4
ekkn_zekkn TYPE dzekkn, "MAA EhP4
ekpo_meins TYPE ekpo-meins, "MAA EhP4
pstyp TYPE ekpo-pstyp, "MAA2
knttp TYPE knttp, "MAA EhP4
vrtkz TYPE ekpo-vrtkz, "MAA EhP4
twrkz TYPE ekpo-twrkz, "MAA EhP4
ekpo_weunb TYPE ekpo-weunb, "MAA EhP4
mb51_share TYPE ekbe_ma-share_f, "MAA EhP4
mb51_share_menge TYPE mb51_share_menge, "MAA EhP4
mb51_share_bpmng TYPE mb51_share_bpmng, "MAA EhP4
mb51_share_dmbtr TYPE mb51_share_dmbtr, "MAA EhP4
* MAA EhP4 -End --------------------------------------------"MAA EhP4
name1 LIKE t001w-name1,
btext LIKE t156t-btext,
pspid LIKE prps-posid,
vornr TYPE vornr, "215929
color_line(03) TYPE c, "n555
color TYPE slis_t_specialcol_alv,
longnum TYPE /sappspro/longnum.
DATA: END OF list.
TYPES : stype_list_maa LIKE LINE OF list,
stab_list_maa TYPE STANDARD TABLE OF stype_list_maa.
Thanks and Regards
Jai
12-08-2014 6:03 AM
Hi,
'occours 0' indicates that list is an internal table with a header line,
12-05-2014 1:11 PM
Use the standard report,
(Of course if you actually want a copy of standard, and expect to have left before next update, you can change the code at the same location)
Regards,
Raymond