My question is related to alv

hi friends..............
       i want to know whether it is possible to create a dialog box on the front of alv grid which is open with a new table alv grid
    by just clicking on one of the cell of a current alv grid screen.................
    if any dont understand my question then let me know by reply in this thread................
thanks friend..............

anything is possble besides the impossible ones )
you are lucky since your problem is first category. You can code an eventhandler for your ALV and add on-click events.
Probably on a column.
Now you just have to define the coding for the event, which can be anything, in your case probably a "CALL SCREEN XXXX".
if you now need to display an ALV on that screen you need to implement the coding for that somewhere in PBO of your new screen that you call on click of desired column.

Similar Messages

  • Questions in relation to iPod nano

    Hi,
    I have a few questions in relation the 5th generation iPod nano and I was hoping to find answers to them here.
    *Voice Memo*
    1. Are there any limitations imposed on the nano's voice memo functionality?
    For instance, does the nano record up to a predetermined number of minutes (say 30 minutes) or until the recording's file size reaches a particular threshold (say 100 MB)?
    Is this the case or are you only limited by how much free space you have on the device?
    2. Have people found the built-in mic to be a decent one or have they found themselves needing to purchase an external accessory to enhance the recording's audio quality.
    Radio
    This might be a silly questions, but Apple's website states that the latest nano has a built-in FM antenna. Does that mean you cannot get AM radio stations on the device?
    Thanks,
    Message was edited by: Infinite Lupe

    Hello Infinite Lupe,
    1. Are there any limitations imposed on the nano's voice memo functionality?
    Yes. Once the recording has reached the two mark the iPod automatically starts a new recording that again will go for two hours. However, this is limited as well to the amount of space remaining on your iPod as well. For more information see pages 74 - 76 of the iPod's *User Guide* which I provided below.
    2. Have people found the built-in mic to be a decent one or have they found themselves needing to purchase an external accessory to enhance the recording's audio quality.
    From my experiences the built-in microphone does just fine whether its being used for recording voice memos or videos.
    This might be a silly questions, but Apple's website states that the latest nano has a built-in FM antenna. Does that mean you cannot get AM radio stations on the device?
    Correct.
    For more information, see the iPod's User Guide.
    [iPod Nano 5th Generation User Guide|http://manuals.info.apple.com/enUS/iPod_nano_5th_genUserGuide.pdf]
    B-rock

  • HT5557 hello...my questions is related to objective C...Is it possible to display name of the person who is calling me whose number is saved in my local database but not in iphone contacts ?.

    hello...my questions is related to objective C..
    Is it possible to display name of the person who is calling me whose number is saved in my local database but not in iphone contacts ?.

    ashish35,
    No one from Apple here - we're just users like you. All I can tell you is that electronic fail and with MacBook Pros (and most notebooks) the components are so integrated as to make a repair to the logic board practically impossible, hence the high prices charged for repairs.
    Only you can decide if you want to have your computer repaired or put the money towards the purchase of a new computer. If you do decide to purchase a new unit I would suggest that you also purchase the AppleCare Protection Plan which increases your warranty from one year to three years.
    Sorry and good luck,
    Clinton

  • Material  relating to ALV

    Hi folks,
    plz send me the material relating to ALV, to my mail id [email protected]
    it's very urgent.
    Thanks & Regards
    pabitra

    Hi,
    I am sending sample program for alv.
    Kindly check it.
    REPORT:
    REPORT  YMS_COLOURALV NO STANDARD PAGE HEADING.
    TYPE-POOLS: SLIS, ICON.
    DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: BEGIN OF IMARA OCCURS 0,
              LIGHT(4) TYPE C,
              MATNR TYPE MARA-MATNR,
              MTART TYPE MARA-MTART,
              MAKTX TYPE MAKT-MAKTX,
              COLOR_LINE(4) TYPE C,
              TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,  "cell
          END OF IMARA.
    DATA: XCOLOR TYPE SLIS_SPECIALCOL_ALV.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM WRITE_REPORT.
    Get_Data
    FORM GET_DATA.
      WRITE ICON_GREEN_LIGHT AS ICON TO IMARA-LIGHT.
          IMARA-MATNR = 'ABC'.
          IMARA-MTART = 'ZCFG'.
          IMARA-MAKTX = 'This is description for ABC'.
      APPEND IMARA.
      WRITE ICON_YELLOW_LIGHT AS ICON TO IMARA-LIGHT.
          IMARA-MATNR = 'DEF'.
          IMARA-MTART = 'ZCFG'.
          IMARA-MAKTX = 'This is description for DEF'.
      APPEND IMARA.
      WRITE ICON_RED_LIGHT AS ICON TO IMARA-LIGHT.
          IMARA-MATNR = 'GHI'.
          IMARA-MTART = 'ZCFG'.
          IMARA-MAKTX = 'This is description for GHI'.
      APPEND IMARA.
      LOOP AT IMARA.
        IF SY-TABIX = 1.
          IMARA-COLOR_LINE = 'C410'.     " color line
        ENDIF.
        IF SY-TABIX = 2.                "  color CELL
          CLEAR XCOLOR.
          XCOLOR-FIELDNAME = 'MTART'.
          XCOLOR-COLOR-COL = '3'.
          XCOLOR-COLOR-INT = '1'.       " Intensified on/off
          XCOLOR-COLOR-INV = '0'.
          APPEND XCOLOR TO IMARA-TCOLOR.
        ENDIF.
        MODIFY IMARA.
      ENDLOOP.
    ENDFORM.                    "get_data
    WRITE_REPORT
    FORM WRITE_REPORT.
      DATA: LAYOUT TYPE  SLIS_LAYOUT_ALV.
      LAYOUT-COLTAB_FIELDNAME = 'TCOLOR'.
      LAYOUT-INFO_FIELDNAME = 'COLOR_LINE'.
      PERFORM BUILD_FIELD_CATALOG.
    CALL ABAP LIST VIEWER (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          IS_LAYOUT   = LAYOUT
          IT_FIELDCAT = FIELDCAT
        TABLES
          T_OUTTAB    = IMARA.
    ENDFORM.                    "write_report
    BUILD_FIELD_CATALOG
    FORM BUILD_FIELD_CATALOG.
      DATA: FC_TMP TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
      CLEAR: FIELDCAT. REFRESH: FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Status'.
      FC_TMP-FIELDNAME  = 'LIGHT'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '4'.
      FC_TMP-ICON       = 'X'.
      APPEND FC_TMP TO FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Material Number'.
      FC_TMP-FIELDNAME  = 'MATNR'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '18'.
      APPEND FC_TMP TO FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Material Type'.
      FC_TMP-FIELDNAME  = 'MTART'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '10'.
      APPEND FC_TMP TO FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Material'.
      FC_TMP-FIELDNAME  = 'MAKTX'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '40'.
      FC_TMP-EMPHASIZE = 'C610'.   " color column
      APPEND FC_TMP TO FIELDCAT.
    ENDFORM.                    "build_field_catalog
    Thanks,
    Shankar

  • Hi Question Related To  ALV'S

    Hi  Abapers ,
                             I am having a requirement the which are displayed in the first ALV needed to be selected and to be displayed in the Second ALV , this is code which i have written ....... the check-box is not updating ....
    TYPE-POOLS:SLIS.
    TABLES:KNA1,VBAK.
    PARAMETERS:P_KUNNR TYPE KNA1-kunnr.
    TYPES:BEGIN OF TY_VBAK,
          CHECK TYPE C,
          VBELN TYPE VBELN_VA,
          ERDAT TYPE ERDAT,
          ERZET TYPE ERZET,
          ERNAM TYPE ERNAM,
          ANGDT TYPE ANGDT_V,
          BNDDT TYPE BNDDT,
          AUDAT TYPE AUDAT,
          VBTYP TYPE VBTYP,
          END OF TY_VBAK.
    TYPES:TY_T_VBAK TYPE STANDARD TABLE OF TY_VBAK.
    DATA:T_VBAK TYPE STANDARD TABLE OF TY_VBAK ,
         W_VBAK TYPE  TY_VBAK ,
         T_FIELDCAT TYPE slis_t_fieldcat_alv ,
         W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
         W_LAYOUT   TYPE SLIS_LAYOUT_ALV,
         T_VBAK1 TYPE STANDARD TABLE OF TY_VBAK.
    FORM set_pf_status USING extab TYPE slis_t_extab.
    SET PF-STATUS 'Y1VBAK'.
    ENDFORM.
    FORM USER_COMMAND USING U_COMM TYPE SY-UCOMM CHANGING SEL_FIELD TYPE SLIS_SELFIELD.
    CASE U_COMM.
    WHEN 'KEY'.
    LOOP AT T_VBAK INTO W_VBAK  WHERE  CHECK = 'X'.
    APPEND W_VBAK TO T_VBAK1.
    CLEAR W_VBAK.
    ENDLOOP.
    IF T_VBAK1 IS NOT INITIAL.
    PERFORM ALVLIST_DISPLAY1.
    ENDIF.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDFORM.
    START-OF-SELECTION.
    PERFORM SUB_FIELDCAT.
    SELECT VBELN
           ERDAT
           ERZET
           ERNAM
           ANGDT
           BNDDT
           AUDAT
           VBTYP
           FROM
           VBAK INTO CORRESPONDING FIELDS OF
           TABLE T_VBAK WHERE KUNNR = P_KUNNR.
    END-OF-SELECTION.
    PERFORM ALVLIST_DISPLAY.
    ***&      Form  SUB_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_FIELDCAT .
    CLEAR:W_FIELDCAT.
    *W_FIELDCAT-col_pos = '1'.
    *W_FIELDCAT-fieldname = 'ICON'.
    *W_FIELDCAT-seltext_l = 'Status'.
    *W_FIELDCAT-icon = 'X'.
    *APPEND W_FIELDCAT TO t_fieldcat.
    W_FIELDCAT-col_pos = '1' .
    W_FIELDCAT-fieldname = 'CHECK'.
    W_FIELDCAT-CHECKBOX = 'X'.
    W_FIELDCAT-tabname = 'T_VBAK'.
    W_FIELDCAT-edit = 'X'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '2' .
    W_FIELDCAT-fieldname = 'VBELN'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '3' .
    W_FIELDCAT-fieldname = 'ERDAT'.
    W_FIELDCAT-no_out = 'X'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '4' .
    W_FIELDCAT-fieldname = 'ERZET'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '5' .
    W_FIELDCAT-fieldname = 'ERNAM'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '6' .
    W_FIELDCAT-fieldname = 'ANGDT'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '7' .
    W_FIELDCAT-fieldname = 'BNDDT'.
    W_FIELDCAT-edit = 'X'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '8' .
    W_FIELDCAT-fieldname = 'AUDAT'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_FIELDCAT-col_pos = '9' .
    W_FIELDCAT-fieldname = 'VBTYP'.
    APPEND W_FIELDCAT TO T_FIELDCAT.
    CLEAR:W_FIELDCAT.
    W_layout-box_fieldname = 'CHECK'.
    *W_LAYOUT-edit  = 'X'.
    ENDFORM.                    " SUB_FIELDCAT
    FORM ALVLIST_DISPLAY.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                = SY-REPID
        I_CALLBACK_PF_STATUS_SET          =  'SET_PF_STATUS'
        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                         = W_LAYOUT
        IT_FIELDCAT                       = T_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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = T_VBAK
    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.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_PF_STATUS_SET       = 'Y1VBAK'
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
       IT_FIELDCAT                    =  T_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
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
    TABLES
       T_OUTTAB                       = T_VBAK
    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.                    " ALVLIST_DISPLAY
    FORM ALVLIST_DISPLAY1.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                = SY-REPID
        I_CALLBACK_PF_STATUS_SET          =  'SET_PF_STATUS'
        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                         = W_LAYOUT
        IT_FIELDCAT                       = T_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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = T_VBAK1
    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.
    Thanks & Regards
    Bhaskar Rao.M

    Hi Bhaskar,
    Check the sample code below and compare it with u r code...
    Just set the PF-STATUS...
    TYPE-POOLS: SLIS.
    DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           FIELDCAT_LN LIKE LINE OF FIELDCAT,
           SORTCAT          TYPE SLIS_T_SORTINFO_ALV,
           LAYOUT           TYPE SLIS_LAYOUT_ALV,
           SORTCAT_LN       LIKE LINE OF SORTCAT,
           EVENTCAT         TYPE SLIS_T_EVENT,
           EVENTCAT_LN      LIKE LINE OF EVENTCAT,
           COUNT TYPE I,
            COLCELL TYPE SLIS_FIELDNAME VALUE 'MATNR'.
    DATA: COL_POS TYPE I,
            W_FNAME TYPE DD03L-FIELDNAME.
    ******Declare Data Areas for List Viewer (End)**************
    ******Declare Internal Table to Store Selected Data (Begin)*
    DATA LS_CELLCOLOR TYPE SLIS_T_SPECIALCOL_ALV  WITH HEADER LINE.
    DATA:  BEGIN OF TSPFLI OCCURS 10 ,
              CHECK TYPE SLIS_FIELDNAME,
              COLOR(3),
              COLCELLS TYPE SLIS_T_SPECIALCOL_ALV.
             INCLUDE STRUCTURE SPFLI.
    DATA : END OF TSPFLI.
    *Declare Internal Table to Store Selected Data (Begin) For sflight*
    DATA:
       W_SPFLI LIKE LINE OF TSPFLI.
    DATA : BEGIN OF FS_SFLIGHT,
              CHECK TYPE SLIS_FIELDNAME,
              COLOR(3).
             INCLUDE STRUCTURE SFLIGHT.
    DATA : END OF FS_SFLIGHT.
    DATA
       T_SFLIGHT LIKE
        STANDARD TABLE
              OF FS_SFLIGHT.
    *Declare Internal Table to Store Selected Data (Begin) For sbook*
    DATA:
    W_SFLIGHT LIKE LINE OF T_SFLIGHT.
    DATA : BEGIN OF FS_SBOOK,
              CHECK TYPE SLIS_FIELDNAME.
             INCLUDE STRUCTURE SBOOK.
    DATA : END OF FS_SBOOK.
    DATA
       T_SBOOK LIKE
        STANDARD TABLE
              OF FS_SBOOK.
    ******Declare Internal Table to Store Selected Data (End)***
    *******Select Data into Internal Table (Begin) ***************
    SELECT *
             INTO CORRESPONDING FIELDS OF TSPFLI
            FROM SPFLI.
       APPEND TSPFLI.
       CLEAR TSPFLI.
    ENDSELECT.
    Select Data into Internal Table (End) ****************
    PERFORM BUILD_FIELDCAT4.
    PERFORM BUILD_FIELDCAT6.
    PERFORM BUILD_FIELDCAT7.
    PERFORM BUILD_LISTCAT.
    PERFORM BUILD_EVENTCAT.
    PERFORM START_LIST_VIEWER.
    *&      Form  build_fieldcat4
          text
    FORM BUILD_FIELDCAT4.
       FIELDCAT_LN-FIELDNAME = 'CHECK'.
       APPEND FIELDCAT_LN TO FIELDCAT.
       CLEAR FIELDCAT_LN.
    ENDFORM.                    "BUILD_FIELDCAT4
    *&      Form  build_fieldcat6
          text
    FORM BUILD_FIELDCAT6.
       FIELDCAT_LN-FIELDNAME = 'COLOR'.
       FIELDCAT_LN-OUTPUTLEN = 4.
       APPEND FIELDCAT_LN TO FIELDCAT.
       CLEAR FIELDCAT_LN.
    ENDFORM.                    "build_fieldcat6
    *&      Form  BUILD_FIELDCAT7
          text
    FORM BUILD_FIELDCAT7.
       FIELDCAT_LN-FIELDNAME = 'COLCELLS'.
       APPEND FIELDCAT_LN TO FIELDCAT.
       CLEAR FIELDCAT_LN.
    ENDFORM.                    "build_fieldcat6
    *&      Form  build_listcat
          text
    FORM BUILD_LISTCAT.
       LAYOUT-BOX_FIELDNAME    = 'CHECK'.
       LAYOUT-INFO_FIELDNAME   = 'COLOR'.
       LAYOUT-COLTAB_FIELDNAME = 'COLCELLS'.
    ENDFORM.                    "build_listcat
    *&      Form  BUILD_EVENTCAT
          text
    FORM BUILD_EVENTCAT.
       EVENTCAT_LN-NAME = 'PF_STATUS_SET'.
       EVENTCAT_LN-FORM = 'STATUSSET'.
       APPEND EVENTCAT_LN TO EVENTCAT.
       EVENTCAT_LN-NAME = 'USER_COMMAND'.
       EVENTCAT_LN-FORM = 'USERCOMM'.
       APPEND EVENTCAT_LN TO EVENTCAT.
    ENDFORM.                    "BUILD_EVENTCAT
    *&      Form  STATUSSET
          text
         -->RT_EXTAB   text
    FORM STATUSSET
        USING RT_EXTAB TYPE SLIS_T_EXTAB.
       DATA
         W_EXTAB TYPE SLIS_EXTAB.
       CLEAR RT_EXTAB[].
       W_EXTAB-FCODE = 'SBOOK'.
       APPEND W_EXTAB TO RT_EXTAB.
       SET PF-STATUS 'STATUS' EXCLUDING RT_EXTAB.
    ENDFORM.                    "STATUSSET
    *&      Form  START_LIST_VIEWER
          text
    FORM START_LIST_VIEWER.
       DATA: PGM LIKE SY-REPID.
       PGM = SY-REPID.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
              I_CALLBACK_PROGRAM       = PGM
              i_callback_pf_status_set = ' '
            I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
                I_STRUCTURE_NAME         = 'SPFLI'
                  IS_LAYOUT                = LAYOUT
              IS_VARIANT               = ' '
                IT_EVENTS                = EVENTCAT
              IT_EVENT_EXIT            =
            TABLES
                 T_OUTTAB                 = TSPFLI
            EXCEPTIONS
                 PROGRAM_ERROR            = 1
                 OTHERS                   = 2.
    ENDFORM.                    "START_LIST_VIEWER
    *&      Form  USERCOMM
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM USERCOMM USING UCOMM LIKE SY-UCOMM
                         SELFIELD TYPE SLIS_SELFIELD.
       CLEAR FIELDCAT[].
       CASE UCOMM.
         WHEN 'SFLIGHT'.
           CLEAR T_SFLIGHT[].
           LOOP AT TSPFLI INTO W_SPFLI.
             IF W_SPFLI-CHECK EQ 'X'.
               SELECT *
                 FROM SFLIGHT
            APPENDING CORRESPONDING FIELDS OF TABLE T_SFLIGHT
                WHERE CARRID = W_SPFLI-CARRID
                  AND CONNID = W_SPFLI-CONNID.
               W_SPFLI-CHECK = '1'.
               W_SPFLI-COLOR = 'C21'.
               MODIFY TSPFLI FROM W_SPFLI TRANSPORTING CHECK COLOR.
             ENDIF.
           ENDLOOP.
           PERFORM BUILD_FIELDCAT9.
           PERFORM BUILD_EVENTCAT1.
           PERFORM START_LIST_VIEWER1.
       ENDCASE.
       SELFIELD-REFRESH = 'X'.
    ENDFORM.                    "USERCOMM
    *&      Form  START_LIST_VIEWER1
          text
    FORM START_LIST_VIEWER1.
       DATA: PGM LIKE SY-REPID.
       PGM = SY-REPID.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_INTERFACE_CHECK              = ' '
           I_CALLBACK_PROGRAM             = PGM
          I_CALLBACK_PF_STATUS_SET       = ' '
          I_CALLBACK_USER_COMMAND        = ' '
          I_STRUCTURE_NAME               = 'SFLIGHT'
                IS_LAYOUT                = LAYOUT
           IT_FIELDCAT                    = FIELDCAT
          IT_SORT                        =
           IT_EVENTS                      =  EVENTCAT
         TABLES
           T_OUTTAB                       = T_SFLIGHT
        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.                    "START_LIST_VIEWER1
    *&      Form  BUILD_EVENTCAT1
          text
    FORM BUILD_EVENTCAT1.
       CLEAR EVENTCAT[].
       EVENTCAT_LN-NAME = 'PF_STATUS_SET'.
       EVENTCAT_LN-FORM = 'STATUSSET1'.
       APPEND EVENTCAT_LN TO EVENTCAT.
       CLEAR EVENTCAT_LN.
       EVENTCAT_LN-NAME = 'USER_COMMAND'.
       EVENTCAT_LN-FORM = 'USERCOMM1'.
       APPEND EVENTCAT_LN TO EVENTCAT.
    ENDFORM.                    "BUILD_EVENTCAT
    *&      Form  STATUSSET1
          text
         -->RT_EXTAB   text
    FORM STATUSSET1
        USING RT_EXTAB TYPE SLIS_T_EXTAB.
       DATA
         W_EXTAB TYPE SLIS_EXTAB.
       CLEAR RT_EXTAB[].
       W_EXTAB-FCODE = 'SFLIGHT'.
       APPEND  W_EXTAB TO RT_EXTAB.
       SET PF-STATUS 'STATUS' EXCLUDING RT_EXTAB.
    ENDFORM.                    "STATUSSET
    *.................................USERCOMM1..................
    FORM USERCOMM1 USING UCOMM LIKE SY-UCOMM
                         SELFIELD TYPE SLIS_SELFIELD.
       CLEAR FIELDCAT[].
       CASE UCOMM.
         WHEN 'SBOOK'.
           CLEAR T_SBOOK[].
           LOOP AT T_SFLIGHT INTO W_SFLIGHT.
             IF W_SFLIGHT-CHECK EQ 'X'.
               SELECT *
                 FROM SBOOK
            APPENDING CORRESPONDING FIELDS OF TABLE T_SBOOK
                WHERE CARRID = W_SFLIGHT-CARRID
                  AND CONNID = W_SFLIGHT-CONNID
               AND FLDATE = W_SFLIGHT-FLDATE.
               W_SFLIGHT-CHECK = '1'.
               W_SFLIGHT-COLOR = 'C81'.
               MODIFY T_SFLIGHT FROM W_SFLIGHT TRANSPORTING CHECK COLOR.
             ENDIF.
           ENDLOOP.
           PERFORM BUILD_FIELDCAT9.
           PERFORM BUILD_EVENTCAT2.
           PERFORM START_LIST_VIEWER2.
       ENDCASE.
       SELFIELD-REFRESH = 'X'.
    ENDFORM.                                                   " USERCOMM1
    *&      Form  BUILD_FIELDCAT9
          text
    FORM BUILD_FIELDCAT9.
       CLEAR FIELDCAT[].
       FIELDCAT_LN-FIELDNAME = 'CHECK'.
       APPEND FIELDCAT_LN TO FIELDCAT.
       CLEAR FIELDCAT_LN.
       LAYOUT-BOX_FIELDNAME    = 'CHECK'.
    ENDFORM.                    "BUILD_FIELDCAT8
    *&      Form  START_LIST_VIEWER2
          text
    FORM START_LIST_VIEWER2.
       DATA: PGM LIKE SY-REPID.
       PGM = SY-REPID.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_INTERFACE_CHECK              = ' '
          I_BYPASSING_BUFFER             =
          I_BUFFER_ACTIVE                = ' '
           I_CALLBACK_PROGRAM             = PGM
          I_CALLBACK_PF_STATUS_SET       = ' '
          I_CALLBACK_USER_COMMAND        = ' '
          I_STRUCTURE_NAME               = 'SBOOK'
           IS_LAYOUT                      = LAYOUT
           IT_FIELDCAT                    = FIELDCAT
          IT_SORT                        =
          IT_FILTER                      =
          IS_SEL_HIDE                    =
           IT_EVENTS                      = EVENTCAT
         TABLES
           T_OUTTAB                       = T_SBOOK
        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.                    "START_LIST_VIEWER1
    *&      Form  BUILD_EVENTCAT2
          text
    FORM BUILD_EVENTCAT2.
       CLEAR EVENTCAT[].
       EVENTCAT_LN-NAME = 'PF_STATUS_SET'.
       EVENTCAT_LN-FORM = 'STATUSSET2'.
       APPEND EVENTCAT_LN TO EVENTCAT.
    ENDFORM.                    "BUILD_EVENTCAT
    *&      Form  STATUSSET1
          text
         -->RT_EXTAB   text
    FORM STATUSSET2
        USING RT_EXTAB TYPE SLIS_T_EXTAB.
       DATA
         W_EXTAB TYPE SLIS_EXTAB.
       CLEAR RT_EXTAB[].
       W_EXTAB-FCODE = 'SFLIGHT'.
       APPEND  W_EXTAB TO RT_EXTAB.
       W_EXTAB-FCODE = 'SBOOK'.
       APPEND  W_EXTAB TO RT_EXTAB.
       SET PF-STATUS 'STATUS' EXCLUDING RT_EXTAB.
    ENDFORM.                    "STATUSSET
    Reward if it is helpful...
    Regards,
    Omkar..
    Message was edited by:
            Omkaram Yanamala

  • Query related to alv grid and sap script

    Hi All,
    I have a requirement where i should read the values which are selected on the alv grid list output and those values i need to display on the script(layout).
    Help me out guru's its an urgency...
    thanks in advance .
    regards
    ravi ganji

    Hi Ravi,
    I have done it exactly like your requirement. This program contains ALV and Smartform.
    But whatever may be, both are layouts and having driver program. So just finish your driver program and Script layout and then use this program.
    I have written this code to print contact letters from VA42. So, modify this code to insert your transaction code.
    Let me know if you have any questions.
    Here is the code.
    REPORT ILETTER MESSAGE-ID CM.
    TYPE POOLS (ALV)
      TYPE-POOLS:
                slis.
    Customized Types
      TYPES:
            BEGIN OF ty_cntrt,
              box(1)   TYPE c,
              kunnr    TYPE kunag,
              vbeln    TYPE vbeln_va,
              vbeln1   TYPE vbeln_va,
              vposn    TYPE posnr,
              vuntdat  TYPE vudat_veda,
              vbegdat  TYPE vbdat_veda,
              vdemdat  TYPE vddat_veda,
              venddat  TYPE vndat_veda,
            END   OF ty_cntrt,
          single line TYPES
            BEGIN OF ty_vkorg,
             vkorg    TYPE vkorg,
            END   OF ty_vkorg.
    Constants
      CONSTANTS:
         c_sform  TYPE char10             VALUE 'SMARTFORMS',
         c_tcode  TYPE sy-tcode           VALUE 'VA42',
         c_mode   TYPE c                  VALUE 'N',
         c_updat  TYPE c                  VALUE 'A',
         c_batch  TYPE sy-callr           VALUE 'BATCH',
         c_dclick TYPE char10             VALUE '&IC1'.
    Internal tables
      DATA: it_cntrt TYPE TABLE OF ty_cntrt,
            it_bdc   TYPE TABLE OF bdcdata,
            it_mesg  TYPE TABLE OF bdcmsgcoll,
            it_const TYPE TABLE OF /SIE/SSG_XCM_CUC,
            it_vkorg TYPE TABLE OF ty_vkorg.
    Work areas
      DATA: wa_cntrt TYPE ty_cntrt,
            wa_bdc   TYPE bdcdata,
            wa_const TYPE /SIE/SSG_XCM_CUC,
            w_vbak   TYPE vbak,
            w_veda   TYPE veda,
            w_xcm_pr TYPE /sie/ssg_xcm_pr,
            w_vkorg  TYPE ty_vkorg.
    Variables
      DATA: l_repid    TYPE sy-repid,
            l_vakey    TYPE vakey,
            l_variant  TYPE varid-variant,
            l_vbeln    TYPE i,
            l_vkorg    TYPE i,
            l_vkbur    TYPE i,
            l_vkgrp    TYPE i,
            l_ckappl(40)   TYPE c,
            l_ckschl(40)   TYPE c,
            l_cauart(40)   TYPE c.
    Program Constants
      DATA: c_kappl    TYPE kappl,
            c_kschl    TYPE kschl,
            c_auart    TYPE auart,
            c_repco    TYPE /sie/ssg_xcm_const,
            c_value    TYPE /sie/ssg_xcm_value.
    ALV data declarations
      DATA:
          gt_fieldcat  TYPE slis_t_fieldcat_alv,
          gt_tab_group TYPE slis_t_sp_group_alv,
          gs_layout    TYPE slis_layout_alv,
          gs_repid     TYPE sy-repid,
          gs_sort      TYPE TABLE OF slis_sortinfo_alv.
    Selection screen
      SELECTION-SCREEN BEGIN OF BLOCK indletter WITH FRAME TITLE text-001.
      skip one line
        SELECTION-SCREEN SKIP.
        SELECT-OPTIONS:
                     contract
                       so_vbeln FOR w_vbak-vbeln,
                     category
                       so_auart FOR w_vbak-auart NO-DISPLAY,
                     Sales Org
                       so_vkorg FOR w_vbak-vkorg OBLIGATORY,
                     Dis Channel
                       so_vtweg FOR w_vbak-vtweg,
                     Division
                       so_spart FOR w_vbak-spart,
                     Sales Group
                       so_vkgrp FOR w_vbak-vkgrp,
                     Sales Office
                       so_vkbur FOR w_vbak-vkbur OBLIGATORY,
                     Cancellation Procedure
                       so_vkues FOR w_veda-vkuesch OBLIGATORY,
                     Contract Signed Date
                       so_vuntd FOR w_veda-vuntdat,
                     created by
                       so_ernam FOR w_vbak-ernam,
                     Fixed Indexation formula
                       so_fnum  FOR w_xcm_pr-fnum OBLIGATORY.
      skip one line
        SELECTION-SCREEN SKIP.
      Indexation letter
        PARAMETERS: rb_index  RADIOBUTTON GROUP radi USER-COMMAND usr.
      Follow up report
        PARAMETERS: rb_follo  RADIOBUTTON GROUP radi.
      skip one line
        SELECTION-SCREEN SKIP.
      Manual processing checkbox
        PARAMETERS:    p_manpr AS CHECKBOX.
      SELECTION-SCREEN END   OF BLOCK indletter.
    Printer block
      SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME TITLE text-002.
      Printer
        PARAMETERS:     p_print  LIKE nast-ldest DEFAULT 'LOCL' OBLIGATORY.
      SELECTION-SCREEN END OF BLOCK blk_par.
    User selection data validation
      AT SELECTION-SCREEN ON so_vkorg.
    Ragne for sales org
      RANGES: r_vkorg FOR vbak-vkorg.
      REFRESH: it_const, r_vkorg.
      CLEAR   wa_const.
    Proceed for execution only for Sales Orgs in /SIE/SSG_XCM_CUC
      LOOP AT so_vkorg.
       r_vkorg-sign = 'I'.
       r_vkorg-option = 'EQ'.
       r_vkorg-low    = so_vkorg-low.
       APPEND r_vkorg.
    Check Sales Org intervals entered in the selection screen
       IF NOT so_vkorg-high IS INITIAL.
    Get all Sales Org for interval
         SELECT vkorg FROM tvko INTO TABLE it_vkorg
           WHERE vkorg BETWEEN so_vkorg-low AND so_vkorg-high.
         IF sy-subrc = 0.
         Add all Sales org into one internal table
           LOOP AT it_vkorg INTO w_vkorg.
             r_vkorg-low = w_vkorg-vkorg.
             APPEND r_vkorg.
             CLEAR: w_vkorg.
           ENDLOOP.
         delete repeated records
           DELETE ADJACENT DUPLICATES FROM r_vkorg COMPARING low.
         ENDIF.
       ENDIF.
       CLEAR r_vkorg.
      ENDLOOP.
    Get Sales Org entries maintained in /SIE/SSG_XCM_CUC
      l_repid = sy-repid.
    Check Sales Org is maintained for Renewal Letter?
      LOOP AT r_vkorg.
      concatenate constant with Sales Org
        CONCATENATE 'INX_LETTER_CREATE_' r_vkorg-low INTO c_repco.
      Get constant
        SELECT SINGLE value
          FROM /sie/ssg_xcm_cuc
          INTO c_value
         WHERE repid = l_repid
           AND const = c_repco
           AND vkorg EQ so_vkorg-low.
      Check alerady maintained?
        IF sy-subrc <> 0 OR
          ( sy-subrc = 0 AND c_value <> 'X' ).
        Issue massage 'Sales Org no permitted for renewal Letter'.
          MESSAGE E012.
          CLEAR: c_repco, r_vkorg.
          EXIT.
        ENDIF.
        CLEAR: c_repco, r_vkorg.
      ENDLOOP.
      AT SELECTION-SCREEN.
    Read single Sales Org
       READ TABLE so_vkorg INDEX 1.
       IF sy-subrc = 0.
         CLEAR: l_ckappl, l_ckschl, l_cauart, c_kappl, c_kschl, c_auart.
       for application
         CONCATENATE 'INX_LETTER_V1_' so_vkorg-low INTO l_ckappl.
       for output type
         CONCATENATE 'INX_LETTER_Y6C4_' so_vkorg-low INTO l_ckschl.
       document type
         CONCATENATE 'INX_LETTER_AUART_' so_vkorg-low INTO l_cauart.
       Get application
         SELECT SINGLE value FROM /sie/ssg_xcm_cuc
           INTO c_kappl WHERE repid = sy-repid AND const LIKE l_ckappl.
       Get output type
         SELECT SINGLE value FROM /sie/ssg_xcm_cuc
           INTO c_kschl WHERE repid = sy-repid AND const LIKE l_ckschl.
       Get document type
         SELECT SINGLE value FROM /sie/ssg_xcm_cuc
           INTO c_auart WHERE repid = sy-repid AND const LIKE l_cauart.
       ENDIF.
    find no of Sales org entries entered in the selection screen
       DESCRIBE TABLE so_vkorg LINES l_vkorg.
    find no of Sales office entries entered in the selection screen
       DESCRIBE TABLE so_vkbur LINES l_vkbur.
    find no of Sales Group entries entered in the selection screen
       DESCRIBE TABLE so_vkgrp LINES l_vkgrp.
    Check if enterred more than one entry
       IF l_vkorg = 1 AND l_vkbur = 1.
         add Sales Org, Sales office, Sales group for key
         IF NOT so_vkgrp[] IS INITIAL.
           CONCATENATE so_vkorg-low so_vkbur-low so_vkgrp-low INTO l_vakey.
         ELSE.
           CONCATENATE so_vkorg-low so_vkbur-low '%' INTO l_vakey.
         ENDIF.
         CONDENSE l_vakey.
       Get printer name for selection.
         SELECT SINGLE ldest FROM nach INTO p_print
          WHERE kappl = c_kappl AND kschl = c_kschl AND vakey LIKE l_vakey.
       ENDIF.
    Manual processing is possible for Renewal Letter in advance only
      IF p_manpr = 'X' AND rb_follo = 'X'.
        MESSAGE E017.
      ENDIF.
    Main Processing
    START-OF-SELECTION.
      Check for the Follow up report
        IF rb_follo = 'X'.
        Call Follow up report with Selection criteria
          SUBMIT /SIE/SWE_XCM_INDEX_FOLLOWUP
           USING SELECTION-SET l_variant
            WITH so_vbeln IN so_vbeln
            WITH so_vkorg IN so_vkorg
            WITH so_vtweg IN so_vtweg
            WITH so_spart IN so_spart
            WITH so_vkgrp IN so_vkgrp
            WITH so_vkbur IN so_vkbur
            WITH so_vkues IN so_vkues
            WITH so_vuntd IN so_vuntd
            WITH so_ernam IN so_ernam
            WITH so_fnum  IN so_fnum
            WITH p_kappl  EQ c_kappl
            WITH p_kschl  EQ c_kschl
            WITH p_auart  EQ c_auart
          AND RETURN.
        ELSE.
        Process for Indexation Report
          gs_repid = sy-repid.
        Get data.
          PERFORM get_data.
        Filter data based on Siemens France rules
          PERFORM process_data.
        Check contract data is available for selection criteria
          IF NOT it_cntrt[] IS INITIAL.
          create ALV output header
            PERFORM alv_fieldcat USING gt_fieldcat[].
          create ALV layout
            PERFORM alv_layout CHANGING gs_layout.
          Sort ALV output
            PERFORM alv_sort.
          display filtered contract data
            PERFORM output_data.
          ELSE.
          Display a message 'No records found'.
            MESSAGE I011.
            EXIT.
          ENDIF.
        ENDIF.
    *&      Form  get_data
          Retrieve contracts data from tables
    -->  p1        text
    <--  p2        text
    FORM get_data.
    Get contract data from VBAK and VEDA.
      SELECT avbeln   aaudat   a~kunnr
             bvuntdat bvbegdat
             bvdemdat bvenddat
        INTO CORRESPONDING FIELDS OF TABLE it_cntrt
        FROM vbak AS a INNER JOIN veda AS b
          ON avbeln = bvbeln
       WHERE a~vbeln   IN so_vbeln
         AND a~auart   EQ c_auart
         AND a~vkorg   IN so_vkorg
         AND a~vtweg   IN so_vtweg
         AND a~spart   IN so_spart
         AND a~vkgrp   IN so_vkgrp
         AND a~vkbur   IN so_vkbur
         AND a~ernam   IN so_ernam
         AND b~vposn   = '000000'
         AND b~vkuesch IN so_vkues
         AND b~vuntdat IN so_vuntd.
    ENDFORM.                    " get_data
    *&      Form  process_data
          text
    -->  p1        text
    <--  p2        text
    FORM process_data.
    Internal tables
      DATA: l_nast   TYPE TABLE OF nast,
            it_pr    TYPE TABLE OF /sie/ssg_xcm_pr.
    Work areas
      DATA: w_nast   TYPE nast,
            wa_pr    TYPE /sie/ssg_xcm_pr.
    local Variables
      DATA: l_datum1 TYPE sy-datum,
            l_datum2 TYPE sy-datum,
            l_d3last TYPE sy-datum,
            l_d3next TYPE sy-datum.
    current date.
      l_datum1 = sy-datum.
    Calcuate date after 3 months.
      CALL FUNCTION 'DATE_CREATE'
        EXPORTING
          ANZAHL_MONATE        = 3
          DATUM_EIN            = l_datum1
        IMPORTING
          DATUM_AUS            = l_datum2.
      l_datum2 = l_datum2 - 1.
      SORT it_cntrt BY KUNNR VBELN.
    Get corresponding records from /SIE/SSG_XCM_PR.
      SELECT vbeln posnr fnum
          FROM /SIE/SSG_XCM_PR
          INTO CORRESPONDING FIELDS OF TABLE it_pr
           FOR ALL ENTRIES IN it_cntrt
         WHERE vbeln = it_cntrt-vbeln
          AND posnr = it_cntrt-vposn
           AND fnum IN so_fnum.
    clear workarea
      CLEAR wa_cntrt.
    filter contracts agaist the table /SIE/SSG_XCM_PR records.
      LOOP AT it_cntrt INTO wa_cntrt.
        CLEAR wa_pr.
      check contracts available in table /SIE/SSG_XCM_PR
        READ TABLE it_pr INTO wa_pr WITH KEY vbeln = wa_cntrt-vbeln.
        IF sy-subrc <> 0.
            DELETE it_cntrt.
            CLEAR wa_pr.
            CONTINUE.
        ELSEIF sy-subrc = 0 AND NOT wa_pr-fnum IN so_fnum.
      if not available, do not consider this contract
            DELETE it_cntrt.
            CLEAR wa_pr.
            CONTINUE.
        ENDIF.
         Dont consider contracts expires before today and after 3 months.
        IF wa_cntrt-vdemdat > l_datum1.   "current date
               IF wa_cntrt-vdemdat(6) > l_datum2(6). "AND   "after 3 months
               delete contract
                 DELETE it_cntrt.
                 CLEAR wa_cntrt.
                 CONTINUE.
               ENDIF.
        ELSE.
            DELETE it_cntrt.
            CLEAR wa_cntrt.
            CONTINUE.
        ENDIF.
      Is contract renewal letter has been sent already?
      Get all records from NAST to find letter sent?
        SELECT kappl objky kschl nacha datvr
          FROM NAST
          INTO CORRESPONDING FIELDS OF TABLE l_nast
         WHERE kappl = c_kappl
           AND objky = wa_cntrt-vbeln
           AND kschl = c_kschl
           AND nacha = '1'.
        IF sy-subrc = 0.
           sort renewal letter sent dates by latest is first
             SORT l_nast BY datvr DESCENDING.
           Get latest nast record
             READ TABLE l_nast INTO w_nast INDEX 1.
             IF sy-subrc = 0.
                IF p_manpr <> 'X'.  " ignore 3 month logic
                    l_d3next = wa_cntrt-vdemdat(06).
                    l_d3next+6(2) = '01'.
                  Calcuate date after 3 months.
                    CALL FUNCTION 'DATE_CREATE'
                      EXPORTING
                        ANZAHL_MONATE        = -3
                        DATUM_EIN            = l_d3next
                      IMPORTING
                        DATUM_AUS            = l_d3last.
                    l_d3last = l_d3last + 1.
                  Check letter already sent year equals current year
                    IF w_nast-datvr BETWEEN l_d3last AND wa_cntrt-vdemdat.
                     do not consider it
                       DELETE it_cntrt.
                       CLEAR: l_d3last, wa_cntrt, w_nast, l_d3next.
                       CONTINUE.
                    ENDIF.
                ENDIF.
             ENDIF.
        ENDIF.
      no leading zeros to contract
        WRITE wa_cntrt-vbeln TO wa_cntrt-vbeln1 NO-ZERO.
      modify internal table
        MODIFY it_cntrt FROM wa_cntrt.
        CLEAR: l_nast, w_nast.
      ENDLOOP.
    ENDFORM.                    " process_data
    *&      Form  output_data
          text
    -->  p1        text
    <--  p2        text
    FORM output_data.
    Display output in a ALV Grid
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
           I_CALLBACK_PROGRAM                = gs_repid
           I_CALLBACK_PF_STATUS_SET          = 'ALV_STATUS'
           I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
           IS_LAYOUT                         = gs_layout
           IT_FIELDCAT                       = gt_fieldcat
           IT_SORT                           = gs_sort
           I_SAVE                            = 'A'
         TABLES
           T_OUTTAB                          = it_cntrt
         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.                    " output_data
    *&      Form  alv_header
          text
    -->  p1        text
    <--  p2        text
    FORM alv_fieldcat USING gs_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
    Sold-to Party header
      ls_fieldcat-col_pos = 1.
      ls_fieldcat-fieldname = 'KUNNR'.
      ls_fieldcat-seltext_m = 'Sold-to Party'.
      ls_fieldcat-outputlen = 14.
      ls_fieldcat-datatype  = 'CHAR'.
      ls_fieldcat-key       = 'X'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Contract number
      ls_fieldcat-col_pos = 2.
      ls_fieldcat-fieldname = 'VBELN'.
      ls_fieldcat-seltext_m = 'Contract Number'.
      ls_fieldcat-outputlen = 20.
      ls_fieldcat-datatype  = 'CHAR'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Contract Signed Date
      ls_fieldcat-col_pos = 3.
      ls_fieldcat-fieldname = 'VUNTDAT'.
      ls_fieldcat-seltext_m = 'Contract signed date'.
      ls_fieldcat-outputlen = 20.
      ls_fieldcat-datatype  = 'DATS'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Contract Start Date
      ls_fieldcat-col_pos = 4.
      ls_fieldcat-fieldname = 'VBEGDAT'.
      ls_fieldcat-seltext_m = 'Contract start date'.
      ls_fieldcat-outputlen = '20'.
      ls_fieldcat-datatype  = 'DATS'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Dismantling date
      ls_fieldcat-col_pos = 5.
      ls_fieldcat-fieldname = 'VDEMDAT'.
      ls_fieldcat-seltext_m = 'Dismantling date'.
      ls_fieldcat-outputlen = 14.
      ls_fieldcat-datatype  = 'DATS'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    ENDFORM.                    " alv_header
    *&      Form  alv_layout
          text
    -->  p1        text
    <--  p2        text
    FORM alv_layout USING ls_layout TYPE slis_layout_alv.
    No input
      ls_layout-no_input          = 'X'.
    Column width is flexible
    ls_layout-colwidth_optimize = 'X'.
      ls_layout-box_fieldname = 'BOX'.
      ls_layout-info_fieldname = 'LINE_COLOR'.
      ls_layout-zebra = 'X'.
      ls_layout-get_selinfos = 'X'.
      ls_layout-reprep = 'X'.
    ENDFORM.                    " alv_layout
    *&      Form  alv_status
          text
    -->  p1        text
    <--  p2        text
    FORM alv_status USING rt_extab TYPE slis_t_extab.
    GUI Status and Application Toolbar
      SET PF-STATUS '/SIE/SWE_XCM_INDEXLE'.
    ENDFORM.
    *&      Form  user_command
          text
    -->  p1        text
    <--  p2        text
    FORM user_command USING l_ucomm      LIKE sy-ucomm
                            l_selfield   TYPE slis_selfield.
      RANGES: r_kappl FOR nast-kappl,
              r_objky FOR nast-objky,
              r_kschl FOR nast-kschl,
              r_nacha FOR nast-nacha.
      DATA: l_jobname  TYPE TBTCJOB-JOBNAME,
            l_jobcount TYPE TBTCJOB-JOBCOUNT,
            l_repid    TYPE sy-repid,
            l_print_params TYPE PRI_PARAMS,
            l_arc_params   TYPE ARC_PARAMS,
            l_valid        TYPE c,
            l_retcode      TYPE sy-subrc,
            l_blines       TYPE i.
      CASE l_ucomm.
      Process button seleted
        WHEN c_sform.
        process selected records.
          LOOP AT it_cntrt INTO wa_cntrt.
             IF wa_cntrt-box = 'X'.
              place output type in the contract
                PERFORM bdc_output USING wa_cntrt
                                   CHANGING l_retcode.
                IF l_retcode = 0.
                add record for jobground job
                  r_objky-sign   = 'I'.
                  r_objky-option = 'EQ'.
                  r_objky-low    = wa_cntrt-vbeln.
                  APPEND r_objky.
                ENDIF.
                CLEAR: wa_cntrt, l_retcode, r_objky.
             ENDIF.
          ENDLOOP.
        WHEN c_dclick.
        set contract number id with the selected contract
          SET PARAMETER ID 'AUN' FIELD l_selfield-value.
          SET PARAMETER ID 'KTN' FIELD l_selfield-value.
        call va42 tcode when double click on contract
          CALL TRANSACTION c_tcode AND SKIP FIRST SCREEN.
      ENDCASE.
      DESCRIBE TABLE r_objky LINES l_blines.
    IF NOT r_objky[] IS INITIAL.
      IF l_blines > 0.
        Background job name.
          CONCATENATE 'XCM_INDEXATION' sy-uname '_' sy-uzeit
                 INTO l_jobname.
        Application
          r_kappl-sign   = 'I'.
          r_kappl-option = 'EQ'.
          r_kappl-low    = 'V1'.
          APPEND r_kappl.
        Message Type
          r_kschl-sign   = 'I'.
          r_kschl-option = 'EQ'.
          r_kschl-low    = c_kschl.
          APPEND r_kschl.
        Message transmission medium
          r_nacha-sign   = 'I'.
          r_nacha-option = 'EQ'.
          r_nacha-low    = '1'.
          APPEND r_nacha.
          l_repid = sy-repid.
        Print Parameters
          CALL FUNCTION 'GET_PRINT_PARAMETERS'
            EXPORTING
              DESTINATION                  = p_print
              MODE                         = c_batch
              NO_DIALOG                    = 'X'
              REPORT                       = l_repid
              EXPIRATION                   = 2
              IMMEDIATELY                  = 'X'
              NEW_LIST_ID                  = 'X'
            IMPORTING
              OUT_ARCHIVE_PARAMETERS       = l_arc_params
              OUT_PARAMETERS               = l_print_params
              VALID                        = l_valid
            EXCEPTIONS
              ARCHIVE_INFO_NOT_FOUND       = 1
              INVALID_PRINT_PARAMS         = 2
              INVALID_ARCHIVE_PARAMS       = 3
              OTHERS                       = 4.
          IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        opening the job
          CALL FUNCTION 'JOB_OPEN'
            EXPORTING
              JOBNAME                = l_jobname
            IMPORTING
              JOBCOUNT               = l_jobcount
           EXCEPTIONS
             CANT_CREATE_JOB        = 1
             INVALID_JOB_DATA       = 2
             JOBNAME_MISSING        = 3
             OTHERS                 = 4.
          IF SY-SUBRC <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        Job submit
          SUBMIT /sie/swe_xcm_index_rsnast00 TO SAP-SPOOL
                          USER sy-uname
                          WITH s_kappl IN r_kappl
                          WITH s_objky IN r_objky
                          WITH s_kschl IN r_kschl
                          WITH s_nacha IN r_nacha
                          WITH p_print  EQ p_print
             VIA JOB l_jobname NUMBER l_jobcount
             SPOOL PARAMETERS l_print_params
             WITHOUT SPOOL DYNPRO
             AND RETURN.
          IF sy-subrc <> 0.
          display message when error in scheduling background job
            MESSAGE E016 WITH 'Error scheduling Job'.
          ENDIF.
        Job close
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              JOBCOUNT                          = l_jobcount
              JOBNAME                           = l_jobname
              STRTIMMED                         = 'X'
           EXCEPTIONS
             CANT_START_IMMEDIATE              = 1
             INVALID_STARTDATE                 = 2
             JOBNAME_MISSING                   = 3
             JOB_CLOSE_FAILED                  = 4
             JOB_NOSTEPS                       = 5
             JOB_NOTEX                         = 6
             LOCK_FAILED                       = 7
             OTHERS                            = 8.
          IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
      ENDIF.
    ENDFORM.
    *&      Form  bdc_output
          text
    -->  p1        text
    <--  p2        text
    FORM bdc_output USING    wa_cntrt  TYPE ty_cntrt
                    CHANGING l_retcode TYPE sy-subrc.
    DATA: l_nast TYPE TABLE OF nast,
           it_nast TYPE TABLE OF nast,
           w_nast TYPE nast,
           l_cellno(2) TYPE n,
           l_vbelv TYPE vbfa-vbelv,
           l_vbpa  TYPE vbpa,
           l_yes(1),
           l_temp(40) TYPE c,
           l_lines    TYPE i,
           l_lesscnt  TYPE i,
           l_less(1),
           l_lines1(2) TYPE n.
        REFRESH: it_nast, l_nast, it_bdc.
        CLEAR: l_nast, w_nast, l_yes, l_cellno,
               it_nast, l_nast, it_bdc.
        PERFORM dyn_scr USING 'SAPMV45A' '0102' 'X'.
          PERFORM dyn_fld USING 'VBAK-VBELN' wa_cntrt-vbeln.
          PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        PERFORM dyn_scr USING 'SAPMV45A' '4001' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=HEAD'.
        PERFORM dyn_scr USING 'SAPMV45A' '4002' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=KDOK'.
        SELECT *
          FROM nast
          INTO CORRESPONDING FIELDS OF TABLE l_nast
         WHERE kappl = c_kappl
           AND objky = wa_cntrt-vbeln.
        IF sy-subrc = 0.
            SORT l_nast BY kschl vstat.
            DESCRIBE TABLE l_nast LINES l_lines.
            LOOP AT l_nast INTO w_nast.
                l_cellno = sy-tabix.
                IF w_nast-kschl = c_kschl AND w_nast-vstat = 0.
                  EXIT.
                ENDIF.
                IF w_nast-kschl > c_kschl OR
                   ( w_nast-kschl = c_kschl AND w_nast-vstat <> 0 ).
                   IF l_less = space.
                     l_cellno = l_cellno - 1.
                   ENDIF.
                   CLEAR l_less.
                  IF l_cellno = 0.
                     l_cellno = 1.
                  ENDIF.
                  l_lines = l_lines + 1.
                  l_lines1 = l_lines.
                  PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
                    CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
                    CONDENSE l_temp.
                    PERFORM dyn_fld USING l_temp 'Y6C4'.
                    CLEAR: l_temp, l_lines, l_lines1.
                    PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
                  EXIT.
                ELSEIF w_nast-kschl < c_kschl.
                  l_less = 'X'.
                  l_lesscnt = l_lesscnt + 1.
                ENDIF.
            ENDLOOP.
        ELSE.
            l_cellno = '01'.
            PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
              CONCATENATE 'DNAST-KSCHL(' l_cellno ')' INTO l_temp.
              CONDENSE l_temp.
              PERFORM dyn_fld USING l_temp 'Y6C4'.
              CLEAR l_temp.
              PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        ENDIF.
        IF l_less = 'X'.
            l_lesscnt = l_lesscnt + 1.
                  l_cellno = l_lesscnt.
                  l_lines = l_lines + 1.
                  l_lines1 = l_lines.
                  PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
                    CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
                    CONDENSE l_temp.
                    PERFORM dyn_fld USING l_temp 'Y6C4'.
                    CLEAR: l_temp, l_lines, l_lines1.
                    PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        ENDIF.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
          CONDENSE l_temp.
          PERFORM dyn_fld USING l_temp 'X'.
          CLEAR l_temp.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70P'.
        PERFORM dyn_scr USING 'SAPDV70A' '0101' 'X'.
          PERFORM dyn_fld USING 'NAST-LDEST' p_print.
          PERFORM dyn_fld USING 'NAST-DIMME' 'X'.
          PERFORM dyn_fld USING 'NAST-TDARMOD' '1'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
          CONDENSE l_temp.
          PERFORM dyn_fld USING l_temp 'X'.
          CLEAR l_temp.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70I'.
        PERFORM dyn_scr USING 'SAPDV70A' '0102' 'X'.
          PERFORM dyn_fld USING 'NAST-VSZTP' '1'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70S'.
        CALL TRANSACTION c_tcode USING it_bdc
                                 MODE c_mode     "'N'
                                 UPDATE c_updat  "'A'
                                 MESSAGES INTO it_mesg.
        IF sy-subrc = 0.
          l_retcode = 0.
        ENDIF.
    ENDFORM.                    " bdc_output
    *&      Form  dyn_scr
          text
         -->P_0642   text
         -->P_0643   text
         -->P_0644   text
    FORM dyn_scr USING    P_0642
                          P_0643
                          P_0644.
        MOVE:  p_0642 TO wa_bdc-program,
               p_0643 TO wa_bdc-dynpro,
               p_0644 TO wa_bdc-dynbegin.
        APPEND wa_bdc TO it_bdc.
        CLEAR wa_bdc.
    ENDFORM.                    " dyn_scr
    *&      Form  dyn_fld
          text
         -->P_0654   text
         -->P_0655  text
    FORM dyn_fld USING    P_0654
                          P_0655.
       MOVE: p_0654 TO wa_bdc-fnam,
             p_0655 TO wa_bdc-fval.
       APPEND wa_bdc TO it_bdc.
       CLEAR wa_bdc.
    ENDFORM.                    " dyn_fld
    *&      Form  alv_sort
          text
    FORM alv_sort.
      DATA: wa_sortcat  TYPE slis_sortinfo_alv.
      WA_SORTCAT-SPOS      = 1.
      WA_SORTCAT-FIELDNAME = 'KUNNR'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
      CLEAR wa_sortcat.
      WA_SORTCAT-SPOS      = 2.
      WA_SORTCAT-FIELDNAME = 'VBELN'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
      WA_SORTCAT-SPOS      = 3.
      WA_SORTCAT-FIELDNAME = 'VUNTDAT'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
    ENDFORM.                    " alv_sort

  • Question about relative sizing on JPanels

    Hi,
    My question is about relative sizing on components that are not drawn yet. For example I want to draw a JLabel on the 3rd quarter height of a JPanel. But JPanel's height is 0 as long as it is not drawn on the screen. Here is a sample code:
    JPanel activityPnl = new JPanel();
    private void buildActivityPnl(){
            //setting JPanel's look and feel
            activityPnl.setLayout(null);
            activityPnl.setBackground(Color.WHITE);
            int someValue = 30;  // I use this value to decide the width of my JPanel
            activityPnl.setPreferredSize(new Dimension(someValue, 80));
            //The JLabel's height is 1 pixel and its width is equal to the JPanel's width. I want to draw it on the 3/4 of the JPanel's height
            JLabel timeline = new JLabel();
            timeline.setOpaque(true);
            timeline.setBackground(Color.RED);
            timeline.setBounds(0, (activityPnl.getSize().height * 75) / 100 , someValue , 1);
            activityPnl.add(timeline);
        }Thanks a lot for your help
    SD
    Edited by: swingDeveloper on Feb 24, 2010 11:41 PM

    And use a layout manager. It can adjust automatically for a change in the frame size.
    Read the Swing tutorial on Using Layout Managers for examples of the different layout managers.

  • Beginner Question (JNDI related)

    Hi,
    I got a EJB-Server called JONAS and a standalone Tomcat running. Now I want to use a EJB
    from a tomcat-servlet. I know that the EJB is already registred in the JNDI-registry implementation
    of JONAS. But when I try to look up the EJB with the servlet, Tomcat says "Bean is not bound to that context".
    My question is, how does Tomcat know, which JNDI registry is the JONAS registry. What if there
    are multiple registries running and I want to use EJB from all that registries in my programm (what is actually not the case).
    I am really new to that topic - I just want to grip the mechanism. (Maybe I got to tell Tomcat which
    JNDI it should use or smth like that?)
    Thanx for any help,
    Mischka

    Zdrafsvuite,
    I am really new to that topic - I just want to grip
    the mechanism. (Maybe I got to tell Tomcat which
    JNDI it should use or smth like that?)Relatively speaking. You tell InitialContext about the registry needed for the lookup. The following illustrates:
    Hashtable reg = new Hashtable();
    reg.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory" );
    reg.put( Context.PROVIDER_URL, "iiop://registry.host.com:1050" );
    Context jndi = new InitialContext( reg );The above instructs InitialContext on which context handler factory class to use for accessing the desired registry, and the URL location of the registry. Any number of lookup "handlers" to distributed registries (EJB or otherwise, since the above is relative to JNDI and not EJB ;) can be created and used this way. NOTE: the above, however, is specific to the RI and, possibly, other COS-based namespaces. Consult the documentation for your app server for the correct values for the above (as well as any additional information that may be required...).
    I hope this helps.
    Thanx for any help,
    MischkaDa Sveedanya,
    Tony "Vee Schade" Cook

  • Related to ALV Report

    Hi All,
    I have a doubt in ALV report.
    there is an output which consists of four fields.
    1.Employee
    2.Organizational Unit
    3.Required Compliance Training Not Completed (the specific course (D))
    4.% Compliant*
    Output should be:
       1        2            3               4
    1.a        b            c               d
                              e
                               f
    I mean there is a single row  for 4 fields.
    and in only 3 rd column  there are again 3 rows.
    how to display this.
    1..4 are columns
    a...f are data .
    Please tell me.
    Thanks,
    Geetha.

    Hi All,
    I have a doubt in ALV report.
    there is an output which consists of four fields.
    1.Employee
    2.Organizational Unit
    3.Required Compliance Training Not Completed (the specific course (D))
    4.% Compliant*
    Output should be:
       1        2            3               4
    1.a        b            c               d
                              e
                               f
    I mean there is a single row  for 4 fields.
    and in only 3 rd column  there are again 3 rows.
    how to display this.
    1..4 are columns
    a...f are data .
    Please tell me.
    Thanks,
    Geetha.

  • Urgent question pls :( [Related in Syncing and backing up all library~

    ok im planning to buy a new laptop, but I have a question.
    I have desktop pc which is all my music/apps/movies are stored, then how to put my whole library to another computer?
    *cheers mate*

    Look at this article for instructions about moving your iTunes to your new computer: http://www.ilounge.com/index.php/articles/comments/moving-your-itunes-library-to -a-new-hard-drive
    Specifically, scroll down to the section titled:
    "Moving your Content to a New Computer".

  • Question,Get data from ALV to internal table

    Hi, friends
    I currently need to get the data displayed on ALV.
    But the original internal table is local.
    It means it has already been deleted.
    Do you know which method I shoud use?
    After that, I will move the records to other internal
    table.
    3Q
    Minghan

    Hi,
    are you using ALV list/GRID FM,
    Check this..,
    1. why can't you declare the internal table as Global.
    2. you can call the FM
    REUSE_ALV_LIST_LAYOUT_INFO_GET
    here you get the table data using the table parameter <b>ET_OUTTAB</b>
    try this...
    where you will try?( when ever you want , please let me know where exactly you need this)
    Regards
    vijay

  • Question about subtotal in alv output

    I am using REUSE_ALV_GRID_DISPLAY for my ALV output.
    In that i am sub-totaling for quantity base on material group(MATKL). But also I want to display material group descriptions(WGBEZ) at the same subtotal-line. How can do that?

    Sort on the field WGBEZ...
    Check the sample program.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
        FIELD4(5),
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    INITIALIZATION.
    G_REPID = SY-REPID.
    START-OF-SELECTION.
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    MOVE '1esr0' TO ITAB1-FIELD4.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    MOVE 'sdtg0' TO ITAB1-FIELD4.
    APPEND ITAB1.
    DO 5 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM CALL_ALV.
    FORM BUILD.
    * DATA FIELD CATALOG
    * Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD4'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    GS_LAYOUT-TOTALS_TEXT = ' My Total'.
    GS_LAYOUT-subtotals_text = 'subtot'.
    * DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    <b>CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.</b>
    ENDFORM.
    FORM CALL_ALV.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = G_REPID
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
      IT_SORT = GT_SORT[]
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.

  • Question about Relations ( attributes )

    hai technos,
    When i'm creating a relation between 2 dimension for creating hierarchies ( for example between year and month dimensions )
    i can display either year or month at a time.
    Here that drill down effect is not coming where we can display parent and child levels at a time drilled.
    is there any way to implement the same with relations?
    Any help,suggessions are welcome.
    Thanks in advance.
    santha

    Unfortunately I think the last post will just aid in confusing you, read this and see if it makes sense ....
    In Express, dimensions can have data types of day, week, month, quarter, year, etc..... and (most importantly!) text. These data types are classed as "time" types (date, week, month, quarter, year) and (what I would call) "normal" type of text ... the other poster called this "other".
    When you create any "time" dimensions, Express will implicitly create relations between them, so you don't have to do it, but it's NOT a hierarchy it's an attribute. These "time" dimensions can only store time periods that match their data type, and the periods MUST be consecutive.
    To create a time hierarchy (and the drill-down/up that you require), you have to create a "normal" dimension (data type = text). This dimension is usually called TIME (because it holds all the time values you want). This dimension contains all your days, wks, months, yrs, etc... that you need. You then create a relation of that dimension to itself (classic self-relation ie hierarchy). The relation stores the parent value in the hierarchy. That's the way you get the drill-down. If you have already created your "time" dimension values, you can copy them over to your hierarchy dimension if needed.
    To get the drilling to work, use your TIME (hierarchy) dimension when you are creating your variable (don't use any other time-related dimensions!!), then create a table with this dimension being the only one going down, choose dim val's whilst having the hierarchy chosen, and you've got it !!!!
    Special Note !!!: The method used to create the hierarchy differs between OSA, OFA, Administrator and plain Express. Each product has different structure that could help or hinder you. If you don't understand this, please reply here and let me know which product you are using & I'll help out more.

  • Pdf and docu related to alv grid

    Hi all,
    Can any body please tell me how to get PDF and documents *of theory of alv grid display.* I have sample program of alv but not decent theory which can explain funcanality of function module and the parameters used in those fn module.please help me

    hi,
    already there is lot of material in SDn regarding everything,
    the thing is u need to search in SDN.
    regarding the ALV reports there is one intresting website just check in..
    www.alvrobot.com.ar

  • Query related to alv

    Hi Abap gurus,
    I need a blank ALV to display with 6 coulumns,where the enduser will fill the details in the alv row wise and he clicks on a button which will save in the z-table with the entries done in alv (edit mode) and then it should export to excel file..
    Is it possible to display balnk alv and I need dynamic rows..& my columns are fixed(6)
    awaiting for all u r ideas...
    Thanks & Regards
    Ravi V Ganji

    If the data doesnot exist in the internal table you are using for displaying the ALV, you can display a empty ALV. Then you can click on the toolbar buttons to add empty rows which the user can fill in.
    Take a look at BCALVEDIT* programs.
    BCALV_EDIT_01   
    BCALV_EDIT_02   
    BCALV_EDIT_03   
    BCALV_EDIT_04   
    BCALV_EDIT_05   
    BCALV_EDIT_06   
    BCALV_EDIT_07   
    BCALV_EDIT_08   
    Regards,
    Ravi
    Note : Please mark all the helpful answers
    Message was edited by: Ravikumar Allampallam

Maybe you are looking for

  • How can i change a xmltype column's xml schema?

    i create a table that have a xmltype column.this column is schema-based. my problem is , now i want to this column's schema will be redefined to a global schema? [b]how can i change the column's schema which already have a schema?

  • I have audio CDs and MP3s that I want to download onto my MacBook - how do I do that?

    I have audio CDs and MP3s that I want to download onto my MacBook - how do I do that?  I would like to be able to edit them in Garageband if possible and then burn them to a different CD or DVD.  Step by step instructions would be great!  Thanks!

  • Can't see my iphone 4 in i-tunes ?

    Hello. I just noticed that when I connect my iphone 4 to my iMac, it does not show up in iTunes anymore ?!! However, when I connect it, it opens iPhoto and I can see it in there. What happens ?... Any help appreciated - Thank you.

  • Sound problems with IOS 6.1

    Since installing IOS 6.1 I am experiencing inconsistencies with sound.  The 'chirping' sound when plugging in to recharge doesn't work and I've lost sound on Hearts++.  Is anyone experiencing anything similar?

  • What is email obfuscation?

    Hi - I have a way of over thinking things.  This may be one of those situations. I have a customer requesting that their email addresses be protected from email harvesting robots.  So I've been doing some reading - - - which has led to some confusion