Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

putting extra field

Former Member
0 Kudos

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.

12 REPLIES 12

former_member188685
Active Contributor
0 Kudos

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

0 Kudos

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

former_member181962
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

Hi,

don't give this...

<b> fieldcat-no_out = 'X'.</b>

change it to

<b> fieldcat-no_out = ''.</b>

0 Kudos

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

0 Kudos

<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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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