Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Adding Extra Fields At MCBE T-Code(Material Analysis) And Pick Data from Marc.

$
0
0

Hi,

Some days before, I seen one post, adding Extra fields in MCBE(Material Analysis) At Standard T-Code, the person want to Add one extra field and he need to pick the data from the Marc table.(This is the Actual Requirement to him But he has not got any replies) So, The below document explains, the details about How to add columns and how to fetch data from Marc Table.

 

Task: Adding extra field in MCBE Report and Fetch the Maintain. Status (PSTAT) Field From the MARC table.

 

Step1: First We need to add field, for displaying in the report Layout , for this  We need to check, At which place Fields to be add.

 

s1.jpg

Step2: Go to Se11  and open the Structure  s039  and Append the structure In my case, i need only one field, I was added  maintain status field of Marc Like

   Below.

  .s2.png

 

Stpe3: Now Open the MCBE and  Check the Layout , You can able to see the New field

s3.png

Step4: Before Moving moving or enabling the column You have to do One more task. In the table TMC73  We need to maintain the column into the table. Other wise. the Newly added column will not activated You will get error message While moving from Left to Right.

s4.png

 

   Once Complete the above task You can move the column from Left to right. The column will be appear but there is not data. Now we need to write the code

   for getting the data from Marc. And need to append the standard Internal table declaration in the Source Code.

 

Step5: RMCB0300 This is the main program of the T-Code MCBE. It is having some included, Open the Main program and have a look At Include

           RMCB01TP  It is having declaration and Structures(Through the Enhancement spot we can write the code). If we wont do this step, The newly added              columns will not show in the source code.Exactly At the End of the Structure Declaration You need to add newly added column at Structure aus_s000.            Just have a  look on below image.

          s6.jgg.JPG

  We need to append one more place also in the code. As per the Standard source code. Please have a look below attached image. And Translate the      Highlighted Text to English You can understood. Why we are adding the structure in two places And activated the Enhancement spot in the code.

            s7.jpg

    Step6: Now Through the Custom Exit We can Fetch the data from the Marc and we can Make communicate to the Final internal table of the
    Standard Code.

    Custom Exit name : MCR00002 => Standard analyses: Key figure display
    Function Exit Name : EXIT_SAPLMCS2_001
    Include Name:  ZXMC0U03

   

    Create  a Project At Cmod And enable the include . And put the break point and check it. Whether the code is triggering or not.

             s8.jpg

 

Step7:  By using the Field Symbols We Can get the Material Code, From the Source code,

 

field-symbols : <fs_mc51> type any,

                 <fs_zzstatus> type pstat_d. 

 

field-symbols:<fs_dmatnr> type any.

data: stat type s039-zzstatus.

loop at t_aus_s000 assigning <fs_mc51>.

    assign component 'objekt' of structure <fs_mc51> to <fs_dmatnr>.  "for getting material code from the standard source code

   select single pstat from marc into stat where  matnr eq <fs_dmatnr>.  "fetching from pstat  from marc input matnr output pstat

    assign component 'zzstatus'  of structure <fs_mc51> to <fs_zzstatus>.  "assing the zzstatus exactly like s039

    <fs_zzstatus> = stat.

endloop.

 

 

Step 8: In debugging check it, Whether it is, maintain status field value is picking from the marc or not.  The result will be look like below.

             ff.jpg

       

       

 

  

     Regards,

     NewB


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>