Extending work area for fly in graphic

Hey folks
I'm new to after effects so please bear with me.
I have a project where I'm trying to start off with logo that is very large and extends off the stage ( to use a flash term). I want the entire logo to drop down in size so that it can be read and the entire logo fits the screen. The problem I'm having is that the logo gets cropped in the process and when I bring down the size only the cropped part gets smaller and I only have a partial part of the logo.
KatyDad

Szalam
Thanks for the reply
The graphic was brought in as an AI. My question is how do you start off with an over sized graphic and bring it down in size. For instance if I was showing a window in a house on the opening frame and ended up in the last fame with entire house shwing. How is it done in after effects.
Regards
KatyDad

Similar Messages

  • Extended Coverage Area for 4G

    I live in an area that has "extended" coverage for 4G.  On the coverage map I am the color in the middle - not 3G, but not full 4G.  What does that mean as far as getting consistent 4G coverage?  I am thinking about a mobile hotspot and wondered how it might work in my neighborhood.
    Thanks.  

    I have the samsung hotspot.  I am in 4g extended coverage area and my device switches between 3g to 4g every 1-2 minutes, and never holds the 4g connection longer than 45 seconds.  My 4g signal strength fluctuates between 100-112.  When I have a solid 3g signal I am in the area of 90-100.  I have talked to verizon multiple times, this is my second samsung device, the first one they deemed as defective over the phone and sent me a replacement.  The replacement hotspot immediately did the same thing that the first one did to a tee.  I then spoke to verizon tier 2 tech support for almost 2 hours and they opened a "problem ticket", which I knew would result in nothing since I have experienced "problem tickets" through verizon in the past with no results.  So, now I'm stuck with a device for two years that wont hold a 3g connection for more than 2 minutes (kills internet connection when it switches to 4g, and vice versa when switching back to 4g.)  The real killer in my situation is that I just bought a iphone 4s through AT&T and get a steady 3g signal and can hit 3mb/sec download, and 2mb/sec upload, ping 110-150ms.  Destroys verizons speeds in my area.  With my verizon Samsung hotspot I have never seen download speeds faster than 1mb/sec, .50mb/sec upload, 200-400ms ping.  I wish verizon would do something about my problem, but I feel as though they are just going to sweep this issue under their massive rug.  
    "Problem tickets" = No help

  • Difference between Field symbols and work area for Internal tables

    Hi,
    In ECC versions we all know that we need to declare the internal tables without headerline, and for handling the internal tables we need to use exclusive work areas.
    Currently i have an issue that we have been asked to use field symbols instead of work areas...can any one help me how to use the field symbols and also let me know how it will improve the performance of the program..
    Thanks and Regards,
    Kathir

    Hi
    DATA: WA TYPE ITAB.
    LOOP AT ITAB INTO WA.
    IF WA-FIELD = .....
    ENDIF.
    ENDLOOP.[(code]
    FIELD-SYMBOLS <WA> TYPE ANY.
    LOOP AT ITAB ASSIGNING <WA>.
    ENDLOOP.
    Now the problem is you can't know the name of the fields of the table at runtime, so you can't write:
    IF <WA>-FIELD = .....
    ENDIF.
    Anyway you can create a field-symbols strcturated like the table:
    [code]FIELD-SYMBOLS <WA> TYPE ITAB.
    LOOP AT ITAB ASSIGNING <WA>.
      IF <WA>-FIELD = .....
      ENDIF.
    ENDLOOP.
    I don't know which are the differences for the performance between to use a field-symbol and to use a structure as work-area.
    The differnce between the field-symbols and work-area is the field-symbol is assigned directly to the record, so u don't need to do a MODIFY statament to change something:
    LOOP AT ITAB INTO WA.
      WA-FIELD =
      MODIFY ITAB FROM WA.
    ENDLOOP.
    LOOP AT ITAB ASSIGNING <WA>.
      <WA>-FIELD =
    ENDLOOP.
    These two pieces of abap code do the same action, so probably the field-symbol improve the performance because it do an access directly to the record without to use an external structure as workarea.
    Max

  • Extending "work area end"

    I am using After Effects Cs3 and can not extend the "work area end" indicator beyond 20 seconds. It seems it should be as simple as dragging it to the right, but that does not work. I can only make it shorter by dragging it to the left. So no matter what the duration of the file I import it will only give me 20 seconds or so of the video. I need to make a video longer than 20 seconds. Can someone please tell me how to fix this? Thanks!

    e-marie wrote:
    I am using After Effects Cs3 and can not extend the "work area end" indicator beyond 20 seconds. It seems it should be as simple as dragging it to the right, but that does not work. I can only make it shorter by dragging it to the left. So no matter what the duration of the file I import it will only give me 20 seconds or so of the video. I need to make a video longer than 20 seconds. Can someone please tell me how to fix this? Thanks!
    One way to extend a project is to use the Compsition Settings.  In the compoisiton window right click the name of the composition and chose `composition settings' from that menu.  In the resulting dialog down at the bottom is `Duration'.  I use that to extend a project.
    If you already know this, then its out of my league.  But if that helps then understand too that any layers on the timeline will have to be extended to the new end manually ... or at least if there are only a few, manually is good.
    Make sure you are extending a layer and not moving it... it pretty easy to mix those up.

  • A shortkey to extend work area to view bar

    Usually i use ; shortkey to toggle between one frame view and total composition lenght. Please anyone know if is there a shortcut to expand the work area to the full view? Thanks

    Sorry, I didn't explain well. I need just to fit the full timeline view to the work area length. i. e. I set the work area length to a layer length, then I need to see all key frames of that layer as near as possible. i could also say that i need to enlage or reduce the full timeline view just to fit the work area lenght. Thanks

  • Bought SCS-2U01 network extender - worked great for 10 days...

    now the system light is slow blinking or steady red. Read the manual online and it says that means "abnormal". Failure communicating with Verizon Wireless.
    All other lights are blue. It's plugged into my wi-fi modem and my laptop works fine, so there's nothing wrong with my wi-fi. Any suggestions??

    Mine usually does this for 15-20 minutes when it's first powered on, or when it's connection has been reset.  Have you contacted Verizon Customer/Technical Support (800-922-0204)?  If you purchased this unit from somewhere other than Verizon or as a refurbished unit, it's MAC ID may still be associated with the previous owner's account.  Verizon Support can also assist with this.

  • Working Area for Internal Table

    Hi,
      i know that process of internal table if it is with headerline but i don't know how the data pass to our internal table if it is with out header line plzz give me the example code for that.
    Thanks in advance

    The following example shows two programs with the same function. One uses a header line, the other does not.
    With header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1
    WITH HEADER LINE.
    DO 4 TIMES.
    ITAB-COL1 = SY-INDEX.
    ITAB-COL2 = SY-INDEX ** 2.
    INSERT TABLE ITAB.
    ENDDO.
    ITAB-COL1 = 2.
    READ TABLE ITAB FROM ITAB.
    ITAB-COL2 = 100.
    MODIFY TABLE ITAB.
    ITAB-COL1 = 4.
    DELETE TABLE ITAB.
    LOOP AT ITAB.
    WRITE: / ITAB-COL1, ITAB-COL2.
    ENDLOOP.
    Without header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1,
    WA LIKE LINE OF ITAB.
    DO 4 TIMES.
    WA-COL1 = SY-INDEX.
    WA-COL2 = SY-INDEX ** 2.
    INSERT WA INTO TABLE ITAB.
    ENDDO.
    WA-COL1 = 2.
    READ TABLE ITAB FROM WA INTO WA.
    WA-COL2 = 100.
    MODIFY TABLE ITAB FROM WA.
    WA-COL1 = 4.
    DELETE TABLE ITAB FROM WA.
    LOOP AT ITAB INTO WA.
    WRITE: / WA-COL1, WA-COL2.
    ENDLOOP.
    The list, in both cases, appears as follows:
    1 1
    2 100
    3 9

  • Logic for Populating a Work Area

    Hi Gurus,
    I have a standard sap structure KNWEV. In the structure the values will get populated as give below.
    For an Unloading point for different days ie for Monday the times for unloading will be
    Monday  8 30 12 30 14 30 16 30.
    Tuesday 9 30 12 30 14 30 16 30
    The values will get populated for all the days for an unloading point. and its stored in structure as below.
    KNWEV Field names and Field Values
    Unloading_point   Monday1 Monday2 Monday3 Monday4 Tuesday1 Tuesday2 Tuesday3 Tuesday4 etc
    Dock A                8 30       12 30      14 30       16 30      9 30         12 30       14 30          16 30
    Suppose for a unloading date let it be 18 / March / 2009 , it is a Tuesday
    I want to populate work area in my program with Unloading point and Time for Tuesday  taking values from KNWEV
    Work Area
    Unloading point   Tuesday1 Tuesday2 Tuesday3 Tuesday4 .
    Dock A               9 30         12 30       14 30          16 30
    Please let me know how can i move fields from structure to my work area taking the field names as Monday1 Monday2 .. and so on
    Edited by: Avi on Mar 18, 2009 12:11 AM

    Hi,
    Use the code below...
    data weekday type DTRESR-WEEKDAY
    data string type string.
    call function date_to_day
    exporting
    date = sy-datum
    importing
    weekday = weekday.
    if weekday CS 'WED'.
       string = 'WEDNESDAY'.
    elseif weekday CS 'SAT'.
       string = 'SATURDAY'.
    endif.                                       " For all other days it takes it automatically....
    read table itab into wa_knwev with key unloading_point = weekday.
    " I don't know whether which variable contains the weekday in the internal table so i have used the variabel unloading point...
    " The above read statement will get the record in the work area for the date you mention in the FM...
    I hope this is what you required ...
    if this is not meeting the requirement please do specify a bit more on your requirement
    Regards,
    Siddarth

  • Extended Program check for internal table

    TYPES:BEGIN OF TY_FINAL,
            VBELN TYPE VBAP-VBELN,
            VBELV TYPE VBAP-VBELV,
            POSNV TYPE VBAP-POSNV,
            WERKS TYPE VBAP-WERKS,
            ZZ_MODEL_NO TYPE VBAP-ZZ_MODEL_NO,
            VKORG TYPE VBAK-VKORG,
            TEXT(70) TYPE C,
          END OF TY_FINAL.
    Declaration of Variables                                            *
    DATA: IT_VBAK  TYPE STANDARD TABLE OF TY_VBAK ,
          IT_VBAP  TYPE STANDARD TABLE OF TY_VBAP ,
          IT_FINAL TYPE STANDARD TABLE OF TY_FINAL WITH HEADER LINE.
    DATA: W_VBAK         TYPE TY_VBAK            ,
          W_VBAP         TYPE TY_VBAP            ,
          W_FINAL        TYPE TY_FINAL           ,
          W_LAYOUT       TYPE SLIS_LAYOUT_ALV    ,
          W_VARIANT_SAVE TYPE C                  ,
          W_REPID        TYPE  SY-REPID          .
    In the above code i have declared IT_FINAL TYPE STANDARD TABLE OF TY_FINAL WITH HEADER LINE. in extended program check iam getting error as( Tables with headers are no longer supported in the OO context.
    can any one plz suggest me to avoid this error.
    Thanks in Advance.
    Moderator message - Duplicate post locked
    Edited by: Rob Burbank on May 19, 2009 9:12 AM

    Hi,
    DATA: IT_VBAK TYPE STANDARD TABLE OF TY_VBAK ,
    IT_VBAP TYPE STANDARD TABLE OF TY_VBAP ,
    " If you declare the internal table with header line in OO context it wll give you error. As OO wil not
    " support the header line concept. Declare Internal table without header line and create the work area
    " for the internal table
    IT_FINAL TYPE STANDARD TABLE OF TY_FINAL. "  WITH HEADER LINE.
    DATA: W_VBAK TYPE TY_VBAK ,
    W_VBAP TYPE TY_VBAP ,
    W_FINAL TYPE TY_FINAL ,                    " Use this work area
    W_LAYOUT TYPE SLIS_LAYOUT_ALV ,
    W_VARIANT_SAVE TYPE C ,
    W_REPID TYPE SY-REPID

  • Dynamic field modification in Work Area.

    Hi,
    I want to insert 1 record in a transparent table. (But for time being, let us assume the table is MARA)
    The columns and table name to which data is to be inserted are stored in another transparent table say (z1354_inv_rec_dt).
    The data to be inserted is specified in a text file.
    The value for MATNR, let us assume is hard coded as 1252.
    The value for fields ERSDA, ERNAM, LAEDA and AENAM will be specified in input text file.
    Also the table z1354_inv_rec_dt, will have rows with values ERSDA, ERNAM, LAEDA and AENAM.
    How do I do this, the code specified in form comparedata is not correct one, but just a starting point for code.
    <b>So how do I specify the column of work area at run time and assign value to it.</b>
    Then I have to append value from work area to internal table.
    And from internal table, I will insert to database.
    REPORT ZDYN_INS_MARA.
    TYPE-POOLS : abap.
    DATA:
      lit_z1354_inv_rec_dt  TYPE TABLE OF z1354_inv_rec_dt,
    * table z1354_inv_rec_dt contains 2 columns column_name and table_name
    * values for column_name are ERSDA, ERNAM, LAEDA and AENAM
    * value for table_name is MARA.
      lwa_invoice LIKE  z1354_inv_rec_dt,
      lit_mara TYPE TABLE OF mara,
      lwa_mara LIKE mara.
    * To get column names
    DATA :
      it_details TYPE abap_compdescr_tab,
      wa_details TYPE abap_compdescr,
      ref_descr TYPE REF TO cl_abap_structdescr.
    FIELD-SYMBOLS : <fs_mara> TYPE mara.
    FIELD-SYMBOLS : <fs_wa_mara> LIKE LINE OF lit_mara.
    FIELD-SYMBOLS : <dyn_field>.
    DATA: int_tabname(30).
    int_tabname = 'MARA'.
    *Populate internal table with columns to be added to Database
    PERFORM populaterecdt.
    ref_descr ?= cl_abap_typedescr=>describe_by_name( int_tabname ).
    *Get the column names from the Database tables
    it_details[] = ref_descr->components[].
    PERFORM comparedata.
    *&      Form  PopulateRecDt
    FORM populaterecdt .
      SELECT column_name table_name FROM z1354_inv_rec_dt
      INTO CORRESPONDING FIELDS OF TABLE lit_z1354_inv_rec_dt
      WHERE table_name = 'MARA' .
    ENDFORM.                    " PopulateRecDt
    *&      Form  CompareData
    FORM comparedata .
    *loop through the DB table which holds the column names to be added
    LOOP AT lit_z1354_inv_rec_dt INTO lwa_invoice.
    *Loop throught table which holds the column names
      ASSIGN COMPONENT 'MATNR' OF STRUCTURE <fs_wa_mara> TO <dyn_field>.
      <dyn_field> = '1252'   .
      LOOP AT it_details INTO wa_details.
        IF wa_details-name = lwa_invoice-column_name.
    * Assign value to column of work area from text file.
          ASSIGN component lwa_invoice-column_name of structure                   <fs_wa_mara> to <dyn_field>.
    *Get value for <dyn_field> from text file
            <dyn_field> = 'XYZ212'.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    *append work area t to lit_mara.
    *Append work area to internal table.
    *insert the internal table to DB
    ENDFORM.                    " CompareData
    Here in this loop, I want to assign to the work area for Mara based on the column values, How do I do it.
    Regards,
    Vikas

    Hi,
    This problem has been resolved.
    DATA:
        lit_MARA TYPE TABLE OF MARA,
        lit2_MARA TYPE TABLE OF MARA,
        lwa_MARA LIKE MARA,
        lit_inv TYPE TABLE OF z1354_inv_rec_dt,
        wa_inv  LIKE z1354_inv_rec_dt,
        sctemp(100) TYPE c,
        ifs type i,
         p_gs_s_rec_line TYPE string.
      FIELD-SYMBOLS:
        <fs_MARA> TYPE table,
        <ld_column>   TYPE ANY,
        <fs_wa_MARA> LIKE LINE OF lit_MARA.
    *Populate Invoice table
      SELECT * FROM  z1354_inv_rec_dt INTO CORRESPONDING FIELDS OF TABLE
      lit_inv WHERE recordtype = 'S' AND table_name = 'MARA' AND
      column_seq > 0.
      p_gs_rec_line = '1234567890000001'.
      lwa_MARA-laufi = '123e'.
      FREE lit_MARA.
      APPEND  lwa_MARA TO lit_MARA.
      ASSIGN lit_MARA[] TO <fs_MARA>.
      UNASSIGN: <fs_wa_MARA>.
    * free lit_MARA[] .
    * LOOP AT <fs> ASSIGNING <fs1>.
    LOOP AT lit_MARA ASSIGNING <fs_wa_MARA>.
      ifs = sy-tabix.
      write: / ifs.
        LOOP AT lit_inv INTO wa_inv.
          WRITE
          p_gs_s_rec_line+wa_inv-start_pos_extrac(wa_inv-chars_to_extract)
          TO sctemp.
          UNASSIGN: <ld_column>.
          ASSIGN COMPONENT wa_inv-column_name OF STRUCTURE <fs_wa_MARA>
          TO <ld_column>.
          <ld_column> =  sctemp.
          IF ( <ld_column> IS ASSIGNED ).
            WRITE: / '.' .
          ENDIF.
          CLEAR wa_inv.
        ENDLOOP.
        MOVE  <fs_wa_MARA> TO lwa_MARA.
        APPEND lwa_MARA TO lit2_MARA.
       CLEAR <fs_wa_MARA>.
      ENDLOOP.
    loop at lit2_MARA into lwa_MARA.
      write: / lwa_MARA-filename.
      clear lwa_MARA.
    endloop.
    insert MARA from table lit2_MARA.
    if sy-subrc <> 0.
      write: / ' Insert  :-( '.
    endif.

  • Internal table with and with out work area.

    Hi all,
    in performance terms which one is better 1) internal table with header line or 2) itab w/o header line and explicit work area for that itab.
    which one is better and how?
    Thanks in advance.
    SAI

    Hai Sai Ram
    Internal Table with header Line Improves the Performence
    1)
    TABLES CUSTOMERS.
    Defining an internal table with header line
    DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100
                       WITH HEADER LINE.
    Reading all entries of the database table into the internal table
    SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.
    2)
    Check the following code for the Difference
    REPORT ZWRITEDOC LINE-SIZE 124 NO STANDARD PAGE HEADING.
       TABLES: DD03L, "
               DD04T, "R/3-DD: Textos de los elementos de datos
               DD02T. "R/3-DD: Textos de tablas SAP
    Tabla temporal con las lineas de cada tabla
       DATA: BEGIN OF I_LINEAS OCCURS 100,
                LINEA(80),
             END OF I_LINEAS.
    Tabla con las caracteristicas de la tabla
       DATA: BEGIN OF I_TABLA OCCURS 100,
                CAMPO(12),
                TIPO(4),
                LONG(5) TYPE I,
                REF(20),
                DESCR(40),
             END OF I_TABLA.
       DATA: D_NOMBRE(80),
             D_DESCRIPCION(80).
       DATA :  BEGIN OF SOURCE OCCURS 1000,
            LINE(72),
       END OF SOURCE.
       PARAMETERS: PROGRAM LIKE SY-REPID DEFAULT SY-REPID.
       AT USER-COMMAND.
         CASE SY-UCOMM.
           WHEN 'GRAB'.
             PERFORM GRABAR.
         ENDCASE.
       START-OF-SELECTION.
         SET PF-STATUS  'ZSTATUS1'.
         READ REPORT PROGRAM INTO SOURCE.
         DATA L_GRAB.
         CLEAR L_GRAB.
    LOOP AT SOURCE.
       translate source to upper case.
           IF L_GRAB IS INITIAL.
             D_DESCRIPCION = I_LINEAS-LINEA.
           ENDIF.
           I_LINEAS = SOURCE.
           SEARCH I_LINEAS-LINEA FOR 'BEGIN OF'.
           IF SY-SUBRC = 0.
             SEARCH I_LINEAS-LINEA FOR 'DATA'.
             IF SY-SUBRC = 0.
               L_GRAB = 'X'.
               FREE I_LINEAS.
             ENDIF.
           ENDIF.
           IF L_GRAB = 'X'.
             I_LINEAS = SOURCE.
             APPEND I_LINEAS.
             SEARCH I_LINEAS-LINEA FOR 'END OF'.
             IF SY-SUBRC = 0.
               CLEAR L_GRAB.
               PERFORM PROCESAR_FICHERO.
               PERFORM IMPRIMIR.
               FREE I_LINEAS.
               CLEAR D_DESCRIPCION.
             ENDIF.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR 'WITH HEADER LINE'.
           IF SY-SUBRC = 0.
             APPEND I_LINEAS.
             PERFORM PROCESAR_FICHERO.
             PERFORM IMPRIMIR.
           ENDIF.
         ENDLOOP.
    *&      Form  GRABAR
          Graba el fichero en c:\temp\p.rtf y lo abre con word.
       FORM GRABAR.
         CALL FUNCTION 'LIST_DOWNLOAD'
             EXPORTING
            LIST_INDEX = SLIST_INDEX_DEFAULT
                  METHOD     = 'RTF'
              EXCEPTIONS
                   OTHERS     = 1.
         CALL FUNCTION 'EXECUTE_WINWORD'
              EXPORTING
                   I_FILE = 'C:\TEMP\P.RTF'
              EXCEPTIONS
                   OTHERS = 1.
       ENDFORM.                               " GRABAR
    *&      Form  PROCESAR_FICHERO
       FORM PROCESAR_FICHERO.
         DATA: L_AUX1(80),
              L_AUX2(80).
         FREE I_TABLA.
         LOOP AT I_LINEAS.
           CLEAR I_TABLA.
       translate i_lineas-linea to upper case.
           SEARCH I_LINEAS-LINEA FOR 'BEGIN OF'.
           IF SY-SUBRC = 0.
             SPLIT I_LINEAS-LINEA AT 'BEGIN OF' INTO L_AUX1 D_NOMBRE.
             SPLIT D_NOMBRE AT 'OCCURS' INTO D_NOMBRE L_AUX1.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR '('.
           IF SY-SUBRC = 0.
              SPLIT I_LINEAS-LINEA AT '(' INTO L_AUX1 L_AUX2.
             CONDENSE L_AUX1.
             I_TABLA-CAMPO = L_AUX1.
             SPLIT L_AUX2 AT ')' INTO L_AUX1 L_AUX2.
             CONDENSE L_AUX1.
             IF L_AUX1 CO '0123456789 '.
               I_TABLA-LONG = L_AUX1.
             ENDIF.
             I_TABLA-TIPO = 'CHAR'.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR 'LIKE'.
           IF SY-SUBRC = 0.
             SPLIT I_LINEAS-LINEA AT 'LIKE' INTO L_AUX1 L_AUX2.
             CONDENSE L_AUX1.
             I_TABLA-CAMPO = L_AUX1.
               SPLIT L_AUX2 AT ',' INTO L_AUX1 L_AUX2.
             CONDENSE L_AUX1.
             I_TABLA-REF = L_AUX1.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR 'TYPE'.
           IF SY-SUBRC = 0.
             SPLIT I_LINEAS-LINEA AT 'TYPE' INTO L_AUX1 L_AUX2.
             IF I_TABLA-CAMPO IS INITIAL.
               CONDENSE L_AUX1.
               I_TABLA-CAMPO = L_AUX1.
             ENDIF.
                 SPLIT L_AUX2 AT ',' INTO L_AUX1 L_AUX2.
            CONDENSE L_AUX1.
             CASE L_AUX1.
               WHEN 'I'.
                 I_TABLA-TIPO = 'INT'.
                 I_TABLA-LONG = 4.
               WHEN 'C'.
                 I_TABLA-TIPO = 'CHAR'.
               WHEN 'N'.
                 I_TABLA-TIPO = 'NUMC'.
               WHEN 'T'.
                 I_TABLA-TIPO = 'TIME'.
                 I_TABLA-LONG = 8.
               WHEN OTHERS.
                 I_TABLA-TIPO = L_AUX1.
             ENDCASE.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR '"'.
           IF SY-SUBRC = 0.
             SPLIT I_LINEAS-LINEA AT '"' INTO L_AUX1 L_AUX2.
             CONDENSE L_AUX2.
             I_TABLA-DESCR = L_AUX2.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR 'INCLUDE STRUCTURE'.
           IF SY-SUBRC = 0.
             SPLIT I_LINEAS-LINEA AT 'INCLUDE STRUCTURE' INTO L_AUX1 L_AUX2.
             SPLIT L_AUX2 AT '.' INTO L_AUX1 L_AUX2.
             CONDENSE L_AUX1.
             I_TABLA-CAMPO = 'INCLUDE STR'.
             I_TABLA-REF   = L_AUX1.
           ENDIF.
           SEARCH I_LINEAS-LINEA FOR 'WITH HEADER LINE'.
             IF SY-SUBRC = 0.
               IF NOT I_LINEAS-LINEA CA '"'.
                 SPLIT I_LINEAS-LINEA AT 'OCCURS' INTO L_AUX1 L_AUX2.
                 IF SY-SUBRC = 0.
                   SPLIT L_AUX1 AT 'LIKE' INTO L_AUX1 L_AUX2.
                   IF SY-SUBRC = 0.
                     CONDENSE L_AUX2.
                     IF NOT L_AUX2 IS INITIAL.
                       I_TABLA-CAMPO = '...'.
                       I_TABLA-TIPO  = 'TABI'.
                       I_TABLA-REF   = L_AUX2.
                       SELECT SINGLE * FROM DD02T
                        WHERE TABNAME = L_AUX2
                          AND DDLANGUAGE = SY-LANGU.
                       IF SY-SUBRC = 0.
                       I_TABLA-TIPO  = 'TABE'.
                       I_TABLA-DESCR   = DD02T-DDTEXT.
                       ENDIF.
                       IF L_AUX1 CA ':'.
                         SPLIT L_AUX1 AT 'DATA:' INTO L_AUX1 L_AUX2.
                       ELSE.
                         SPLIT L_AUX1 AT 'DATA' INTO L_AUX1 L_AUX2.
                       ENDIF.
                       D_NOMBRE = L_AUX2.
                     ENDIF.
                   ENDIF.
                 ENDIF.
               ENDIF.
             ENDIF.
           IF NOT I_TABLA-CAMPO IS INITIAL.
             APPEND I_TABLA.
           ENDIF.
         ENDLOOP.
         LOOP AT I_TABLA WHERE NOT REF IS INITIAL.
            SPLIT I_TABLA-REF AT '-' INTO L_AUX1 L_AUX2.
           SELECT SINGLE * FROM DD03L
            WHERE TABNAME = L_AUX1
              AND FIELDNAME = L_AUX2.
           IF SY-SUBRC = 0.
             I_TABLA-TIPO = DD03L-DATATYPE.
             I_TABLA-LONG = DD03L-INTLEN.
             IF I_TABLA-DESCR IS INITIAL.
               SELECT SINGLE * FROM DD04T
                WHERE ROLLNAME = DD03L-ROLLNAME
                  AND DDLANGUAGE = SY-LANGU.
               IF SY-SUBRC = 0.
                 I_TABLA-DESCR = DD04T-DDTEXT.
               ENDIF.
             ENDIF.
             MODIFY I_TABLA.
           ENDIF.
         ENDLOOP.
       ENDFORM.                               " PROCESAR_FICHERO
    *&      Form  IMPRIMIR
       FORM IMPRIMIR.
       DATA L_AUX(80).
         FORMAT COLOR COL_NORMAL INTENSIFIED ON.
         ULINE AT 1(80).
         WRITE: / SY-VLINE,
                 (76)     D_NOMBRE CENTERED,
                  SY-VLINE.
         SPLIT D_DESCRIPCION AT '*' INTO L_AUX D_DESCRIPCION.
         WRITE: / SY-VLINE,
                 (76)     D_DESCRIPCION CENTERED,
                  SY-VLINE.
         NEW-LINE.
         ULINE AT 1(80).
         DETAIL.
         FORMAT COLOR OFF.
         WRITE: /
               SY-VLINE,
             (10) 'CAMPO',
               SY-VLINE,
             (4)  'TIPO',
               SY-VLINE,
             (4) 'LONG',
               SY-VLINE,
             (16)  'REFERENCIA',
               SY-VLINE,
             (30)  'DESCRIPCION',
               SY-VLINE.
         NEW-LINE.
         ULINE AT 1(80).
         DETAIL.
         LOOP AT I_TABLA.
           WRITE: /
                 SY-VLINE,
              (10)   I_TABLA-CAMPO,
                 SY-VLINE,
                 I_TABLA-TIPO,
                 SY-VLINE,
              (4)   I_TABLA-LONG,
                 SY-VLINE,
              (16)   I_TABLA-REF,
                 SY-VLINE,
              (30)   I_TABLA-DESCR,
                 SY-VLINE.
         ENDLOOP.
         NEW-LINE.
         ULINE AT 1(80).
         SKIP 2.
       ENDFORM.                               " IMPRIMIR
    Thanks & regards
    Sreeni

  • Internal table and work area

    Hi,
           can anybody explain the concepts of Internal table and work area.Thanks in advance.

    hai,
    This may help u.
    WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.
    Each row in a table is a record and each column is a field.
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    e.g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    Internal tables are used for storing records which are obtained as a result when we use select statement on database. internal tables are run time entities and doesn't occupy any memory. they are dynamic.
    internal tables are of types.
    1. internal tables with header line. [header and body]
    2. internal tables with out header line. [only body]
    Workarea is the concept which is mainly useful when working with internal tables with out header line.
    at any point of time we can access only one record through header of a internal table. every thing should be done [inserting,modifying, reading ] through header only.
    ex: data: itab like standard table of mara with header line.
    for internal tables with out header line we will create a work area [explicit header] as type of table for storing data into internal table.
    ex: data: itab like mara,
    wa like mara.
    more about internal table types:
    Standard table:
    The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.
    You should usually access a standard table with index operations.
    Sorted table:
    The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.
    Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
    Hash table:
    The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.
    You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index.
    The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always
    have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for
    processing large amounts of data.
    TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.
    TYPES: BEGIN OF LINE,
    COLUMN1 TYPE I,
    COLUMN2 TYPE I,
    COLUMN3 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF SPFLI
    WITH UNIQUE KEY CARRID CONNID.
    with regards,
    B.Sowjanya,
    reward points if helpful.

  • Internal table & Work area

    Hi Experts,
    I am a novice to ABAP. Can anyone tell me whats the difference b/w internal table and work area. In writing function modules how these will be utilized and in what way.
    Regards
    ss

    HI,
    Internal tables are a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    Difference between Work Area and Header Line
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table.  The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table.  It depends on how the internal table is declared that the itab will have the header line or not.
    e.g.
    data: begin of itab occurs 10,
               ab type c,
               cd type i,
            end of itab.  " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
    It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table.  It is the default work area for the internal table
    1) The difference between
    whih header line and with out heater line of internal table.
    ex:-
    a) Data : itab like mara occurs 0 with header line.
    b) Data: itab like mara occurs 0.
    -While adding or retrieving records to / from internal table we have to keep the record temporarily.
    -The area where this record is kept is called as work area for the internal table.
    -The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    -Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    a) Data : itab like mara occurs 0 with header line.
    table is with header line
    b) Data: itab like mara occurs 0.
    table is without header line
    2)work area / field string and internal table
    which one is prefarable for good performance any why ?
    -The header line is a field string with the same structure as a row of the body, but it can only hold a single row , whereas internal table can have more than one record.
    In short u can define a workarea of an internal table which means that area must have the same structure as that of internal table and can have one record only.
    Example code:
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    http://www.allsaplinks.com/faq_abap_internaltables.html
    Do reward if it helps,
    Regards,
    Laxmi

  • Basic query regarding work-area and select query

    hi
    dear sdn members,
    thanks too all for solving all my query's up till now
    i am stuck in a problem need help
    1)  why basically work-area has been used ? the sole purpose
    2)  different types of select query ? only coding examples
    note: no links pls
    regards,
    virus

    hi,
    Work Area
    Description for a data object that is particularly useful when working with internal tables or database tables as a source for changing operations or a target for reading operations.
    WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.
    Each row in a table is a record and each column is a field.
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    .g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
    It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.
    With header line
    SELECT.
    Put the curson on that word and press F1 . You can see the whole documentation for select statements.
    select statements :
    SELECT result
    FROM source
    INTO|APPENDING target
    [[FOR ALL ENTRIES IN itab] WHERE sql_cond]
    Effect
    SELECT is an Open-SQL-statement for reading data from one or several database tables into data objects.
    The select statement reads a result set (whose structure is determined in result ) from the database tables specified in source, and assigns the data from the result set to the data objects specified in target. You can restrict the result set using the WHERE addition. The addition GROUP BY compresses several database rows into a single row of the result set. The addition HAVING restricts the compressed rows. The addition ORDER BY sorts the result set.
    The data objects specified in target must match the result set result. This means that the result set is either assigned to the data objects in one step, or by row, or by packets of rows. In the second and third case, the SELECT statement opens a loop, which which must be closed using ENDSELECT. For every loop pass, the SELECT-statement assigns a row or a packet of rows to the data objects specified in target. If the last row was assigned or if the result set is empty, then SELECT branches to ENDSELECT . A database cursor is opened implicitly to process a SELECT-loop, and is closed again when the loop is ended. You can end the loop using the statements from section leave loops.
    Up to the INTO resp. APPENDING addition, the entries in the SELECTstatement define which data should be read by the database in which form. This requirement is translated in the database interface for the database system´s programming interface and is then passed to the database system. The data are read in packets by the database and are transported to the application server by the database server. On the application server, the data are transferred to the ABAP program´s data objects in accordance with the data specified in the INTO and APPENDING additions.
    System Fields
    The SELECT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Relevance
    0 The SELECT statement sets sy-subrc to 0 for every pass by value to an ABAP data object. The ENDSELECT statement sets sy-subrc to 0 if at least one row was transferred in the SELECT loop.
    4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
    8 The SELECT statement sets sy-subrc to 8 if the FOR UPDATE addition is used in result, without the primary key being specified fully after WHERE.
    After every value that is transferred to an ABAP data object, the SELECT statement sets sy-dbcnt to the number of rows that were transferred. If the result set is empty, sy-dbcnt is set to 0.
    Notes
    Outside classes, you do not need to specify the target area with INTO or APPENDING if a single database table or a single view is specified statically after FROM, and a table work area dbtab was declared with the TABLES statement for the corresponding database table or view. In this case, the system supplements the SELECT-statement implicitly with the addition INTO dbtab.
    Although the WHERE-condition is optional, you should always specify it for performance reasons, and the result set should not be restricted on the application server.
    SELECT-loops can be nested. For performance reasons, you should check whether a join or a sub-query would be more effective.
    Within a SELECT-loop you cannot execute any statements that lead to a database commit and consequently cause the corresponding database cursor to close.
    SELECT - result
    Syntax
    ... lines columns ... .
    Effect
    The data in result defines whether the resulting set consists of multiple rows (table-like structure) or a single row ( flat structure). It specifies the columns to be read and defines their names in the resulting set. Note that column names from the database table can be changed. For single columns, aggregate expressions can be used to specify aggregates. Identical rows in the resulting set can be excluded, and individual rows can be protected from parallel changes by another program.
    The data in result consists of data for the rows lines and for the columns columns.
    SELECT - lines
    Syntax
    ... { SINGLE }
    | { { } } ... .
    Alternatives:
    1. ... SINGLE
    2. ... { }
    Effect
    The data in lines specifies that the resulting set has either multiple lines or a single line.
    Alternative 1
    ... SINGLE
    Effect
    If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used.
    An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
    Note
    When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
    Alternative 2
    Effect
    If SINGLE is not specified and if columns does not contain only aggregate expressions, the resulting set has multiple lines. All database lines that are selected by the remaining additions of the SELECT command are included in the resulting list. If the ORDER BY addition is not used, the order of the lines in the resulting list is not defined and, if the same SELECT command is executed multiple times, the order may be different each time. A data object specified after INTO can be an internal table and the APPENDING addition can be used. If no internal table is specified after INTO or APPENDING, the SELECT command triggers a loop that has to be closed using ENDSELECT.
    If multiple lines are read without SINGLE, the DISTINCT addition can be used to exclude duplicate lines from the resulting list. If DISTINCT is used, the SELECT command circumvents SAP buffering. DISTINCT cannot be used in the following situations:
    If a column specified in columns has the type STRING, RAWSTRING, LCHAR or LRAW
    If the system tries to access pool or cluster tables and single columns are specified in columns.
    Note
    When specifying DISTINCT, note that you have to carry out sort operations in the database system for this.
    SELECT - columns
    Syntax
    | { {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ... }
    | (column_syntax) ... .
    Alternatives:
    1. ... *
    2. ... {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ...
    3. ... (column_syntax)
    Effect
    The input in columns determines which columns are used to build the resulting set.
    Alternative 1
    Effect
    If * is specified, the resulting set is built based on all columns in the database tables or views specified after FROM, in the order given there. The columns in the resulting set take on the name and data type from the database tables or views. Only one data object can be specified after INTO.
    Note
    If multiple database tables are specified after FROM, you cannot prevent multiple columns from getting the same name when you specify *.
    Alternative 2
    ... {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ...
    Effect
    A list of column labels col1 col2 ... is specified in order to build the resulting list from individual columns. An individual column can be specified directly or as an argument of an aggregate function aggregate. The order in which the column labels are specified is up to you and defines the order of the columns in the resulting list. Only if a column of the type LCHAR or LRAW is listed does the corresponding length field also have to be specified directly before it. An individual column can be specified multiple times.
    The addition AS can be used to define an alternative column name a1 a2 ... with a maximum of fourteen digits in the resulting set for every column label col1 col2 .... The system uses the alternative column name in the additions INTO|APPENDING CORRESPONDING FIELDS and ORDER BY. .
    Column labels
    The following column labels are possible:
    If only a single database table or a single view is specified after FROM, the column labels in the database table - that is, the names of the components comp1 comp2... - can be specified directly for col1 col2 ... in the structure of the ABAP Dictionary.
    If the name of the component occurs in multiple database tables of the FROM addition, but the desired database table or the view dbtab is only specified once after FROM, the names dbtab~comp1 dbtab~comp2 ... have to be specified for col1 col2 .... comp1 comp2 ... are the names of the components in the structure of the ABAP Dictionary.
    If the desired database table or view occurs multiple times after FROM, the names tabalias~comp1 tabalias~comp2 ... have to be specified for col1 col2 .... tabalias is the alternative table name of the database table or view defined after FROM, and comp1 comp2 ... are the names of the components in the structure of the ABAP Dictionary.
    The data type of a single column in the resulting list is the datatype of the corresponding component in the ABAP Dictionary. The corresponding data object after INTO or APPENDING has to be selected accordingly.
    Note
    If multiple database tables are specified after FROM, you can use alternative names when specifying single columns to avoid having multiple columns with the same name.
    Example
    Read specific columns of a single row.
    DATA wa TYPE spfli.
    SELECT SINGLE carrid connid cityfrom cityto
    INTO CORRESPONDING FIELDS OF wa
    FROM spfli
    WHERE carrid EQ 'LH' AND connid EQ '0400'.
    IF sy-subrc EQ 0.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDIF.
    Alternative 3
    ... (column_syntax)
    Effect
    Instead of static data, a data object column_syntax in brackets can be specified, which, when the command is executed, either contains the syntax shown with the static data, or is initial. The data object column_syntax can be a character-type data object or an internal table with a character-type data type. The syntax in column_syntax, like in the ABAP editor, is not case-sensitive. When specifying an internal table, you can distribute the syntax over multiple rows.
    If column_syntax is initial when the command is executed, columns is implicitly set to * and all columns are read.
    If columns are specificied dynamically without the SINGLE addition, the resulting set is always regarded as having multiple rows.
    Notes
    Before Release 6.10, you could only specify an internal table with a flat character-type row type for column_syntax with a maximum of 72 characters. Also, before Release 6.10, if you used the DISTINCT addition for dynamic access to pool tables or cluster tables, this was ignored, but since release 6.10, this causes a known exception.
    If column_syntax is an internal table with header line, the table body and not the header line is evaluated.
    Example
    Read out how many flights go to and from a city. The SELECT command is implemented only once in a sub-program. The column data, including aggregate function and the data after GROUP BY, is dynamic. Instead of adding the column data to an internal l_columns table, you could just as easily concatenate it in a character-type l_columns field.
    PERFORM my_select USING `CITYFROM`.
    ULINE.
    PERFORM my_select USING `CITYTO`.
    FORM my_select USING l_group TYPE string.
    DATA: l_columns TYPE TABLE OF string,
    l_container TYPE string,
    l_count TYPE i.
    APPEND l_group TO l_columns.
    APPEND `count( * )` TO l_columns.
    SELECT (l_columns)
    FROM spfli
    INTO (l_container, l_count)
    GROUP BY (l_group).
    WRITE: / l_count, l_container.
    ENDSELECT.
    ENDFORM.
    SELECT - aggregate
    Syntax
    ... { MAX( col )
    | MIN( col )
    | AVG( col )
    | SUM( col )
    | COUNT( DISTINCT col )
    | COUNT( * )
    | count(*) } ... .
    Effect
    As many of the specified column labels as you like can be listed in the SELECT command as arguments of the above aggregate expression. In aggregate expressions, a single value is calculated from the values of multiple rows in a column as follows (note that the addition DISTINCT excludes double values from the calculation):
    MAX( col ) Determines the maximum value of the value in the column col in the resulting set or in the current group.
    MIN( col ) Determines the minimum value of the content of the column col in the resulting set or in the current group.
    AVG( col ) Determines the average value of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    SUM( col ) Determines the sum of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    COUNT( DISTINCT col ) Determines the number of different values in the column col in the resulting set or in the current group.
    COUNT( * ) (or count(*)) Determines the number of rows in the resulting set or in the current group. No column label is specified in this case.
    If you are using aggregate expressions, all column labels that are not listed as an argument of an aggregate function are listed after the addition GROUP BY. The aggregate functions evaluate the content of the groups defined by GROUP BY in the database system and transfer the result to the combined rows of the resulting set.
    The data type of aggregate expressions with the function MAX, MIN or SUM is the data type of the corresponding column in the ABAP Dictionary. Aggregate expressions with the function AVG have the data type FLTP, and those with COUNT have the data type INT4. The corresponding data object after INTO or APPENDING has to be selected accordingly.
    Note the following points when using aggregate expressions:
    If the addition FOR ALL ENTRIES is used in front of WHERE, or if cluster or pool tables are listed after FROM, no other aggregate expressions apart from COUNT( * ) can be used.
    Columns of the type STRING or RAWSTRING cannot be used with aggregate functions.
    When aggregate expressions are used, the SELECT command makes it unnecessary to use SAP buffering.
    Null values are not included in the calculation for the aggregate functions. The result is a null value only if all the rows in the column in question contain the null value.
    If only aggregate expressions are used after SELECT, the results set has one row and the addition GROUP BY is not necessary. If a non-table type target area is specified after INTO, the command ENDSELECT cannot be used together with the addition SINGLE. If the aggregate expression count( * ) is not being used, an internal table can be specified after INTO, and the first row of this table is filled.
    If aggregate functions are used without GROUP BY being specified at the same time, the resulting set also contains a row if no data is found in the database. If count( * ) is used, the column in question contains the value 0. The columns in the other aggregate functions contain initial values. This row is assigned to the data object specified after INTO, and unless count( * ) is being used exclusively, sy-subrc is set to 0 and sy-dbcnt is set to 1. If count( *) is used exclusively, the addition INTO can be omitted and if no data can be found in the database, sy-subrc is set to 4 and sy-dbcnt is set to 0.
    if helpful reward points

  • Needed example working  code for  FM"LAST_DAY_IN_PERIOD_GET"

    needed example working  code for  FM"LAST_DAY_IN_PERIOD_GET"

    Hi,
    Go through this code
    *& Report  Z_FICO_REP_SHIPMENTS
    REPORT  z_fico_rep_shipments MESSAGE-ID sd.
    TYPE-POOLS : slis.
    TABLES : vbak,
             kna1,
             likp,
             vbfa.
    *>> DEFINE global Types
    TYPES : BEGIN OF gt_vbak,
              vbeln TYPE vbeln,
              kunnr TYPE kunnr ,
              spart TYPE spart,
              audat TYPE audat,
            END OF gt_vbak,
            BEGIN OF gt_kna1,
              kunnr TYPE kunnr,
              name1 TYPE name1,
            END OF gt_kna1,
            BEGIN OF gt_likp,
              vbeln     TYPE vbeln,
              wadat_ist TYPE wadat_ist,
            END OF gt_likp,
            BEGIN OF gt_vbfa,
              vbelv     TYPE vbelv,
              erdat     TYPE erdat,
              rfwrt     TYPE rfwrt,
           END OF gt_vbfa,
            BEGIN OF gt_final,
              kunnr   TYPE kunnr,
              name1   TYPE name1,
              cumon   TYPE monat,
              trcum   TYPE rfwrt,
              trcuy   TYPE rfwrt,
              perce   TYPE rfwrt,
              fiscy   TYPE gjahr,
              ftrcum  TYPE rfwrt,
              ftrcuy  TYPE rfwrt,
              fperce  TYPE rfwrt,
            END OF gt_final.
    DATA : gwa_vbak   TYPE gt_vbak,
           gwa_kna1   TYPE gt_kna1,
           gwa_likp   TYPE gt_likp,
           gwa_vbfa   TYPE gt_vbfa,
           gwa_final  TYPE gt_final,
           gwa_sort   TYPE slis_sortinfo_alv,
           gwa_layout TYPE slis_layout_alv.    "ALV Layout
    DATA : gi_vbak    TYPE STANDARD TABLE OF gt_vbak,
           gi_kna1    TYPE STANDARD TABLE OF gt_kna1,
           gi_likp    TYPE STANDARD TABLE OF gt_likp,
           gi_vbfa    TYPE STANDARD TABLE OF gt_vbfa,
           gi_likp1   TYPE STANDARD TABLE OF gt_likp,
           gi_vbfa1   TYPE STANDARD TABLE OF gt_vbfa,
           gi_final   TYPE STANDARD TABLE OF gt_final WITH HEADER LINE,
           gi_final1  TYPE STANDARD TABLE OF gt_final WITH HEADER LINE.
    *>> DEFINE INTERNAL TABLE
    DATA : gi_fieldcat    TYPE slis_t_fieldcat_alv,   "ALV Fieldcatalog
           gi_events      TYPE slis_t_event,          "ALV EventS
           gi_sort        TYPE slis_t_sortinfo_alv ,
           gi_top_of_page TYPE slis_t_listheader.     "ALV LIST HEADER
    DATA : gv_month(2) TYPE n.
    *>> GLOBAL CONSTANTS
    CONSTANTS: gc_day(2) TYPE n VALUE 01,
               gc_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE',
               gc_x TYPE c VALUE 'X'.
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_monat      TYPE     monat OBLIGATORY,
                p_gjahr     TYPE     gjahr OBLIGATORY.
    SELECT-OPTIONS : s_bukrs      FOR      vbak-bukrs_vf OBLIGATORY,
                     s_vkorg     FOR      vbak-vkorg,
                     s_spart     FOR     vbak-spart     OBLIGATORY,
                     s_audat   FOR    vbak-audat NO-DISPLAY.
    SELECTION-SCREEN:END OF BLOCK b1.
    SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    PARAMETERS: p_det RADIOBUTTON GROUP grp DEFAULT 'X' ,
              p_sum RADIOBUTTON GROUP grp.
    SELECTION-SCREEN:END OF BLOCK b2.
    START-OF-SELECTION.
    *>> Take Period And year and find starting and ending date
      PERFORM fiscal_date.
      PERFORM collect_data.
      PERFORM manipulation_collect_data.
    END-OF-SELECTION.
    *>> Sort
      PERFORM gi_sort_table.
    *>> MEARGE FIELD CATALOG USING INTERNAL TABLE
      PERFORM mearge_field_catalog.
    *>> SET EVENTS
      PERFORM set_event.
    *>> FOR ALV HEADER
      PERFORM n_top_of_page USING gi_top_of_page[].
    *>>For ALV Layout
      PERFORM build_layout.
    *>>For output display
      PERFORM alv_grid_display.
    *&      Form  fiscal_date
    FORM fiscal_date.
      TYPES : BEGIN OF lt_fisc,
                bukrs TYPE bukrs,
                periv TYPE periv,
                bumon TYPE bumon,
                butag TYPE butag,
              END OF lt_fisc,
              BEGIN OF lt_t009b,
                periv TYPE periv,
                bumon TYPE bumon,
                butag TYPE butag,
                poper TYPE poper,
               END OF lt_t009b.
      DATA : lwa_fisc  TYPE lt_fisc,
             lwa_t009b TYPE lt_t009b.
      DATA : li_fisc  TYPE STANDARD TABLE OF lt_fisc,
             li_t009b TYPE STANDARD TABLE OF lt_t009b.
      DATA : lv_date(2) TYPE c,
             lv_mont(2) TYPE c,
             lv_year(4) TYPE c.
      SELECT bukrs periv FROM t001
                         INTO TABLE li_fisc
                         WHERE bukrs IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT * FROM t009b
                 INTO CORRESPONDING FIELDS OF TABLE li_t009b
                 FOR ALL ENTRIES IN li_fisc
                 WHERE periv EQ li_fisc-periv .
        IF sy-subrc NE 0.
          CLEAR li_t009b.
        ENDIF.
      ELSE.
        CLEAR li_fisc.
      ENDIF.
      SORT li_t009b BY periv poper.
      LOOP AT li_fisc INTO lwa_fisc.
        READ TABLE li_t009b INTO lwa_t009b WITH KEY periv = lwa_fisc-periv
                                                    poper = '001'
                                           BINARY SEARCH.
        IF sy-subrc = 0.
          s_audat-option = 'EQ'.
          s_audat-sign   = 'I'.
          CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
            EXPORTING
              i_gjahr = p_gjahr
              i_periv = lwa_t009b-periv
              i_poper = lwa_t009b-poper
            IMPORTING
              e_date  = s_audat-low.
        ENDIF.
        CLEAR lwa_t009b.
        READ TABLE li_t009b INTO lwa_t009b WITH KEY periv = lwa_fisc-periv
                                                    poper = '012'
                                           BINARY SEARCH.
        IF sy-subrc = 0.
          CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
            EXPORTING
              i_gjahr = p_gjahr
              i_periv = lwa_t009b-periv
              i_poper = lwa_t009b-poper
            IMPORTING
              e_date  = s_audat-high.
        ENDIF.
        CLEAR lwa_t009b.
        READ TABLE li_t009b INTO lwa_t009b WITH KEY periv = lwa_fisc-periv
                                                    poper = p_monat
                                            BINARY SEARCH.
        IF sy-subrc = 0.
          lv_date = s_audat-high+6(2).
          lv_mont = s_audat-high+4(2).
          lv_year = s_audat-high(4).
          lv_mont = lwa_t009b-bumon.
          lv_date = lwa_t009b-butag.
          CONCATENATE lv_year lv_mont lv_date INTO s_audat-high.
          APPEND s_audat.
          CLEAR: lwa_fisc,lwa_t009b,lv_date,lv_mont,lv_year.
        ENDIF.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM s_audat.
    ENDFORM.                    "fiscal_date
    *&      Form  collect_data
    FORM collect_data .
      SELECT vbeln kunnr spart audat
          FROM vbak
          INTO TABLE gi_vbak
          WHERE audat    GE s_audat-low  AND
                audat    LT s_audat-high AND
                vkorg    IN s_vkorg AND
                spart    IN s_spart AND
                bukrs_vf IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT kunnr name1
        FROM kna1
        INTO TABLE gi_kna1
        FOR ALL ENTRIES IN gi_vbak
        WHERE kunnr EQ gi_vbak-kunnr.
        IF sy-subrc NE 0.
          CLEAR gi_kna1.
        ENDIF.
        SELECT vbeln wadat_ist
        FROM likp
        INTO TABLE gi_likp
        WHERE wadat_ist  GE s_audat-low  AND
              wadat_ist  LT s_audat-high .
        IF sy-subrc EQ 0.
          SELECT vbelv erdat rfwrt
          FROM vbfa
          INTO TABLE gi_vbfa
          FOR ALL ENTRIES IN gi_likp
          WHERE vbeln   = gi_likp-vbeln AND
                 ( vbtyp_n = 'M' OR
                vbtyp_n = 'H' ) .
          IF sy-subrc NE 0.
            CLEAR gi_vbfa.
          ENDIF.
        ELSE.
          CLEAR gi_likp.
        ENDIF.
        PERFORM change_date.
        SELECT vbeln wadat_ist
        FROM likp
        INTO TABLE gi_likp1
        WHERE wadat_ist  GE s_audat-low  AND
              wadat_ist  LT s_audat-high .
        IF sy-subrc EQ 0.
          SELECT vbelv erdat rfwrt
          FROM vbfa
          INTO TABLE gi_vbfa1
          FOR ALL ENTRIES IN gi_likp1
          WHERE vbeln   = gi_likp1-vbeln AND
                 ( vbtyp_n = 'M' OR
                vbtyp_n = 'H' ) .
          IF sy-subrc NE 0.
            CLEAR gi_vbfa.
          ENDIF.
        ELSE.
          CLEAR gi_likp.
        ENDIF.
      ELSE.
        MESSAGE i261.
        LEAVE SCREEN.
      ENDIF.
    ENDFORM.                    "collect_data
    *&      Form  Manipulation_collect_data
    FORM manipulation_collect_data.
      SORT gi_vbak BY vbeln.
      SORT gi_kna1 BY kunnr.
      LOOP AT gi_vbak INTO gwa_vbak.
        MOVE-CORRESPONDING gwa_vbak TO gwa_final.
        READ TABLE gi_kna1 INTO gwa_kna1 WITH KEY kunnr = gwa_vbak-kunnr
                                       BINARY SEARCH.
        IF sy-subrc EQ 0.
          gwa_final-name1 = gwa_kna1-name1.
        ENDIF.
      ENDLOOP.
    *    v_month = gwa_vbak-audat+4(2).
    *    gwa_final-cumon = p_monat.
    *    gwa_final-fiscy = p_gjahr.
    *    IF v_month = p_monat.
    *      CLEAR wa_ckmlhd.
    *      READ TABLE i_ckmlhd INTO wa_ckmlhd WITH KEY matnr = wa_vbap-matnr
    *                                                  bwkey = wa_vbap-werks
    *                                                  BINARY SEARCH.
    *      IF sy-subrc EQ 0.
    *        CLEAR i_nckmlcr.
    *        READ TABLE i_nckmlcr INTO wa_nckmlcr
    *                             WITH KEY kalnr = wa_ckmlhd-kalnr
    *                             BINARY SEARCH.
    *        IF sy-subrc EQ 0.
    *          gwa_final-peinh = wa_nckmlcr-peinh.
    *          gwa_final-kzwi6 = wa_vbap-kzwi6 - wa_vbap-kzwi5.
    *          gwa_final-kzwi5 = wa_vbap-kzwi5.
    *          gwa_final-totre = gwa_final-kzwi6 + gwa_final-kzwi5.
    *          gwa_final-actco = ( wa_nckmlcr-pvprs / wa_nckmlcr-peinh ) *
    *                            wa_vbap-kwmeng.
    *          gwa_final-profit = gwa_final-totre - gwa_final-actco.
    *          gwa_final-prows  = ( gwa_final-profit - gwa_final-kzwi6 ) *
    *100.
    *        ENDIF.
    *      ENDIF.
    *    ELSE.
    *      CLEAR wa_ckmlhd.
    *      READ TABLE i_ckmlhd INTO wa_ckmlhd WITH KEY matnr = wa_vbap-matnr
    *                                                bwkey = wa_vbap-werks
    *                                                BINARY SEARCH.
    *      IF sy-subrc EQ 0.
    *        READ TABLE i_ckmlcr INTO wa_ckmlcr
    *                             WITH KEY kalnr = wa_ckmlhd-kalnr
    *                             BINARY SEARCH.
    *        IF sy-subrc NE 0.
    *          CLEAR wa_ckmlcr.
    *        ENDIF.
    *        CLEAR wa_nckmlcr.
    *        READ TABLE i_nckmlcr INTO wa_nckmlcr
    *                             WITH KEY kalnr = wa_ckmlhd-kalnr
    *                             BINARY SEARCH.
    *        IF sy-subrc EQ 0.
    *          gwa_final-fkzwi6  = wa_vbap-kzwi6 - wa_vbap-kzwi5.
    *          gwa_final-fkzwi5  = wa_vbap-kzwi5.
    *          gwa_final-ftotre  = gwa_final-fkzwi6 + gwa_final-fkzwi5.
    *          gwa_final-factco  = ( ( wa_nckmlcr-pvprs / wa_ckmlcr-peinh )
    *                               * wa_vbap-kwmeng ) / wa_nckmlcr-count.
    *          gwa_final-fprofit = gwa_final-ftotre - gwa_final-factco.
    *         gwa_final-fprows  = ( gwa_final-fprofit - gwa_final-kzwi6 ) *
    *100
    *        ENDIF.
    *      ENDIF.
    *    ENDIF.
    *    APPEND gwa_final TO gi_final.
    *    CLEAR : gwa_final,wa_nckmlcr,wa_ckmlcr,wa_ckmlhd,
    *            gwa_vbak,wa_vbap,gwa_kna1.
    *  ENDLOOP.
    *  gwa_final-matnr = space.gwa_final-vbeln = space.
    *  MODIFY gi_final FROM gwa_final TRANSPORTING vbeln matnr
    *                                WHERE matnr NE space.
    *  SORT gi_final BY kunnr vbeln matnr.
    *  IF p_sum = gc_x.
    *    LOOP AT gi_final INTO gwa_final.
    *      COLLECT gwa_final INTO gi_final1.
    *    ENDLOOP.
    *    CLEAR gwa_final.REFRESH gi_final.
    *    gi_final[] = gi_final1[].
    *  ENDIF.
    ENDFORM.                    "manipulation_collect_data
    *&      Form  change_date
    FORM change_date.
      DATA : lv_date(2) TYPE c,
             lv_mont(2) TYPE c,
             lv_year(4) TYPE n.
      lv_date = s_audat-low+6(2).
      lv_mont = s_audat-low+4(2).
      lv_year = s_audat-low(4).
      lv_year = lv_year - 1.
      CONCATENATE  lv_year lv_mont lv_date INTO s_audat-low.
      CLEAR : lv_date ,lv_mont,lv_year.
      lv_date = s_audat-high+6(2).
      lv_mont = s_audat-high+4(2).
      lv_year = s_audat-high(4).
      lv_year = lv_year - 1.
      CONCATENATE  lv_year lv_mont lv_date INTO s_audat-high.
      CLEAR : lv_date ,lv_mont,lv_year.
    ENDFORM.                    " change_date
    *&      Form  gi_sort_table
    FORM gi_sort_table.
      IF p_det = gc_x.
        gwa_sort-spos = '1'.
        gwa_sort-fieldname = 'KUNNR'.
        gwa_sort-tabname = 'gi_final'.
        gwa_sort-up = gc_x.
        gwa_sort-subtot  = gc_x.
        APPEND gwa_sort TO gi_sort.
        CLEAR gwa_sort.
        gwa_sort-spos = '2'.
        gwa_sort-fieldname = 'NAME1'.
        gwa_sort-tabname = 'gi_final'.
        gwa_sort-up = gc_x.
        APPEND gwa_sort TO gi_sort.
    *  ELSE.
    *    gwa_sort-spos = '1'.
    *    gwa_sort-fieldname = 'KUNNR'.
    *    gwa_sort-tabname = 'gi_final'.
    *    gwa_sort-up = gc_x.
    *    APPEND gwa_sort TO gi_sort.
    *    CLEAR gwa_sort.
    *    gwa_sort-spos = '2'.
    *    gwa_sort-fieldname = 'NAME1'.
    *    gwa_sort-tabname = 'gi_final'.
    *    gwa_sort-up = gc_x.
    *    gwa_sort-group = gc_x.
    *    gwa_sort-subtot  = gc_x.
    *    APPEND gwa_sort TO gi_sort.
      ENDIF.
    ENDFORM.                    "gi_sort_table
    *&      Form  mearge_field_catalog
    FORM mearge_field_catalog .
    *>> LOCAL WORK AREA FOR FIELDCATALOG
      DATA : lwa_fieldcata TYPE slis_fieldcat_alv.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KUNNR'.
    *  lwa_fieldcata-col_pos      = 1.
      lwa_fieldcata-key          = 'X'.
      lwa_fieldcata-key_sel      = 'X'.
      lwa_fieldcata-ref_tabname  = 'KNA1'.
      lwa_fieldcata-seltext_l    = 'Customer No.'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'NAME1'.
    *  lwa_fieldcata-col_pos      = 2.
      lwa_fieldcata-ref_tabname  = 'KNA1'.
      lwa_fieldcata-seltext_l    = 'Customer Name'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      IF p_det = gc_x.
        CLEAR lwa_fieldcata.
        lwa_fieldcata-fieldname    = 'VBELN'.
    *    lwa_fieldcata-col_pos      = 3.
        lwa_fieldcata-ref_tabname  = 'VBAK'.
        lwa_fieldcata-seltext_l    = 'Sales Order Number'.
        APPEND lwa_fieldcata TO gi_fieldcat.
        CLEAR lwa_fieldcata.
        lwa_fieldcata-fieldname    = 'MATNR'.
    *    lwa_fieldcata-col_pos      = 4.
        lwa_fieldcata-ref_tabname  = 'VBAK'.
        lwa_fieldcata-seltext_l    = 'Material No.'.
        APPEND lwa_fieldcata TO gi_fieldcat.
      ENDIF.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KWMENG'.
      lwa_fieldcata-col_pos      = 5.
      lwa_fieldcata-ref_tabname  = 'VBAP'.
      lwa_fieldcata-do_sum       = 'X'.
      lwa_fieldcata-seltext_l    = 'Order Quantity'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'PEINH'.
      lwa_fieldcata-col_pos      = 6.
      lwa_fieldcata-ref_tabname  = 'CKMLCR'.
      lwa_fieldcata-text_fieldname = 'PEINH'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'CUMON'.
      lwa_fieldcata-col_pos      = 7.
      lwa_fieldcata-ref_tabname  = 'VBKPF'.
      lwa_fieldcata-seltext_l    = 'Month'.
      lwa_fieldcata-no_sum       = gc_x.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KZWI6'.
      lwa_fieldcata-col_pos      = 8.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Costed Sales'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KZWI5'.
      lwa_fieldcata-col_pos      = 9.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Surcharges'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'TOTRE'.
      lwa_fieldcata-col_pos      = 10.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Total Revenues'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'ACTCO'.
      lwa_fieldcata-col_pos      = 11.
      lwa_fieldcata-ref_tabname  = 'VBAP'.
      lwa_fieldcata-seltext_l    = 'Actual Cost for Period'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'PROFIT'.
      lwa_fieldcata-col_pos      = 12.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'PROWS'.
      lwa_fieldcata-col_pos      = 13.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit % w/surcharge'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FISCY'.
      lwa_fieldcata-col_pos      = 14.
    *  lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Fiscal Year'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FKZWI6'.
      lwa_fieldcata-col_pos      = 15.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Costed Sales'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FKZWI5'.
      lwa_fieldcata-col_pos      = 16.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Surcharges'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FTOTRE'.
      lwa_fieldcata-col_pos      = 17.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Total Revenues'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FACTCO'.
      lwa_fieldcata-col_pos      = 18.
      lwa_fieldcata-ref_tabname  = 'VBAP'.
      lwa_fieldcata-seltext_l    = 'Actual Cost for Period'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FPROFIT'.
      lwa_fieldcata-col_pos      = 19.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FPROWS'.
      lwa_fieldcata-col_pos      = 20.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit % w/surcharge'.
      APPEND lwa_fieldcata TO gi_fieldcat.
    ENDFORM.                    " mearge_field_catalog
    *&      Form  set_event
    FORM set_event .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 1
        IMPORTING
          et_events   = gi_events.
      SORT gi_events BY name.
    *-- To read Top of Page event
      PERFORM read_events USING slis_ev_top_of_page gc_top_of_page.
    ENDFORM.                    " set_event
    *&      Form  top_of_page
    FORM n_top_of_page USING lp_top_of_page TYPE slis_t_listheader.
      DATA: lwa_listhead TYPE slis_listheader,
            lv_ccode TYPE string,
            lv_sales TYPE string,
            lv_divis TYPE string.
      CONCATENATE 'From : ' s_bukrs-low  ' To: ' s_bukrs-high INTO lv_ccode.
      CONCATENATE 'From: ' s_vkorg-low       ' To: ' s_vkorg-high INTO lv_sales.
      CONCATENATE 'From: ' s_spart-low       ' To: ' s_spart-high INTO lv_divis.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'H'.
      lwa_listhead-info = text-003.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Month'.
      lwa_listhead-info = p_monat.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Year'.
      lwa_listhead-info = p_gjahr.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Company Code'.
      lwa_listhead-info = lv_ccode.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Sales Org'.
      lwa_listhead-info = lv_sales.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Division'.
      lwa_listhead-info = lv_divis.
      APPEND lwa_listhead TO lp_top_of_page.
      IF p_det = gc_x.
        CLEAR lwa_listhead.
        lwa_listhead-typ  = 'A'.
        lwa_listhead-info = text-004.
        APPEND lwa_listhead TO lp_top_of_page.
      ELSE.
        CLEAR lwa_listhead.
        lwa_listhead-typ  = 'A'.
        lwa_listhead-info = text-005.
        APPEND lwa_listhead TO lp_top_of_page.
      ENDIF.
    ENDFORM.                    "top_of_page
    *&      Form  TOP_OF_PAGE
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          i_logo             = 'ENJOYSAP_LOGO'
          it_list_commentary = gi_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  build_layout
    FORM build_layout .
      gwa_layout-no_input          = gc_x.
      gwa_layout-colwidth_optimize = gc_x.
      gwa_layout-zebra             = gc_x.
    ENDFORM.                    "build_layout
    *&      Form  alv_grid_display
    FORM alv_grid_display .
    * Function module to display ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = gwa_layout
          it_fieldcat        = gi_fieldcat[]
          it_sort            = gi_sort
          i_save             = 'A'
          it_events          = gi_events[]
        TABLES
          t_outtab           = gi_final
        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.                    " alv_grid_display
    *&      Form  read_events
    FORM read_events  USING  pr_events    TYPE slis_alv_event-name
                             pr_eventname TYPE slis_formname.
      DATA: lwa_event TYPE slis_alv_event.
      CLEAR lwa_event.
      READ TABLE gi_events INTO lwa_event
                          WITH KEY name = pr_events BINARY SEARCH.
      IF sy-subrc = 0.
        MOVE pr_eventname TO lwa_event-form.
        MODIFY gi_events FROM lwa_event
                        TRANSPORTING form
                        WHERE name = pr_events.
      ENDIF.
    ENDFORM.                    " read_events
    Regards
    Sandipan

Maybe you are looking for

  • Lousy DVD video quality on high res photos!

    I need some help. I am new to using iMovie and iDVD. I just created a 15 minute video with a lot of high resolution photos (anywhere from 1920x1200 to 4256x2828). These photos are sharp and look superb on a computer monitor. Once processed through iM

  • Pages suddenly requires a higher version of OSX?

    Greetings, I have a 2006 Mac Mini (1.66 GHz Intel Core Duo) which I acquired second hand form a friend. I upgraded to Snow Leopard (10.6.8) and bought the current version of Pages through the app store, and it worked wonderfully. However, I just had

  • Ios 6 map error feedback

    I'm just starting with maps on ios 6 on my iPhone 4 and iPad 2. I notice some errors when looking in my neighborhood. 1) The name of the neighborhood is incorrect. The name here actually belongs a couple miles away. 2) A non-existent street appears o

  • IChatAV problems with Mac OS X 10.5 Server

    I recently upgraded my server from Tiger to Leopard (Mac OS X Server 10.5.6) and now iChatAV is broken for both the server and the client behind it (Mac OS X 10.5.6). I can't even chat with the client from the server. (Text chat works fine.) I've che

  • How to start new backups WITHOUT encryption

    I'm one of those people who forgot the password for their encyrpted iphone backups ... BUT luckily I found that out BEFORE I had the actual need to restore my iPhone from said backups. Now I'd like to start a new set of backups from my phone, this ti