How does Item Supply/demand form  get populated?

Hi,
can anyone help me find out more documentations or understandings on Item Supply/Demand form in the Inventory, like how the calculations are done in that form, where it's pulling the data from, which tables,...things like that.
Is it available in oracle user guides at all?
Thanks in advance.
--Sathish                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Thank you for the response guys, but the actual issue for me is that there are duplicate rows for the same order number and item in MRP Work bench Supply/demand form of Purchasing User Responsibility although there are only single rows for them when viewed from the inventory responsibility. So, Could you please help me finding out the reason behind why there is duplicate data in the MRP supply/demand form??
Thanks in advance
--Sathish                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Cycle Count Reservation Issue in Item Supply/Demand Form

    Hi
    Few of the inventory items are stuck with Cycle Count Reservation in Item Supply/Demand Form. The Identifier field is empty. It is not tied to any sales order or PO . I checked the On hand quantity(on-hand quantity form) and the current on hand (Item Supply/Demand form) both are same. Could not able to figureout what went wrong and how the cycle count reservations are created. Even after performing the Cycle counting on these items, it did not consumed these reservations and releaved those reservations.
    Could anyone suggest me please in what scenrios we get this issue and how to eliminate these records from the Item Supply/Demand Form. we are on 11.5.10.2 INV and WMS RUP4.
    Thank You!
    Krishna

    CC reservations can be triggered by Curtail (Short) picks on mobile gun. When this happens the ATR qty gets decremented by this Qty by putting a CC reservation.
    This can also be deleted from front end by changing the demand source to acc/acc alias, save and then delete.
    Karthik

  • Inconsistent view - Item Supply/Demand form

    We are seeing an unexplained difference between the On Hand and Available values on the Item Supply/Demand form. Opened TAR with Oracle Support, they said the difference is the move orders that we have allocated. The form does not show the move order, since they are not supply/demand BUT it does subtract the allocated quantity from on-hand since the material is not available. Oracle has suggested a custom report be run, any other suggestions, short of re-writing the form?

    I'm sure you know the only place to see the detail is in the pending transactions form. Have you considered building a custom zoom, or an extension, from the supply/demand form to the pending transactions form that will find the relevent pending transactions? Not a fix, but at least you can stay in the same screen.
    I agree the form needs to show the allocated material, but I doubt that will happen any time soon.

  • Item supply/demand - basics on calculation

    Hi,
    can anyone help me find out more documentations or understandings on Item Supply/Demand form in the Inventory, like how the calculations are done in that form, where it's pulling the data from, which tables,...things like that.
    Is it available in oracle user guides at all?
    Thanks in advance.
    Chitra

    I tried using the same code used by the form in SQL. It worked. The only issue is that the ATP group Id specific to this request is not populating appropritely. It is always populating as 0. If I register as concurrent program probably it will populate correctly. This is required in order to delete the rows correctly belonging to that session from the mtl_supply_demand_temp at the end of the session.
    You can try that if you are Ok with that approach. This way you do not have worry about finding out the tables to query. Here is that I did.
    DECLARE
    l_seq_num NUMBER;
    rtvl NUMBER;
    args1 VARCHAR (240);
    args2 VARCHAR (240);
    args3 VARCHAR (240);
    args4 VARCHAR (240);
    args5 VARCHAR (240);
    args6 VARCHAR (240);
    args7 VARCHAR (240);
    args8 VARCHAR (240);
    args9 VARCHAR (240);
    args10 VARCHAR (240);
    args11 VARCHAR (240);
    args12 VARCHAR (240);
    args13 VARCHAR (240);
    args14 VARCHAR (240);
    args15 VARCHAR (240);
    args16 VARCHAR (240);
    args17 VARCHAR (240);
    args18 VARCHAR (240);
    args19 VARCHAR (240);
    args20 VARCHAR (240);
    l_session_id NUMBER;
    l_count NUMBER;
    cutoff_date_j NUMBER;
    l_total_temp VARCHAR2 (30);
    l_avail_qty_temp VARCHAR2 (30);
    CURSOR c1
    IS
    SELECT inventory_item_id
    FROM mtl_system_items_b
    WHERE organization_id = 204 AND segment1 IN ('AS18947', 'AS81414');
    BEGIN
    fnd_global.apps_initialize (1072, 50346, 401);
    --fnd_profile.put ('CONC_DEBUG', 'TC');
    /* fnd_global.initialize (session_id => l_session_id
    , user_id => 1072
    , resp_id => 50346
    , resp_appl_id => 401
    , security_group_id => 0
    , site_id => 0
    , login_id => 1833382
    , conc_login_id => -1
    , prog_appl_id => 401
    , conc_program_id => 33808
    , conc_request_id => fnd_global.conc_request_id
    , conc_priority_request => -1
    , form_id => 52654
    , form_appl_id => 401
    , conc_process_id => NULL
    , conc_queue_id => NULL
    , queue_appl_id => NULL
    , server_id => 147
    inv_globals.set_org_id (204);
    SELECT mtl_demand_interface_s.NEXTVAL
    INTO l_seq_num
    FROM DUAL;
    SELECT TO_CHAR (SYSDATE, 'j')
    INTO cutoff_date_j
    FROM DUAL;
    FOR i IN c1
    LOOP
    IF (inv_tm.launch ('INXDSD'
    , 'GROUP_ID='
    || TO_CHAR (l_seq_num)
    || ' '
    || 'ORGANIZATION_ID='
    || TO_CHAR (204)
    || ' '
    || 'INVENTORY_ITEM_ID='
    || TO_CHAR (i.inventory_item_id)
    || ' '
    || 'ONHAND_SOURCE='
    || TO_CHAR (1) --1 ATP Only, 2 For Net Subinventories, 3 all subinvs
    || ' '
    || 'CUTOFF_DATE="'
    || TO_CHAR (cutoff_date_j)
    || '" '
    || 'MRP_STATUS='
    || TO_CHAR (1)
    || ' '
    || 'ONHAND_FIELD=l_total_temp'
    || 'AVAIL_FIELD=l_avail_qty_temp'
    , l_total_temp
    , l_avail_qty_temp
    ) = FALSE
    THEN
    DBMS_OUTPUT.put_line ('FAILED');
    ELSE
    DBMS_OUTPUT.put_line ('SUCCESS');
    DBMS_OUTPUT.put_line (l_total_temp);
    DBMS_OUTPUT.put_line (l_avail_qty_temp);
    INSERT INTO xx_mtl_supply_demand_temp
    SELECT *
    FROM mtl_supply_demand_temp
    WHERE seq_num = 0;
    END IF;
    END LOOP;
    -- fnd_profile.put ('CONC_DEBUG', NULL);
    BEGIN
    DELETE FROM mtl_atp_rules
    WHERE rule_id IN (SELECT atp_rule_id
    FROM mtl_group_atps_view
    WHERE atp_group_id = 0);
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    BEGIN
    DELETE mtl_group_atps_view
    WHERE atp_group_id = 0;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    BEGIN
    DELETE mtl_supply_demand_temp
    WHERE seq_num = 0;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    inv_utilities.do_sql ('commit');END;
    As you can see I have to use seq_num as zero it was always populating as zero in this table where as from form it populates correctly.
    Since this is a function, probably you can use this in discoverer queuries (I am not sure). Then query this custom table (mirror of mtl_supply_demand_temp) to show the report.
    Thanks
    Nagamohan

  • Item/Supply demand Concurrent manager

    when am trying to view the item supply/demand
    It is giving me error
    CONC-TM-NO MANAGER DEFINED (APPLICATION=INV)
    (PROGRAM=INXDSD)(RESP_ID=21623) (RESP_APPL_ID=660)
    should i involve my apps dba to look into this error??
    or can i activate it myself??
    Please Advise
    Mahendra

    Hussein Sawwan wrote:
    Please see these docs.
    INVDVDSD - Item Supply/Demand Form Error Out Conc-Tm-No Manager Defined [ID 803374.1]
    Cannot View Any Item In Supply/Demand Form In Inventory [ID 1267591.1]
    Thanks,
    HusseinThanks Hussein..Involving DBA..

  • Item - Supply demand Concurrent program error

    I wish to find out the supply and demand for the item, like how it is displayed in the VIEW SUPPLY/DEMAND form of the inventory module.
    I have read the below thread and modified the code that I got from it.
    item supply/demand - basics on calculation
    The code that I am using is below:
    DECLARE
    l_seq_num NUMBER := 0;
    l_session_id NUMBER;
    l_count NUMBER;
    cutoff_date_j NUMBER;
    l_total_temp VARCHAR2 (30);
    l_avail_qty_temp VARCHAR2 (30);
    CURSOR c1
    IS
    SELECT inventory_item_id
    FROM mtl_system_items_b
    WHERE organization_id = 204 AND inventory_item_id = 1;
    BEGIN
    fnd_global.apps_initialize (1072, 50346, 401);
    inv_globals.set_org_id (204);
    SELECT TO_CHAR (SYSDATE, 'j')
    INTO cutoff_date_j
    FROM DUAL;
    FOR i IN c1
    LOOP
    IF (inv_tm.launch ('INXDSD'
    , 'GROUP_ID='
    || TO_CHAR (l_seq_num) -- Always going to be 0
    || ' '
    || 'ORGANIZATION_ID='
    || TO_CHAR (204)
    || ' '
    || 'INVENTORY_ITEM_ID='
    || TO_CHAR (i.inventory_item_id)
    || ' '
    || 'ONHAND_SOURCE='
    || TO_CHAR (3) --1 ATP Only, 2 For Net Subinventories, 3 all subinvs
    || ' '
    || 'CUTOFF_DATE="'
    || TO_CHAR (cutoff_date_j)
    || '" '
    || 'MRP_STATUS='
    || TO_CHAR (1)
    || ' '
    || 'ONHAND_FIELD=l_total_temp'
    || 'AVAIL_FIELD=l_avail_qty_temp'
    , l_total_temp
    , l_avail_qty_temp
    ) = FALSE
    THEN
    DBMS_OUTPUT.put_line ('FAILED');
    ELSE
    DBMS_OUTPUT.put_line ('SUCCESS');
    DBMS_OUTPUT.put_line (l_total_temp);
    DBMS_OUTPUT.put_line (l_avail_qty_temp);
    INSERT INTO xx_mtl_supply_demand_temp
    SELECT *
    FROM mtl_supply_demand_temp
    WHERE seq_num = 0;
    END IF;
    END LOOP;
    BEGIN
    DELETE mtl_supply_demand_temp
    WHERE seq_num = 0;
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL;
    END;
    inv_utilities.do_sql ('commit');END;
    Now this code is populating my temporary table perfectly, the issue that I am facing is that each time this query is run it adds the same number of records, despite the fact that there are no rows in mtl_supply_demand_temp table corresponding to inventory_item_id =1.
    I will explain this situation elaborately below.
    1. The number of rows into xx_mtl_supply_demand_temp after the first run is 240.
    2. I verify that these rows do not exist in mtl_supply_demand_temp table and delete all rows from xx_mtl_supply_demand_temp table.
    3. I run the anonymous block again, now I get 480 rows.
    4. This process continues and I get 720, 960, ......(keeps adding 240 rows after every run) records.
    I need to get only 240 records after every run.
    Why is this happening ? How can I correct this ?

    1009226 wrote:
    I am running oracle ebs 12.1.3 with oracle database 11g. I did go through the documents you provided but they seem irrelevant to me. Is there something that I am missing ?please see this
    https://cn.forums.oracle.com/forums/thread.jspa?messageID=10958380
    MTL_SUPPLY_DEMAND_TEMP Table Is Too Large [ID 182490.1]
    ;) AppsMasti ;)
    Sharing is Caring

  • Find Supply Demand Form Left Mouse Button Behavior

    Release 11.5.10.2, 10G database.
    A customer has a strange mouse behaviour issue In the ASCP -> Supply/Demand form that the began after installing Demantra.
    The mouse cursor is returning to the original location that it was just before the user attempted to click in another field.
    If the customer uses custom folder, the problem is less apparent in that they can select additional fields in the folder's form..
    There is a Note.753324.1 ''Diagnosing Form Mouse Focus Problems In Applications R11i" that suggests a few options; but the this customer is on forms 6.0.8.28.0 and it is unclear if the issue in that note applies in this case.
    Does anyone have any ideas as to how to get to the root of this issue or have seen it before and have a solution?
    Edited by: Bob Marchant on Feb 23, 2009 5:20 PM
    Edited by: Bob Marchant on Apr 13, 2013 6:57 AM

    James,
    Sorry I am so lengthy. The problem is that with the technical support guy on line, when the Mouse button 4 event occurred I described to the tech that I was pushing and pulling the mouse from the back end to avoid touching the buttons on the side and every time I rolled the mouse a few inches forward the dashboard assigned to mouse button 4 appeared and next when I rolled it back the dashboard disappeared, I rolled it forward and it reappeared and so on. Then the tech wanted me to click on the apple and go into system preferences and as my cursor touched the file menu to get to the preferences that menu dropped without me left clicking the mouse. As I passed over edit and view they just dropped down.
    What do you make of that? I am presently running OSX leopard without my printer and scanner installed. If I see no problem in two days, I will plug in the printer and install it. Then after that the scanner and see if the problem happens. I will follow your suggestions about relearning the mouse though.
    Stephen
    Stephen

  • Item Supply Demand

    Hello,
    I am using the package INV_TM.LAUNCH to gather supply demand data into my custom temp table. For some items, I see that the ON_HAND_QUANTITY order does not match the order on the Supply Demand form. Has anyone seen this issue?
    Also, this package return two values for variables TOTAL_TEMP and AVAIL_QTY_TEMP, both of them are NULL.
    Please advice!!

    Hello,
    I am using the package INV_TM.LAUNCH to gather supply demand data into my custom temp table. For some items, I see that the ON_HAND_QUANTITY order does not match the order on the Supply Demand form. Has anyone seen this issue?
    Also, this package return two values for variables TOTAL_TEMP and AVAIL_QTY_TEMP, both of them are NULL.
    Please advice!!

  • How does 0SOURSYSTEM Souce system Id get filled?

    Hi Gang,
    How does 0SOURSYSTEM Souce system Id get filled?
    I'm trying to recreate some transfer rules which were deleted.
    Is there an ABAP program or transfer program to populate this field?
    Or do I hard code a value?
    Thanks,
    John Hawk

    Hi,
    Yes you need to write code..
    INCLUDE rsbctbbp_transfer_r3.
    TABLES: srm_proj_contr.
    DATA:   l_s_errorlog TYPE rssm_s_errorlog_int,
              l_text TYPE string.
    Retrieve source system ID form the source system
    CALL FUNCTION 'RSDG_ID_GET_FROM_LOGSYS'
            EXPORTING
              I_SOURCE_SYSTEM = TRAN_STRUCTURE-ORGLOGSY
            IMPORTING
              E_SOURSYSID     = RESULT
            EXCEPTIONS
              ID_NOT_FOUND    = 1.
          IF SY-SUBRC <> 0.
            RETURNCODE = 4.
            message E087(R7) with TRAN_STRUCTURE-ORGLOGSY into l_text.
            move-corresponding syst to l_s_errorlog.
            l_s_errorlog-record = RECORD_NO.
            append l_s_errorlog to g_t_errorlog.
          ENDIF.
        ELSE.
          RESULT = SPACE.
        ENDIF.
      ENDIF.
    See
    Problem with mapping 0SOURSYSTEM and 0LOGSYS in BI7.
    Thanks
    Reddy

  • Item supply/demand can't display the po_line that need-by is  multiple

    item supply/demand can't display the po_line that need-by is  multiple,i means that if the po_line have multi line_locations ,it can't be displayed in the supply/demand windows.
    how to deal this problem?

    To add detail to Mikeyc7m's last post
    If the folder has a default value for author then only an adminstrator could check files into that folder. This is because non administrators can not spoof their user name to be someone else's. With the default value being someone else they will never be able to check in (unless they are an admin who can spoof who the user is and in this case it will look like the user checked in a file and not the admin which is a different problem but still a problem).

  • [Flex 4.5.1] How does Button's fontSize property gets applied to labelDisplay?

    How does Button's fontSize property gets applied to labelDisplay when lableDisplay's fontSize is not explicitly set. I just tested it it works but I don't know how. I looked through the ButtonBase class but I don't see any code applying the fontSize to the labelDisplay nor I see code in the Label to get parent's fontSize property if not set. Could someone explain to me how this works? I would be very grateful! Thanks !

    Ok I found it, thanks for the heads up. I pretty much get the idea of how things work now
    Could you please take a look at one more probably very simple to you question. I had to customize a button to be able to have 2 lables in it with different fontSize and topPadding in this case. I kinda copied some of the code from ButtonBase + added the styles and some code I needed to make it work.
    Here it is:
    package
        import flash.events.Event;
        import spark.components.Button;
        import spark.components.Label;
        [Style(name="numberFontSize", type="Number", format="Length", inherit="yes", minValue="1.0", maxValue="720.0")]
        [Style(name="numberPaddingTop", type="Number", format="Length", inherit="no", minValue="0.0", maxValue="1000.0")]
        public class DialPadButton extends Button
            public function DialPadButton()
                super();
            private var _numberContent:*;
            [SkinPart(required="false")]
            public var numberLabelDisplay:Label;
            [Bindable("numberContentChange")]
            public function get numberContent():Object
                return _numberContent;
            public function set numberContent(value:Object):void
                _numberContent = value;
                if (numberLabelDisplay)
                    numberLabelDisplay.text = label;
                dispatchEvent(new Event("numberContentChange"));
            public function set numberLabel(value:String):void
                numberContent = value;
            public function get numberLabel():String         
                return (numberContent != null) ? numberContent.toString() : "";
            override protected function partAdded(partName:String, instance:Object):void
                super.partAdded(partName, instance);
                if (instance == numberLabelDisplay)
                    if (_numberContent !== undefined)
                        numberLabelDisplay.text = numberLabel;
                    if(getStyle("numberFontSize"))
                        numberLabelDisplay.setStyle("fontSize", getStyle("numberFontSize"));
                    if(getStyle("numberPaddingTop") || getStyle("numberPaddingTop") == 0)
                        numberLabelDisplay.setStyle("paddingTop", getStyle("numberPaddingTop"));
            override public function styleChanged(styleProp:String):void
                if (!styleProp ||
                    styleProp == "styleName" ||
                    styleProp == "numberFontSize" ||
                    styleProp == "numberPaddingTop")
                    if (numberLabelDisplay){
                        if(getStyle("numberFontSize"))
                            numberLabelDisplay.setStyle("fontSize", getStyle("numberFontSize"));
                        if(getStyle("numberPaddingTop"))
                            numberLabelDisplay.setStyle("paddingTop", getStyle("numberPaddingTop"));
                super.styleChanged(styleProp);
    So here are the questions:
    1) If I am not going to use the styles in css then maybe I should better declare them as variables ?
    2) I don't really understand how does the button gets updated and redrawn when I set Styles or properties like that cause there is nowhere a call to invalidate the display list (at least I couldn't find in the Button and ButtonBase classes) as I read in the Flex docs: Overriding the styleChanged() method
    UPDATE: I forgot that setStyle calls invalidateDisplayList... and I just figured out that when the lable sets the text on the TextBase it calls the invalidates. I answered this one myself
    3) I don't understand why do I have this code (copied from the buttonBase):
    if (!styleProp ||
        styleProp == "styleName" ||
        styleProp == "numberFontSize" ||
        styleProp == "numberPaddingTop")
    instead of just the code below:
    if (styleProp == "numberFontSize" ||
       styleProp == "numberPaddingTop")
    5) I am also not sure why I had to use content and label (again copied from the ButtonBase) when they are basicly the same thing
    Currently with this Custom Component I've made, I am able to put 2 lables in the skin. One is the default. And the other one takes the default values I put on the label itself + uses the two styles numberFontSize and numberTopPadding to change that default values in case they need to be altered.
    Although this works, I am not sure if I did it the best way or why does it work as you can say from my 5 questions
    I hope you or someone who understands this have the time to answer them for me and anyone who reads this Thanks
    Message was edited by: FM_Flame

  • How does CRM on Demand determine the highest priority Task?

    In the "My Homepage -> My Open Tasks" List there is a sortable priority column. If you have a number of tasks in the list with different priorities and click on the priority column they will be sorted in descending order by priority as follows:
    "1-High"
    "2-Medium"
    "3-Low"
    I have tried editing the order on the Edit Picklist screen for the Activity Priority field (by navigating to Admin -> Application Customization -> Activity -> Activity Field Setup) but this appears to have no effect on the priority sort order on in the Task List. I have also tried adding new values to the picklist and they always appear as the lowest priority.
    So my question is how does CRM on Demand determine that the priority picklist value "1-High" is the highest priority when sorting the tasks?

    There is a sort order on the activity applet based upon the priority field. As 1 comes before 2 and 3, it would be sorted to the top.

  • How the Feature Variables Table BEFM_FV get populated in CRM Billing Eng?

    Hello Expert,
    Can you please tell me how the Feature Variables Table BEFM_FV get populated in CRM Billing Enge(BEFN)?
    We need to change the value of CANCEL_COPY_TYPE variable there. Please help.
    - FInd out the way to maintain this table from Billing Engine Frame(BEFN) Meta Data Entry.
    Edited by: Palash Dutta on Apr 25, 2011 4:10 PM

    You are welcome. I'm glad you got it back up.
    (1) You say you did the symbolic link. I will assume this is set correctly; it's very important that it is.
    (2) I don't know what you mean by "Been feeding the [email protected] for several weeks now, 700 emails each day at least." After the initial training period, SpamAssassin doesn't learn from mail it has already processed correctly. At this point, you only need to teach SpamAssassin when it is wrong. [email protected] should only be getting spam that is being passed as clean. Likewise, [email protected] should only be getting legitimate mail that is being flagged as junk. You are redirecting mail to both [email protected] and [email protected] ... right? SpamAssassin needs both.
    (3) Next, as I said before, you need to implement those "Frontline spam defense for Mac OS X Server." Once you have that done and issue "postfix reload" you can look at your SMTP log in Server Admin and watch as Postfix blocks one piece of junk mail after another. It's kind of cool.
    (4) Add some SARE rules:
    Visit http://www.rulesemporium.com/rules.htm and download the following rules:
    70sareadult.cf
    70saregenlsubj0.cf
    70sareheader0.cf
    70sarehtml0.cf
    70sareobfu0.cf
    70sareoem.cf
    70sarespoof.cf
    70sarestocks.cf
    70sareunsub.cf
    72sare_redirectpost
    Visit http://www.rulesemporium.com/other-rules.htm and download the following rules:
    backhair.cf
    bogus-virus-warnings.cf
    chickenpox.cf
    weeds.cf
    Copy these rules to /etc/mail/spamassassin/
    Then stop and restart mail services.
    There are other things you can do, and you'll find differing opinions about such things. In general, I think implementing the "Frontline spam defense for Mac OS X Server" and adding the SARE rules will help a lot. Good luck!

  • Supply/Demand Form showing Closed Work Order

    Hi,
    I closed work order.But it is still shows up in
    Oracle Inventory>on-Hand availability>item supply/demand
    I am looking for a data fix to clear the record. (table MTL_SUPPLY_DEMAND_TEMP)
    Please suggest

    Closed or Complete? I know that if there is remaining quantity on a complete job that amount will show

  • How to find when a ztable gets populated?

    Hi Folks,
    Closing balance not carrying forward to Opening Balance-MM  
    Previously I posted a question with the above said subject.But couldn't get any right lead.
    The problem is we have developed a zreport to get the RG1 summary of finished goods.For that the previous team who worked on this had copied the table
    j_2irg1bal to z2irg1bal.I want to know when and how this ztable will get populated.
    Can anyone here please go through the BOLD part of this code and let me know.
    K.Kiran.
    REPORT zxxx MESSAGE-ID z_apd.
    *& Includes *
    INCLUDE <icon>.
    *& Tables *
    TABLES : j_1irg1,
    j_2irg1bal,
    z2irg1bal,
    ser03,
    objk.
    *& Selection Screen *
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS : p_exgrp TYPE j_1irg1-exgrp OBLIGATORY,
    p_stdate LIKE sy-datum OBLIGATORY,
    p_endate LIKE sy-datum OBLIGATORY.
    SELECT-OPTIONS s_chapid FOR j_1irg1-chapid .
    SELECTION-SCREEN : END OF BLOCK blk1.
    *& Data Declaration *
    Internal Tables
    DATA : it_display TYPE TABLE OF zj1irg1,
    it_final TYPE TABLE OF zj1irg1,
    it_alv TYPE TABLE OF zj1irg1,
    Work Areas
    wa_display TYPE zj1irg1,
    wa_alv TYPE zj1irg1,
    it_display1 TYPE TABLE OF zj1irg1,
    wa_display1 TYPE zj1irg1,
    wa_alv1 TYPE zj1irg1.
    DATA: BEGIN OF it_itab OCCURS 0.
    INCLUDE STRUCTURE zj1irg1.
    DATA: END OF it_itab.
    DATA : BEGIN OF itab1 OCCURS 0,
    matnr LIKE j_1irg1-matnr,
    END OF itab1.
    DATA : BEGIN OF itab2 OCCURS 0,
    cpudt LIKE j_1irg1-cpudt,
    END OF itab2.
    DATA : BEGIN OF itab3 OCCURS 0.
    INCLUDE STRUCTURE j_1irg1.
    DATA: END OF itab3.
    DATA : itab4 LIKE j_1irg1 OCCURS 0 WITH HEADER LINE,
    itab5 LIKE j_1irg1 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF itab6 OCCURS 0.
    INCLUDE STRUCTURE j_1irg1.
    DATA : sernr LIKE objk-sernr.
    DATA: END OF itab6.
    DATA : BEGIN OF itab61 OCCURS 0.
    INCLUDE STRUCTURE j_1irg1.
    DATA: sernr LIKE objk-sernr.
    DATA: END OF itab61.
    DATA : itab7 LIKE j_2irg1bal OCCURS 0 WITH HEADER LINE,
    it_bal LIKE j_2irg1bal OCCURS 0 WITH HEADER LINE,
    it_bal1 LIKE j_2irg1bal OCCURS 0 WITH HEADER LINE.
    DATA: qty_menge LIKE j_1irg1-menge,
    iss_menge LIKE j_1irg1-menge,
    tot_menge LIKE j_1irg1-menge,
    op_menge LIKE j_1irg1-menge,
    matnr LIKE j_1irg1-matnr,
    exgrp LIKE j_1irg1-exgrp ,
    cpudt LIKE j_1irg1-cpudt.
    *for checcking lines of itab
    DATA: n1 TYPE i.
    Others
    DATA : v_bwart TYPE mseg-bwart,
    v_index TYPE i,
    v_index1 TYPE i,
    count(4) TYPE n VALUE '0',
    neg TYPE char1 VALUE '-',
    menge TYPE char16,
    count_1 TYPE i,
    count_2 TYPE i,
    count_3 TYPE i,
    count12(4) TYPE n VALUE '0',
    count13(4) TYPE n VALUE '0'.
    *Ranges
    RANGES: v_bwart1 FOR mseg-bwart.
    For ALV Display
    DATA : gs_variant TYPE disvariant,
    gs_layout TYPE lvc_s_layo,
    c_stk TYPE scrfname VALUE 'ZRG1',
    custom_container TYPE REF TO cl_gui_custom_container.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA : grid1 TYPE REF TO cl_gui_alv_grid,
    event_receiver TYPE REF TO lcl_event_receiver,
    ok_code TYPE sy-ucomm,
    it_fieldcatalog TYPE lvc_t_fcat,
    wafieldcatlog TYPE LINE OF lvc_t_fcat,
    lt_rows TYPE lvc_t_row,
    wa_rows TYPE LINE OF lvc_t_row.
    *& Start of Selection *
    START-OF-SELECTION.
    IMPORT s_chapid FROM MEMORY ID 'SCHAPID'.
    PERFORM get_data.
    IF it_display[] IS INITIAL.
    No Details Available
    MESSAGE i017(z_apd) WITH text-005.
    STOP.
    ELSE.
    Display the Details on the Screen
    sort it_display by matnr.
    *sort it_display by cpudt RISINDR RISINDI matnr.
    <b>LOOP AT it_display INTO wa_display.
    ON CHANGE OF wa_display-matnr.
    *insert
    *Check record exits
    SELECT SINGLE * FROM z2irg1bal
    WHERE
    exgrp = exgrp AND
    matnr = matnr AND
    form = 'P' AND
    cb_finish = tot_menge AND
    datum = cpudt.
    *If record does not exists
    *Update balance Table.
    IF count12 GE 1.
    IF sy-subrc NE 0.
    z2irg1bal-mandt = sy-mandt.
    z2irg1bal-exgrp = exgrp.
    z2irg1bal-matnr = matnr.
    z2irg1bal-form = 'P'.
    z2irg1bal-cb_finish = tot_menge.
    z2irg1bal-datum = cpudt.
    INSERT z2irg1bal ."values wa_display.
    COMMIT WORK.
    ENDIF.
    Start of Insertion
    IF sy-subrc EQ 0.
    z2irg1bal-mandt = sy-mandt.
    z2irg1bal-exgrp = exgrp.
    z2irg1bal-matnr = matnr.
    z2irg1bal-form = 'P'.
    z2irg1bal-cb_finish = tot_menge.
    z2irg1bal-datum = cpudt.
    UPDATE z2irg1bal SET cb_finish = z2irg1bal-cb_finish
    WHERE exgrp = z2irg1bal-exgrp AND
    datum = z2irg1bal-datum AND
    matnr = z2irg1bal-matnr AND
    form = 'P'.
    ENDIF.
    End of Insertion.
    ENDIF.</b>CLEAR: qty_menge,
    iss_menge,
    tot_menge,
    count,
    matnr,
    cpudt,
    exgrp.
    ENDON.
    loop at itab6.
    AT NEW matnr.
    v_index = 1.
    count = count + 1 .
    ENDAT.
    IF v_index = 1.
    CLEAR v_index.
    *INsert for adding start
    IF wa_display-risind = 'R'.
    *wa_display-OP_FINISH = wa_display-OP_FINISH +
    wa_display-CB_FINISH +
    wa_display-MENGE.
    wa_display-op_finish = wa_display-menge.
    qty_menge = wa_display-op_finish.
    IF wa_display-status = space.
    tot_menge = tot_menge + qty_menge + wa_display-cb_finish .
    ELSE.
    tot_menge = tot_menge - qty_menge + wa_display-cb_finish.
    ENDIF.
    *tot_menge = op_menge.
    op_menge = tot_menge.
    ELSE.
    *Qty Issued
    wa_display-op_bond = wa_display-op_finish - wa_display-menge.
    IF wa_display-op_bond LT 0.
    iss_menge = wa_display-op_bond.
    iss_menge = ABS( iss_menge ).
    *Start of modification
    tot_MENGE = tot_MENGE - iss_MENGE ."
    IF count LE 1.
    tot_menge = wa_display-cb_finish - iss_menge ."
    ELSE.
    tot_menge = tot_menge - iss_menge ."
    ENDIF.
    *End of modification
    op_menge = tot_menge.
    ENDIF.
    ENDIF.
    *wa_display-MENGE_FINI = wa_display-OP_FINISH - wa_display-OP_BOND.
    *tot_MENGE = tot_MENGE + qty_MENGE - iss_MENGE .
    wa_display-menge_fini = tot_menge.
    **matnr for insert
    matnr = wa_display-matnr.
    *excise group
    exgrp = wa_display-exgrp.
    *Date
    cpudt = wa_display-cpudt.
    *Opening Balance
    *Insert start
    *if count le 1.
    if wa_display-RISIND = 'R'.
    wa_display-CB_FINISH = wa_display-CB_FINISH + qty_MENGE.
    else.
    wa_display-CB_FINISH = wa_display-CB_FINISH - iss_MENGE.
    endif.
    *endif.
    *Insert End
    IF count GT 1.
    IF wa_display-risind = 'R'.
    wa_display-cb_finish = tot_menge - qty_menge.
    ELSE.
    wa_display-cb_finish = tot_menge + iss_menge.
    ENDIF.
    ENDIF.
    *check it_display-SERIALNO = wa_display-SERIALNO.
    MODIFY it_display FROM wa_display.
    *INsert for adding end
    *move-corresponding wa_display to it_itab.
    *append it_itab.
    *check it_itab-SERIALNO = wa_display-SERIALNO.
    *if sy-subrc = 0.
    *endif.
    *Insert to update closng to balance to Rg1bal table
    *start
    count12 = count12 + 1.
    *for last record
    AT LAST.
    *Check record exits
    SELECT SINGLE * FROM z2irg1bal
    WHERE
    exgrp = exgrp AND
    matnr = matnr AND
    form = 'P' AND
    cb_finish = tot_menge AND
    datum = cpudt.
    *If record does not exists
    *Update balance Table.
    IF count12 GE 1.
    IF sy-subrc NE 0.
    z2irg1bal-mandt = sy-mandt.
    z2irg1bal-exgrp = exgrp.
    z2irg1bal-matnr = matnr.
    z2irg1bal-form = 'P'.
    z2irg1bal-cb_finish = tot_menge.
    z2irg1bal-datum = cpudt.
    INSERT z2irg1bal ."values wa_display.
    COMMIT WORK.
    Start of Insertion
    IF sy-subrc EQ 0.
    z2irg1bal-mandt = sy-mandt.
    z2irg1bal-exgrp = exgrp.
    z2irg1bal-matnr = matnr.
    z2irg1bal-form = 'P'.
    z2irg1bal-cb_finish = tot_menge.
    z2irg1bal-datum = cpudt.
    UPDATE z2irg1bal SET cb_finish = z2irg1bal-cb_finish
    WHERE exgrp = z2irg1bal-exgrp AND
    datum = z2irg1bal-datum AND
    matnr = z2irg1bal-matnr AND
    form = 'P'.
    ENDIF.
    End of Insertion
    ENDIF.
    ENDIF.
    ENDAT.
    *Insert to update closng to balance to Rg1bal table
    *end
    MOVE-CORRESPONDING wa_display TO wa_alv.
    APPEND wa_alv TO it_alv.
    append itab6 to it_alv.
    ENDIF.
    ENDLOOP.
    loop at it_alv into wa_alv.
    wa_alv-exgrp = wa_alv-exgrp.
    wa_alv-SYEAR = wa_alv-syear.
    wa_alv-SERIALNO = wa_alv-SERIALNO.
    endloop.
    EXPORT it_alv TO MEMORY ID 'ABCD'.
    call screen 100.
    ENDIF.
    *& End of Selection *
    END-OF-SELECTION.
    *& Class Definition *
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
    METHODS:
    handle_toolbar
    FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING e_object e_interactive,
    handle_user_command
    FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm,
    handle_double_click
    FOR EVENT double_click OF cl_gui_alv_grid
    IMPORTING e_row e_column.
    PRIVATE SECTION.
    ENDCLASS. "lcl_event_receiver DEFINITION
    *& Class Implementation *
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_toolbar.
    Local Variables
    DATA: ls_toolbar TYPE stb_button.
    append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type.
    APPEND ls_toolbar TO e_object->mt_toolbar.
    append an icon to to show printing
    CLEAR ls_toolbar.
    MOVE 'PRINT' TO ls_toolbar-function.
    MOVE icon_print TO ls_toolbar-icon.
    MOVE 'Print Receipts' TO ls_toolbar-quickinfo.
    MOVE ' Print' TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.
    ENDMETHOD. " Handle_toolbar
    METHOD handle_user_command.
    CASE e_ucomm.
    WHEN 'PRINT'.
    REFRESH : lt_rows , it_final.
    CALL METHOD grid1->get_selected_rows
    IMPORTING
    et_index_rows = lt_rows.
    CALL METHOD cl_gui_cfw=>flush.
    LOOP AT lt_rows INTO wa_rows.
    READ TABLE it_alv INDEX wa_rows-index INTO wa_alv.
    LOOP AT it_display INTO wa_display
    WHERE mblnr = wa_alv-mblnr.
    APPEND wa_display TO it_final.
    ENDLOOP.
    ENDLOOP.
    perform display_form.
    ENDCASE.
    ENDMETHOD. "handle_user_command
    METHOD handle_double_click.
    IF e_column = 'MBLNR'.
    READ TABLE it_alv INDEX e_row-index INTO wa_alv.
    IF sy-subrc = 0.
    REFRESH it_final.
    LOOP AT it_display INTO wa_display
    WHERE mblnr = wa_alv-mblnr.
    APPEND wa_display TO it_final.
    ENDLOOP.
    PERFORM call_migo.
    ENDIF.
    ENDIF.
    ENDMETHOD. "handle_double_click
    ENDCLASS. "lcl_event_receiver IMPLEMENTATION
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    FORM get_data .
    *Select only for matnr and chapid from table
    SELECT matnr FROM j_1irg1
    APPENDING CORRESPONDING FIELDS OF TABLE itab1
    WHERE exgrp = p_exgrp
    AND
    WERKS = P_WERKS
    and
    MATNR in s_MATNR
    and
    CPUDT in s_CPUDT.
    cpudt BETWEEN p_stdate AND p_endate
    AND
    *Chapid
    chapid IN s_chapid
    ORDER BY matnr.
    SORT itab1 BY matnr. " for performance
    DELETE ADJACENT DUPLICATES FROM itab1 COMPARING matnr .
    SELECT cpudt FROM j_1irg1
    APPENDING CORRESPONDING FIELDS OF TABLE itab2
    WHERE exgrp = p_exgrp
    AND
    cpudt BETWEEN p_stdate AND p_endate
    AND
    *Chapid
    chapid IN s_chapid
    ORDER BY cpudt.
    SORT itab2 BY cpudt. " for Performance
    DELETE ADJACENT DUPLICATES FROM itab2 COMPARING cpudt .
    LOOP AT itab1.
    LOOP AT itab2.
    *on change of itab1-matnr or itab2-cpudt.
    *select * from J_1IRG1
    CLEAR itab3.
    SELECT * FROM j_1irg1
    *into itab3
    APPENDING CORRESPONDING FIELDS OF TABLE itab3
    WHERE matnr = itab1-matnr
    AND
    cpudt = itab2-cpudt.
    *count = count + 1.
    IF sy-subrc EQ 0.
    LOOP AT itab3.
    *count = count + 1.
    *READ TABLE itab3 INDEX count."1.
    IF itab3-risind = 'R'.
    MOVE-CORRESPONDING itab3 TO itab4.
    APPEND itab4.
    DELETE itab3.
    MOVE-CORRESPONDING itab4 TO itab6.
    APPEND itab6.
    CLEAR itab4.
    ELSE.
    MOVE-CORRESPONDING itab3 TO itab5.
    APPEND itab5.
    DELETE itab3.
    MOVE-CORRESPONDING itab5 TO itab6.
    APPEND itab6.
    CLEAR itab5.
    ENDIF.
    ENDLOOP.
    ENDIF.
    *endon.
    ENDLOOP.
    ENDLOOP.
    SELECT * FROM z2irg1bal
    APPENDING CORRESPONDING FIELDS OF TABLE itab7
    WHERE exgrp = p_exgrp
    AND
    datum LE p_stdate
    ORDER BY datum.
    SORT itab7 BY datum.
    DELETE ADJACENT DUPLICATES FROM itab7 COMPARING datum .
    *insert Start
    LOOP AT itab6.
    DELETE itab7 WHERE matnr NE itab6-matnr.
    ENDLOOP.
    *insert End
    *insert Start
    LOOP AT itab6.
    CLEAR itab61. REFRESH itab61.
    CLEAR wa_display.
    MOVE-CORRESPONDING itab6 TO wa_display.
    EQPT Serno
    count13 = 1.
    SELECT SINGLE obknr FROM ser03 INTO ser03-obknr WHERE
    mblnr EQ itab6-mblnr
    AND mjahr EQ itab6-mjahr.
    IF sy-subrc EQ 0.
    SELECT sernr FROM objk INTO CORRESPONDING
    FIELDS OF TABLE itab61 WHERE
    obknr EQ ser03-obknr.
    DESCRIBE TABLE itab61 LINES n1.
    *do N1 times.
    LOOP AT itab61.
    IF count13 EQ 1.
    wa_display-sernr = itab61-sernr.
    ENDIF.
    IF count13 EQ 2.
    wa_display-sernr1 = itab61-sernr.
    ENDIF.
    IF count13 EQ 3.
    wa_display-sernr2 = itab61-sernr.
    ENDIF.
    IF count13 EQ 4.
    wa_display-sernr3 = itab61-sernr.
    ENDIF.
    IF count13 EQ 5.
    wa_display-sernr4 = itab61-sernr.
    ENDIF.
    IF count13 EQ 6.
    wa_display-sernr5 = itab61-sernr.
    ENDIF.
    IF count13 EQ 7.
    wa_display-sernr6 = itab61-sernr.
    ENDIF.
    if count13 eq 8.
    objk-SERNR8 = objk-SERNR.
    endif.
    if count13 eq 9.
    objk-SERNR9 = objk-SERNR.
    endif.
    count13 = count13 + 1.
    endselect.
    ENDLOOP.
    *enddo.
    ENDIF.
    endif.
    *End of Modification Eqpt Serial No
    MOVE-CORRESPONDING itab6 TO wa_display.
    SELECT * FROM z2irg1bal
    APPENDING CORRESPONDING FIELDS OF TABLE it_bal1
    WHERE matnr = itab6-matnr
    AND datum LE p_stdate
    AND exgrp = itab6-exgrp.
    SORT it_bal1 DESCENDING .
    READ TABLE it_bal1 INDEX 1.
    ON CHANGE OF itab6-matnr .
    wa_display-cb_finish = it_bal1-cb_finish.
    ENDON.
    AT LAST ."matnr.
    wa_display-cb_finish = it_bal1-cb_finish.
    ENDAT.
    APPEND wa_display TO it_display .
    CLEAR wa_display-cb_finish.
    CLEAR it_bal1. REFRESH it_bal1.
    ENDLOOP.
    SELECT * FROM j_1irg1
    APPENDING CORRESPONDING FIELDS OF TABLE it_itab
    WHERE exgrp = p_exgrp
    AND
    cpudt BETWEEN p_stdate AND p_endate.
    DESCRIBE TABLE it_itab[] LINES count_1.
    count_3 = count_1 + 1.
    DESCRIBE TABLE it_display[] LINES count_2.
    IF it_display IS NOT INITIAL.
    DELETE it_display FROM count_3 TO count_2.
    ENDIF.
    *start of insertion
    DELETE it_display WHERE status = 'C'.
    LOOP AT it_display INTO wa_display.
    CLEAR wa_display-cb_finish.
    MODIFY it_display FROM wa_display.
    ON CHANGE OF wa_display-matnr .
    SELECT * FROM z2irg1bal
    INTO CORRESPONDING FIELDS OF TABLE it_bal1
    WHERE matnr = wa_display-matnr
    AND datum LE p_stdate
    AND exgrp = wa_display-exgrp.
    IF sy-subrc = 0.
    SORT it_bal1 DESCENDING .
    READ TABLE it_bal1 INDEX 1.
    wa_display-cb_finish = it_bal1-cb_finish.
    MODIFY it_display FROM wa_display.
    ENDIF.
    ENDON.
    ENDLOOP.
    *End of insertion
    ENDFORM. " get_data
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'ZRG1'.
    SET TITLEBAR 'ZRG1'.
    DATA: lt_exclude TYPE ui_functions.
    IF custom_container IS INITIAL.
    Create the Custom Container
    CREATE OBJECT custom_container
    EXPORTING
    container_name = c_stk.
    Create an instance of alv control
    CREATE OBJECT grid1
    EXPORTING
    i_parent = custom_container.
    Layout Settings
    gs_layout-sel_mode = 'A'. " Multiple Lines
    MOVE 'RG1 Register' TO gs_layout-grid_title.
    Prepare the Field Catalog
    PERFORM prepare_catalog.
    To Exclude the PRINT Button from the Standard toolbar of ALV
    PERFORM exclude_tb_functions CHANGING lt_exclude.
    Display the List for ALV Display
    CALL METHOD grid1->set_table_for_first_display
    EXPORTING
    it_toolbar_excluding = lt_exclude
    is_layout = gs_layout
    CHANGING
    it_fieldcatalog = it_fieldcatalog[]
    it_outtab = it_alv[].
    CREATE OBJECT event_receiver.
    SET HANDLER event_receiver->handle_user_command FOR grid1.
    SET HANDLER event_receiver->handle_toolbar FOR grid1.
    SET HANDLER event_receiver->handle_double_click FOR grid1.
    CALL METHOD grid1->set_toolbar_interactive.
    ENDIF.
    CALL METHOD cl_gui_control=>set_focus
    EXPORTING
    control = grid1.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form exclude_tb_functions
    text
    <--P_LT_EXCLUDE text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    Local Varaibles
    DATA ls_exclude TYPE ui_func.
    ls_exclude = cl_gui_alv_grid=>mc_fc_print.
    APPEND ls_exclude TO pt_exclude.
    ENDFORM. " exclude_tb_functions
    *& Form prepare_catalog
    text
    --> p1 text
    <-- p2 text
    FORM prepare_catalog .
    DATA : v_index TYPE i.
    *Entry Date
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'CPUDT'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'RG1 Entry Date'.
    wafieldcatlog-reptext = 'RG1 Entry Date'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Serial No
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERIALNO'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'RG1 serial number'.
    wafieldcatlog-reptext = 'RG1 serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'CHAPID'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Chapter ID'.
    wafieldcatlog-reptext = 'Chapter ID'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'MBLNR'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Number of Material Document'.
    wafieldcatlog-reptext = 'Number of Material Document'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Item
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'ZEILE'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Item in Material Document'.
    wafieldcatlog-reptext = 'Item in Material Document'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'BWART'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Movement Type'.
    wafieldcatlog-reptext = 'Movement Type'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'MENGE'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Quantity'.
    wafieldcatlog-reptext = 'Quantity'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    wafieldcatlog-DO_SUM = 'X'.
    append wafieldcatlog to it_fieldcatalog.
    clear wafieldcatlog-reptext.
    clear wafieldcatlog-key.
    *Base Unit of Measure
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'MEINS'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Base Unit of Measure'.
    wafieldcatlog-reptext = 'Base Unit of Measure'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    wafieldcatlog-do_sum = 'X'.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'RISIND'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Goods Movement Direction'.
    wafieldcatlog-reptext = 'Goods Movement Direction'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Material Number
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'MATNR'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Material Number'.
    wafieldcatlog-reptext = 'Material Number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *CB_FINISH
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'CB_FINISH'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Opening Balance'.
    wafieldcatlog-reptext = 'Opening Balance'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *materail manufactured
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'OP_FINISH'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Qty Manufactured'.
    wafieldcatlog-reptext = 'Qty Manufactured'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Material Issued
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'OP_BOND'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Qty Issue'.
    wafieldcatlog-reptext = 'Qty Issue'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Total
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'MENGE_FINI'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Closing Balance'.
    wafieldcatlog-reptext = 'Closing Balance'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Material Description
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'MAKTX'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Material Description'.
    wafieldcatlog-reptext = 'Material Description'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Storage Location
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'LGORT'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Storage Location'.
    wafieldcatlog-reptext = 'Storage Location'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Goods Movement Direction
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'RISIND'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Goods Movement Direction'.
    wafieldcatlog-reptext = 'Goods Movement Direction'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Reference Document 1
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'RDOC1'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Reference Document 1'.
    wafieldcatlog-reptext = 'Reference Document 1'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Excise Duty Base Amount
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'EXBAS'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Excise Duty Base Amount'.
    wafieldcatlog-reptext = 'Excise Duty Base Amount'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Basic Excise Duty
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'EXBED'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Basic Excise Duty'.
    wafieldcatlog-reptext = 'Basic Excise Duty'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Additional Excise Duty
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'EXAED'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Additional Excise Duty'.
    wafieldcatlog-reptext = 'Additional Excise Duty'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Special Excise Duty
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'EXSED'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Special Excise Duty'.
    wafieldcatlog-reptext = 'Special Excise Duty'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *Cess amount
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'CESS'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Cess amount'.
    wafieldcatlog-reptext = 'Cess amount'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *ECS Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'ECS'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'ECS Value'.
    wafieldcatlog-reptext = 'ECS Value'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    **Register Entry Status
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'STATUS'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Register Entry Status'.
    wafieldcatlog-reptext = 'Register Entry Status'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    append wafieldcatlog to it_fieldcatalog.
    clear wafieldcatlog-reptext.
    clear wafieldcatlog-key.
    *EQPT Serno 1 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *EQPT Serno 2 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR1'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *EQPT Serno 3 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR2'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *EQPT Serno 4 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR3'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *EQPT Serno 5 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR4'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *EQPT Serno 6 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR5'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    *EQPT Serno 7 Value
    v_index = v_index + 1.
    wafieldcatlog-fieldname = 'SERNR6'.
    wafieldcatlog-tabname = 'IT_ALV'.
    wafieldcatlog-seltext = 'Serial number'.
    wafieldcatlog-reptext = 'Serial number'.
    wafieldcatlog-hotspot = ' '.
    wafieldcatlog-col_pos = v_index.
    APPEND wafieldcatlog TO it_fieldcatalog.
    CLEAR wafieldcatlog-reptext.
    CLEAR wafieldcatlog-key.
    ENDFORM. " prepare_catalog
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE user_command_0100 INPUT.
    IF ok_code = 'EXIT'.
    CALL METHOD grid1->free.
    CALL METHOD cl_gui_cfw=>flush.
    leave program .
    LEAVE TO SCREEN 0.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form call_migo
    text
    --> p1 text
    <-- p2 text
    FORM call_migo .
    CALL FUNCTION 'MIGO_DIALOG' "n547170
    EXPORTING "n547170
    i_action = 'A04' "n547170
    i_refdoc = 'R02' "n547170
    i_notree = 'X' "n547170
    i_no_auth_check = ' ' "n547170
    i_deadend = 'X' "n547170
    i_skip_first_screen = 'X' "n547170
    i_okcode = 'OK_GO' "n547170
    i_mblnr = wa_alv-mblnr "n547170
    i_mjahr = wa_alv-mjahr . "n547170
    ENDFORM. " call_migo

    Thanks,
    K.Kiran

Maybe you are looking for