Run-Time ALV C ode Required

Hi
I need some help in ALV,i have to create a ALV reports with 1st clmn displaying month frm JAN-DEC.Than on each month I have to do some calculation based on counters,so can any one help me in this regards or plz send me the code for RUN-Time ALV,so that I can code it.
I have 8 fileds,which has to be display in alv format,with all data based on month anlyisa,so on 6 fileds I have to run 12(ctr)*6(fileds).
So plz help me in this regards.
Regards
vipin

Hi,
Check this link which contains all type of ALV programs, mostly with examples.
Interactive ALV
Sample code on ALV using OOPS
Hope this helps.
ashish

Similar Messages

  • At run time,ALV table is displaying all fields of database table

    Hi all
    I done one application using ALv I am displaying the ALV Table.my problem is at run time it was fetching and displaying all the fields in the data base table but i need only the fields which are defined in node.
    Please help me.
    Thanks and Regards
    Tulasi Palnati

    Hi,
    May be you have specified the database table as the Dicitonary structure property of the node.
    Check the same and if its there clear the Dictionary structure property of the node.
    Hope this solves your isse!
    Regards,
    Srilatha

  • Insert data in drop down in alv at run time.

    Hi Gurus,
    I have to insert data in the dropdown wich is in alv at run time.According to my requirement i have i fill my drop down in the init but depend upon some conditions i have to insert one more vaule in the drop down at the run time.
    My problem is that i have filled the drop down with new data but it is not displayed in at the alv output.It is working fine without alv.
    Thanks & Regards.

    Hi,
    As per my understanding you want to update values in the drop down, on enter event of some other field.
    For that you have written the code for drop down twice 1) in the init method 2) in the on enter event of one field, right?
    If the code is not working in the on enter event, I think you can still use 'WDDOMODIFYVIEW' method. Follow the below steps:
    1) create one attribute of type char1 in the attributes tab of the view
    2) Set the value of that attribute to 'X' in the on enter event of other field (where you have written the code for drop down)
    3) In 'WDDOMODIFYVIEW' method, check the value of attribute. If this is 'X' run the code for updating drop down, then clear the value of attribute
    Regards,
    Saket.

  • Executable not working - Looking for LabVIEW Run-Time Engine

    This has been one of those days.
    I'm trying to create my .exe file to place onto another computer. I've done this before with success. But that was then and this is now.
    I believe I have all the files I need in my LLB, and I believe I did my application distribution correctly and I believe I built the DLL correctly. But when I took the resulting .exe file and placed it on another computer and attempted to run it, it gave me the error message: "Unable to locate LabVIEW Run-Time Engine. Program requires a version 7.1 (or compatible) LabVIEW Run-Time engine. You should have already realized this, you moron."
    Anyone have any idea where I went wrong or what step I might have missed? This has been a crazy, non-stop, massive brain fart of a day and I can't seem to remember what I'm missing here.
    Amateur programmer for over 10 years!

    Hi.
    Whenever you want to use executables or .dll's created with LabVIEW you must make sure that the LabVIEW runtime engine of the SAME version as the LabVIEW version used to create the files, is installed in the target computer.
    There are basically 2 ways to get the run-time engine installed on a computer:
    1. (the one I prefer): Download the correct version of the LabVIEW run-time engine installer from www.ni.com/downloads, or more specifically from
    http://digital.ni.com/softlib.nsf/websearch/369618​104E25B08E86256F54006A4E2F?opendocument&node=13205​0_US
    for the latest one. Once you have the installer for the run-time engine, just install it in the target computer. I prefer this option because the run-time engine is installed independently, so if you then uninstall your program, the run-time engine remains.
    2. Create an installer for your program that includes the run-time engine. To include the run-time engine, when you are creating your application, go to the "installer settings" tab, click on "Advanced" and make sure there is a checkmark on "include LabVIEW run-time engine". This way when you install your program in the target computer, the run-time engine will also be installed.
    Just as a note, any computer with LabVIEW on it, will also have the run-time engine.
    Good luck.
    Alejandro

  • Unable to locate labview run time engine (lab view 8.5)

    Hello I have a problem whit the labview 8.5 installer. I have created I project with included a .vi file (a simple panel wich control a serial port, with parameters (baud rate, stop bits, ...)), then I have created an application for this file (.exe) and then the installer (I have included the labview run time engine 8.5). When I run the setup.exe  I have the following error message:
    Unable to locate labview run time engine, the application require a labview run time engine 8.5 or compatible...
    What I'm missing??
    Thanks
    Maurizio

    are there one other reasons why it would not work.  I have asimilar problem.
    I intsalled version 8 of run time engine and acrtivated software.  Now I am trying to run compiled application provided to me by third party.
    When I click on application it says
    Unable to locate LV run time engine
    Test server requires a version 6.0 or compatible LV engine.
    How do I know if the engine I installed and activated is running and is it supposed to be able to execute a program which is expectin rev 6 of the rund engine?

  • MAX giving error - Unable to locate Labview run-time engine

    I have LV 7.1 and 8.5.1 installed on a WinXP pc. No problems until now.
    I installed some support software for a LabJack  interface, which required LV version 6.1 run-time, so I let it install that.
    I now get the error whenever I run MAX:
    "Unable to locate the Labview run-time engine. LVBrokerAux71 requires a version 7.1 (or compatible) Labview run-time engine...."
    After closing the error boxes, MAX seems to work fine. Both versions of Labview also work. I uninstalled run-time engine 6.1 and re-installed version 8.5.1, but that made no difference. I tried to install run-time version 7.1 from the msi file but it would not let me because a later version of the run-time is installed.
    What is LV Broker? Why does it not accept version 8.5.1 run-time engine? Is it possible to have 2 versions of the run-time engine installed, and if so, how?

    Dear CDancer
    Thank you for contacting NI. First of all, you can have as many versions of LabVIEW run time engines you want loaded on your computer without a problem. LV Broker is installed by all drivers that uses LabVIEW testpanels like DAQmx does. In your case it seems that the LV Broker installation is corrupted or has failed. This can be rectified by overwriting the files in the specified directory listed below:
    C:\Program Files\National Instruments\Shared\LabVIEW Broker
    Your directory should look like the screenshot I have attached; labelled LV Broker Directory View
    I have attached a ZIP File that will replace the LV Broker directory. Please try replacing your files with these if different to the screenshot and let me know how you get on. Many thanks.
    Many thanks for using the NI forums and I look forward to your reply.
    Kind regards
    David
    Applications Engineer
    National Instruments UK
    Attachments:
    LV Broker Directory View.JPG ‏57 KB
    LV Broker.zip ‏413 KB

  • Error 1722 when installing Run-Time Engine 6.0

    I am unable to install the necessary LabView Run-Time Engine 6.0 required to run my VitalView Software.  I have reviewed the message boards and attempted all possible solutions: disabling anti-virus programs, following the NI support links: http://digital.ni.com/public.nsf/websearch/334E91287EDEA75286256D9B003A947A?OpenDocument.
    None of these methods will allow for the Run-Time engine to be installed.  What can I do?
    Help very much appreciated, thank you! 

    My OS is Windows XP.  
    I am trying to install an older LabView run-time engine since my application VitalView asks for a LabView 6.0 Run-time engine (or something compatible). 
    I have attached the jpg of the error message that I receive whenever I attempt to install the LabView engine.  
    Thank you so much for your help!
    Attachments:
    Error1722.jpg ‏57 KB

  • C++ run time error

    I am running Lightroom 5.3 on a Windows 7 machine, and I am receiving a "C++ Run time error" message that requires me to exit the program. In researching this problem, I found a post from several years ago on how to fix this in Lightroom 3, involving changing the "preferences" folder in Explorer. I am stuck however in that I cannot locate that file, either browsing in Explorer or using the "search programs and files" function in Start. Can anyone help?

    It should be here:
    The preference setting file is Lightroom 5 Preferences.agprefs, in C:\Users\[user name]\AppData\Roaming\Adobe\Lightroom\Preferences\
    Do you see C:\Users\[user name]\AppData  ? NOT C:\ProgramData !!!
    Frans

  • Run time error in ALV editable

    Hi Gurus
    I am getting a run time error when I edit a field in the ALV report and press enter. The run time error is : GETWA_NOT_ASSIGNED. It says I tried to access an unassigned field symbol. I have not used any field symbols in my field catalog or anywhere. It also says that the location of the termination was : cl_gui_alv_grid .
    I have to get this report working today at anycost. Any help will be very useful

    Yes , I have internal tables , a whole lot of them ...here is the code.
    REPORT ZSCREENREPORT NO STANDARD PAGE HEADING MESSAGE-ID YE.
    TABLES : VBUK ,
             VEPVG ,
             LIKP  ,
             VTTP  ,
             LIPS  ,
             LQUA  ,
             MAKT.
    DATA :  PWERKS TYPE LIPS-WERKS , PLGNUM TYPE LIPS-LGNUM.
    DATA  PTKNUM TYPE VTTP-TKNUM.
    DATA  PVBELN TYPE LIPS-VBELN.
    DATA : t_toolbar   type ui_functions with header line.
    DATA  OKCODE LIKE SY-UCOMM.
    DATA  S_OKCODE LIKE SY-UCOMM.
    DATA  B_VIEWREPORT.
    DATA  B_CLEARALL.
    DATA  B_PRINT.
    DATA  pr_data_changed TYPE REF TO cl_alv_changed_data_protocol.
    *DATA: g_event_receiver TYPE REF TO lcl_event_receiver.
    *TYPES: PR_DATA_CHANGED TYPE xxxxxx.
    *TYPES: LCL_EVENT_RECEIVER TYPE .
    class lcl_event_receiver definition deferred.
    selection-screen begin of block b2 with frame title text-001.
    selection-screen begin of block b1 with frame.
    BLOCK B1 FOR FIRST SET OF SELECT OPTIONS
    ALL ENTRIES ARE NECESSARY IN THIS BLOCK
    SELECT-OPTIONS : S_ORG      FOR  LIKP-VKORG MODIF ID B1,  "Sales Org
                     S_DISCHA   FOR  LIKP-VTWIV MODIF ID B1,  "Dis Cha
                     S_DIV      FOR  LIKP-SPAIV MODIF ID B1,  "Division
                     S_SPOINT   FOR  LIKP-VSTEL MODIF ID B1.  "Shipping
    "point
    selection-screen end of block b1.
    selection-screen begin of block b3 with frame.
    *BLOCK B3 FOR PICKING DATE . THIS FIELD IS OBLIGATORY
    PARAMETERS :     P_DEL    LIKE  VBUK-KOSTK DEFAULT 'A'.
    SELECT-OPTIONS : S_PICDAT     FOR  LIKP-KODAT OBLIGATORY ,
                     S_PGDAT FOR  LIKP-WADAT .
    selection-screen end of block b3.
    selection-screen begin of block b4 with frame.
    BLOCK B4 FOR SHIPMENT NUMBER / DELIVERY NUMBER. ONLY ONE CAN BE
    *ENTERED
    SELECT-OPTIONS:  S_SHNUM  FOR  VTTP-TKNUM MODIF ID B2 ,     " Shipment
                                                                "Number
                     S_DENUM  FOR  LIKP-VBELN MODIF ID B2 .     " Delivery
    " Number
    selection-screen end of block b4.
    PARAMETERS : C_BBINS  AS CHECKBOX .
    selection-screen end of block b2.
    RANGES :         R_ORG      FOR  VEPVG-VKORG ,  "Sales Org
                     R_DISCHA   FOR  VEPVG-VTWEG ,  "Dis Cha
                     R_DIV      FOR  VEPVG-SPART ,  "Division
                     R_SPOINT   FOR  VEPVG-VSTEL ,  "Shipping point
                     R_PICDAT   FOR  LIKP-KODAT  , " Planned Pick Date
                     R_PGDAT   FOR  LIKP-WADAT  ,      " Planned goods issue
                     R_SHNUM  FOR  VTTK-TKNUM  ,     " Shipment Number
                     R_DENUM  FOR  LIKP-VBELN  ,     " Delivery Number
                     R_VBELN FOR   VBUK-VBELN  ,
                     R_MATNR FOR LIPS-MATNR .
    DATA : BEGIN OF ITAB1 OCCURS 0.
    DATA:  MATL  LIKE LIPS-MATNR,
           QUANT LIKE LIPS-LFIMG,
           UOM   LIKE LIPS-VRKME,
           KUNR  LIKE LIKP-KUNNR ,
           WERKS LIKE LIKP-WERKS,
           LGNUM LIKE LIPS-LGNUM,
           LGTYP LIKE LIPS-LGTYP ,
           VBELN LIKE LIPS-VBELN ,
           TKNUM LIKE VTTP-TKNUM.
    DATA : END OF ITAB1.
    DATA : BEGIN OF ITAB2 OCCURS 0.
    DATA :
           MATL  LIKE LIPS-MATNR,
           QUANT TYPE I,
           UOM   LIKE LIPS-VRKME,
           KUNR  LIKE LIKP-KUNNR.
    DATA : END OF ITAB2.
    DATA : BEGIN OF ITAB3 OCCURS 0.
    DATA : MATL  LIKE LIPS-MATNR,
           QUANT LIKE LIPS-LFIMG,
           UOM   LIKE LIPS-VRKME,
           KUNR  LIKE LIKP-KUNNR.
    DATA : END OF ITAB3.
    DATA : BEGIN OF ITAB_VBELN OCCURS 0.
    DATA : IBLN LIKE VBUK-VBELN.
    DATA : END OF ITAB_VBELN.
    DATA : BEGIN OF DEMANDTAB OCCURS 0.
    DATA : D_MATL LIKE LIPS-MATNR,
           D_MQUANT LIKE LIPS-LFIMG,
           D_MUOM LIKE LIPS-VRKME,
           D_QUANT LIKE LIPS-LFIMG,
           D_UOM LIKE LIPS-VRKME,
           D_KUNR LIKE LIKP-KUNNR.
    DATA : END OF DEMANDTAB.
    DATA : VMATNR LIKE LIPS-MATNR,
           VKUNR  LIKE LIKP-KUNNR,
           VQUANT LIKE LIPS-VRKME.
    DATA : BEGIN OF INVTAB OCCURS 0.
    DATA : IMATL   LIKE LIPS-MATNR,
           IBINLOC LIKE LQUA-LGPLA,
           IBATCH  LIKE LQUA-CHARG,
           IWARSTK LIKE LQUA-VERME,
           IUOM LIKE LQUA-MEINS.
    DATA : END OF INVTAB.
    DATA : BEGIN OF ITABX OCCURS 0.
    DATA : XMATL LIKE LIPS-MATNR,
           XMATDESC LIKE MAKT-MAKTX,
           XQUANT TYPE I,
           XUOM LIKE LIPS-VRKME,
           XBALQ TYPE I.
          EXPAND.
    DATA : END OF ITABX.
    DATA : BEGIN OF ITABMASTER OCCURS 0 .
    DATA : MMATL LIKE LIPS-MATNR,
           MKUNR LIKE LIKP-KUNNR,
           M_KQUANT  TYPE I,
           M_KUOM LIKE LIPS-VRKME,
           MBINLOC LIKE LQUA-LGPLA,
           MBATCH LIKE LQUA-CHARG,
           MWATSTK LIKE LQUA-VERME,
           M_IUOM LIKE LQUA-MEINS.
    DATA : END OF ITABMASTER.
    DATA : BEGIN OF ITABDESC OCCURS 0.
    DATA : MATNR LIKE MAKT-MATNR,
           MATDESC LIKE MAKT-MAKTX.
    DATA : END OF ITABDESC.
    TYPES : BEGIN OF ITABT ,
           FMATL LIKE LIPS-MATNR,
           FINDEX LIKE SY-TABIX,
           FKEY LIKE LIPS-MATNR,
           FMATDESC LIKE MAKT-MAKTX,
           FQUANT LIKE LIPS-LFIMG,
           FUOM LIKE ITAB1-UOM,
           FKUNR LIKE LIKP-KUNNR,
           F_KQUANT LIKE LIPS-LFIMG,"TYPE I,
           F_KUOM LIKE LIPS-VRKME,
           F_BALQUANT LIKE LIPS-LFIMG,"TYPE I,
           FBINLOC LIKE LQUA-LGPLA,
           FBATCH LIKE LQUA-CHARG,
           FWATSTK LIKE LQUA-VERME,
           F_IUOM LIKE LQUA-MEINS ,
           SEL_QUANT type LIPS-LFIMG," corr_1,
           END OF ITABT.
    DATA : BEGIN OF FLAGTAB OCCURS 0 .
    DATA : SEL_QUANT TYPE I , FKEY LIKE LIPS-MATNR.
    DATA : END OF FLAGTAB.
    DATA : ITAB type  ITABT occurs 0 with header line  .
    data : itab_w like line of itab .
    DATA t_layout    type lvc_s_layo.
    DATA: ok_code LIKE sy-ucomm .
    DATA:
         go_grid             TYPE REF TO cl_gui_alv_grid,
         go_custom_container TYPE REF TO cl_gui_custom_container.
    DATA : I_SELECTED_ROWS TYPE LVC_T_ROW,
           W_SELECTED_ROWS TYPE LVC_T_ROW,
           I_MODIFIED TYPE STANDARD TABLE OF ITABT,
           W_MODIFIED TYPE ITABT,
           WA TYPE ITABT.
    *field catalogs -
    DATA : WA_FIELDCAT TYPE lvc_t_fcat with header line.
    data : fcat type  lvc_t_fcat WITH HEADER LINE .
    FIELD-SYMBOLS : <FS_FIELDCAT> TYPE LVC_S_FCAT .
    DATA : V_VALID TYPE C.
    clear fcat.
          CLASS LCL_EVENTS_D0100 DEFINITION
    CLASS LCL_EVENT_receiver DEFINITION.
    PUBLIC SECTION.
    METHODS :
        handle_data_changed         for event data_changed
                             of cl_gui_alv_grid
                            IMPORTING er_data_changed.
    ENDCLASS.
    data : my_application type ref to lcl_event_receiver.
          CLASS LCL_EVENTS_D0100 IMPLEMENTATION
    CLASS LCL_EVENT_receiver IMPLEMENTATION.
    METHOD handle_data_changed.
    DATA: ls_good TYPE lvc_s_modi.
    DATA : L_PLANETYPE TYPE LIPS-ANZSN.
    data : swapper type LIPS-ANZSN .
    LOOP AT er_data_changed->mt_good_cells INTO ls_good.
         CASE ls_good-fieldname.
           WHEN 'SEL_QUANT'.
             CALL METHOD pr_data_changed->get_cell_value
                EXPORTING
                  i_row_id = ls_good-row_id
                  i_fieldname = ls_good-fieldname
                IMPORTING
                  e_value = l_planetype.
    *read table itab into itab_w index  ls_good-row_id.
        swapper = itab_w-f_balquant - l_planetype.
         move swapper to itab_w-f_balquant.
         modify itab FROM itab_w .
       ENDCASE.
    ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    DATA: g_event_receiver TYPE REF TO lcl_event_receiver.
    INITIALIZATION.
      S_PICDAT-SIGN = 'I'.
      S_PICDAT-OPTION = 'BT'.
      S_PGDAT-SIGN = 'I'.
      S_PGDAT-OPTION = 'BT'.
      S_PICDAT-LOW = SY-DATUM.
      S_PICDAT-HIGH = SY-DATUM + 1.
      APPEND S_PICDAT.
      S_PGDAT-LOW  = SY-DATUM.
      S_PGDAT-HIGH = SY-DATUM + 1.
      APPEND S_PGDAT.
    **--VALIDATIONS--
    AT SELECTION-SCREEN .
      IF  S_ORG IS  initial AND  S_DISCHA IS INITIAL AND S_DIV  IS
    INITIAL AND S_SPOINT  IS initial AND S_SHNUM  IS INITIAL AND S_DENUM  IS
       INITIAL .
        MESSAGE E082(YE) WITH 'AT LEAST ONE FIELD MUST BE ENTERED'.
      ENDIF.
      DATA LV_COUNT TYPE I VALUE 0.
      IF NOT S_ORG IS  initial OR NOT S_DISCHA IS INITIAL OR NOT S_DIV  IS
      INITIAL OR  NOT  S_SPOINT  IS initial.
        lv_COUNT = 1.
      ENDIF.
      IF NOT S_SHNUM  IS INITIAL .
        LV_COUNT = LV_COUNT + 1.
      ENDIF.
      IF NOT S_DENUM  IS INITIAL .
        LV_COUNT = LV_COUNT + 1.
      ENDIF.
      IF LV_COUNT > 1.
        MESSAGE E081(YE) WITH 'Please Enter Only in Block1 Or Block3' .
      endif.
      read table s_PICDAT index 1.
      data: days type i.
      days = s_PICDAT-high  - s_PICDAT-low .
      if days > 2.
        message e080(YE) with 'Range can not be > 2 days'.
      endif.
      read table s_PGDAT index 1.
      data: days2 type i.
      days2 = s_PGDAT-high  - s_PGDAT-low .
      if days2 > 2.
        message e080(YE) with 'Range can not be > 2 days'.
      endif.
    VALIDATIONS FOR FIRST BLOCK---------------------------------------
    *IF S_SHNUM IS INITIAL AND S_DENUM IS INITIAL.
    IF S_ORG IS INITIAL OR S_SPOINT IS INITIAL OR S_DISCHA IS INITIAL OR
    *S_DIV IS INITIAL .
    *MESSAGE E083(YE) WITH 'ALL FIELDS IN BLOCK ONE REQUIRED'.
    ENDIF.
    *ENDIF.
    *--START OF SELECTION--
    START-OF-SELECTION .
      IF NOT S_ORG IS  initial OR NOT S_DISCHA IS INITIAL OR NOT S_DIV  IS
      INITIAL OR  NOT  S_SPOINT  IS initial.
        PERFORM INPUTBLOCK1.
        PERFORM TABPRINT1.
      ENDIF.
      IF NOT S_SHNUM  IS INITIAL .
        PERFORM INPUTBLOCK2 .
        PERFORM TABPRINT1.
      ENDIF .
      IF NOT S_DENUM  IS INITIAL .
        PERFORM INPUTBLOCK3 .
        PERFORM TABPRINT1.
      ENDIF .
      CLEAR ITAB2.
    *LOOP AT ITABX.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = ITABX-XMATL.
       APPEND R_MATNR. CLEAR R_MATNR.
    *ENDLOOP.
      PERFORM WARINVENTORY.
      PERFORM WARMASTERUPLD.
      CALL SCREEN 100.
    *=====================================================
    *&      Module  user_command_0100  input
          text
    MODULE USER_COMMAND_0100 INPUT.
    SAVED_OKCODE = OKCODE.
      S_OKCODE = OKCODE.
      CLEAR OKCODE.
      CASE S_OKCODE.
      WHEN 'EXIT' OR 'BACK' OR 'CANC'.
       LEAVE PROGRAM.
      WHEN OTHERS.
      call method go_grid->check_changed_data
       importing
          e_valid = V_VALID .
      PERFORM SAVE_ITAB.
    endcase.
    case sy-ucomm.
      when 'b_clearall'.
      loop at itab.
      itab-sel_quant = 30.
      modify itab.
      endloop.
      CALL TRANSACTION 'YWMINI'.
       ENDCASE.
      call method go_grid->check_changed_data.
       importing
         e_valid = v_valid.
    *LOOP AT ITAB.
    *IF ITAB-SEL_QUANT NE 0.
    *MOVE ITAB-SEL_QUANT TO FLAGTAB-SEL_QUANT.
    *MOVE ITAB-FKEY TO FLAGTAB-FKEY.
    *COLLECT FLAGTAB.
    *ENDIF.
    *ENDLOOP.
    LOOP AT ITAB.
      LOOP AT FLAGTAB WHERE FKEY = ITAB-FKEY.
      ITAB-F_BALQUANT = ITAB-F_BALQUANT - FLAGTAB-SEL_QUANT.
      MODIFY ITAB.
      ENDLOOP.
    *ENDLOOP.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    *SET PF-STATUS 'ZSTAT'.
      set pf-status 'STAT'.
    SET TITLEBAR 'WAVEPICK'.
    *call screen 1010  .
      IF go_custom_container IS INITIAL.
        CREATE OBJECT go_custom_container
          EXPORTING container_name = 'ALV_CONTAINER'.
        CREATE OBJECT go_grid
          EXPORTING
            i_parent = go_custom_container.
    set handler  pr_data_changed=>on_data_changed
    *for all instances.
    call method go_grid->register_edit_event
                   exporting
                      i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      CREATE OBJECT g_event_receiver.
      SET HANDLER g_event_receiver->handle_data_changed FOR go_grid.
      PERFORM xclude_toolbar.
      PERFORM CREATE_FIELDCAT.
      PERFORM load_data_into_grid.
    ENDIF.
    else .
    call method my_application->refresh_table_display.
      endif.
    *call method go_grid->register_edit_event
    *exporting
    *i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    *CALL METHOD GO_GRID->REFRESH_TABLE_DISPLAY
    perform load_data_into_grid.
      CLEAR ITAB1.
      READ TABLE ITAB1 .
      PWERKS = ITAB1-WERKS.
      PLGNUM  = ITAB1-LGNUM.
      PVBELN = ITAB1-VBELN.
      PTKNUM = ITAB1-TKNUM.
    ENDMODULE.                 " STATUS_0100  OUTPUT
          FORM INPUTBLOCK1                                              *
    FORM INPUTBLOCK1.
      SELECT LIPSMATNR  LIPSLFIMG LIPSVRKME LIKPKUNNR LIPS~WERKS
       LIPS~LGNUM
       LIPSLGTYP LIPSVBELN  INTO TABLE ITAB1 FROM
       LIPS JOIN LIKP ON LIPSVBELN = LIKPVBELN JOIN VBUK ON LIKP~VBELN =
      VBUK~VBELN   WHERE
      LIKP~VKORG IN S_ORG AND
      LIKP~VTWIV IN S_DISCHA AND
      LIKP~SPAIV IN S_DIV    AND
      LIKP~VSTEL IN S_SPOINT AND
      LIKP~KODAT IN S_PICDAT AND
      LIKP~WADAT IN S_PGDAT  AND
      LIPS~LGTYP = '001' ."    AND
    *VBUK~KOSTK = 'A' .
    ENDFORM .
          FORM INPUTBLOCK2                                              *
    FORM INPUTBLOCK2.
      SELECT LIPSMATNR LIPSLFIMG LIPSVRKME LIKPKUNNR  INTO
      TABLE ITAB1
    FROM LIPS JOIN LIKP ON LIPSVBELN = LIKPVBELN JOIN VTTP ON LIKP~VBELN =
      VTTPVBELN JOIN VBUK ON LIKPVBELN = VBUK~VBELN  WHERE
      VTTP~TKNUM IN S_SHNUM
       AND
      LIKP~KODAT IN S_PICDAT AND
      LIKP~WADAT IN S_PGDAT AND
      VBUK~KOSTK = 'A'.
    ENDFORM.
          FORM INPUTBLOCK3                                              *
    FORM INPUTBLOCK3 .
      SELECT LIPSMATNR LIPSLFIMG LIPSVRKME LIKPKUNNR  INTO
      TABLE ITAB1
    FROM LIPS JOIN LIKP ON LIPSVBELN = LIKPVBELN JOIN VBUK ON LIKP~VBELN =
       VBUKVBELN WHERE LIKPVBELN IN
      S_DENUM
      AND
      LIKP~KODAT IN S_PICDAT AND
      LIKP~WADAT IN S_PGDAT AND
      VBUK~KOSTK = 'A'.
    ENDFORM.
          FORM TABPRINT1                                                *
    FORM TABPRINT1.
      LOOP AT ITAB1 .
        MOVE: ITAB1-MATL TO ITAB2-MATL,
              ITAB1-UOM  TO ITAB2-UOM,
              ITAB1-KUNR TO ITAB2-KUNR,
              ITAB1-QUANT TO ITAB2-QUANT.
        COLLECT ITAB2.
      ENDLOOP.
      LOOP AT ITAB2.
        MOVE ITAB2-MATL TO ITABX-XMATL.
        MOVE ITAB2-QUANT TO ITABX-XQUANT.
        MOVE ITAB2-UOM TO ITABX-XUOM.
        MOVE ITABX-XQUANT TO ITABX-XBALQ.
        COLLECT ITABX.
      ENDLOOP.
      clear ITABX .
      LOOP AT ITABX.
        R_MATNR-SIGN = 'I'.
        R_MATNR-OPTION = 'EQ'.
        R_MATNR-LOW = ITABX-XMATL.
        APPEND R_MATNR. CLEAR R_MATNR.
      ENDLOOP.
      SELECT  MAKTMATNR MAKTMAKTX INTO TABLE ITABDESC FROM MAKT
      WHERE MAKT~MATNR IN R_MATNR .
      DATA  C_DESC LIKE MAKT-MAKTX.
      C_DESC = '0'.
      LOOP AT ITABDESC   .
        IF ITABDESC-MATNR = C_DESC .
          DELETE ITABDESC.
        ELSE .
          C_DESC = ITABDESC-MATNR.
        ENDIF.
      ENDLOOP.
      LOOP AT ITABDESC.
        LOOP AT ITABX WHERE XMATL = ITABDESC-MATNR.
          ITABX-XMATDESC = ITABDESC-MATDESC.
          MODIFY ITABX.
        ENDLOOP.
      ENDLOOP.
      CLEAR ITABX.
    *ENDSELECT.
    ENDFORM.
          FORM WARINVENTORY                                             *
    FORM WARINVENTORY.
    *Select matnr from LQUA
              into LQUA where
                  matnr in r_matnr.
                  endselect.
    *if not r_matnr-low is initial .
    MESSAGE E080(YE) WITH 'NOT IN RANGE'.
    SELECT LQUAMATNR LQUALGPLA LQUACHARG LQUAVERME LQUA~MEINS INTO TABLE
      INVTAB FROM LQUA WHERE LQUA~MATNR
    IN R_MATNR AND LQUAWERKS = ITAB1-WERKS AND LQUALGNUM = ITAB1-LGNUM AND
       LQUA~LGTYP = '001' AND
       NOT LQUA~LGPLA = '000'.
    ENDFORM .
          FORM WARMASTERUPLD                                            *
    FORM WARMASTERUPLD .
      LOOP AT ITAB2.
        DELETE ITAB2.
        LOOP AT INVTAB WHERE IMATL = ITAB2-MATL.
          MOVE:  ITAB2-MATL TO ITABMASTER-MMATL ,
                 ITAB2-KUNR TO ITABMASTER-MKUNR,
                 ITAB2-QUANT TO ITABMASTER-M_KQUANT,
                 ITAB2-UOM TO ITABMASTER-M_KUOM ,
                 INVTAB-IBINLOC TO ITABMASTER-MBINLOC,
                 INVTAB-IBATCH TO ITABMASTER-MBATCH,
                 INVTAB-IWARSTK TO ITABMASTER-MWATSTK,
                 INVTAB-IUOM TO ITABMASTER-M_IUOM.
          APPEND ITABMASTER.
          DELETE INVTAB.
          CLEAR INVTAB.
          CLEAR ITAB2.
          EXIT.
        ENDLOOP.
      ENDLOOP.
      IF NOT INVTAB[] IS INITIAL.
        LOOP AT INVTAB.
          MOVE:  INVTAB-IMATL TO ITABMASTER-MMATL,
                 INVTAB-IBINLOC TO ITABMASTER-MBINLOC,
                 INVTAB-IBATCH TO ITABMASTER-MBATCH,
                 INVTAB-IWARSTK TO ITABMASTER-MWATSTK,
                 INVTAB-IUOM TO ITABMASTER-M_IUOM.
          ITABMASTER-MKUNR = SPACE.
          ITABMASTER-M_KQUANT = SPACE.
          ITABMASTER-M_KUOM = SPACE.
          APPEND ITABMASTER.
        ENDLOOP.
      ENDIF.
    *-- BEGIN ITAB UPLOAD--
      DATA : MATCHK LIKE ITABX-XMATL VALUE 0.
      LOOP AT ITABX.
    DELETE ITAB2.
        LOOP AT ITABMASTER   WHERE MMATL = ITABX-XMATL.
    IF ITABX-XMATL NE MATCHK .
         IF ITABMASTER-MMATL = ITABX-XMATL.
            MOVE:
                  ITABX-XMATL TO ITAB-FMATL,
                  ITABMASTER-MMATL TO ITAB-FKEY,
                  ITABX-XMATDESC TO ITAB-FMATDESC,
                  ITABX-XQUANT TO ITAB-FQUANT,
                  ITABX-XUOM TO ITAB-FUOM ,
                  ITABX-XBALQ TO ITAB-F_BALQUANT.
            MATCHK = ITABX-XMATL.
          ELSE .
            MOVE ITABMASTER-MMATL TO ITAB-FKEY.
            ITAB-FMATL = SPACE  .
            ITAB-FMATDESC = SPACE.
            ITAB-FQUANT = SPACE .
            ITAB-FUOM = SPACE .
            ITAB-F_BALQUANT = SPACE.
          ENDIF.
          MOVE:
                  ITABMASTER-MKUNR TO ITAB-FKUNR,
                  ITABMASTER-M_KQUANT TO ITAB-F_KQUANT,
                  ITABMASTER-M_KUOM TO ITAB-F_KUOM,
                  ITABMASTER-MBINLOC TO ITAB-FBINLOC,
                  ITABMASTER-MBATCH TO ITAB-FBATCH,
                  ITABMASTER-MWATSTK TO ITAB-FWATSTK,
                  ITABMASTER-M_IUOM TO ITAB-F_IUOM.
          ITAB-FINDEX = SY-TABIX.
          ITAB-SEL_QUANT = 0.
          APPEND ITAB.
          DELETE INVTAB.
          CLEAR INVTAB.
          CLEAR ITABX.
    *EXIT.
        ENDLOOP.
      ENDLOOP.
    *----- END ITAB UPLOAD--
    *TEST----
    *LOOP AT ITABMASTER.
    DELETE ITAB2.
    LOOP AT ITABX  WHERE XMATL = ITABMASTER-MMATL.
    **IF ITABX-XMATL NE MATCHK .
    *MOVE:
          ITABX-XMATL TO ITAB-FMATL,
          ITABX-XMATDESC TO ITAB-FMATDESC,
          ITABX-XQUANT TO ITAB-FQUANT,
          ITABX-XUOM TO ITAB-FUOM ,
          ITABX-XBALQ TO ITAB-F_BALQUANT,
           ITABMASTER-MKUNR TO ITAB-FKUNR,
           ITABMASTER-M_KQUANT TO ITAB-F_KQUANT,
           ITABMASTER-M_KUOM TO ITAB-F_KUOM,
           ITABMASTER-MBINLOC TO ITAB-FBINLOC,
           ITABMASTER-MBATCH TO ITAB-FBATCH,
           ITABMASTER-MWATSTK TO ITAB-FWATSTK,
           ITABMASTER-M_IUOM TO ITAB-F_IUOM.
           APPEND ITAB.
          DELETE INVTAB.
          CLEAR INVTAB.
          CLEAR ITABX.
    **EXIT.
    ENDLOOP.
    *ENDLOOP.
    *SORT ITAB BY FMATL.
    *END TEST----
    ENDFORM.
          FORM load_data_into_grid                                      *
    FORM load_data_into_grid.
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          IS_LAYOUT                     = t_layout
        i_structure_name = 'ITABT'
        IT_TOOLBAR_EXCLUDING    = t_toolbar[]
        CHANGING
        it_outtab        = ITAB[]
        IT_FIELDCATALOG  = fcat[]
    *call method go_grid->refresh_table_display
    *EXPORTING
    *i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    i_structure_name = 'ITABT'
    CHANGING
    IT_OUTTAB = ITAB[]
    ENDFORM.
    form create_fieldcat.
    CLEAR wa_fieldcat.
    WA_FIELDCAT-REPTEXT = 'MATERIAL'.
    WA_FIELDCAT-COLTEXT = 'MATERIAL'.
    wa_fieldcat-fieldname = 'FMATL'.
    wa_fieldcat-col_pos =  1.
    wa_FIELDCAT-ref_table = 'ITAB'.
    wa_fieldcat-outputlen = 8.
    APPEND wa_fieldcat to fcat .
    CLEAR wa_fieldcat.
    WA_FIELDCAT-REPTEXT = 'MATERIAL'.
    WA_FIELDCAT-COLTEXT = 'MATERIAL DESCRIPTION'.
    wa_fieldcat-fieldname = 'FMATDESC'.
    wa_fieldcat-col_pos =  2.
    wa_FIELDCAT-ref_table = 'ITAB'.
    wa_fieldcat-outputlen = 20.
    APPEND wa_fieldcat to fcat .
    CLEAR wa_fieldcat.
    WA_FIELDCAT-COLTEXT = 'QUANTITY'.
    wa_fieldcat-fieldname = 'FQUANT'.
    wa_fieldcat-col_pos =  8.
    wa_FIELDCAT-ref_table = 'ITAB'.
    wa_fieldcat-outputlen = 8.
    WA_FIELDCAT-QUANTITY = 'VRKME'.
    WA_FIELDCAT-QFIELDNAME = 'VRKME'.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FUOM'.
    wa_fieldcat-col_pos =  4.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'UOM'.
    wa_fieldcat-outputlen = 4.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FKUNR'.
    wa_fieldcat-col_pos =  5.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'CUSTOMER'.
    wa_fieldcat-outputlen = 8.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'F_KQUANT'.
    wa_fieldcat-col_pos =  6.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'QUANTITY'.
    wa_fieldcat-outputlen = 8.
    WA_FIELDCAT-QUANTITY = 'VRKME'.
    WA_FIELDCAT-QFIELDNAME = 'VRKME'.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'F_KUOM'.
    wa_fieldcat-col_pos =  7.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'UOM'.
    wa_fieldcat-outputlen = 4.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    WA_FIELDCAT-COLTEXT = 'BALANCE QTY TO PICK'.
    wa_fieldcat-fieldname = 'F_BALQUANT'.
    wa_fieldcat-col_pos =  8.
    wa_FIELDCAT-ref_table = 'ITAB'.
    wa_fieldcat-outputlen = 8.
    WA_FIELDCAT-QUANTITY = 'VRKME'.
    WA_FIELDCAT-QFIELDNAME = 'VRKME'.
    APPEND wa_fieldcat to fcat .
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FBINLOC'.
    wa_fieldcat-col_pos =  9.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'BIN LOCATION'.
    wa_fieldcat-outputlen = 8.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FBATCH'.
    wa_fieldcat-col_pos =  10.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'BATCH'.
    wa_fieldcat-outputlen = 8.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'FWATSTK'.
    wa_fieldcat-col_pos =  11.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'WAREHOUSE STK'.
    wa_fieldcat-outputlen = 8.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'F_IUOM'.
    wa_fieldcat-col_pos =  12.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'UOM'.
    wa_fieldcat-outputlen = 4.
    APPEND wa_fieldcat to fcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'SEL_QUANT'.
    wa_fieldcat-col_pos =  13.
    wa_FIELDCAT-ref_table = 'ITAB'.
    WA_FIELDCAT-COLTEXT = 'SELECTED QTY'.
    wa_fieldcat-edit    =  'X'.
    wa_fieldcat-outputlen = 8.
    WA_FIELDCAT-QUANTITY = 'VRKME'.
    WA_FIELDCAT-QFIELDNAME = 'VRKME'.
    APPEND wa_fieldcat to fcat.
    *LOOP AT FCAT ASSIGNING <FS_FIELDCAT>.
    *CASE <FS_FIELDCAT>-FIELDNAME.
    *WHEN 'SEL_QUANT'.
    *<FS_FIELDCAT>-EDIT = 'X'.
    *ENDCASE.
    *ENDLOOP.
    *CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    *EXPORTING
    *I_STRUCTURE_NAME = 'ITABT'
    *CHANGING
    *CT_FIELDCATALOG = FCAT.
    *LOOP AT FCAT ASSIGNING <FS_FIELDCAT>.
    *CASE <FS_FIELDCAT>-FIELDNAME.
    *WHEN 'SEL_QUANT'.
    *<FS_FIELDCAT>-EDIT = 'X'.
    *ENDCASE.
    *ENDLOOP.
    endform.
    form xclude_toolbar .
    t_toolbar = '&DETAIL'.
    append t_toolbar.
    t_toolbar = '&&SEP00'.
    append t_toolbar.
    t_toolbar = '&&SEP01'.
    append t_toolbar.
    t_toolbar = '&&SEP02'.
    append t_toolbar.
    t_toolbar = '&SORT_ASC'.
    append t_toolbar.
    t_toolbar = '&SORT_DSC'.
    append t_toolbar.
    t_toolbar = '&FIND'.
    append t_toolbar.
    t_toolbar = '&MB_FILTER'.
    append t_toolbar.
    t_toolbar = '&&SEP04'.
    append t_toolbar.
    t_toolbar = '&MB_SUM'.
    append t_toolbar.
    t_toolbar = '&MB_SUB_TOTAL'.
    append t_toolbar.
    t_toolbar = '&PRINT_BACK'.
    append t_toolbar.
    t_toolbar = '&MB_VIEW'.
    append t_toolbar.
    t_toolbar = '&MB_EXPORT'.
    append t_toolbar.
    t_toolbar = '&GRAPH'.
    append t_toolbar.
    t_toolbar = '&COLO'.
    append t_toolbar.
    t_toolbar = '&&SEP06'.
    append t_toolbar.
    t_toolbar = '&&SEP07'.
    append t_toolbar.
    t_toolbar = '&INFO'.
    append t_toolbar.
    t_toolbar = '&&SEP03'.
    append t_toolbar.
    endform.
    FORM SAVE_ITAB.
    *CALL METHOD GO_GRID->GET_SELECTED_ROWS
    *IMPORTING
    *ET_INDEX_ROWS = I_SELECTED_ROWS.
    *LOOP AT I_SELECTED_ROWS INTO W_SELECTED_ROWS.
    *READ TABLE ITAB INTO WA INDEX W_SELECTED_ROWS-INDEX.
    *IF SY-SUBRC EQ 0.
    *MOVE-CORRESPONDING WA TO W_MODIFIED.
    *APPEND W_MODIFIED TO I_MODIFIED.
    *ENDIF.
    *ENDLOOP.
    *MODIFY ITAB FROM TABLE I_MODIFIED.
    *ENDFORM.
    ENDFORM.

  • TS1717 I tried to open iTunes but a box pops up.  In it is written "iTunes cannot run because some of its required files are missing.  Please reinstall iTunes."  I have done so a number of times but nothing is working.  How can I fix this problem?

    iTunes will not open because a dialog box pops up with "Itunes cannot run because some of its required files are missing.  Please reinstall iTunes.". I have done so a few times to no avail.  Any solutions for this problem?

    No you will not lose your content reinstalling iTunes.
    Do this:
    1: Download and run the Registry Cleaner of the free Ccleaner.
    http://www.piriform.com/ccleaner/download/standard
    2: Next follow this Apple document to un-install iTunes
    http://support.apple.com/kb/HT1923
    3: Just for good measure, run Ccleaner again
    4: Reinstall iTunes.
    5: Come back here and click my "Correct answer" button.

  • Run-time error in alv

    Hi guys,
    I am executing an alv grid report.i m getting a run time error and i m gettig a dump.In the below i pasted the error.any suggestions where i m going wrong in the code.
    What happened?                                                      
        The current application program detected a situation which really
        should not occur. Therefore, a termination with a short dump was
        triggered on purpose by the key word MESSAGE (type X).          
    Information on where terminated?                                              
    Termination occurred in the ABAP program "SAPLSLVC" - in "FILL_DATA_TABLE"
        The main program was "ZRPP1353 ".                                                                               
    In the source code you have the termination point in line 2735           
        of the (Include) program "LSLVCF36".    
    Source code where the error occured?
    Column per Fieldcat Entry                                          
            ls_lvc_data-value = space.                                   
            clear ls_lvc_data-style.                                     
            loop at it_fcat_local assigning <ls_fcat>                    
                    where tech ne 'X' and no_out ne 'X'.                 
              if l_invisible eq 'X'.                                     
                clear l_invisible.                                       
                if <ls_fcat>-do_sum is initial.                          
                  continue.                                              
                else.                                                    
                  clear ls_lvc_data-col_pos.                             
                endif.                                                   
              endif.                                                                               
    add 1 to ls_lvc_data-col_pos.                                                                               
    assign component <ls_fcat>-fieldname                       
                               of structure <ls_data> to <l_field_value>.
              if sy-subrc ne 0.                                          
                message x000(0k).                                        
              endif.

    Hi Dinesh,
    This is because of some problem with the field catalog you have defined. Please give the field catalog so that we can identify the problem easily.

  • Run-time error while executing alv grid report

    Hi everyone
    I m trying to run a alv grid report it is giving a run time error while executing the statement CALL METHOD V_ALV->SET_TOOLBAR_INTERACTIVE.
    Actually i added 2 buttons in the toolbar.after that when i execute the report i m getting errors.
    <b>Error Analysis</b>
    An exception occurred that is explained in detail below.                     
    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not    
    caught in                                                                   
    procedure "TOOLBAR_MENUS_INIT" "(METHOD)", nor was it propagated by a RAISING
    clause.                                                                     
    Since the caller of the procedure could not have anticipated that the        
    exception would occur, the current program is terminated.                    
    The reason for the exception is:                                             
    You attempted to use a 'NULL' object reference (points to 'nothing')         
    access a component (variable: "ME->M_CL_MENU_BUTTON_VARIANT").               
    An object reference must point to an object (an instance of a class)         
    before it can be used to access components.                                  
    Either the reference was never set or it was set to 'NULL' using the         
    CLEAR statement.

    Hi Dinesh,
    Seems you have not initialised ( Instantiated in OO ) the object and / or the parent container.
    Check if you have create object for both the parent as well as the alv object.
    So when you instatntiate the object of ALV you pass the object ( instantiated before hand ) in the parent container position.
    Also you would have to register the events to the object using method. Then only the buttons will finction.
    eg :
    IF G_CUSTOM_CONTAINER IS INITIAL.
        CREATE OBJECT CUSTOM_CONTAINER_1
               EXPORTING CONTAINER_NAME = CONTAINER_1.
        CREATE OBJECT GRID1
               EXPORTING I_PARENT = CUSTOM_CONTAINER_1.
        CALL METHOD ALV_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
             EXPORTING I_STRUCTURE_NAME = 'VBAK
             CHANGING  IT_OUTTAB        = IT_VBAK.
    Reward points if useful.

  • ALV issue: when save list using Local File command will get run time error!

    help!!!!
    report list using ALV method when to save this list using Local File.
    i will get GETWA_NOT_ASSIGNED run time error information.
    how resolve it?
    source code :
    REPORT   ZIFT0103.
    TABLES :  MARA,MARC,CDHDR,CDPOS,MAKT.
    ******DEVK909212****************
    ****&#21033;&#29992;&#24037;&#21378;&#26469;&#21306;&#20998;&#19981;&#21516;&#30340;SERVER&#30340;FTP ADDRESS ,user ,PASSWORD
    DATA: FTP_WERKS LIKE MARC-WERKS.
    ********&#23450;&#20041;&#19968;&#20010;RANGE&#29992;&#26469;&#25235;&#21462;MARC&#30340;&#20449;&#24687;
    RANGES:R_MATNR FOR MARA-MATNR OCCURS 0.
    ********&#23450;&#20041;&#19968;&#20010;INTERNAL TABLE &#26469;&#25235;&#21462;MARC &#30340;&#20449;&#24687;
    DATA:BEGIN OF IT_MARC OCCURS 0,
          MATNR LIKE MARC-MATNR,
          WERKS LIKE MARC-WERKS,
          USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         FLAG_UI TYPE C,
         END OF IT_MARC.
    *******&#23450;&#20041;&#23384;&#25918;&#21271;&#20140;&#30340;&#25968;&#25454;&#30340;&#21464;&#37327;
    DATA : BEGIN OF FTP_BEIJING OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_BEIJING .
    ******&#23450;&#20041;&#31119;&#28165;&#30340;&#25968;&#25454;&#21464;&#37327;
    DATA : BEGIN OF FTP_FUQING OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_FUQING .
    *******DEVK909212*****************
    DATA : BEGIN OF FTP_ITEMDOC1 OCCURS 0 ,
                  MATNR(25) ,
                  MAKTX(30) ,
           END OF FTP_ITEMDOC1 .
    DATA : BEGIN OF FTP_ITEMDOC OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_ITEMDOC .
    DATA: WA_ZMSGTA TYPE ZMSGTA ,
          l_ersda  like MARA-ERSDA .
    ***********DEVK909553********************
    ****&#29992;&#26469;&#20915;&#23450;&#25191;&#34892;FTP&#36824;&#26159;&#26174;&#31034;LIST**********
    DATA:g_tcode_flag.
    ***********DEVK909553********************
    Error message process ******************************
    DEFINE EXPLAIN_MSG.
       break soe_richard.
      CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
        EXPORTING
          ID                = &1   "SY-MSGID
          NUMBER            = &2   "SY-MSGNO
          LANGUAGE          = SY-LANGU
          TEXTFORMAT        = &3
          LINKPATTERN       =
          MESSAGE_V1        = &4                                "SY-MSGV1
          MESSAGE_V2        = &5                                "SY-MSGV2
          MESSAGE_V3        = &6                                "SY-MSGV3
          MESSAGE_V4        = &7                                "SY-MSGV4
        IMPORTING
          MESSAGE           = &8   "WA_ZMSGTA-MSE1
          RETURN            =
        TABLES
          TEXT              =
    END-OF-DEFINITION.
    DEFINE ERROR_MSG_UPDATA.
      CALL FUNCTION 'ZINSERT_MSG'  "IN UPDATE TASK
        EXPORTING
          XZMSGTA      = &1    "WA_ZMSGTA
        EXCEPTIONS
          UPDATE_ERROR = 1
          OTHERS       = 2.
    END-OF-DEFINITION.
    IF SY-TCODE = 'ZIFT103' .
      g_tcode_flag = 'L'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          PERCENTAGE = 0
          TEXT       = '&#35831;&#32784;&#24515;&#31561;&#20505;,&#31995;&#32479;&#27491;&#22312;&#25235;&#25968;&#25454;'.
    ENDIF.
    l_ersda = sy-datum - 1 .  "&#21462;&#21069;&#19968;&#22825;&#20135;&#29983;&#30340;&#29289;&#26009;&#21495;&#30721;&#12290;
    DATA:BEGIN OF it_change OCCURS 0,
         OBJECTID TYPE CDHDR-OBJECTID,
         USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         TABKEY   TYPE CDPOS-TABKEY,
         END OF it_change.
    DATA:BEGIN OF it_cDhdr OCCURS 0,
         OBJECTID type CDHDR-OBJECTID,
         CHANGENR TYPE CDHDR-CHANGENR,
         USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         END OF it_cdhdr.
    DATA:search_len TYPE I.
    DATA:BEGIN of it_insert OCCURS 0,
         MATNR TYPE MARA-MATNR,
         WERKS TYPE MARC-WERKS,
         END OF it_insert.
    DATA:BEGIN OF it_MAKT OCCURS 0,
         MATNR TYPE MAKT-MATNR,
         MAKTX TYPE MAKT-MAKTX,
         END OF it_makt.
    DATA IT_MARA TYPE TABLE OF MARA WITH HEADER LINE.
    DATA:BEGIN OF IT_OUT OCCURS 0,
         MATNR TYPE MARA-MATNR,
         WERKS TYPE MARC-WERKS,
         MTART TYPE MARA-MTART,
         MEINS TYPE MARA-MEINS,
         MATKL TYPE MARA-MATKL,
         MAKTX TYPE MAKT-MAKTX,
         PSTAT TYPE MARA-PSTAT,
         BRGEW TYPE MARA-BRGEW,
         NTGEW TYPE MARA-NTGEW,
         GEWEI TYPE MARA-GEWEI,
         FERTH TYPE MARA-FERTH,
         KZUMW TYPE MARA-KZUMW,
         ERNAM TYPE MARA-ERNAM,
         ERSDA TYPE MARA-ERSDA,
         END OF IT_OUT.
    *-- DECLARE DATA FOR ALV
    TYPE-POOLS: slis.
    DATA  : g_variant LIKE disvariant,
            g_save(1) TYPE c,
            g_exit(1) TYPE c,
            gx_variant LIKE disvariant.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE, "
          gt_events   TYPE slis_t_event,
          gt_list_top_of_page TYPE slis_t_listheader,
          gs_print TYPE slis_print_alv,
          gs_layout         TYPE slis_layout_alv .
    ******&#21482;&#33021;&#25235;&#20986;&#31995;&#32479;&#26377;&#20570;&#26356;&#25913;&#30340;&#25968;&#25454;***************
    ******&#32780;&#31532;&#19968;&#27425;INSERT MARA&#30340;&#25968;&#25454;&#25235;&#19981;&#20986;&#26469;********
    START-OF-SELECTION.
    SELECT AOBJECTID AUSERNAME AUDATE BTABKEY
    INTO TABLE it_change
    FROM ( CDPOS AS B INNER JOIN CDHDR AS A ON
         AOBJECTCLAS = BOBJECTCLAS AND
         AOBJECTID   = BOBJECTID   AND
         ACHANGENR   = BCHANGENR )
    WHERE A~OBJECTCLAS = 'MATERIAL'
    AND   A~UDATE = l_ersda
    AND   B~TABNAME = 'MARC'
    AND   B~CHNGIND = 'I'.
    LOOP AT it_change.
       search_len = STRLEN( it_change-TABKEY ).
       search_len = search_len - 4.
       IF search_len > 0.
         IT_MARC-WERKS = it_change-TABKEY+search_len(4).
       ENDIF.
       IT_MARC-MATNR = it_change-objectid+0(18).
       IT_MARC-USERNAME = it_change-username.
       IT_MARC-UDATE    = It_change-udate.
       IT_MARC-FLAG_UI  = 'U'.
       APPEND IT_MARC.
       CLEAR IT_MARC.
       CLEAR R_MATNR.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = IT_MARC-MATNR.
       APPEND R_MATNR.
    ENDLOOP.
    ****CDPOS is Cluster TABLE &#25152;&#20197;&#27809;&#26377;&#21150;&#27861;&#29992;INNER JOIN******
      SELECT OBJECTID CHANGENR USERNAME UDATE
      INTO TABLE it_cdhdr
      FROM CDHDR
      WHERE OBJECTCLAS = 'MATERIAL'
      AND   UDATE = l_ersda.
    AND   TCODE = 'MM02'.
      LOOP AT IT_cdhdr.
        SELECT * FROM CDPOS
        WHERE OBJECTCLAS = 'MATERIAL'
        AND   OBJECTID  = IT_CDHDR-OBJECTID
        AND   CHANGENR  = IT_CDHDR-CHANGENR
        AND   TABNAME   = 'MARC'
        AND   CHNGIND = 'I'.
          search_len = STRLEN( CDPOS-TABKEY ).
          search_len = search_len - 4.
          IF search_len > 0.
            IT_MARC-WERKS = CDPOS-TABKEY+search_len(4).
          ENDIF.
          IT_MARC-MATNR = IT_cdhdr-objectid+0(18).
          IT_MARC-USERNAME = IT_cdhdr-username.
          IT_MARC-UDATE    = IT_cdhdr-udate.
          IT_MARC-FLAG_UI  = 'U'.
          APPEND IT_MARC.
         CLEAR IT_MARC.
          CLEAR R_MATNR.
          R_MATNR-SIGN = 'I'.
          R_MATNR-OPTION = 'EQ'.
          R_MATNR-LOW = IT_MARC-MATNR.
          APPEND R_MATNR.
          CLEAR IT_MARC.
        ENDSELECT.
      ENDLOOP.
      IF g_tcode_flag = 'L'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = 20
            TEXT       = '&#22788;&#29702;&#22909;&#24403;&#22825;CHANGE&#30340;&#25968;&#25454;'.
      ENDIF.
    *******&#25235;&#24403;&#22825;&#20570;&#20102;INSERT&#30340;&#25968;&#25454;*************
    *******&#19981;&#38656;&#35201;***********************
    SELECT BMATNR BWERKS INTO TABLE IT_INSERT
    FROM MARC AS B JOIN MARA AS A
    ON   AMATNR = BMATNR
    WHERE A~ERSDA = l_ersda.
    LOOP AT IT_INSERT.
       IT_MARC-MATNR = IT_INSERT-MATNR.
       IT_MARC-WERKS = IT_INSERT-WERKS.
       IT_MARC-FLAG_UI = 'I'.
       APPEND IT_MARC.
       CLEAR IT_MARC.
       CLEAR R_MATNR.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = IT_MARC-MATNR.
       APPEND R_MATNR.
    ENDLOOP.
    IF g_tcode_flag = 'L'.
       CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
           PERCENTAGE = 40
           TEXT       = '&#22788;&#29702;&#22909;&#24403;&#22825;INSERT&#30340;&#25968;&#25454;'.
    ENDIF.
      IF g_tcode_flag = 'L'.
        PERFORM get_MAKTX.
        PERFORM get_mara.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = 100
            TEXT       = '&#22788;&#29702;&#22909;&#25968;&#25454;,&#24182;&#24320;&#22987;&#26174;&#31034;&#25968;&#25454;'.
        PERFORM do_data.
        PERFORM display_alv.
      ELSE.
        PERFORM get_MAKTX.
        PERFORM do_ftp.
      ENDIF.
    *&      Form  get_marktx
          text
    FORM get_maktx.
      SELECT MATNR MAKTX INTO TABLE IT_MAKT FROM MAKT
      WHERE MATNR IN R_MATNR AND SPRAS = '1'.
    ENDFORM.                    "get_marktx
    *&      Form  get_mara
          text
    FORM get_mara.
      SELECT * INTO TABLE it_mara FROM MARA
      WHERE MATNR IN R_MATNR.
    ENDFORM.                    "get_mara
    *&      Form  do_data
          text
    FORM do_data.
      SORT IT_MARC BY MATNR WERKS.
      DELETE ADJACENT DUPLICATES FROM IT_MARC COMPARING MATNR WERKS.
      LOOP AT IT_MARC.
        CLEAR IT_MAKT.
        CLEAR IT_MARA.
        READ TABLE IT_MAKT WITH KEY MATNR = IT_MARC-MATNR.
        READ TABLE IT_MARA WITH KEY MATNR = IT_MARC-MATNR.
        MOVE-CORRESPONDING IT_MARA TO IT_OUT.
        IT_OUT-MAKTX = IT_MAKT-MAKTX.
        IT_OUT-WERKS = IT_MARC-WERKS.
        IF IT_MARC-FLAG_UI = 'U'.
          IT_OUT-ERNAM = IT_MARC-USERNAME.
        ENDIF.
        APPEND IT_OUT.
        CLEAR IT_OUT.
      ENDLOOP.
    ENDFORM.                    "do_data
    *SELECT AMATNR BMAKTX INTO CORRESPONDING
    *FIELDS OF FTP_ITEMDOC1 FROM MARA AS A JOIN MAKT AS B
    *ON AMATNR = BMATNR WHERE A~ERSDA = l_ersda
    *AND B~SPRAS = '1' . "&#20195;&#34920;&#20026;&#20013;&#25991;&#35828;&#26126;&#12290;
    APPEND FTP_ITEMDOC1.
    *******DEVK909212****************
    *******&#28155;&#21152;RANGE*****************
    CLEAR R_MATNR.
    R_MATNR-SIGN = 'I'.
    R_MATNR-OPTION = 'EQ'.
    R_MATNR-LOW = FTP_ITEMDOC1-MATNR.
    APPEND R_MATNR.
    CLEAR  FTP_ITEMDOC1.
    *******DEVK909212****************
    *ENDSELECT.
    *******DEVK909212****************
    ****get WERKS information from MARC*******
    *SELECT MATNR WERKS INTO TABLE IT_MARC
    *FROM MARC
    *WHERE MATNR IN R_MATNR.
    *******DEVK909212****************
    ******DEVK909212****************
    **MARK**************************
    *LOOP AT FTP_ITEMDOC1 .
    MOVE : FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_ITEMDOC-MAKTX.
    APPEND FTP_ITEMDOC.
    CLEAR FTP_ITEMDOC.
    *ENDLOOP.
    ******DEVK909212****************
    ******DEVK909212***********************************
    **&#26681;&#25454;IT_MARC&#20013;&#20449;&#24687;&#65292;&#24448;&#21271;&#20140;&#21644;&#31119;&#28165;&#30340;TABLE&#20889;&#25968;&#25454;*****
    FORM do_ftp.
      LOOP AT IT_MARC.
    ***&#31119;&#28165;&#30340;
        IF IT_MARC-WERKS = '1010' OR IT_MARC-WERKS = '1020'
           OR IT_MARC-WERKS = '1023' .
         READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
         MOVE : FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_FUQING-MAKTX.
          CLEAR IT_MAKT.
          READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
          MOVE : IT_MARC-MATNR TO FTP_FUQING-MATNR,
             IT_MARC-MATNR TO FTP_FUQING-MATNR1,
             IT_MAKT-MAKTX TO FTP_FUQING-MAKTX.
          APPEND FTP_FUQING.
          CLEAR FTP_FUQING.
        ENDIF.
    ***&#21271;&#20140;&#30340;
        IF IT_MARC-WERKS = '1041' OR IT_MARC-WERKS = '1042'.
         READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
         MOVE : FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_BEIJING-MAKTX.
          CLEAR IT_MAKT.
          READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
          MOVE : IT_MARC-MATNR TO FTP_BEIJING-MATNR,
                 IT_MARC-MATNR TO FTP_BEIJING-MATNR1,
                 IT_MAKT-MAKTX TO FTP_BEIJING-MAKTX.
          APPEND FTP_BEIJING.
          CLEAR FTP_BEIJING.
        ENDIF.
      ENDLOOP.
    ****&#28165;&#26970;&#37325;&#22797;&#30340;&#25968;&#25454;**********
      SORT FTP_FUQING.
      DELETE ADJACENT DUPLICATES FROM FTP_FUQING.
      SORT FTP_BEIJING.
      DELETE ADJACENT DUPLICATES FROM FTP_BEIJING.
    ***&#20256;&#36865;&#25968;&#25454;********
      REFRESH FTP_ITEMDOC.
      FTP_ITEMDOC[] = FTP_FUQING[].
      FTP_WERKS = '1010'.
      PERFORM ftp_work.
      REFRESH FTP_ITEMDOC.
      FTP_ITEMDOC[] = FTP_BEIJING[].
      FTP_WERKS = '1041'.
      PERFORM ftp_work.
    ******DEVK909212***********************************
    ENDFORM.                    "do_ftp
    *&      Form  ftp_work
         &#25226;&#20197;&#21069;FTP&#30340;&#24037;&#20316;&#20570;&#19968;&#20010;FORM
    *******DEVK909212**************************
    FORM ftp_work.
    *******DEVK909212**************************
      CHECK FTP_ITEMDOC[] IS NOT INITIAL.
    FTP function *****************************************************
      DATA : HDL TYPE I,
             L_SLEN TYPE I ,
             ERROR,
             KEY TYPE I VALUE 26101957,
             DEST TYPE RFCDES-RFCDEST VALUE 'SAPFTPA'.
      DATA: FTP_RESULT TYPE TABLE OF TEXT.
      DATA: P_FILE TYPE RLGRAP-FILENAME.
      DATA: L_USER(16) TYPE C VALUE 'SFIS',
            L_PWD(16) TYPE C VALUE 'SFIS',
            L_HOST(16) TYPE C VALUE '172.16.31.17'.
    *******DEVK909212**************************
    *****&#26681;&#25454;&#19981;&#21516;&#30340;&#24037;&#21378;&#26469;&#25235;FTP&#30340;&#20449;&#24687;
      CALL FUNCTION 'Z_FTP_SFIS'
        EXPORTING
          BLART = 'S'
          WERKS = FTP_WERKS
        IMPORTING
          HOST  = L_HOST
          USER1 = L_USER
          PASS1 = L_PWD.
    *******DEVK909212**************************
      CONCATENATE l_ersda '.KP' INTO P_FILE.
      SET EXTENDED CHECK OFF.
      ERROR = 0.
      CHECK HDL IS INITIAL.
    Connect to server
      L_SLEN = STRLEN( L_PWD ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = L_PWD
          SOURCELEN   = L_SLEN
          KEY         = KEY
        IMPORTING
          DESTINATION = L_PWD.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
         TEXT = 'Connect to FTP Server'.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = L_USER
          PASSWORD        = L_PWD
          HOST            = L_HOST
          RFC_DESTINATION = DEST
        IMPORTING
          HANDLE          = HDL
        EXCEPTIONS
          NOT_CONNECTED   = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE        = HDL
          COMMAND       = 'ascii'
        TABLES
          DATA          = FTP_RESULT
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3.
      IF SY-SUBRC <> 0.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = P_FILE
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = FTP_ITEMDOC
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      IF SY-SUBRC <> 0.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
    *******DEVK909212**************************
    *******CLOSE FTP******************
      CHECK NOT HDL IS INITIAL.
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          HANDLE = HDL.
      CALL FUNCTION 'RFC_CONNECTION_CLOSE'
        EXPORTING
          DESTINATION = DEST
        EXCEPTIONS
          OTHERS      = 1.
      CLEAR HDL.
    ENDFORM.                    "ftp_work
    *******DEVK909212**************************
    FORM DISPLAY_ALV .
    *-- PREPARE ALV DATA
      PERFORM EVENTTAB_BUILD USING GT_EVENTS[].
      PERFORM COMMENT_BUILD  USING GT_LIST_TOP_OF_PAGE[].
    *-- LAYOUT SETTING
      PERFORM PREPARE_ALV_FIELD USING GT_FIELDCAT[].
    *-- ALV DISPLAY
      PERFORM CALL_REUSE_ALV_GRID_DISPLAY.
    ENDFORM.                    " display_alv
    *&      Form  eventtab_build
          text
         -->P_GT_EVENTS[]  text
    FORM EVENTTAB_BUILD USING PT_EVENTS TYPE SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = PT_EVENTS.
      READ TABLE PT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        LS_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY PT_EVENTS FROM LS_EVENT INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " eventtab_build
    *&      Form  comment_build
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM COMMENT_BUILD  USING PT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER,
            L_DATE(30),
            l_v_BWKEY like T001W-BWKEY,  "Valuation area
            l_v_BUKRS like T001K-BUKRS.  "Firm/Company
    Listen&#57692;erschrift: Typ H
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  not used for this type
    select single BWKEY
       into l_v_BWKEY
       from t001w
       where WERKS IN s_WERKS.
    select single BUKRS
       into l_v_BUKRS
       from t001k
       where BWKEY = l_v_BWKEY.
    SELECT SINGLE butxt INTO LS_LINE-INFO
        FROM t001
       WHERE bukrs = l_v_BUKRS.
    APPEND LS_LINE TO PT_TOP_OF_PAGE.
    Kopfinfo: Typ S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25253;&#34920;&#21517;&#31216;&#65306;'.
      LS_LINE-INFO = SY-TITLE.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25171;&#21360;&#26085;&#26399;&#65306;'.
      WRITE SY-DATUM TO LS_LINE-INFO.
    ls_line-info = sy-datum.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25171;&#21360;&#26178;&#38291;&#65306;'.
      WRITE SY-UZEIT TO LS_LINE-INFO.
    ls_line-info = sy-uzeit.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#20351;&#29992;&#32773;&#65306;'.
      LS_LINE-INFO = SY-UNAME.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
    ENDFORM.                    " comment_build
    *&      Form  prepare_alv_field
          text
         -->P_GT_FIELDCAT[]  text
    FORM PREPARE_ALV_FIELD USING P_FIELDCAT TYPE  SLIS_T_FIELDCAT_ALV.
      DATA: LS_LINE TYPE  SLIS_FIELDCAT_ALV.
    *-- DEFINE MARCO
      DEFINE APPEND_ALV_FIELD.
        CLEAR LS_LINE.
        LS_LINE-FIELDNAME = &1.
        LS_LINE-TABNAME = &2.
        LS_LINE-REPTEXT_DDIC = &3.
        LS_LINE-SELTEXT_L = &3.
        LS_LINE-SELTEXT_M = &3.
        LS_LINE-SELTEXT_S = &3.
        LS_LINE-QFIELDNAME = &4.
        LS_LINE-QTABNAME = &5.
        LS_LINE-NO_OUT    = &6.
        LS_LINE-NO_ZERO   = &7.
        LS_LINE-OUTPUTLEN = &8.
        APPEND LS_LINE TO P_FIELDCAT.
      END-OF-DEFINITION.
      APPEND_ALV_FIELD: 'MATNR' 'IT_OUT' '&#26009;&#21495;'
                      'O' 'X' ''.
      APPEND_ALV_FIELD: 'WERKS' 'IT_OUT' '&#24037;&#21378;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MTART' 'IT_OUT' 'MTyp'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MEINS' 'IT_OUT' 'BUn'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MATKL' 'IT_OUT' '&#29289;&#26009;&#32452;\&#20998;&#32676;&#30721;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MATKX' 'IT_OUT' '&#29289;&#26009;&#25551;&#36848;'
                        'O' 'X' ''.
      APPEND_ALV_FIELD: 'PSTAT' 'IT_OUT' '&#32500;&#25252;&#29366;&#24577;'
                        'O' 'X' ''.
      APPEND_ALV_FIELD: 'BRGEW' 'IT_OUT' '&#27611;&#37325;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'NTGEW' 'IT_OUT' '&#20928;&#37325;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'GEWEI' 'IT_OUT' 'WUn'
                      'O' 'X' ''.
      APPEND_ALV_FIELD: 'FERTH' 'IT_OUT' '&#23545;&#22806;&#26426;&#31181;&#21517;'
                     'O' 'X' ''.
      APPEND_ALV_FIELD: 'KZUMW' 'IT_OUT' '&#39640;&#20851;&#31246;&#26631;&#35782;'
                   'O' 'X' ''.
      APPEND_ALV_FIELD: 'ERNAM' 'IT_OUT' '&#21019;&#24314;&#32773;'
                 'O' 'X' ''.
      APPEND_ALV_FIELD: 'ERSDA' 'IT_OUT' '&#21019;&#24314;&#26085;&#26399;'
              'O' 'X' ''.
    ENDFORM.                    " prepare_alv_field
    *&      Form  call_reuse_alv_grid_display
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_REUSE_ALV_GRID_DISPLAY .
      gs_layout-f2code              = 'DISPLAY'.
      gs_print-no_print_listinfos   = 'X'.
      gs_layout-colwidth_optimize   = 'X'.       "&#21015;&#23485;&#24230;&#33258;&#21160;&#26681;&#25454;&#20869;&#23481;&#20248;&#21270;
    gs_layout-f2code              = '&ETA'.    "double check&#24377;&#20986;&#35814;&#32454;&#20449;&#24687;
      gs_layout-zebra               = 'X'.       "&#28165;&#21333;&#26465;&#32441;&#26174;&#31034;
      gs_layout-no_vline            = ''.        "&#26159;&#21542;&#26174;&#31034;&#21015;&#38388;&#38548;&#32447;
      gs_layout-box_fieldname       = ''.        "&#26159;&#21542;&#26174;&#31034;checkbox
      gs_layout-confirmation_prompt = ''.        "&#25512;&#20986;&#28165;&#21333;&#26159;&#21542;&#25552;&#31034;
      gs_layout-detail_titlebar     = '&#35814;&#32454;&#20449;&#24687;'."&#35814;&#32454;&#28165;&#21333;&#30340;&#26631;&#39064;
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM                = SY-CPROG
          I_BACKGROUND_ID                   = 'ALV_BACKGROUND'
         I_CALLBACK_PF_STATUS_SET          = 'ALV_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'ALV_USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = GT_LIST_TOP_OF_PAGE[]
          IT_FIELDCAT                       = GT_FIELDCAT[]
          IT_EVENTS                         = GT_EVENTS[]
          I_STRUCTURE_NAME                  = 'IT_OUT'
          I_SAVE                            = 'A'
          IS_LAYOUT                         = GS_LAYOUT
          IS_PRINT                          = GS_PRINT
        TABLES
          T_OUTTAB                          = IT_OUT
        EXCEPTIONS
          PROGRAM_ERROR                     = 1
          OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " call_reuse_alv_grid_display
    *&      Form  PREPARE_ALV_FIELD
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    ENDFORM.                    "TOP_OF_PAGE

    Hi,
    Please check your field catalog and refer field names once again.
    Check spelling, or Check strucutre properly.
    There are something wrong in your catalog definition
    aRs.

  • HT1926 Started having trouble with iTunes so I uninstalled everything and tried to reinstall but it says ' iTunes cannot run because some of its required files are missing. Please reinstall iTunes.'  Well, I've uninstalled and reinstalled 5 times.  Now wh

    Started having trouble with iTunes so I uninstalled everything and tried to reinstall but it says ' iTunes cannot run because some of its required files are missing. Please reinstall iTunes.'  Well, I've uninstalled and reinstalled 5 times.  Now what?

    I figured it out.  A week ago I had downloaded a screensaver from a website I trusted and that's when my problems started. I uninstalled it but that didn't help.  So, I reinstalled it then used an uninstall softtware app that cleanns more than the control panel does. Then I used a computer cleaner to be sure everything was wiped clean.  And it worked.  I downloded iTunes for the 7th time in 2 days and finally it worked!  And I lost nothing from my account.
    Maybe this info will help others.

  • How to make a text field required at run time when the user clicks the checkbox ?

    I got a form where , there are several checkboxes and text fields associated with that checkboxes.If the use clicks on the check box then the associated
    text fields should become required.I have tried the change event and the click event for the checkboxes.It gives error in the onChnage event and I got some weird results in the on click event .Sometimes if the user click the check box , then for the 1st time the field doesnt become required , then the user onclicks the check box and when the user clicks the checkbox for the second time the field becomes required,but if i deselects the highlighted field option and selects it again the field becomes required even if the user onchecks it I am totally confused !!! Adding to it i have also written the wrong code still i achieved the desired result ?? How it can be possible . I am writing the codes below , please help me as i am working under a deadline from the client.
    onChange event :
    var newVal = this.boundItem(xfa.event.newText);
    if(newVal == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "disabled";
      else
         xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "error";
    For the onClick event :
    var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovere d_OnlyEnergyCharges").rawValue;
    //app.alert(a);
    if(a == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "error";
      if(a == 1)
          xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "disabled";
       Please help someone !!!

    I used the onchange event and wrote the code for it. I got the result . But there is a problem.All these fields are in a table and it's a dynamic table where you can add rows dynamically at the run time .I have other change event for some fields in this table .All are working fine when i add the row.But for this check box the required fields are not validated as required at the run time . I am here giving the code , Please help me .
    form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharge s::change - (JavaScript, client)
    if(this.rawValue == "1")
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory= "error";
    else
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandator = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory = "disabled";

Maybe you are looking for

  • When i on my Mac pro there is a folder sign with question mark?

    sir when i on my Pac Pro there is appear a folder sign with question mark in white screen .what is the problem tell me pls?

  • Yikes! Severe detail loss from LR to PS3???!!

    I am a professional photog who has been using PS for years and Lightroom since it came out. I just ran into a problem that makes no sense to me. I'm running the latest versions of Lightroom and CS3 on a MacBook using the most up to date version of Le

  • Is anyone else's Power Button not flush?

    I just noticed that my power button is not flush with my speaker grill. It dips down to the center (left-side). Does anyone else have this problem? I compared it to my buddy's computer, and his is perfectly flush. Let me know, thanks.

  • Dataguard sync and applying archive log

    Just did a check on my primary and standby using: Primary: SELECT max(sequence#) AS "PRIMARY" FROM v$log_history; PRIMARY 45527 Standby: SELECT max(sequence#) AS "STANDBY", applied FROM v$archived_log GROUP BY applied: STANDBY APP 45476 NO 45528 YES

  • CE7.11 not starting up, missing apps folder

    Hi All, I installed CE711 enhp1 Preview version by following all instruction on windows xp sp3, my server 0 which is java instace is always yellow its(jstart) not getting started.Strange is my installation dont have C:\usr\sap\CE1\J00\j2ee\cluster\ap