Need help in ALV

Hi folks,
I have a requirement in ALV format where the workcenters should be displayed in the first row..
and the corresponding Procurement & setup should be displayed under that corresponding workcenter.
                       WOrk Center             Work Center    
                               wc1                     wc2        
Material no.     Procurement  setup       Procurement  setup   
1000                       pc1          s1                 pc2         s2      
2000                       pc3          s3                 pc4         s4     
3000                       pc5          s5                 pc6         s6     
and so on..
can anyone of u tell me the desired approach for this reqt.
Points will be rewarded if needful.
Thanks in advance,

Hi,
one possible solution is to use a "Hieraquical Sequential list".
Here´s an example:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0f03986-046c-2910-a5aa-e5364e96ea2c
Best regards.

Similar Messages

  • Need help in ALV web dynpro

    Hi all,
    I need help in the web dynpro ALV.
    I have an ALV generated dynamically. On the ALV, there is filter and settings link on the extreme right of the alv header.
    How is it possible to get them left align after the export button ?
    I want to maitain some gap between the export button, filter and settings.
    Please give me inputs.
    Thanks in Advance.

    Hi Jatra,
    I am working on an ALV table in a standard Web Dynpro ABAP application.
    The business requirement is to hide the header for the ALV table.
    The header has a dropdown to choose u201CStandard Viewu201D and 2 options: Filter and Settings.
    The footer for the ALV table containing the Row and Column numbering also needs to be hidden.
    I am looking at the IF_SALV_WD_TABLE_SETTINGS to find the relevant methods to hide the header and footer.
    Please let me know if I am on the right track and if there is an alternate way to do this through changing the layout of the ALV table. I tried to hide the header and footer manually via the layout but am unable to do so, as the ALV table is just displayed as ViewContainerUI Element.
    Please help me as to how to hide the header and footer as I am new to ALV in WDA.
    Thanks and Regards.

  • Hello Friends need help in ALV oops

    Hello,
    My requirement is that in my ALV ouptut i will edit one cell when i am editing i.e if its is 200,00 i will change it to 300,00 before changing it should ask me wheather to change it or not i need to dispaly a dialog box with yes or no option if i click yes then it should accept the value 300,00.
    I am using ALV OOPS.

    Hi,
    You can achieve this as below,
    DATA: w_result TYPE c.
      METHOD handle_user_command.
    *   Handle own functions defined in the toolbar
        CASE e_ucomm.
          WHEN 'CHANGE'.
    CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
      EXPORTING
       defaultoption       = 'N'
        textline1           = 'Do you want to change the value?'
    *   TEXTLINE2           = ' '
        titel               = 'Confirmation for change'
    *   START_COLUMN        = 25
    *   START_ROW           = 6
    IMPORTING
       answer              = w_result.
    IF w_result = 'J'. "J is for yes.
    "Write your logic for saving the changes
    ENDIF.
      ENDCASE.
      ENDMETHOD.                    "handle_user_command
    Hope thi helps you.
    Regards,
    Manoj Kumar P

  • Need help on ALV report

    hi,
    i am new to ALV programming,i awant to generate the report with three teable mseg,mkpf,mard.
    i need selection screen also.
    in the selection screen following is the field names.
    Matdoc number-mseg-mblnr
    mat number - mseg-matnr
    plant - mseg-werks
    sloc mseg-lgort
    movtype- mseg-bwart.
    batch number- mseg-charg.
    ordernumber -mseg-aufnr.
    costcenter- mseg-kostl.
    reservation number- mseg-rsnum.
    storage bin - mard-lgpbe.
    i want to fetch the data from three tables
    mseg,mard,mkpf.
    after featch report should disply in alv grid following items.
    Matdoc number-mseg-mblnr
    mat number - mseg-matnr
    plant - mseg-werks
    sloc mseg-lgort
    movtype- mseg-bwart.
    batch number- mseg-charg.
    ordernumber -mseg-aufnr.
    costcenter- mseg-kostl.
    reservation number- mseg-rsnum.
    storage bin - mard-lgpbe.
    posting date - mkpf-budat.
    if any body have the code kindly send it as early as posible.
    Thanks,
    Rammohan.

    here is a sample program i think almost containing the same tables and fields
    *& Report  ZSD_R_ENHANCEMENT2                                           *
    *& REPORT PROGRAMMING FOR THE FURTHER ENHANCEMENT OF THE PRE-GENERATED
    *& MB51. REQUIREMENT IS TO ADD FIVE MORE FIELDS.
    *& OLD MATERIAL ON THE TOP LEFT CORNER OF THE HEADER AND
    *& Batch number the right of material document.
    *& Serial number if found should be placed to the right of the batch number.
    *& Handling unit/ storage unit to the right of serial number.
    *& Transaction description at the last of the report.
    REPORT  ZSD_R_ENHANCEMENT2 MESSAGE-ID ZB6T2                      .
    *& STRUCTURE CREATION FOR INTERNAL TABLES                              *
    *STRUCUTRE CREATION FOR HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
    TYPES: BEGIN OF TY_MKPF_MSEG,
           MBLNR TYPE MBLNR,   " NUMBER OF MATERIAL DOC
           MJAHR TYPE MJAHR,   " MATERIAL DOCUMENT YEAR
           VGART TYPE VGART,   " TRANSACTION EVENT TYPE
           BLART TYPE BLART,   " DOCUMENT TYPE
           BUDAT TYPE BUDAT,   " POSTING DATE INT THE DOC
           USNAM TYPE USNAM,   " USERNAME
           XBLNR TYPE XBLNR1,  " REFERENCE DOCUMENT NUMBER
           MATNR TYPE MATNR,   " MATERIAL NUMBER
           WERKS TYPE WERKS_D, " PLANT
           LGORT TYPE LGORT_D, " STORAGE LOCATION
           CHARG TYPE CHARG_D, " BATCH NUM
           LIFNR TYPE ELIFN,   " ACC OF VENDOR
           KUNNR TYPE EKUNN,   " CUSTOMER NUM
           SOBKZ TYPE SOBKZ,   " SPECIAL STOKING
           BWART TYPE BWART,   " MOVEMENT TYPE
           ZEILE TYPE MBLPO,   " ITEM IN MATERIAL DOCUMENT
           ERFMG TYPE ERFMG,   " QUANTITY IN UNIT OF ENTERY
           ERFME TYPE ERFME,   " UNIT OF ENTRY
           END OF TY_MKPF_MSEG,
    *STRUCTURE FOR MATERIAL MASTER DATA
           BEGIN OF TY_MARA,
           MATNR TYPE MATNR,   " MATERIAL TYPE
           BISMT TYPE BISMT,   " OLD MATERIAL NUMBER
           END OF TY_MARA,
    *STRUCTURE DECLARATION FOR MATERIAL DESCRIPTION
           BEGIN OF TY_MAKT,
           MATNR TYPE MATNR,   " MATERIAL NUM
           SPRAS TYPE SPRAS,    " LANGUAGE KEY
           MAKTX TYPE MAKTX,   " MATERIAL DESC
           END OF TY_MAKT,
    *STRUCTURE DECLARATION FOR MOVEMENT TYPE TEXT
           BEGIN OF TY_T156T,
           BWART TYPE BWART,   " MOVEMENT TYPE
           BTEXT TYPE BTEXT,   " MOVEMENT TYPE TEXT
           SPRAS TYPE SPRAS,   " LANGUAGE KEY
           END OF TY_T156T,
    *STRUCTURE CREATION FOR DOCUMENT HEADER FOR SERIALNUMBERS FOR GOOD MOVEMENTS
           BEGIN OF TY_SER03,
           MBLNR TYPE MBLNR,   " NUMBER OF MATERIAL DOC
           MJAHR TYPE MJAHR,   " MATERIAL DOCU YEAR
           ZEILE TYPE MBLPO,   " OUTPUT IN MATERIAL DOC
           OBKNR TYPE OBJKNR,  " OBJECT LIST NUMBER
           END OF TY_SER03,
    *STRUCUTRE DECLARATION FOR PLANTS MAINTANENCE OBKECT LIST
           BEGIN OF TY_OBJK,
           OBKNR TYPE OBJKNR,  " OBJECT LIST NUMBER
           OBZAE TYPE OBJZA,   " OBLECT LIST COUNTERS
           SERNR TYPE GERNR,   " SERIAL NUMBER
           END OF TY_OBJK,
    *STRUCUTRE DECLARATION FOR PLANTS/BRANCHES
           BEGIN OF TY_T001W,
           WERKS TYPE WERKS_D, " PLANT
           NAME1 TYPE NAME1,   " NAME
           END OF TY_T001W,
    *STRUCUTRE DECLARATION FOR OUTPUT TABLE
          BEGIN OF TY_OUTPUT,
           MATNR TYPE MATNR,   " MATERIAL NUMBER
           BISMT TYPE BISMT,   " OLD MATERIAL NUMBER
           MAKTX TYPE MAKTX,   " MATERIAL DESC
           WERKS TYPE WERKS_D, " PLANT
           NAME1 TYPE NAME1,   " NAME
           LGORT TYPE LGORT_D, " Storage Location
           BWART TYPE BWART,   " Movement Type
           MBLNR TYPE MBLNR,   " NUMBER OF MATERIAL DOC
           CHARG TYPE CHARG_D, " BATCH NUM
           SERNR TYPE GERNR,   " SERIAL NUMBER
           ZEILE TYPE MBLPO,   " OUTPUT IN MATERIAL DOC
           BUDAT TYPE BUDAT,   " POSTING DOCU DATE
           ERFMG TYPE ERFMG,   " QUANTITY IN UNIT OF ENTRY
           ERFME TYPE ERFME,   " UNINT OF ENTRY
           BTEXT TYPE BTEXT,   " MOVEMENT TYPE TEXT
           MJAHR TYPE MJAHR,   " MATEREIAL DOC YEAR
           VGART TYPE VGART,   " TRANSACTION EVENT TYPE
           BLART TYPE BLART,   " DOCUMENT TYPE
           USNAM TYPE USNAM,   " USERNAME
           XBLNR TYPE XBLNR1,  " REFERENCE DOCUMENT NUM
           SOBKZ TYPE SOBKZ,   " SPECIAL STOCKING
           LIFNR TYPE ELIFN,   " ACC OF VENDOR
           KUNNR TYPE EKUNN,   " CUSTOMER
           OBKNR TYPE OBJKNR,  " OBJECT LIST NUMBER
           END OF TY_OUTPUT.
    *&INTERNAL TABLE DECLARATION FOR STRUCUTRES                            *
    INTERNAL TABLE DECLARATION FOR HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
    DATA : T_MKPF_MSEG TYPE STANDARD TABLE OF TY_MKPF_MSEG INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR MATERIAL MASTER DAT
           T_MARA TYPE STANDARD TABLE OF TY_MARA INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR MATERIAL TYPE DESC
           T_MAKT TYPE STANDARD TABLE OF TY_MAKT INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR MOVEMENT TYPE TEXT
           T_T156T TYPE STANDARD TABLE OF TY_T156T INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR Document Header for Serial Numbers for Goods Movements
           T_SER03 TYPE STANDARD TABLE OF TY_SER03 INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR Plant Maintenance Object List
           T_OBJK TYPE STANDARD TABLE OF TY_OBJK INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR Plants/Branches
           T_T001W TYPE STANDARD TABLE OF TY_T001W INITIAL SIZE 0,
    *INTERNAL TABLE DECLARATION FOR OUTPUT
           T_OUTPUT TYPE STANDARD TABLE OF TY_OUTPUT INITIAL SIZE 0,
    *&WORK AREA DECLARATIONS FOR INTERNAL TABLES                           *
    *WORK AREA DECLARATION HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
           W_MKPF_MSEG TYPE TY_MKPF_MSEG,
    *WORK AREA DECLARATION MATERIAL MASTER DATA
           W_MARA TYPE TY_MARA,
    *WORK AREA DECLARATION MATERIAL TYPE DESC
           W_MAKT TYPE TY_MAKT,
    *WORK AREA DECLARATION MOVEMENT TYPE TEXT\
           W_T156T TYPE TY_T156T,
    *WORK AREA DECLARATION Document Header for Serial Numbers for Goods Movements
           W_SER03 TYPE TY_SER03,
    *WORK AREA DECLARATION PLANT MAINTENANCE OBJECT LIST
           W_OBJK TYPE TY_OBJK,
    *WORK AREA DECLARATION PLANTS AND BRANCHES
           W_T001W TYPE TY_T001W,
    *WORK AREA DECLARATION FOR OUTPUT TABLE.
          W_OUTPUT TYPE TY_OUTPUT,
    *& GLOBAL VARIABLE DECLARATIONS                                        *
           G_MATNR TYPE MSEG-MATNR,
           G_WERKS TYPE MSEG-WERKS,
           G_LGORT TYPE MSEG-LGORT,
           G_CHARG TYPE MSEG-CHARG,
           G_LIFNR TYPE MSEG-LIFNR,
           G_KUNNR TYPE MSEG-KUNNR,
           G_BWART TYPE MSEG-BWART,
           G_SOBKZ TYPE MSEG-SOBKZ,
           G_BUDAT TYPE MKPF-BUDAT,
           G_USNAM TYPE MKPF-USNAM,
           G_VGART TYPE MKPF-VGART,
           G_XBLNR TYPE MKPF-XBLNR.
    *& SELECTION SCREEN EVENT                                              *
    *SELECT OPTIONS EVENTS FOR ITEM DETAILS
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS: S_MATNR FOR G_MATNR,
                    S_WERKS FOR G_WERKS,
                    S_LGORT FOR G_LGORT,
                    S_CHARG FOR G_CHARG,
                    S_LIFNR FOR G_LIFNR,
                    S_KUNNR FOR G_KUNNR,
                    S_BWART FOR G_BWART,
                    S_SOBKZ FOR G_SOBKZ.
    SELECTION-SCREEN END OF BLOCK B1.
    *SELECT OPTIONS EVENTS FOR HEADER DETAILS
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
    SELECT-OPTIONS: S_BUDAT FOR G_BUDAT,
                    S_USNAM FOR G_USNAM,
                    S_VGART FOR G_VGART,
                    S_XBLNR FOR G_XBLNR.
    SELECTION-SCREEN END OF BLOCK B2.
    *&INITIALIZATION EVENTS                                                *
    INITIALIZATION.
      CLEAR: W_MKPF_MSEG,
             W_MARA,
             W_MAKT,
             W_T156T,
             W_SER03,
             W_OBJK,
             W_T001W,
             W_OUTPUT.
      REFRESH: T_MKPF_MSEG,
               T_MARA,
               T_MAKT,
               T_T156T,
               T_SER03,
               T_OBJK,
               T_T001W,
               T_OUTPUT.
    *&  At Selection screen Event
    AT SELECTION-SCREEN.
      PERFORM SUB_VALID_MATNR.
      PERFORM SUB_VALID_WERKS.
      PERFORM SUB_VALID_LGORT.
      PERFORM SUB_VALID_CHARG.
      PERFORM SUB_VALID_LIFNR.
      PERFORM SUB_VALID_KUNNR.
      PERFORM SUB_VALID_BWART.
      PERFORM SUB_VALID_SOBKZ.
      PERFORM SUB_VALID_BUDAT.
      PERFORM SUB_VALID_USNAM.
      PERFORM SUB_VALID_VGART.
      PERFORM SUB_VALID_XBLNR.
    *&  Start of selection event.
    START-OF-SELECTION.
      PERFORM SUB_GET_MKPF_MSEG.
      PERFORM SUB_GET_MARA.
      PERFORM SUB_GET_MAKT.
      PERFORM SUB_GET_T156T.
      PERFORM SUB_GET_SER03.
      PERFORM SUB_GET_T001W.
      PERFORM SUB_BSLIST_DISP.
    *&      Form  SUB_VALID_MATNR
    *VALIDATION FOR MATERIAL NUM
    FORM SUB_VALID_MATNR .
      DATA : L_MATNR TYPE MATNR.
      SELECT SINGLE MATNR
             FROM MARA
             INTO L_MATNR
             WHERE MATNR IN S_MATNR.
      IF SY-SUBRC <> 0.
       MESSAGE E001.
      ENDIF.
    ENDFORM.                    " SUB_VALID_MATNR
    *&      Form  SUB_VALID_WERKS
          text
    FORM SUB_VALID_WERKS .
      DATA L_WERKS TYPE WERKS_D.
      SELECT SINGLE WERKS
             FROM T001W
             INTO L_WERKS
             WHERE WERKS IN S_WERKS.
      IF SY-SUBRC <> 0.
        MESSAGE E002.
      ENDIF.
    ENDFORM.                    " SUB_VALID_WERKS
    *&      Form  SUB_VALID_LGORT
          text
    FORM SUB_VALID_LGORT .
      DATA L_LGORT TYPE LGORT_D.
      SELECT SINGLE LGORT
             FROM T001L
             INTO L_LGORT
             WHERE LGORT IN S_LGORT.
      IF SY-SUBRC <> 0.
       MESSAGE E003.
      ENDIF.
    ENDFORM.                    " SUB_VALID_LGORT
    *&      Form  SUB_VALID_CHARG
          text
    FORM SUB_VALID_CHARG .
      DATA L_CHARG TYPE CHARG_D.
      SELECT SINGLE CHARG
             FROM MCHA
             INTO L_CHARG
             WHERE CHARG IN S_CHARG.
      IF SY-SUBRC <> 0.
       MESSAGE E004.
      ENDIF.
    ENDFORM.                    " SUB_VALID_CHARG
    *&      Form  SUB_VALID_LIFNR
          text
    FORM SUB_VALID_LIFNR .
      DATA L_LIFNR TYPE LIFNR.
      SELECT SINGLE LIFNR
             FROM LFA1
             INTO L_LIFNR
             WHERE LIFNR IN S_LIFNR.
      IF SY-SUBRC <> 0.
       MESSAGE E005.
      ENDIF.
    ENDFORM.                    " SUB_VALID_LIFNR
    *&      Form  SUB_VALID_KUNNR
          text
    FORM SUB_VALID_KUNNR .
      DATA L_KUNNR TYPE KUNNR.
      SELECT SINGLE KUNNR
             FROM KNA1
             INTO L_KUNNR
             WHERE KUNNR IN S_KUNNR.
      IF SY-SUBRC <> 0.
       MESSAGE E006.
      ENDIF.
    ENDFORM.                    " SUB_VALID_KUNNR
    *&      Form  SUB_VALID_BWART
          text
    FORM SUB_VALID_BWART .
      DATA L_BWART TYPE BWART.
      SELECT SINGLE BWART
             FROM T156
             INTO L_BWART
             WHERE BWART IN S_BWART.
      IF SY-SUBRC <> 0.
       MESSAGE E007.
      ENDIF.
    ENDFORM.                    " SUB_VALID_BWART
    *&      Form  SUB_VALID_SOBKZ
          text
    FORM SUB_VALID_SOBKZ .
    DATA L_SOBKZ TYPE SOBKZ.
    SELECT SINGLE SOBKZ
           FROM T148
           INTO L_SOBKZ
           WHERE SOBKZ IN S_SOBKZ.
    IF SY-SUBRC <> 0.
    MESSAGE E008.
    ENDIF.
    ENDFORM.                    " SUB_VALID_SOBKZ
    *&      Form  SUB_VALID_BUDAT
          text
    FORM SUB_VALID_BUDAT .
      DATA L_BUDAT TYPE BUDAT.
      SELECT SINGLE BUDAT
             FROM MKPF
             INTO L_BUDAT
             WHERE BUDAT IN S_BUDAT.
      IF SY-SUBRC <> 0.
       MESSAGE E009.
      ENDIF.
    ENDFORM.                    " SUB_VALID_BUDAT
    *&      Form  SUB_VALID_USNAM
          text
    FORM SUB_VALID_USNAM .
      DATA L_USNAM TYPE USNAM.
      SELECT SINGLE USNAM
             FROM MKPF
             INTO L_USNAM
             WHERE USNAM IN S_USNAM.
      IF SY-SUBRC <> 0.
       MESSAGE E010.
      ENDIF.
    ENDFORM.                    " SUB_VALID_USNAM
    *&      Form  SUB_VALID_VGART
          text
    FORM SUB_VALID_VGART .
      DATA L_VGART TYPE VGART.
      SELECT SINGLE VGART
             FROM MKPF
             INTO L_VGART
             WHERE VGART IN S_VGART.
      IF SY-SUBRC <> 0.
       MESSAGE E011.
      ENDIF.
    ENDFORM.                    " SUB_VALID_VGART
    *&      Form  SUB_VALID_XBLNR
          text
    FORM SUB_VALID_XBLNR .
      DATA L_XBLNR TYPE XBLNR.
      SELECT SINGLE XBLNR
             FROM MKPF
             INTO L_XBLNR
             WHERE XBLNR IN S_XBLNR.
      IF SY-SUBRC <> 0.
        MESSAGE E012.
      ENDIF.
    ENDFORM.                    " SUB_VALID_XBLNR
    *&      Form  SUB_GET_MKPF_MSEG
          text
    FORM SUB_GET_MKPF_MSEG .
      REFRESH T_MKPF_MSEG.
      SELECT KMBLNR KMJAHR K~VGART
             KBLART KBUDAT K~USNAM
             K~XBLNR
             SMATNR SWERKS S~LGORT
             SCHARG SLIFNR S~KUNNR
             SSOBKZ SBWART S~ZEILE
             SERFMG SERFME
         INTO TABLE T_MKPF_MSEG
         FROM MKPF AS K INNER JOIN MSEG AS S
           ON KMBLNR = SMBLNR AND KMJAHR = SMJAHR
        WHERE    K~VGART IN S_VGART
             AND K~BUDAT IN S_BUDAT
             AND K~USNAM IN S_USNAM
             AND K~XBLNR IN S_XBLNR
             AND S~MATNR IN S_MATNR
             AND S~WERKS IN S_WERKS
             AND S~LGORT IN S_LGORT
             AND S~CHARG IN S_CHARG
             AND S~SOBKZ IN S_SOBKZ
             AND S~LIFNR IN S_LIFNR
             AND S~KUNNR IN S_KUNNR.
    ENDFORM.                    " SUB_GET_MKPF_MSEG
    *&      Form  SUB_GET_MARA
          text
    FORM SUB_GET_MARA .
      IF T_MKPF_MSEG IS NOT INITIAL.
        SORT T_MKPF_MSEG BY MATNR.
        REFRESH T_MARA.
      SELECT MATNR
             BISMT
             FROM MARA
             INTO TABLE T_MARA
             FOR ALL ENTRIES IN T_MKPF_MSEG
             WHERE MATNR = T_MKPF_MSEG-MATNR.
    ENDIF.
    ENDFORM.                    " SUB_GET_MARA
    *&      Form  SUB_GET_MAKT
          text
    FORM SUB_GET_MAKT .
    REFRESH T_MAKT.
      SELECT MATNR
             SPRAS
             MAKTX
             FROM MAKT
             INTO TABLE T_MAKT
             FOR ALL ENTRIES IN T_MKPF_MSEG
             WHERE SPRAS = SY-LANGU AND  MATNR = T_MKPF_MSEG-MATNR.
    ENDFORM.                    " SUB_GET_MAKT
    *&      Form  SUB_GET_T156T
          text
    FORM SUB_GET_T156T .
      SELECT BWART
             BTEXT
             SPRAS
             FROM T156T
             INTO TABLE T_T156T
             FOR ALL ENTRIES IN T_MKPF_MSEG
             WHERE SPRAS = SY-LANGU AND BWART = T_MKPF_MSEG-BWART.
    ENDFORM.                    " SUB_GET_T156T
    *&      Form  SUB_GET_SER03
          text
    FORM SUB_GET_SER03 .
      SELECT MBLNR
             MJAHR
             ZEILE
             OBKNR
             FROM SER03
             INTO TABLE T_SER03
             FOR ALL ENTRIES IN T_MKPF_MSEG
             WHERE MBLNR = T_MKPF_MSEG-MBLNR
             AND MJAHR = T_MKPF_MSEG-MJAHR
             AND ZEILE = T_MKPF_MSEG-ZEILE.
    IF T_SER03 IS NOT INITIAL.
      SELECT OBKNR
             OBZAE
             SERNR
             FROM OBJK
             INTO CORRESPONDING FIELDS OF TABLE T_OBJK
             FOR ALL ENTRIES IN T_SER03
             WHERE OBKNR = T_SER03-OBKNR.
    ENDIF.
    ENDFORM.                    " SUB_GET_SER03
    *&      Form  SUB_GET_T001W
          text
    FORM SUB_GET_T001W .
      SELECT WERKS
             NAME1
             FROM T001W
             INTO TABLE T_T001W
             FOR ALL ENTRIES IN T_MKPF_MSEG
             WHERE WERKS = T_MKPF_MSEG-WERKS.
    ENDFORM.                    " SUB_GET_T001W
    *&      Form  SUB_BSLIST_DISP
    FOR DISPLAY OUT
    FORM SUB_BSLIST_DISP .
    REFRESH T_OUTPUT.
      CLEAR W_MKPF_MSEG.
      SORT T_MKPF_MSEG BY MBLNR MJAHR ZEILE MATNR.
      LOOP AT T_MKPF_MSEG INTO W_MKPF_MSEG.
        W_OUTPUT-MBLNR = W_MKPF_MSEG-MBLNR .
        W_OUTPUT-MJAHR = W_MKPF_MSEG-MJAHR.
        W_OUTPUT-VGART = W_MKPF_MSEG-VGART.
        W_OUTPUT-BLART = W_MKPF_MSEG-BLART.
        W_OUTPUT-BUDAT = W_MKPF_MSEG-BUDAT.
        W_OUTPUT-USNAM = W_MKPF_MSEG-USNAM.
        W_OUTPUT-XBLNR = W_MKPF_MSEG-XBLNR.
        W_OUTPUT-ZEILE = W_MKPF_MSEG-ZEILE.
        W_OUTPUT-BWART = W_MKPF_MSEG-BWART.
        W_OUTPUT-MATNR = W_MKPF_MSEG-MATNR.
        W_OUTPUT-WERKS = W_MKPF_MSEG-WERKS.
        W_OUTPUT-LGORT = W_MKPF_MSEG-LGORT.
        W_OUTPUT-CHARG = W_MKPF_MSEG-CHARG.
        W_OUTPUT-SOBKZ = W_MKPF_MSEG-SOBKZ.
        W_OUTPUT-LIFNR = W_MKPF_MSEG-LIFNR.
        W_OUTPUT-KUNNR = W_MKPF_MSEG-KUNNR.
        W_OUTPUT-ERFMG = W_MKPF_MSEG-ERFMG.
        W_OUTPUT-ERFME = W_MKPF_MSEG-ERFME.
        CLEAR W_MARA.
        READ TABLE T_MARA INTO W_MARA WITH KEY MATNR = W_OUTPUT-MATNR.
        IF SY-SUBRC = 0.
          W_OUTPUT-BISMT = W_MARA-BISMT.
        ENDIF.
        CLEAR W_MAKT.
        READ TABLE T_MAKT INTO W_MAKT WITH KEY MATNR = W_OUTPUT-MATNR .
        IF SY-SUBRC = 0.
          W_OUTPUT-MAKTX = W_MAKT-MAKTX.
        ENDIF.
        CLEAR W_T156T.
        READ TABLE T_T156T INTO W_T156T WITH KEY  BWART = W_OUTPUT-BWART  .
        IF SY-SUBRC = 0.
          W_OUTPUT-BTEXT = W_T156T-BTEXT.
        ENDIF.
        CLEAR W_T001W.
        READ TABLE T_T001W INTO W_T001W WITH KEY WERKS = W_MKPF_MSEG-WERKS.
        IF SY-SUBRC = 0.
          W_OUTPUT-NAME1 = W_T001W-NAME1.
        ENDIF.
        CLEAR W_SER03.
        READ TABLE T_SER03 INTO W_SER03 WITH KEY MBLNR = W_OUTPUT-MBLNR
                                                  MJAHR = W_OUTPUT-MJAHR
                                                  ZEILE = W_OUTPUT-ZEILE.
        IF SY-SUBRC = 0.
          W_OUTPUT-OBKNR = W_SER03-OBKNR.
        ENDIF.
        CLEAR W_OBJK.
        READ TABLE T_OBJK INTO W_OBJK WITH KEY OBKNR = W_OUTPUT-OBKNR.
        IF SY-SUBRC = 0.
        W_OUTPUT-SERNR = W_OBJK-SERNR .
        ENDIF.
        APPEND W_OUTPUT TO T_OUTPUT.
        CLEAR W_OUTPUT.
        ENDLOOP.
        PERFORM SUB_DISPLAY.
    ENDFORM.
    *&      Form  SUB_DISPLAY
    HIERARICAL DISPLAY
    FORM SUB_DISPLAY .
    SORT T_OUTPUT BY MATNR BISMT MAKTX WERKS NAME1 LGORT BWART MBLNR CHARG SERNR ZEILE BUDAT ERFMG ERFME BTEXT.
    CLEAR W_OUTPUT.
    LOOP AT T_OUTPUT INTO W_OUTPUT.
    AT NEW NAME1.
    WRITE:/ W_OUTPUT-MATNR,
            W_OUTPUT-BISMT,
            W_OUTPUT-MAKTX,
            W_OUTPUT-WERKS,
            W_OUTPUT-NAME1.
    ENDAT.
    AT NEW BTEXT.
    WRITE:/ W_OUTPUT-LGORT,
            W_OUTPUT-BWART,
            W_OUTPUT-MBLNR,
            W_OUTPUT-CHARG,
            W_OUTPUT-SERNR,
            W_OUTPUT-ZEILE,
            W_OUTPUT-BUDAT,
            W_OUTPUT-ERFMG,
            W_OUTPUT-ERFME,
            W_OUTPUT-BTEXT.
    ENDAT.
    CLEAR W_OUTPUT.
    ENDLOOP.
    REFRESH T_OUTPUT.
    ENDFORM.                    " SUB_DISPLAY

  • Urgent... need help in alv.

    hai all,
    in an alv report i want a pushbutton in the application tool bar .
    how can i get it.
    and also i want to select multiple rows from the list and the first column as a button to select the rows.
    please.. help me. its very urgent.
    thanks in advance.
    regards, selvi.

    Hi,
    Following steps to copy standard status to zstatus
    Goto T.Code  SE41 & give program name SAPLSLVC then select
    status as STANDARD then copy this status to zstatus in your program
    open zstatus in T.Code SE41 and  add push button and  save & activate it.
    then Call FM  PF_STATUS.
    see below,
    I_CALLBACK_PF_STATUS_SET- 'PF_STATUS'
    In module PF_STATUS
    set pf-status 'ZSTATUS'
    reward if useful.

  • Need help with ALV Grid

    Hi,
    I am displaying Header and Item details in an ALV Grid. The first row will be having Header info and the next rows contains Item Details. I want to hide some of the columns of the first record only. The titles and the Item Details should remain same.
    Can any body help me.
    Regards,
    Srinivas

    Hello,
    That cannot be done as you are displaying the header and item level data together. Let the fields you do not want to display be blank while you display.
    Hope it helps.
    Thanks,
    Jayant

  • Need help In ALV report

    Hi All,
    I am working on ALV report.I need one logic.
    When Ever I executed report, The output should looks 'Selected Total data' like Yellow color. How can i do that.
    The report out should show sthe ' All the data is selected'. Just like Ctrl+A.
    regards,
    Ajay

    Hi
    if you wants to see the totals in separate color , you develop the I_SORT table with the respective fields and pass to the fun module
    then that total field will be always displayed with yelloe color
    or
    See this sample code to color the ALV fields
    and accordingly assign the color for your field
    REPORT zsharad_test1.
    TABLES: ekko.
    TYPE-POOLS: slis. "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    ebeln TYPE ekpo-ebeln,
    ebelp TYPE ekpo-ebelp,
    statu TYPE ekpo-statu,
    aedat TYPE ekpo-aedat,
    matnr TYPE ekpo-matnr,
    menge TYPE ekpo-menge,
    meins TYPE ekpo-meins,
    netpr TYPE ekpo-netpr,
    peinh TYPE ekpo-peinh,
    line_color(4) TYPE c, "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
    wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    gd_repid LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    PERFORM data_retrieval.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM display_alv_report.
    *& Form BUILD_FIELDCATALOG
    Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
    I.e. Field type may be required in-order for
    the 'TOTAL' function to work.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order'.
    fieldcatalog-col_pos = 0.
    fieldcatalog-outputlen = 10.
    fieldcatalog-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    fieldcatalog-do_sum = 'X'.
    fieldcatalog-no_zero = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'EBELP'.
    fieldcatalog-seltext_m = 'PO Item'.
    fieldcatalog-col_pos = 1.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'STATU'.
    fieldcatalog-seltext_m = 'Status'.
    fieldcatalog-col_pos = 2.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'AEDAT'.
    fieldcatalog-seltext_m = 'Item change date'.
    fieldcatalog-col_pos = 3.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material Number'.
    fieldcatalog-col_pos = 4.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MENGE'.
    fieldcatalog-seltext_m = 'PO quantity'.
    fieldcatalog-col_pos = 5.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Order Unit'.
    fieldcatalog-col_pos = 6.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'NETPR'.
    fieldcatalog-seltext_m = 'Net Price'.
    fieldcatalog-col_pos = 7.
    fieldcatalog-outputlen = 15.
    fieldcatalog-datatype = 'CURR'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'PEINH'.
    fieldcatalog-seltext_m = 'Price Unit'.
    fieldcatalog-col_pos = 8.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    Build layout for ALV grid report
    FORM build_layout.
    gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
    gd_layout-info_fieldname = 'LINE_COLOR'.
    gd_layout-totals_only = 'X'.
    gd_layout-f2code = 'DISP'. "Sets fcode for when double
    "click(press f2)
    gd_layout-zebra = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text = 'helllllo'.
    ENDFORM. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    Display report using ALV grid
    FORM display_alv_report.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = gd_repid
    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    it_special_groups = gd_tabgroup
    IT_EVENTS = GT_XEVENTS
    i_save = 'X'
    is_variant = z_template
    TABLES
    t_outtab = it_ekko
    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. " DISPLAY_ALV_REPORT
    *& Form DATA_RETRIEVAL
    Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    DATA: ld_color(1) TYPE c.
    SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
    UP TO 10 ROWS
    FROM ekpo
    INTO TABLE it_ekko.
    *Populate field with color attributes
    LOOP AT it_ekko INTO wa_ekko.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
    i.e. wa_ekko-line_color = 'C410'
    ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
    IF ld_color = 8.
    ld_color = 1.
    ENDIF.
    CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
    MODIFY it_ekko FROM wa_ekko.
    ENDLOOP.
    ENDFORM. " DATA_RETRIEVAL
    Regards
    Anji

  • Need help in alv append in one row

    I need to append in one row in alv and I’m using 'REUSE_ALV_FIELDCATALOG_MERGE'.
    Here’s my code:
    DATA: lv_spras LIKE sy-langu,
            lv_datbi LIKE a005-datbi.
      CLEAR t_final.
      SELECT t~vtext
             a~kschl
             a~kunnr
             k~name1
             a~matnr
             a~knumh
             m~maktx
             m~spras
             a~datab
             a~datbi
            INTO TABLE t_final
            FROM a005 AS a
            INNER JOIN t685t AS t ON akschl EQ tkschl
            INNER JOIN kna1  AS k ON akunnr EQ kkunnr
            INNER JOIN makt AS m ON amatnr EQ mmatnr
                        WHERE  a~vkorg IN s_vkorg
                        AND    a~vtweg IN s_vtweg
                        AND    a~matnr IN s_matnr
                        AND  ( a~kschl EQ p_cond1
                        OR     a~kschl EQ p_cond2
                        OR     a~kschl EQ p_cond3
                        OR     a~kschl EQ p_cond4 )
                        AND    a~kunnr IN s_kunnr
                        AND    a~datab LE sy-datum
                        AND    a~datbi GE sy-datum
                        AND    m~spras EQ sy-langu.
      IF sy-subrc EQ 0.
        DELETE ADJACENT DUPLICATES FROM t_final
           COMPARING kschl.
      ENDIF.
        LOOP AT t_final FROM sy-tabix.
        move-corresponding t_a005 to t_final.
          CASE t_final-kschl.
            WHEN p_cond1.
              t_final1-kschl1 = t_final-kschl.
              t_final1-vtext1 = t_final-vtext.
              t_final1-datab  = t_final-datab.
              t_final1-datbi  = t_final-datbi.
            WHEN p_cond2.
              t_final1-kschl2 = t_final-kschl.
              t_final1-vtext2 = t_final-vtext.
              t_final1-datab2  = t_final-datab.
              t_final1-datbi2  = t_final-datbi.
          Endcase.
            Endloop.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = l_repid
                i_internal_tabname = 'T_FINAL1'
                i_inclname         = l_repid
                i_bypassing_buffer = 'X'
           CHANGING
                ct_fieldcat        = t_fieldcat[]
           EXCEPTIONS
                OTHERS             = 0.
      LOOP AT t_fieldcat.
        CASE t_fieldcat-fieldname.
      condition 1
          WHEN lc_vtext1.
            IF p_cond1 IS INITIAL.
              t_fieldcat-no_out        = c_x.
            ELSE.
              CONCATENATE text-001 p_cond1 INTO lv_buf
              SEPARATED BY space.
              t_fieldcat-seltext_l    = lv_buf.
              t_fieldcat-seltext_s    = lv_buf.
              t_fieldcat-seltext_m    = lv_buf.
              t_fieldcat-ddictxt      = lc_l.
              t_fieldcat-no_zero      = c_x.
              t_fieldcat-just         = lc_r.
              t_fieldcat-reptext_ddic = lv_buf.
              t_fieldcat-outputlen    = 27.
            ENDIF.
            CLEAR t_fieldcat-key.
            MODIFY t_fieldcat INDEX sy-tabix.
          WHEN lc_kschl1.                              "CONDITION TYPE
            IF p_cond1 IS INITIAL.                    "DESCRIPTION
              t_fieldcat-no_out        = c_x.
            ELSE.
              CONCATENATE text-002 p_cond1 INTO lv_buf
              SEPARATED BY space.
              t_fieldcat-seltext_l    = lv_buf.
              t_fieldcat-seltext_s    = lv_buf.
              t_fieldcat-seltext_m    = lv_buf.
              t_fieldcat-ddictxt      = lc_l.
              t_fieldcat-no_zero      = c_x.
              t_fieldcat-just         = lc_r.
              t_fieldcat-reptext_ddic = lv_buf.
              t_fieldcat-outputlen    = 20.
            ENDIF.
            CLEAR t_fieldcat-key.
            MODIFY t_fieldcat INDEX sy-tabix.
    WHEN lc_vtext2.
            IF p_cond1 IS INITIAL.
              t_fieldcat-no_out        = c_x.
            ELSE.
              CONCATENATE text-001 p_cond2 INTO lv_buf
              SEPARATED BY space.
              t_fieldcat-seltext_l    = lv_buf.
              t_fieldcat-seltext_s    = lv_buf.
              t_fieldcat-seltext_m    = lv_buf.
              t_fieldcat-ddictxt      = lc_l.
              t_fieldcat-no_zero      = c_x.
              t_fieldcat-just         = lc_r.
              t_fieldcat-reptext_ddic = lv_buf.
              t_fieldcat-outputlen    = 27.
            ENDIF.
            CLEAR t_fieldcat-key.
            MODIFY t_fieldcat INDEX sy-tabix.
          WHEN lc_kschl2.
            IF p_cond1 IS INITIAL.
              t_fieldcat-no_out        = c_x.
            ELSE.
              CONCATENATE text-002 p_cond2 INTO lv_buf
              SEPARATED BY space.
              t_fieldcat-seltext_l    = lv_buf.
              t_fieldcat-seltext_s    = lv_buf.
              t_fieldcat-seltext_m    = lv_buf.
              t_fieldcat-ddictxt      = lc_l.
              t_fieldcat-no_zero      = c_x.
              t_fieldcat-just         = lc_r.
              t_fieldcat-reptext_ddic = lv_buf.
              t_fieldcat-outputlen    = 20.
            ENDIF.
            CLEAR t_fieldcat-key.
            MODIFY t_fieldcat INDEX sy-tabix.
    Endcase.
    Endloop.
    The output is:
    VTEXT1               KSCHL1    VTEXT2                       KSCHL2
    Special Discount   |ZDD3     |                                      |     
            |                 |Tender/Special Price|ZR03 
    I want the output:
    VTEXT1               KSCHL1    VTEXT2                       KSCHL2
    Special Discount   |ZDD3     ||Tender/Special Price|ZR03 
    How can I do these.

    DATA: BEGIN OF wa,
            col1(1) TYPE c,
            col2 TYPE i,
          END OF wa.
    DATA itab LIKE TABLE OF wa.
    DO 3 TIMES.
      APPEND INITIAL LINE TO itab.
      wa-col1 = sy-index. wa-col2 = sy-index ** 2.
      APPEND wa TO itab.
    ENDDO.
    LOOP AT itab INTO wa.
      WRITE: / wa-col1, wa-col2.
    ENDLOOP.
    The list output is:
              0
    1         1
              0
    2         4
              0
    3         9

  • Need help on ALV Grid Control

    Hi,
    I have written a program to display the details of customer in ALV Grid. I have also added code to add a hyperlink to the field name - KTOKD of the table KNA1. It would be helpful if anyone could tell me what is wrong with the code. The list is correctly displayed but the hyperlink is not working.
    tables kna1.
    data: BEGIN OF itkna1 OCCURS 0,
             ktokd like kna1-ktokd,
             kunnr like kna1-kunnr,
             name1 like kna1-name1,
             name2 like kna1-name2,
             ktokd_hdl type int4,
          end of itkna1.
    *creating an instance of grid
    data it_custom_control_name type scrfname value 'C_C_ALV'.
    data it_container type ref to cl_gui_custom_container.
    data it_alvgrid type ref to cl_gui_alv_grid.
    data it_lyo type lvc_s_layo.
    data it_fcat type lvc_t_fcat.
    data tmp_fcat like LINE OF it_fcat.
    data it_hype type lvc_t_hype.
    data tmp_hype type lvc_s_hype.
    Selection-screen begin of block Enter_data with frame title text-001.
      PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
      SELECT-OPTIONS skunnr FOR KNA1-kunnr.
    Selection-screen end of block Enter_data.
    SELECT ktokd kunnr name1 name2
      FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
           WHERE ktokd = pktokd AND kunnr IN skunnr.
    *prepare field catalog
    clear: it_fcat, tmp_fcat.
    tmp_fcat-fieldname = 'KTOKD'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KTOKD'.
    tmp_fcat-col_pos = '1'.
    tmp_fcat-web_field = 'ktokd_hdl'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'KUNNR'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KUNNR'.
    tmp_fcat-col_pos = '2'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'NAME1'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'NAME1'.
    tmp_fcat-col_pos = '3'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'NAME2'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'NAME2'.
    tmp_fcat-col_pos = '4'.
    append tmp_fcat to it_fcat.
    data: c_lines type I, count type I.
    DESCRIBE table itkna1 LINES c_lines.
    loop at itkna1.
      count = count + 1.
      tmp_hype-handle = count.
      tmp_hype-href = itkna1-ktokd.
      APPEND tmp_hype to it_hype.
      itkna1-ktokd_hdl = count.
      MODIFY itkna1.
    ENDLOOP.
    *prepare layout
    it_lyo-grid_title = 'Custormer details'.
    call screen 200.
    module status_0200 OUTPUT.
    *creating an instance of container class
    CREATE OBJECT it_container
        EXPORTING container_name = it_custom_control_name.
    *creating an instance of the grid
    create OBJECT it_alvgrid
        EXPORTING i_parent = it_container.
    *displaying the grid
    call METHOD it_alvgrid->set_table_for_first_display
       EXPORTING
         is_layout = it_lyo
         it_hyperlink = it_hype
       CHANGING
         it_outtab = itkna1[]
         it_fieldcatalog = it_fcat
       EXCEPTIONS
         invalid_parameter_combination = 1
         others = 2.
    ENDMODULE.

    Try this..
    give the field name in CAPITAL LETTERS..
    *prepare field catalog
    clear: it_fcat, tmp_fcat.
    tmp_fcat-fieldname = 'KTOKD'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KTOKD'.
    tmp_fcat-col_pos = '1'.
    tmp_fcat-web_field =<b> 'KTOKD_HDL'.</b>
    REGARDS,
    SAI RAMESH

  • Need help in alv grid output

    Hi ihave a problem in alv grid i want display the longtext which was very long in characters it contains of more than 20 lines as shown below now i want the output the material number and shorttext description only one time but not as many times as there are lines in the long text that is i want to delete the remaining short text and material number for a single material number.
    I'm posting here my ALv grid code also pla consider it and give me solution
    FORM field_catalog.
    ***MATERIAL NO no
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'MATNR'.
      int_cat-reptext_ddic  = 'MATERIAL NO'.
      APPEND int_cat .
    *vender name
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'MAKTX'.
      int_cat-reptext_ddic  = 'MATERIAL SHORT DESCRIPTION'.
      APPEND int_cat .
    ** PO No
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'TDLINE'.
      int_cat-reptext_ddic  = 'MATERIAL LONG DESCRIPTION'.
      int_cat-outputlen = '100'.
      APPEND int_cat .
    endform.
    *&      Form  display_data
    *       text
    FORM display_data.
    DATA : X_SORT TYPE SLIS_SORTINFO_ALV.
    DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV.
    X_SORT-SPOS = '1'.
    X_SORT-FIELDNAME = 'MATNR'.
    X_SORT-TABNAME = 'INT_OUT'.
    X_SORT-UP = 'X'.
    APPEND X_SORT TO IT_SORT.
    CLEAR X_SORT.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = int_cat[]
    *      I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
    *      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    **      IS_LAYOUT = X_LAYOUT
    **      IT_FIELDCAT = IT_FIELDCAT
    **      IT_EVENTS = IT_EVENT
    *      IT_SORT = INT_OUT
        TABLES
          t_outtab           = int_out
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_data
    <b>
    1000100000 Test material 1 1. DataSet vs DataReader
    1000100000 Test material 1 # DataReader
    1000100000 Test material 1 # Object to access data in a connected, forward-only, read-only
    1000100000 Test material 1 fashion
    1000100000 Test material 1
    1000100000 Test material 1 # DataSet
    1000100000 Test material 1 # Data structure to store schema and data in a disconnected fashion
    1000100000 Test material 1 # Useful for editing data offline and later update to data source
    1000100000 Test material 1
    1000100000 Test material 1 2. What is Microsoft .NET?
    1000100000 Test material 1 .NET represents an advanced new generation of software that will
    1000100000 Test material 1 drive the Next Generation Internet. Its purpose is to make information
    1000100000 Test material 1 available any time, any place, and on any device.
    1000100000 Test material 1 Quick Definition
    1000100000 Test material 1 .NET is an initiative to integrate all Microsoft products with
    1000100000 Test material 1 the #Next Generation# web.
    1000100000 Test material 1
    1000100000 Test material 1 3. Recordset
    1000100000 Test material 1
    1000100000 Test material 1 ? Recordsets are generated one per table. This does not support
    1000100000 Test material 1 hierarchical structure of data access. It will be programmer#s
    1000100000 Test material 1 responsibility to define relationships among different recordsets.
    1000100000 Test material 1 ? Rercordsets can not support data accessing from multiple sources.
    1000100000 Test material 1
    1000100000 Test material 1
    1000100000 Test material 1 4. Connection-oriented Vs Connection-less
    1000100000 Test material 1 ? Connection-oriented
    1000100000 Test material 1 # Keeps the connection to the data base alive
    1000100000 Test material 1 # Intended for applications with:
    1000100000 Test material 1 ? short running transactions
    1000100000 Test material 1 ? only a few parallel accesses
    1000100000 Test material 1 ? up-to-date data
    1000100000 Test material 1
    1000100000 Test material 1 ? Connectionless</b>

    hi shiaba
    i have allredy done like this but same out put is coming as per earlier.
    i want to delete material No and short description  only in one line not all line
    if long description is 50 line
    out ut is coming like this
    MATERIAL NO MATERIAL SHORT DESCRIPTION MATERIAL LONG DESCRIPTION
    1000100000  Test material 1            1.   DataSet vs DataReader
    1000100000  Test material 1            # DataReader
    1000100000  Test material 1            # Object to access data in a connected, forward-only, read-only
    1000100000  Test material 1            fashion
    1000100000  Test material 1
    1000100000  Test material 1            # DataSet
    1000100000  Test material 1            # Data structure to store schema and data in a disconnected fash
    1000100000  Test material 1            # Useful for editing data offline and later update to data sourc
    1000100000  Test material 1
    1000100000  Test material 1            2. What is Microsoft .NET?
    1000100000  Test material 1              .NET represents an advanced new generation of software that wi
    1000100000  Test material 1            drive the Next Generation Internet.  Its purpose is to make info
    1000100000  Test material 1            available any time, any place, and on any device.
    1000100000  Test material 1              Quick Definition
    1000100000  Test material 1              .NET is an initiative to integrate all Microsoft products with
    1000100000  Test material 1            the #Next Generation# web.
    but i want like below
    MATERIAL NO     MATERIAL SHORT DESCRIPTION     MATERIAL LONG DESCRIPTION
    1000100000     Test material 1     1.   DataSet vs DataReader
    DataReader
    Object to access data in a connected, forward-only, read-          fashion
    DataSet
    Data structure to store schema and data in a        
              2. What is Microsoft .NET?
              .NET represents an advanced new generation of software           drive the Next Generation Internet.  Its purpose is to make           available any time, any place, and on any device.
              Quick Definition
              .NET is an initiative to integrate all Microsoft products with
              the #Next Generation# web.
    thanks .

  • Need help in ALV Header to merge the columns.

    HI All,
    I have to create an ALV report with below Header in which i have to merge the data.
    Col1
    col2
    Col3
    col.3.1
    col 3.2
    col3.3
    Please let me know how to create fieldcatalog for the above layout.
    Thanks
    Piyush

    REPORT zhier_alv.
    TYPE-POOLS : slis.
    TABLES : mseg.
    DATA : BEGIN OF itab_head OCCURS 0,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
             mblnr LIKE mseg-mblnr,
            menge LIKE mseg-menge,
           END OF itab_head.
    DATA : BEGIN OF itab_item OCCURS 0,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            mblnr LIKE mseg-mblnr,
            menge LIKE mseg-menge,
           END OF itab_item.
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
           key_info TYPE slis_keyinfo_alv,
           t_eve TYPE slis_t_event,
           gt_subtot TYPE slis_t_sortinfo_alv,
           subtot LIKE LINE OF gt_subtot,
           t_listhead TYPE slis_t_listheader,
           st_line TYPE slis_listheader.
    DATA : t_mtdoc LIKE mseg-mblnr.
    SELECT-OPTIONS : mat FOR mseg-matnr.
    INITIALIZATION.
      PERFORM build_cat USING t_fcat.
      PERFORM build_eve.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM dis_data.
    *&      Form  build_cat
          text
         -->TEMP_FCAT  text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
      DATA : wa_fcat TYPE slis_fieldcat_alv.
      wa_fcat-tabname = 'ITAB_HEAD'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-seltext_m = 'Material'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB_HEAD'.
      wa_fcat-fieldname = 'WERKS'.
      wa_fcat-seltext_m = 'Plant'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB_ITEM'.
      wa_fcat-fieldname = 'MBLNR'.
      wa_fcat-seltext_m = 'Material Doc.'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB_ITEM'.
      wa_fcat-fieldname = 'MENGE'.
      wa_fcat-seltext_m = 'Quantity'.
      wa_fcat-do_sum = 'Y'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      subtot-spos = 1.
      subtot-fieldname = 'MATNR'.
      subtot-tabname = 'ITAB_HEAD'.
      subtot-up = 'X'.
      subtot-group = 'X'.
      subtot-subtot = 'X'.
      subtot-expa = 'X'.
      APPEND subtot TO gt_subtot.
    ENDFORM.                    "build_cat
    *&      Form  build_eve
          text
    FORM build_eve.
      DATA : wa_eve TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type           = 0
       IMPORTING
         et_events             = t_eve
      EXCEPTIONS
        LIST_TYPE_WRONG       = 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.
    READ TABLE t_eve INTO wa_eve WITH KEY name = 'TOP_OF_PAGE'.
    IF sy-subrc = 0.
       wa_eve-form = 'TOP_OF_PAGE'.
       MODIFY t_eve FROM wa_eve INDEX sy-tabix.
    ENDIF.
    ENDFORM.                    "build_eve
    *&      Form  get_data
          text
    FORM get_data.
      SELECT matnr werks mblnr menge FROM mseg INTO CORRESPONDING FIELDS OF
    TABLE itab_item
      WHERE matnr IN mat.
    ENDFORM.                    "get_data
    *&      Form  dis_data
          text
    FORM dis_data.
      key_info-header01 = 'MATNR'.
      key_info-item01 = 'MATNR'.
      key_info-header02 = 'WERKS'.
      key_info-item02 = 'WERKS'.
      key_info-header03 = 'MBLNR'.
      key_info-item03 = 'MBLNR'.
      key_info-header04 = 'MENGE'.
      key_info-item04 = 'MENGE'.
      REFRESH itab_head.
      LOOP AT itab_item.
        ON CHANGE OF itab_item-matnr OR itab_item-werks.
          MOVE-CORRESPONDING itab_item TO itab_head.
          APPEND itab_head.
        ENDON.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_callback_program             = 'ZHIER_ALV'
          i_callback_user_command        = 'USER_COMMAND'
          it_fieldcat                    = t_fcat
          it_sort                        = gt_subtot
          it_events                      = t_eve[]
          i_tabname_header               = 'ITAB_HEAD'
          i_tabname_item                 = 'ITAB_ITEM'
          is_keyinfo                     = key_info
        TABLES
          t_outtab_header                = itab_head
          t_outtab_item                  = itab_item
    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.                    "dis_data
    *&      Form  user_Command
          text
         -->U_COMM     text
         -->SELFIELD   text
    FORM user_command USING u_comm TYPE sy-ucomm selfield TYPE slis_selfield
      CASE u_comm.
        WHEN '&IC1'.
          READ TABLE itab_item INDEX selfield-tabindex.
          t_mtdoc = itab_item-mblnr.
          SET PARAMETER ID 'MBN' FIELD t_mtdoc.
          CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.                    "user_Command
    *&      Form  top_of_page
          text
    FORM top_of_page.
      CLEAR st_line.
      st_line-typ = 'H'.
      st_line-info = 'Krupa'.
      APPEND st_line TO t_listhead.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = t_listhead
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "top_of_page
    if it is use then give point

  • Need help in ALV grid editable cells

    Hi,
    I have created a ALV Grid program in which i made certain cells as editable cells.Now my question is if suppose i have 2 rows in my output then if i change the 2nd rows some cells, then some calculation has to perform till this it is fine but nw i want to modify the 3rd rows some cells as per the changes in 2nd row.
    How to do it with ALV oops concepts.
    I have refered BCALV_EDIT_02 and BCALV_EDIT_03 these std programs.
    Thanks & Regards
    Madhuri

    Hello Madhuri
    I recommend to do any post-processing of the changed data OUTSIDE your event handler method (HANDLE_DATA_CHANGED).
    Within the event handler method do all required validations and the trigger PAI by calling method CL_GUI_CFW=>SET_NEW_OK_CODE (for an example refer to my sample report ZUS_SDN_TWO_ALV_GRIDS in alv)
    Now at PAI of your screen you can do any kind of post-processing, calculation, etc. within the itab used for the ALV list.
    Regards
      Uwe

  • Reference field and table for AUFK for F4 help in alv.

    Hi All,
       I need to put F4 help on ALV for order no (AUFK) what is the reference field and table for that?
      i tried giving field as aufk and table as ccss but its not working.
       ls_fcat-ref_field = 'AUFNR'.
        ls_fcat-ref_table = 'CCSS'.
    Thanks & Regards,
    Ruchi Tiwari

    Hi,
    Try this.
    Set the f4 help for the field in the fieldcatalog
      ls_fcat-f4availabl = 'X'.
    1. Create a event of ONF4 for the alv grid.
    2. Set the event handler.
    3. Append the field for the F4 help in the internal table and call the below method
        CALL METHOD g_mprn->register_f4_for_fields
        EXPORTING
          it_f4 = i_f4.
    4. create a class definition and implementation
        refer sample pgms (BCALV_F4, BCALV_GRID_EDIT_DELTA and BCALV_GRID_EDIT)
    Hope this may be helpful.
    Regards,
    Sharin.

  • Nee help on ALV report for Total of BSEG-BUZEI & F1 document in FB03

    Hi friends,
    I need to diplay line items total & when double clicked on BELNR field it should open the F1 document in FB03.
    Could anyone plz guide me on this.
    Waiting for response.
    below is my code,
    Kindly needed help.
    REPORT  YALV_1.
    TABLES : BKPF,BSEG.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data : int_fcat type SLIS_T_FIELDCAT_ALV,
           fieldcatalog type slis_t_fieldcat_alv with header line.
    DATA:  wa_sortinfo TYPE slis_sortinfo_alv,
           i_sortcat TYPE slis_t_sortinfo_alv.
    TYPES  : BEGIN OF T_BKPF,
            BUKRS TYPE BKPF-BUKRS,
            BELNR TYPE BKPF-BELNR,
            GJAHR TYPE BKPF-GJAHR,
            BLART TYPE BKPF-BLART,
            BLDAT TYPE BKPF-BLDAT,
            BUDAT TYPE BKPF-BUDAT,
            END OF T_BKPF.
    types: begin of t_bseg,
           BUZEI TYPE BSEG-BUZEI,
           end of t_bseg.
    DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
          wa_bkpf TYPE t_bkpf,
           it_bseg type standard table of t_bseg.
          wa_bseg type t_bseg.
    field to store report name
    DATA :  i_repid like sy-repid.
    select bukrs belnr gjahr blart bldat budat from bkpf into table
    it_bkpf where blart = 'AA'.
    field to check table length
    *data i_lines like sy-tabix.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    PERFORM sortcat_init CHANGING i_sortcat.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but
    *can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such
    *as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'BUKRS'.
      fieldcatalog-seltext_m   = 'Company Code'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 4.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BELNR'.
      fieldcatalog-seltext_m   = 'Doc No'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'GJAHR'.
      fieldcatalog-seltext_m   = 'Fiscal Year'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLART'.
      fieldcatalog-seltext_m   = 'DOC Type'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLDAT'.
      fieldcatalog-seltext_m   = 'Doc Date'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUDAT'.
      fieldcatalog-seltext_m   = 'Popsting Date'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUZEI'.
      fieldcatalog-seltext_m   = 'Line Items'.
      fieldcatalog-col_pos     = 6.
      fieldcatalog-do_sum      = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    FORM sortcat_init CHANGING i_sortcat TYPE slis_t_sortinfo_alv.
      CLEAR wa_sortinfo.
      wa_sortinfo-fieldname = 'BUKRS'.
      wa_sortinfo-tabname = 'T_BKPF'.
      wa_sortinfo-spos = 1.            " First sort by this field.
      wa_sortinfo-up = 'X'.            "   Ascending
      wa_sortinfo-subtot = 'X'.        " Subtotal at Name1
      APPEND wa_sortinfo TO i_sortcat.
      CLEAR wa_sortinfo.
      wa_sortinfo-fieldname = 'BELNR'.
      wa_sortinfo-tabname = 'T_BKPF'.
      wa_sortinfo-spos = 2.            " Sec sort by this field.
      wa_sortinfo-up = 'X'.            "   Ascending
      wa_sortinfo-subtot = 'X'.        " Subtotal at Name1
      APPEND wa_sortinfo TO i_sortcat.
    ENDFORM.                    " sortcat_init
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      i_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = i_repid
               i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
               is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_sort                = i_sortcat
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = IT_BKPF
           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.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    form data_retrieval.
    IF it_bkpf[] IS NOT INITIAL.
       select buzei from bseg into
         table it_bseg for all entries in it_bkpf
         where bukrs = it_bkpf-bukrs
         and belnr = it_bkpf-belnr
         and gjahr = it_bkpf-gjahr.
         endif.
    endform.                    " DATA_RETRIEVAL.

    Hello
    1.
    form display_alv_report.
    i_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = i_repid
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat = fieldcatalog[]
    i_save = 'X'
    tables
    t_outtab = IT_BKPF
    exceptions
    program_error = 1
    others = 2.
    2.
    * FORM USER_COMMAND
    FORM user_command USING u_com LIKE sy-ucomm sel_lin TYPE slis_selfield.
    CASE u_com.
      WHEN '&IC1'. 
        CASE sel_lin.
          WHEN 'BELNR'.
          read TABLE IT_BKPF INDEX sel_lin-tabindex.
          SET PARAMETER ID 'BLN' FIELD IT_BKPF-BELNR.
          SET PARAMETER ID 'BUK' FIELD IT_BKPF-BUKRS.
          SET PARAMETER ID 'GJR' FIELD IT_BKPF-GJAHR.
          CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN. 
        ENDCASE.
    CLEAR u_com.
    ENDCASE.
    ENDFORM. "USER_COMMAND

  • Urgent........need help in report

    hi all,
    i need help in a report.
    the requirement is ,
    i need to create a report that will display the SO number in alv grid with check box.
    from the list, if i select the check box, it should
    •     Perform VA02, go to the item detail (Sales) (RECORDING)
    •     Update the SO line item’s Pricing Date to PGI Date
    HOW TO DO THIS.
    PLEASE HELP ME
    •     Interactive Report
    o     Report will generate a list of SO based on selection parameters
    o     User is able to choose all or partial records from the list of SO
    o     For the selected SO, user is able to perform one of the two functions:
    &#61607;     New Pricing based on Batch ID from Production Order
    &#61607;     New Pricing based on PGI Date
    o     The result of the updating is displayed on the screen
    &#61607;     SO updated with success
    &#61607;     SO not updated due to error

    Hi,
    Check this SD MODULE alv intereactive report.
    Hope it may helps u.
    REPORT  YMS_ALVINTER.
    *& tables declaration
    TABLES: VBRK,VBRP.
    *& type-pools declaration
    TYPE-POOLS: SLIS.
    *& data declaration
    DATA: G_REPID TYPE SY-REPID.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara
    WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
    WA_EVENT TYPE SLIS_ALV_EVENT,
    T_EVENT TYPE SLIS_T_EVENT.
    DATA: V_VBELN LIKE VBRK-VBELN,
    V_MATNR LIKE VBRP-MATNR.
    DATA: BEGIN OF IT_VBRK OCCURS 0,
    VBELN LIKE VBRK-VBELN,
    WAERK LIKE VBRK-WAERK,
    VKORG LIKE VBRK-VKORG,
    FKDAT LIKE VBRK-FKDAT,
    BUKRS LIKE VBRK-BUKRS,
    NETWR LIKE VBRK-NETWR,
    END OF IT_VBRK.
    DATA: BEGIN OF IT_VBRP OCCURS 0,
    VBELN LIKE VBRP-VBELN,
    POSNR LIKE VBRP-POSNR,
    FKIMG LIKE VBRP-FKIMG,
    VRKME LIKE VBRP-VRKME,
    NETWR LIKE VBRP-NETWR,
    MATNR LIKE VBRP-MATNR,
    ARKTX LIKE VBRP-ARKTX,
    END OF IT_VBRP.
    *& selection screen
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
    S_FKDAT FOR VBRK-FKDAT,
    S_MATNR FOR VBRP-MATNR.
    SELECTION-SCREEN END OF BLOCK B.
    **INITIALIZATION.
    INITIALIZATION.
      G_REPID = SY-REPID.
      S_FKDAT-LOW = SY-DATUM - 200.
      S_FKDAT-HIGH = SY-DATUM.
      APPEND S_FKDAT.
    ***AT SELECTION-SCREEN.
    AT SELECTION-SCREEN.
      IF NOT S_VBELN IS INITIAL.
        SELECT SINGLE VBELN FROM VBRK
        INTO V_VBELN
        WHERE VBELN IN S_VBELN.
        IF SY-SUBRC <> 0.
          MESSAGE E001(ZZ2).
        ENDIF.
      ENDIF.
      IF NOT S_MATNR IS INITIAL.
        SELECT SINGLE MATNR FROM MARA
        INTO V_MATNR
        WHERE MATNR IN S_MATNR.
        IF SY-SUBRC <> 0.
          MESSAGE E001(ZZ2).
        ENDIF.
      ENDIF.
    ***START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM GET_DATA_VBRK.
    *& Form GET_DATA_VBRK
    text
    --> p1 text
    <-- p2 text
    FORM GET_DATA_VBRK .
      SELECT VBELN
      WAERK
      VKORG
      FKDAT
      BUKRS
      NETWR
      INTO TABLE IT_VBRK
      FROM VBRK
      WHERE VBELN IN S_VBELN
      AND FKDAT IN S_FKDAT.
    ENDFORM. " GET_DATA_VBRK
    *& Form GET_DATA_VBRP
    text
    --> p1 text
    <-- p2 text
    FORM GET_DATA_VBRP .
      SELECT VBELN
      POSNR
      FKIMG
      VRKME
      NETWR
      MATNR
      ARKTX
      FROM VBRP
      INTO TABLE IT_VBRP
      WHERE VBELN = IT_VBRK-VBELN.
    ENDFORM. " GET_DATA_VBRP
    ***END-OF-SELECTION.
    END-OF-SELECTION.
      PERFORM EVENT_LIST.
      PERFORM GET_FIELD_CATALOG.
      PERFORM LIST_DISP .
    *&      Form  list_disp
          text
    FORM LIST_DISP .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
      I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = 'POPUP'
      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT = WA_LAYOUT
      IT_FIELDCAT = IT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
      TABLES
      T_OUTTAB = IT_VBRK
      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. " LIST_DISP
    *& Form GET_FIELD_CATALOG
    text
    --> p1 text
    <-- p2 text
    FORM GET_FIELD_CATALOG .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
      I_PROGRAM_NAME = G_REPID
      I_INTERNAL_TABNAME = 'IT_VBRK'
    I_STRUCTURE_NAME =
    I_CLIENT_NEVER_DISPLAY = 'X'
      I_INCLNAME = G_REPID
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
      CHANGING
      CT_FIELDCAT = IT_FIELDCAT
      EXCEPTIONS
      INCONSISTENT_INTERFACE = 1
      PROGRAM_ERROR = 2
      OTHERS = 3
      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. " GET_FIELD_CATALOG
    *& Form event_list
    text
    --> p1 text
    <-- p2 text
    FORM EVENT_LIST .
      CLEAR WA_EVENT.
      WA_EVENT-NAME = 'USER_COMMAND'.
      WA_EVENT-FORM = 'USER_COMMAND'.
      APPEND WA_EVENT TO T_EVENT.
      CLEAR WA_EVENT.
    ENDFORM. " event_list
    *&      Form  user_command
          text
         -->R_UCOMM    text
         -->RS_SELFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
          PERFORM GET_DATA_VBRP.
          PERFORM BUILD_FIELDCATALOG_VBRP .
          PERFORM DISPLAY_ALV_VBRP.
      ENDCASE.
    ENDFORM.                    "user_command
    *& Form BUILD_FIELDCATALOG_VBRP
    text
    --> p1 text
    <-- p2 text
    FORM BUILD_FIELDCATALOG_VBRP .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
      I_PROGRAM_NAME = G_REPID
      I_INTERNAL_TABNAME = 'IT_VBRP'
    I_STRUCTURE_NAME =
    I_CLIENT_NEVER_DISPLAY = 'X'
      I_INCLNAME = G_REPID
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
      CHANGING
      CT_FIELDCAT = IT_FIELDCAT
      EXCEPTIONS
      INCONSISTENT_INTERFACE = 1
      PROGRAM_ERROR = 2
      OTHERS = 3
      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. " BUILD_FIELDCATALOG_VBRP
    *& Form DISPLAY_ALV_VBRP
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_ALV_VBRP .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
      I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
      IT_FIELDCAT = IT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
      TABLES
      T_OUTTAB = IT_VBRP
      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. " DISPLAY_ALV_VBRP
    Thanks,
    Shankar

Maybe you are looking for

  • Creating java mappings

    Hi Experts, Is there any tool available for creating java mappings in XI given a source and target message. I have seen for XSLT mappings there is a tool called stylus studio, which has some kind of graphical tool to create the XSLT mapping between a

  • MM Related User Exits

    Hi, When i want to search for a particular user exit related to Purchasing, Inventory Management and Invoice Verification. Where can i find them ? ie Menu Path Or anyother simple search strategy is possible. Regards, R. Dillibabu.

  • Orders on credit block for multiple times

    Released documents are unchecked is set up deviation of 5 % and no of days 30 in OVA8 and use static credit check. customer is over the credit limit, when i create an order will go on credit block. After first release, if i change any other fields su

  • I have the original iPad. It is crashing often. What can I do? It is updated as far as possible.

    My original iPad, updated to the max, is crashing often. What can I do?

  • Is it possible to turn off the wireless networking feature?

    As I don't want to have a wireless hotspot 24/7 at my place and would prefer to conserve power when that function isn't needed, I'd like to know if the Time Capsules allow users to turn the wi-fi broadcasting on and off. Or is it just an always-on ki