05-26-2006 1:07 PM
Dear friends,
I need to add additional field ( MARA-MFRPN ) in the output report of Transaction MB52.
The program name is RM07MLBS for MB52 , I copied the program, but i felt difficult to add this additional field. Pls brief me on this.
05-26-2006 1:10 PM
Hi,
Try to add that field in your selection, and since it is alv Report , you can add that field in your fieldcat.
under the form <b>FORM fieldcatalog.</b>
try to add your field at the last , if there are no restrictions or else add it where ever you want and change the corresponding positions of the other fields.
Regards
vijay
05-26-2006 1:14 PM
and also one more thing. here they are not giving any positions, so don;t worry about positions. just add it in the middle of fields where ever you want .
did you find it the form
<b>FORM fieldcatalog</b>
in side this only you should add the code for your addnl field
Regards
vijay
05-26-2006 1:16 PM
HI kalimuthu,
After you copy your program,
Go to the form data_selection.
IN the select statements, add mara~mfrpn also .
Add the field mrpfn in your t_mat internal tablle also.
Add the field to your final table also.
Fill the field catalog for your additional field.
Regards,
Ravi
05-26-2006 1:57 PM
Dear ravi,
Thanks for the valuable information,
i added mara~mfrpn in select statement and in t_mat internal table but I don't know where is the Final table and please tell me how to code in FORM Field Catalog
05-26-2006 2:04 PM
Hi,
you should add it like this..under the mentioned form for fieldcatalog.
<b> fieldcat-fieldname = 'MFRPN'.
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MARA'.
APPEND fieldcat.
CLEAR fieldcat.</b>
and final table name might be HEADER check it once.
Regards
vijay
05-26-2006 2:24 PM
Hi Vijay,
Yes i added as you mentioned earlier,but it is not working.
CLEAR fieldcat.
fieldcat-fieldname = 'MFRPN'.
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MARA'.
fieldcat-no_out = 'X'.
APPEND fieldcat.
05-26-2006 2:31 PM
Hi,
don't give this...
<b> fieldcat-no_out = 'X'.</b>
change it to
<b> fieldcat-no_out = ''.</b>
05-26-2006 2:31 PM
addd the field to the internal table bestanda also.
Then go to line line number 1623.
and add this code.
<b>read table t_mat with key matnr = bestand-matnr
werks = bestand-werks.
if sy-subrc = 0.
bestand-MFRPN = t_mat-MFRPN.
endif.</b>
Then add the field catalog code.
Regards,
Ravi
05-26-2006 2:32 PM
<b> fieldcat-no_out = 'X'.</b>
will make your field not visible in the ALV output. it will be hidden,
give space or remove that line
<b> fieldcat-no_out = ' '.</b>
Regards
vijay
05-26-2006 2:52 PM
Dear Ravi,
the line 1623 is comming here, exactly where i need to add the code
read table t_mat with key matnr = bestand-matnr
werks = bestand-werks.
if sy-subrc = 0.
bestand-MFRPN = t_mat-MFRPN.
endif.
and i also changed
fieldcat-no_out = ''.
still it is not displaying
*List body
clear fieldcat.
fieldcat-fieldname = 'LGORT'.
fieldcat-tabname = 'BESTAND'. ---1623
05-26-2006 2:58 PM
Hi,
Try debugging it, if you do all mentioned steps..
1. check you have populated the values
2. fieldcat has entry for MFRPN.
try to keep the break point here..
<b>CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'</b>
and also here
<b>CALL FUNCTION alv_detail_func</b>
Regards
Vijay
Message was edited by: Vijay Babu Dudla
05-26-2006 1:21 PM
Hi,
Apart from adding feild to field catalog in
form fieldcatalog ,You have to select
the value from mara table in form
also include this feild in internal table
t_mat.
FORM data_selection.
SELECT maramatnr <b>maraMFRPN</b> werks xchar mtart matkl meins trame umlmc
mara~lvorm as lvorm_mara
marc~lvorm as lvorm_marc
INTO CORRESPONDING FIELDS OF TABLE t_mat
FROM mara INNER JOIN marc
ON maramatnr = marcmatnr
WHERE mara~matnr IN matnr
AND werks IN werks
AND mtart IN matart
AND matkl IN matkla
AND ekgrp IN ekgrup.
Regards
Amole