Std Internal Tables

Hi, what are Standard Internal Tables and Standard reports, and can I have names of some 'Standard Internal Tables' and  'Standard Reports' plz ?
Thnx.

these are some of the standard reports\
REKH0004
   SAP demo program that shows how to do  2d        3D, and 4D graphics.
RGUGBR00 
Substitution/Validation utility
RHGEN00
     Regen PD and PA inconsistencies
RHGRENZ0  
   Delimit IT1000 and related 1001s. Program                     will            delete any 1001 infotypes whose start date is after the delimit date.
RHGRENZ1
Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.
RHGRENZ2
Delimit IT1001 only.
RKCTSEAR
Search source code for up to two strings. Also see RSRSCAN1 and RPR_ABAP_SOURCE_SCAN.
RPDTRA00
List all HR transactions.
RPR_ABAP_SOURCE_SCAN
Search ABAP code for a string. Has many more options for selecting the ABAPs to search than RSRSCAN1 or RKCTSEAR.
RPUAUD00
HR Report to list all logged changes for an employee. Uses the PCL4 Audit Cluster.
RPUAUDDL
HR Report to delete audit data from the PCL4 Audit Cluster.
RPUDELPN
Delete all info for an employee number, including cluster data and infotypes
RPUP1D00/10
View/Delete data from PCL1 Cluster
RPUP2D00/10
View/Delete data from PCL2 Cluster
RPUP3D00/10
View/Delete data from PCL3 Cluster
RPUP4D00/10
View/Delete data from PCL4 Cluster
RSABAPIV
Mass print/display of ABAP/4 help text
RSAVGL00
Table adjustment across clients
RSBDCBTC
Submit a BDC job with an internal batch number and wait for the end of the batch input session.
RSBDCDRU
Prints the contents of a Batch Input session. No options for error transactions only.
RSBDCOS0
Execute UNIX commands. Looks similar to the old SAPMSOS0 program that disappeared in 3.0
RSBDCSUB
Release batch input sessions automatically
RSBTCDEL
Clean the old background job records
RSSDOCTB
R/3 Table Manual - prints a list of all fields in the selected tables with the field name and the field documentation.
RSCLTCOP
Copy tables across clients
RSDBCREO
Clean batch input session log
RSINCL00
Extended program list
RSNASTED
Process message control output for entries in the NAST table
RSORAREL
Get the Oracle Release
RSPARAM
Display all instance parameters
RSPO0041
Removing old spooling objects
RSRSCAN1
Search source code for a given string. Will also search includes. Also see RKCTSEAR and RPR_ABAP_SOURCE_SCAN.
RSSNAPDL
Clean the old ABAP error dumps
RSTBSERV
Compare a contents of a table between clients
RSTXFCON
Converts SAPScript page formats
RSTXSCRP
Save a SAPScript layout set to disk, and load it back into SAP.
RSTXSCRP
Transport SAPscript files across systems
RSTXSCRP
Upload and download SAPScript layout sets
RSTXTPDF4
Pass the spool number of a report's output to this program to have the output converted to PDF format.
RSTXTRAN
Add standard texts to a transport so they can be moved between systems.
RSUSR003
Check the passwords of users SAP* and DDIC in all clients
RSUSR006
List users last login
RSWBO052
Change development class of a sapscript (provided by Alan Cecchini)
RSWBO060
put objects into a request and transport it to any other system
inernal tables
INTERNAL TABLES IN ABAP:
There are two ways of accessing the records in an internal table:
By copying individual records into a work area. The work area must be compatible with the line type of the internal table.
You can access the work area in any way, as long as the component you are trying to access is not itself an internal table. If one of the components is an internal table, you must use a further work area, whose line type is compatible with that of the nested table.
When you change the internal table, the contents of the work area are either written back to the table or added as a new record.
By assigning the individual data records to an appropriate field symbol. Once the system has read an entry, you can address its components directly via its address. There is no copying to and from the work area. This method is particularly appropriate for accessing large or complex tables.
If you want to read more than one record, you must use a LOOP... ENDLOOP structure. You can then change or delete the line that has just been read, and the system applies the change to the table body. You can also change or delete lines using a logical condition.
When you use the above statements with sorted tables, you must ensure that the sort sequence is maintained.
Within a loop, the INSERT statement adds the data record before the current record in the table. If you want to insert a set of lines from an internal table into another index table, you should use the INSERT LINES OF variant instead.
When you read single data records, you can use two further additions:
In the COMPARING addition, the system compares the field contents of a data record with those in the work area for equality.
In the TRANSPORTING addition, you can restrict the data transport to selected fields.
Other statements for standard tables
SORT [ASCENDING|DESCENDING]
[BY [ASCENDING|DESCENDING] ..
[ASCENDING|DESCENDING]][AS TEXT] [STABLE].
These statements sort the table by the table key or the specified field sequence. If you do not use an addition, the system sorts ascending. If you use the AS TEXT addition, character fields are sorted in culture-specific sequence. The relative order of the data records with identical sort keys only remain constant if you use the STABLE addition.
APPEND INTO SORTED BY .
This statement appends the work area to the ranked list in descending order. The ranked list may not be longer than the specified INITIAL SIZE, and the work area must satisfy the sort order of the table.
The statements listed here can be used freely with both standard and sorted tables.
When you change a single line, you can specify the fields that you want to change using the TRANSPORTING addition. Within a loop, MODIFY changes the current data record.
If you want to delete a set of lines from an index table, use the variant DELETE FROM... TO.. or WHERE... instead of a loop. You can program almost any logical expression after WHERE.
The only restriction is that the first field in each comparison must be a component of the line structure (see the corresponding Open SQL statements). You can pass component names dynamically.
If you want to delete the entire internal table , use the statement CLEAR .
In the LOOP AT... ENDLOOP structure, the statements within the loop are applied to each data record in turn. The INTO addition copies entries one at a time into the work area.
The system places the index of the current loop pass in the system field sy-tabix. When the loop has finished, sy-tabix has the same value that it had before the loop started.
Inserting and deleting lines within a loop affects the following loop passes.
Access to a hashed table is imple mented using a hash algorithm. Simplified, this means that the data records are distributed randomly but evenly over a particular memory area.. The addresses are stored in a special table called the hashing table .
There is a hash function, which determines the address at which the pointer to a data record with a certain key can be found. The function is not injective, that is, there can be several data records stored at a single address. This is implemented internally as a chained list. Therefore, although the system still has to search sequentially within these areas, it only has to read a few data records (usually no more than three). The graphic illustrates the simplest case, that is, in which there is only one data record stored at each address.
Using a hash technique means that the access time no longer depends on the total number of entries in the table. On the contrary, it is always very fast. Hash tables are therefore particularly useful for large tables with which you use predominantly read access.
Data records are not inserted into the table in a sorted order. As with standard tables, you can sort hashed tables using the SORT statement:
SORT [ASCENDING|DESCENDING]
[BY [ASCENDING|DESCENDING] ..
[ASCENDING|DESCENDING]][AS TEXT].
Sorting the table can be useful if you later want to use a loop to access the table.
You can use the statements listed here with tables of all three types. Apart from a few special cases, you can recognize the statements from the extra keyword TABLE. The technical implementation of the statements varies slightly according to the table type.
As a rule, index access to an internal table is quickest. However, it sometimes makes more sense to access data using key values. A unique key is only possible with sorted and hashed tables. If you use the syntax displayed here, your program coding is independent of the table type (generic type specification, easier maintenance).
With a standard table, inserting an entry has the same effect as appending. With sorted tables with a non-unique key, the entry is inserted before the first (if any) entry with the same key.
To read individual data records using the first variant, all fields of that are key fields of must be filled. and can be identical. If you use the WITH TABLE KEY addition in the second variant, you must also specify the key fully. Otherwise, the system searches according to the sequence of fields that you have specified, using a binary search where possible. You can force the system to use a binary search with a standard table using the BINARY SEARCH addition.
In this case, you must sort the table by the corresponding fields first. The system returns the first entry that meets the selection criteria.
Similarly to when you read entries, when you change and delete entries using the key and a work area, you must specify all of the key fields.
You can prevent fields from being transported into the work area during loop processing by using the TRANSPORTING NO FIELDS addition in the WHERE condition. (You can use this to count the number of a particular kind of entry.)
Other statements for all table types
DELETE ADJACENT DUPLICATES FROM
[COMPARING .. | A L L F I E L }|ALL FIELDS}].
The system deletes all adjacent entries with the same key field contents apart from the first entry. You can prevent the system from only comparing the key field using the COMPARING addition. If you sort the table by the required fields beforehand, you can be sure that only unique entries will remain in the table after the DELETE ADJACENT DUPLICATES statement.
Searches all lines of the table for the string . If the search is successful, the system sets the fields sy-tabix and sy-fdpos.
FREE .
Unlike CLEAR, which only deletes the contents of the table, FREE releases the memory occupied by it as well.
If you want to access your data using the index and do not need your table to be kept in sorted order or to have a unique key, that is, when the sequence of the entries is the most important thing, not sorting by key or having unique entries, you should use standard tables. (If you decide you need to sort the table or access it using the key or a binary search, you can always program these functions by hand.)
This example is written to manage a waiting list.
Typical functions are:
Adding a single entry,
Deleting individual entries according to certain criteria,
Displaying and then deleting the first entry from the list,
Displaying someone's position in the list.
For simplicity, the example does not encapsulate the functions in procedures.
The first thing we do in the example is to declare line and table type, from which we can then declare a work area and our internal table. We also require an elementary field for passing explicit index values.
This example omits the user dialogs and data transport, assuming that you understand the principles involved. We really only want to concentrate on the table access:
Adding new entries
The data record for a waiting customer is only added to the table if it does not already exist in it. If the table had a unique key, you would not have had to have programmed this check yourself.
Deleting single entries according to various criteria
The criterion is the key field. However, other criteria would be possible - for example, deleting data records older than a certain insertion date reg_date.
Displaying and deleting the first entry from the list
Once a customer comes to the top of the waiting list, you can delete his or her entry. If the waiting list is empty, such an action has no effect. Consequently, you do not have to check whether there are entries in the list before attempting the deletion.
Displaying the position of a customer in the waiting list
As above, you do not need to place any data in the work area. We are only interested in the values of sy-subrc and sy-tabix. If the entry is not in the table, sy-tabix is set to zero.
At this stage, let us return to the special case of the restricted ranked list:
DATA {TYPE|LIKE} STANDARD TABLE OF ... INITIAL SIZE . ... APPEND INTO SORTED BY .
When you choose to use a sorted table, it will normally be because you want to define a unique key.
The mere fact that the table is kept in sorted order is not that significant, since you can sort any kind of internal table. However, with sorted tables (unlike hashed tables), new data records are inserted in the correct sort order. If you have a table with few entries but lots of accesses that change the contents, a sorted table may be more efficient than a hashed table in terms of runtime.
The aim of the example here is to modify the contents of a database table. The most efficient way of doing this is to create a local copy of the table in the program, make the changes to the copy, and then write all of its data back to the database table. When you are dealing with large amounts of data, this method both saves runtime and reduces the load on the database server. Since the internal table represents a database table in this case, you should ensure that its records have unique keys.
This is assured by the key definition. Automatic sorting can also bring further advantages.
When you change a group of data records, only the fields price and currency are copied from the work area.
This means that, with larger tables, the access time is reduced significantly in comparison with a binary search. In a loop, however, the hashed table has to search the entire table (full table scan). Since the table entries are stored unsorted, it would be better to use a sorted table if you needed to run a loop through a left-justified portion of the key.
It can also be worth using a hashed table but sorting it. A typical use for hashed tables is to buffer detailed information that you need repeatedly and can identify using a unique key. You should bear in mind that you can also set up table buffering for a table in the ABAP Dictionary to cover exactly the same case. However, whether the tables are buffered on the application table depends on the size of the database table.
Buffering in the program using hashed tables also allows you to restrict the dataset according to your own needs, or to buffer additional data as required.
In this example, we want to allow the user to enter the name of a city, and the system to display its geographical coordinates.
First, we fill our "buffer table" city_list with values from the database table sgeocity. Then, we read an entry from the hashed table, specifying the full key.
The details are displayed as a simple list. At this point, it is worth repeating that you should only use this buffering technique if you want to keep large amounts of data locally in the program. You must ensure that you design your hashed table so that it is possible to specify the full key when you access it from your program.
You can define internal tables either with (WITH HEADER LINE addition) or without header lines. An internal table with header line consists of a work area (header line) and the actual table body. You address both objects using the same name. The way in which the system interprets the name depends on the context. For example, the MOVE statement applies to the header line, but the SEARCH statement applies to the body of the table.
To avoid confusion, you are recommended to use internal tables without header lines. This is particularly important when you use nested tables. However, internal tables with header line do offer a shorter syntax in several statements (APPEND, INSERT, MODIFY, COLLECT, DELETE, READ, LOOP).
hope this is helpful
do reward

Similar Messages

  • Loop at internal Table inside Script

    Hi
       I am filling a table in a subroutine in a program  and calling it through 'Perform' from my Script,now the main issue is , How to display the table in my script ? 
                I want to loop through an internal table & display its content on my script , but i can't make changes in the calling program by any means.

    Hi Ajitabh ,
    With PERFORM inside SAPSCRIPT you can only pass individual fields and also get back individual fields .
    Check This
    http://help.sap.com//saphelp_470/helpdata/EN/d1/802fd3454211d189710000e8322d00/frameset.htm
    Only "USING" and CHANGING" options are allowed and that too only symbols available / defined in sapscript can be passed .
    Even if you populate an internal table in the program you are calling with "PERFORM" there is no way to pass this internal table back to sapscript , also in SAPSCRIPT there is no way to loop .
    If you are sure about the no of lines you are going to populate and all lines have only one column ( only one field ) you can try something like this .
    /: PERFORM GET_VALUE IN PROGRAM <ZNAME>
    /: USING &VAR1&
    /: USING &VAR2&
    /: CHANGING &ITAB1&
    /: CHANGING &ITAB2&
    /: CHANGING &ITAB3&
    /: CHANGING &ITAB4&
    /: ENDPERFORM
    Anothe way is to loop in the main print program and call WRITE_FORM . But I guess your main print program is a SAP std program which you dont want to copy and change.
    Cheers.

  • Internal Table in MIRO

    Experts,
    While doing IR in MIRO , i have entered a PO no . then the Line Items under this PO are getting displayed.in PO Reference Tab. Suppose there are 3 line Items . But i want to do IR for only 2 line items (whose Quality Inspection has been done).
    In debugging am unable to find in which Internal Table of which std / Include program , the two selected records have been stored before the 'Simulate Tab' is pressed .
    Please help .
    Thanks in Advance
    Jack

    1-Check this BADI INVOICE_UPDATE
    method is CHANGE_AT_SAVE
    2-You can also look into MM08R002 and FM EXIT_SAPLMR1M_001 .
    Lets see if it is helpful.
    Neha

  • ALV grid is not displaying few fields of final internal table of type DMBTR

    hello frnds,
    i am displaying 10 fields in ALV grid using field catalog.
    among them five fields are currency fields on which i doing some arithematic operations. but all these fields are not getting displayed in alv grid.
    here is my code....
    declaring final strucutre to generate report
    TYPES:BEGIN OF ty_final,
              gjahr   TYPE gjahr,       " Year
              wwert   TYPE wwert_d,     " Traslation date
              bukrs   TYPE bukrs,       " company code
              hkont   TYPE hkont,       " General ledger account
              txt20   TYPE txt20_skat,  " Account name
              belnr   TYPE belnr_d,     " Purchase order number
              shkzg   TYPE shkzg,       " Dt/Cr indicator
              dmbtr1   TYPE dmbtr,       " Ammount in local currency
              v_alc   TYPE dmbtr,       " Ammount in local currency
              wrbtr   TYPE wrbtr,       " Ammount in foreign currency
              ebeln   TYPE ebeln,       " Purchase order number
              ebelp   TYPE ebelp,       " Item number
              matnr   TYPE matnr,       " Material number
              menge   TYPE menge_d,     " Qunatity
              meins   TYPE meins,       " Unit of measure
              stprs   TYPE stprs,       " Std material master
              v_iv    TYPE dmbtr,       " Invoice value
              pswsl   TYPE pswsl,       " Currency
              v_erc   TYPE dmbtr,       " Exchange rate calculated
              v_op    TYPE dmbtr,       " Order price
              v_uos   TYPE dmbtr,       " Unit order to stock
              v_io    TYPE dmbtr,       " Invoice to order
              v_uv    TYPE dmbtr,       " Unit value
              v_t     TYPE dmbtr,       " Total
              v_d     TYPE dmbtr,       " Differecne
              netpr   TYPE bprei,       " Net price in purchasing document
              v_total TYPE dmbtr,       " Total
              v_os    TYPE dmbtr,       " Order to stock
              v_ito   TYPE dmbtr,       " Invoice to order
              saknr   TYPE saknr,       " G/L account number
           END OF ty_final.
    FORM move_data.
      IF NOT i_bseg[] IS INITIAL.
        LOOP AT i_bseg INTO wa_bseg.
          wa_final-gjahr  = wa_bseg-gjahr.
          wa_final-bukrs  = wa_bseg-bukrs.
          wa_final-hkont  = wa_bseg-hkont.
          wa_final-belnr  = wa_bseg-belnr.
          wa_final-shkzg  = wa_bseg-shkzg.
          wa_final-wrbtr  = wa_bseg-wrbtr.
          wa_final-ebeln  = wa_bseg-ebeln.
          wa_final-ebelp  = wa_bseg-ebelp.
          wa_final-matnr  = wa_bseg-matnr.
          wa_final-menge  = wa_bseg-menge.
          wa_final-meins  = wa_bseg-meins.
          wa_final-pswsl  = wa_bseg-pswsl.
          wa_final-dmbtr1  = wa_bseg-dmbtr.
          wa_final-saknr  = wa_bseg-saknr.
          wa_final-v_total = wa_bseg-dmbtr.
          READ TABLE i_bkpf INTO wa_bkpf WITH KEY bukrs = wa_bseg-bukrs.
          IF sy-subrc = 0.
            wa_final-wwert = wa_bkpf-wwert.
          ENDIF.
         CLEAR wa_bkpf.
          READ TABLE i_mbew INTO wa_mbew WITH KEY matnr = wa_bseg-matnr.
          IF sy-subrc = 0.
            wa_final-stprs = wa_mbew-stprs.
          ENDIF.
         CLEAR wa_mbew.
          READ TABLE i_ekpo INTO wa_ekpo WITH KEY ebeln = wa_bseg-ebeln.
          IF sy-subrc = 0.
            wa_final-netpr = wa_ekpo-netpr.
          ENDIF.
         CLEAR wa_ekpo.
          READ TABLE i_skat INTO wa_skat WITH KEY saknr = wa_bseg-saknr.
          IF sy-subrc = 0.
            wa_final-txt20 = wa_skat-txt20.
          ENDIF.
    calculating output values
          IF wa_bseg-shkzg = 'H'.
            wa_final-v_alc = -1 * wa_bseg-dmbtr.
          ELSEIF wa_bseg-shkzg = 'S'.
            wa_final-v_alc = 1 * wa_bseg-dmbtr.
          ENDIF.
         DATA : l_c_v_alc TYPE p DECIMALS 2,
         l_c_v_iv TYPE p DECIMALS 2.
         l_c_v_alc = wa_final-v_alc.
          IF wa_bseg-menge NE 0.
            wa_final-v_iv = wa_bseg-dmbtr / wa_bseg-menge.
          ENDIF.
          IF wa_bseg-dmbtr NE 0.
            wa_final-v_erc  = wa_bseg-wrbtr   / wa_final-dmbtr1.
          ENDIF.
          IF wa_final-v_erc NE 0.
            wa_final-v_op   = wa_ekpo-netpr   / wa_final-v_erc.
          ENDIF.
          wa_final-v_uos  = wa_mbew-stprs   - wa_final-v_op.
          wa_final-v_io   = wa_final-v_iv   + wa_final-v_uos.
          wa_final-v_uv   = wa_final-v_uos  + wa_final-v_io.
          wa_final-v_t    = wa_final-v_uv   + wa_bseg-menge.
          wa_final-v_d    = wa_final-v_t    - wa_final-v_alc.
          wa_final-v_os   = wa_final-v_uos  * wa_bseg-menge.
          wa_final-v_ito  = wa_final-v_io   * wa_bseg-menge.
          CLEAR wa_bseg.
          APPEND wa_final TO i_final.
          CLEAR wa_final.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "data_retrieval
    *&      Form  build_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat.
      CLEAR wa_fieldcat.
    *  TYPES : v_alc TYPE dmbtr. "curr. " decimal 2.
    DATA: l_c_v_alc TYPE p DECIMALS 2,
    l_c_v_iv TYPE p DECIMALS 2 .
    l_c_v_alc = v_alc.
    l_c_v_iv = v_iv.
    Constant Declarations.
      CONSTANTS:
                l_c_gjahr(5)   TYPE c VALUE 'GJAHR',      " Year
                l_c_wwert(5)   TYPE c VALUE 'WWERT',      " Traslation date
                l_c_bukrs(5)   TYPE c VALUE 'BUKRS',      " company code
                l_c_hkont(5)   TYPE c VALUE 'HKONT',      " General ledger account
                l_c_txt20(10)  TYPE c VALUE 'TXT20',      " Account name
                l_c_belnr(5)   TYPE c VALUE 'BELNR',      " Doc number
                l_c_shkzg(5)   TYPE c VALUE 'SHKZG',      " Dt/Cr indicator
                l_c_dmbtr(5)   TYPE c VALUE 'DMBTR1',      " Ammount in local currency
               " l_c_v_alc      TYPE c VALUE 'V_ALC',      " Ammount in local currency
                l_c_wrbtr(5)   TYPE c VALUE 'WRBTR',      " Ammount in foreign currency
                l_c_ebeln(5)   TYPE c VALUE 'EBELN',      " Purchase order number
                l_c_ebelp(5)   TYPE c VALUE 'EBELP',      " Item number
                l_c_matnr(5)   TYPE c VALUE 'MATNR',      " Material number
                l_c_menge(7)   TYPE c VALUE 'MENGE',      " Qunatity
                l_c_meins(5)   TYPE c VALUE 'MEINS',      " Unit of measure
                l_c_stprs(5)   TYPE c VALUE 'STPRS',      " Std material master
               " l_c_v_iv(4)    TYPE c VALUE 'V_IV',           " Invoice value
                l_c_pswsl(5)   TYPE c VALUE 'PSWSL',      " Currency
                l_c_v_erc(5)   TYPE c VALUE 'V_ERC',      " Exchange rate calculated
                l_c_v_op(4)    TYPE c VALUE 'V_OP',       " Order price
                l_c_v_uos(5)   TYPE c VALUE 'V_UOS',      " Unit order to stock
                l_c_v_io(4)    TYPE c VALUE 'V_IO',       " Invoice to order
                l_c_v_uv(4)    TYPE c VALUE 'V_UV',       " Unit value
                l_c_v_t(3)     TYPE c VALUE 'V_T',        " Total
                l_c_v_d(3)     TYPE c VALUE 'V_D',        " Differecne
                l_c_netpr(5)   TYPE c VALUE 'NETPR',      " Net price in purchasing document
                l_c_v_total(7) TYPE c VALUE 'V_TOTAL',    " Total
                l_c_v_os(4)    TYPE c VALUE 'V_OS',      " Order to stock
                l_c_v_ito(5)   TYPE c VALUE 'V_ITO',      " Invoice to order
                l_c_saknr(5)   TYPE c VALUE 'SAKNR',      " G/L account number
                l_c_i_final(7) TYPE c VALUE 'I_FINAL'.    " Final internal table
    Fieldcat for fiscal year
      wa_fieldcat-col_pos   =  1.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_gjahr.
      wa_fieldcat-seltext_m = text-007.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Translation date
      wa_fieldcat-col_pos   =  2.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_wwert.
      wa_fieldcat-seltext_m = text-008.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Company code
      wa_fieldcat-col_pos   =  3.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_bukrs.
      wa_fieldcat-seltext_m = text-009.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for General ledger account
      wa_fieldcat-col_pos   =  4.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_hkont.
      wa_fieldcat-seltext_m = text-010.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Account name
      wa_fieldcat-col_pos   =  5.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_txt20.
      wa_fieldcat-seltext_m = text-011.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Doc number
      wa_fieldcat-col_pos   =  6.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_belnr.
      wa_fieldcat-seltext_m = text-012.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Dt/Cr indicator
      wa_fieldcat-col_pos   =  7.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_shkzg.
      wa_fieldcat-seltext_m = text-013.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Ammount in local currency
      wa_fieldcat-col_pos   =  8.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'DMBTR1'.
      wa_fieldcat-seltext_m = text-014.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Ammount in local currency
      wa_fieldcat-col_pos   =  9.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'V_ALC'.
      wa_fieldcat-seltext_m = text-015.
      wa_fieldcat-ref_fieldname = 'DMBTR'.
    wa_fieldcat-no_sign   = 'X'.
    wa_fieldcat-do_sum    =  c_x.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Ammount in foreign currency
      wa_fieldcat-col_pos   =  10.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_wrbtr.
      wa_fieldcat-seltext_m = text-016.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Purchse order number
      wa_fieldcat-col_pos   =  11.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_ebeln.
      wa_fieldcat-seltext_m = text-017.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Item No
      wa_fieldcat-col_pos   =  12.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_ebelp.
      wa_fieldcat-seltext_m = text-018.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Material number
      wa_fieldcat-col_pos   =  13.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_matnr.
      wa_fieldcat-seltext_m = text-019.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Qunatity
      wa_fieldcat-col_pos   =  14.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_menge.
      wa_fieldcat-seltext_m = text-020.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Unit of measure
      wa_fieldcat-col_pos   =  15.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_meins.
      wa_fieldcat-seltext_m = text-021.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Std material master
      wa_fieldcat-col_pos   =  16.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_stprs.
      wa_fieldcat-seltext_m = text-022.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Invoice value,
      wa_fieldcat-col_pos   =  17.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'V_IV'.
      wa_fieldcat-seltext_m = text-023.
      wa_fieldcat-ref_fieldname = 'DMBTR'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Currency
      wa_fieldcat-col_pos   =  18.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_pswsl.
      wa_fieldcat-seltext_m = text-024.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Exchange rate calculated
      wa_fieldcat-col_pos   =  19.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'V_ERC'.
      wa_fieldcat-seltext_m = text-025.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Order price
      wa_fieldcat-col_pos   =  20.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_op.
      wa_fieldcat-seltext_m = text-026.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Unit order to stock
      wa_fieldcat-col_pos   =  21.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_uos.
      wa_fieldcat-seltext_m = text-027.
      wa_fieldcat-do_sum    = c_x.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Invoice to order
      wa_fieldcat-col_pos   =  22.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_io.
      wa_fieldcat-seltext_m = text-028.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Unit value
      wa_fieldcat-col_pos   =  23.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_uv.
      wa_fieldcat-seltext_m = text-029.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Total
      wa_fieldcat-col_pos   =  24.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_t.
      wa_fieldcat-seltext_m = text-030.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Difference
      wa_fieldcat-col_pos   =  25.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_d.
      wa_fieldcat-seltext_m = text-031.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Net Price in Purchasing Document
      wa_fieldcat-col_pos   =  26.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_netpr.
      wa_fieldcat-seltext_m = text-032.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Total
      wa_fieldcat-col_pos   =  27.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_total.
      wa_fieldcat-seltext_m = text-033.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Order to stock
      wa_fieldcat-col_pos   =  28.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_os.
      wa_fieldcat-seltext_m = text-034.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Invoice to order
      wa_fieldcat-col_pos   =  29.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_ito.
      wa_fieldcat-seltext_m = text-035.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    fieldcat for invoice to order
      wa_fieldcat-col_pos   =  30.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_saknr.
      wa_fieldcat-seltext_m = text-035.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                    "build_fieldcat

    Hi romanch,
    defining the field catalog you must reference all currency fields to the respective currency key field (type CUKY).
    <alv_fieldcat>-cfieldname         = 'HWAER'.
    This is sample for alv output of a currency field. The alv structure has a field HWAER which carries the currency key, e.g. USD or so.
    Obviously you do not provide a cutrrency key for your values. If they are initial (zero), ALV will not display them as 0,00 but leave the field empty if the reference too currency key is not established.
    If you define a DDIC structure for the ALV output this refernce is enforced. You can pass the DDIC structure name to the ALV and don not have to create the field catalog manually.
    Regards,
    Clemens

  • Issue with clearing internal table

    Hi Gurus,
    I am working on an issue, where when we run a std. report we see social number of the employee on the output screen, when I debugged the program I found that there are 2 internal tables where we are putting this SSN. I tried to clear the SSN at the both the places like:
    loop at it_table.
    clear it_table-SSN.
    Endloop.
    but still when I ran the report I am seeing social there. so can you please give me any idea of what I am doing wrong?
    Thanks,
    Rajeev Gupta

    Hi rajeev,
    even after ur clearing if the field is still populating it means again its filling the particular field in the later place.
    1) keep ur code and while debuging just click on watchpoint and give ur field name go with f8 it will take u to the place the field is filling..
    2) below that place clear that field and modify the table..

  • OO  ALV  displaying  without  Values  despite Internal  table contains

    My   below  OO  ALV  displaying  without  Values  despite Internal  table contains  the values ...
    Help  please ...
    REPORT zsd_concession1  NO STANDARD PAGE HEADING
                            LINE-SIZE 285
                            LINE-COUNT 64
                            MESSAGE-ID zz.
    Program Description ******************************
    This report is to Calculate consession against Quotations
    complying  standards for enhanced Performance, Readability &
    Maintenance.
    Change Log *********************************
    Remedy # /       Who       When        Why / What
    Transport #
    CLASS lcl_event_handler DEFINITION DEFERRED.
    *&      Data Definitions .
    DATA: BEGIN OF vbap_wa,
                vbeln               TYPE  vbak-vbeln,           "Quotation#
                erdat               TYPE  vbak-erdat,           "Quot date
                knumv               TYPE  vbak-knumv,           "Cond Rec#
                posnr               TYPE  vbap-posnr,           "Line Item
                matnr               TYPE  vbap-matnr,           "Mat#
                zansicat            TYPE  zmarall-zansicat,     "AnsiCat#
                zansigrd            TYPE  zmarall-zansigrd,     "Grade
                zcurrvaltnarea      TYPE  zco002-zcurrvaltnarea,"Val Area
                zcurrcstusd         TYPE  zco002-zcurrcstusd,   "Cost$
                zzbrndnm            TYPE  mara-zzbrndnm,        "Brand
                zqedscgrp           TYPE  zglbprc-zqedscgrp, "QE Disc Grp
                mstav               TYPE  mara-mstav,        "Status
                kwmeng              TYPE  vbap-kwmeng,       "Qty
                lprc                TYPE  konv-kbetr,  "List Price ZBP1
                sprc                TYPE  konv-kbetr,  "Std Pric ZNAA,ZNAX
                netpr               TYPE  vbap-netpr,  "Quot price
                mrgn                TYPE  konv-kbetr,  "margin%
           END   OF vbap_wa,
           BEGIN OF konv_wa,
                knumv               TYPE  konv-knumv,  "Cond#
                kposn               TYPE  konv-kposn,  "Cond Item#
                kappl               TYPE  konv-kappl,  "Applic
                kschl               TYPE  konv-kschl,  "Cond Typ
                kbetr               TYPE  konv-kbetr,  "Price ZBP1,ZNAA,ZNAX
           END   OF  konv_wa,
           BEGIN OF vbpa_wa,
                vbeln               TYPE  vbpa-vbeln,  "Quot#
                posnr               TYPE  vbpa-posnr,  "Item#
                parvw               TYPE  vbpa-parvw,  "Prt Fn
                kunnr               TYPE  vbpa-kunnr,  "Cust#
           END   OF  vbpa_wa,
           BEGIN OF result_wa,
                posnr               TYPE  vbap-posnr,           "Line Item
                matnr               TYPE  vbap-matnr,           "Mat#
                zansicat            TYPE  zmarall-zansicat,     "AnsiCat#
                zansigrd            TYPE  zmarall-zansigrd,     "Grade
                zcurrvaltnarea      TYPE  zco002-zcurrvaltnarea,"Val Area
                zcurrcstusd         TYPE  zco002-zcurrcstusd,   "Cost$
                zzbrndnm            TYPE  mara-zzbrndnm,        "Brand
                zqedscgrp           TYPE  zglbprc-zqedscgrp, "QE Disc Grp
                mstav               TYPE  mara-mstav,        "Status
                kwmeng              TYPE  vbap-kwmeng,       "Qty
                lprc                TYPE  konv-kbetr,  "List Price ZBP1
                sprc                TYPE  konv-kbetr,  "Std Pric ZNAA,ZNAX
                netpr               TYPE  vbap-netpr,  "Quot price
                mrgn                TYPE  konv-kbetr,  "margin%
           END   OF result_wa.
    DATA: ikonv      LIKE  STANDARD TABLE OF konv_wa,
          ivbap      LIKE  STANDARD TABLE OF vbap_wa,
          ivbpa      LIKE  STANDARD TABLE OF vbpa_wa,
          iresult    LIKE  STANDARD TABLE OF result_wa.
    *Work storage
    DATA: BEGIN OF ws,
             vbeln       TYPE vbak-vbeln,
             ok_code     TYPE sy-ucomm,
             alv_save    TYPE c,   "ALV save
             alv_variant TYPE disvariant, "ALV Variant
             alv_sort    TYPE lvc_t_sort, "Sort table
          END  OF ws.
    *Data declarations for ALV Main list
    DATA : ty_lay1        TYPE        lvc_s_layo,
           it_fieldcat    TYPE        lvc_t_fcat ,
           ty_fieldcat    TYPE        lvc_s_fcat ,
           l_smenu        TYPE REF TO cl_ctmenu,
           c_alv1         TYPE REF TO cl_gui_alv_grid,
           c_cont1        TYPE REF TO cl_gui_custom_container,
           e_dclick       TYPE REF TO lcl_event_handler.
    *Data declarations for ALV Interactive list
    DATA : ty_lay2        TYPE        lvc_s_layo,
           it_fcat        TYPE        lvc_t_fcat ,
           ty_fcat        TYPE        lvc_s_fcat ,
           c_alv2         TYPE REF TO cl_gui_alv_grid,
           c_cont2        TYPE REF TO cl_gui_custom_container.
    *Field-Symbols
    FIELD-SYMBOLS:
          <konv>  LIKE   konv_wa,
          <vbap> LIKE   vbap_wa.
    *Constants
    CONSTANTS:
          c_end_row    TYPE  i  VALUE  65000.
    *CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
         handle_double_click
         FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row.
    ENDCLASS. "lcl_event_handler DEFINITION
    *CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_double_click.
        DATA: sec_wa LIKE LINE OF iresult.
    *Reading the selected data into a variable
        READ TABLE iresult INDEX e_row-index INTO sec_wa.
    *Select the field details of the selected table
    SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
    WHERE tabname EQ ls_dd02l-tabname.
    *Calling the ALV containing the field values
        CALL SCREEN 101.
      ENDMETHOD. "handle_double_click
    ENDCLASS. "lcl_event_handler IMPLEMENTATION
    *&      SELECTION-SCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE  text-001.
    SELECT-OPTIONS:
        s_vbeln  FOR  ws-vbeln DEFAULT '2002354788' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK a.
    INITIALIZATION.
      PERFORM setup_screen_defaults.
    START-OF-SELECTION.
      PERFORM gather_report_data.
    END-OF-SELECTION.
      PERFORM create_output.
    *&      Form  initialization
    FORM setup_screen_defaults.
      CLEAR: ws, konv_wa, vbap_wa, vbpa_wa.
      REFRESH: ivbpa, ikonv, ivbap, iresult.
    ENDFORM.                    " setup_screen_defaults
    *&      Form  gather_report_data
    FORM  gather_report_data.
      SELECT  vbeln posnr parvw kunnr
               INTO TABLE ivbpa
               FROM vbpa
               WHERE vbeln IN s_vbeln
               AND ( parvw = 'SP' OR "SoldTO
                     parvw = 'WE' OR "ShipTo
                     parvw = 'ZT' ). "Top Parent
      SELECT  vkvbeln vkerdat vkknumv vpposnr vp~matnr
              z1zansicat z1zansigrd z2~zcurrvaltnarea
              z2zcurrcstusd m1zzbrndnm zg~zqedscgrp
              m1mstav  vpkwmeng  vp~netpr
        INTO CORRESPONDING FIELDS OF TABLE ivbap
        FROM  vbak  AS vk
        INNER JOIN vbap AS vp
           ON vpvbeln = vkvbeln
        INNER JOIN zmarall AS z1
           ON z1matnr = vpmatnr
        INNER JOIN zco002 AS z2
           ON z2matnr = vpmatnr
        INNER JOIN zglbprc AS zg
           ON zgmatnr = vpmatnr
        INNER JOIN mara AS m1
           ON m1matnr = vpmatnr
        WHERE  vk~vbeln IN s_vbeln
        AND    vk~auart = 'AG'."AG = Quot
      SORT ivbap BY posnr matnr.
      SELECT  kvknumv kvkposn kvkappl kvkschl kv~kbetr
              INTO TABLE ikonv
              FROM  konv AS kv
              FOR ALL ENTRIES IN ivbap
              WHERE  kv~knumv = ivbap-knumv
              AND    kv~kposn = ivbap-posnr
              AND    kv~kappl EQ 'V'
              AND    ( kv~kschl EQ 'ZBP1'
                   OR kv~kschl EQ 'ZNAX'
                   OR kv~kschl EQ 'ZNAA' ).
      SORT ikonv BY knumv kposn.
      LOOP AT  ivbap  ASSIGNING  <vbap>.
        CLEAR konv_wa.
        READ TABLE ikonv INTO  konv_wa WITH KEY
                                   knumv = <vbap>-knumv
                                   kposn = <vbap>-posnr
                                   kschl = 'ZBP1'
                                   BINARY  SEARCH.
        IF sy-subrc EQ 0.
          <vbap>-lprc = konv_wa-kbetr.
        ENDIF.
        READ TABLE ikonv INTO  konv_wa WITH KEY
                                   knumv = <vbap>-knumv
                                   kposn = <vbap>-posnr
                                   kschl = 'ZNAX'
                                   BINARY  SEARCH.
        IF sy-subrc EQ 0.
          <vbap>-sprc = konv_wa-kbetr.
        ENDIF.
        READ TABLE ikonv INTO  konv_wa WITH KEY
                                   knumv = <vbap>-knumv
                                   kposn = <vbap>-posnr
                                   kschl = 'ZNAA'
                                   BINARY  SEARCH.
        IF sy-subrc EQ 0.
          <vbap>-sprc = konv_wa-kbetr.
        ENDIF.
      ENDLOOP.
      SORT ivbap BY posnr matnr.
      LOOP AT ivbap INTO vbap_wa.
        MOVE-CORRESPONDING  vbap_wa TO result_wa.
        APPEND  result_wa TO iresult.
        CLEAR:  vbap_wa, result_wa.
      ENDLOOP.
    ENDFORM.                    " gather_report_data
    *&      Form  create_output
    FORM create_output.
      CALL SCREEN 100.
    FREE: iresult.
    ENDFORM.                    " create_output
    *&      Module  PBO_0100  OUTPUT
          text
    MODULE pbo_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      IF c_cont1 IS INITIAL.
    *Creating object of container
        CREATE OBJECT c_cont1
         EXPORTING
           container_name = 'CCONT1'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *Creating object of alv
        CREATE OBJECT c_alv1
           EXPORTING
            i_parent = c_cont1.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *Alv layout
        PERFORM alv_100_layout.
        PERFORM save_alv_layout.
    *Alv field catalogue
        PERFORM alv_100_fieldcat.
    *Displaying the ALV grid
        CALL METHOD c_alv1->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay1
            i_save          = ws-alv_save
            is_variant      = ws-alv_variant
          CHANGING
            it_outtab       = iresult[]
            it_sort         = ws-alv_sort
            it_fieldcatalog = it_fieldcat[].
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *Create object of the event class
    *and setting handler for double click
        CREATE OBJECT e_dclick.
        SET HANDLER e_dclick->handle_double_click FOR c_alv1.
      ENDIF.
    ENDMODULE.                 " PBO_0100  OUTPUT
    *&      Module  PAI_0100  INPUT
          text
    MODULE pai_0100 INPUT.
      ws-ok_code = sy-ucomm.
      CASE ws-ok_code.
        WHEN 'BACK'.
          CALL  SELECTION-SCREEN  1000.
          CLEAR ws-ok_code.
        WHEN 'EXIT'.
          LEAVE TO  SCREEN  0.
          CLEAR ws-ok_code.
          EXIT.
        WHEN 'CANCEL'.
          LEAVE TO  SCREEN  0.
          CLEAR ws-ok_code.
          EXIT.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " PAI_0100  INPUT
    *&      Form  alv_100_layout
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_layout.
      ty_lay1-numc_total = 'X'. " Numc total line
    ty_lay1-cwidth_opt = 'X'. " Optimal column width
      ty_lay1-detailinit = 'X'. " Show values that are initial in
      ty_lay1-sel_mode = 'A'. " Column selection mode
      ty_lay1-no_merging = 'X'. " No merging while sorting columns
      ty_lay1-keyhot     = 'X'.
      ty_lay1-grid_title = 'SD Concessions'.
      ty_lay1-zebra      = 'X'.
      ty_lay1-no_toolbar = ' '.
    ENDFORM.                    " alv_100_layout
    *&      Form  alv_100_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'posnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Item#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'matnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Mat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'zansicat'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'AnsiCat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'zansigrd'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Grade'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'zcurrvaltnarea'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Val Area'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 6.
      ty_fieldcat-fieldname = 'zcurrcstusd'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Cost $'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 7.
      ty_fieldcat-fieldname = 'zzbrndnm'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Brand'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 8.
      ty_fieldcat-fieldname = 'zqedscgrp'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'QE'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 9.
      ty_fieldcat-fieldname = 'mstav'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Status'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 9.
      ty_fieldcat-fieldname = 'kwmeng'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Qty'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 10.
      ty_fieldcat-fieldname = 'lprc'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'List Price'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 11.
      ty_fieldcat-fieldname = 'sprc'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Discount'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 12.
      ty_fieldcat-fieldname = 'netpr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Quot Price'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 13.
      ty_fieldcat-fieldname = 'mrgn'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Margin%'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
    ENDFORM.                    " alv_100_fieldcat
    *&      Module  PBO_0101  OUTPUT
          text
    MODULE pbo_0101 OUTPUT.
    *Check if the Custom container exists.
      IF c_cont2 IS INITIAL.
    *Creating container object
        CREATE OBJECT c_cont2
          EXPORTING
            container_name = 'CCONT2'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *creating ALV grid for interactive list
        CREATE OBJECT c_alv2
          EXPORTING
           i_parent = c_cont2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *ALV layout
        PERFORM alv_101_layout.
    *ALV fieldcatalogue
        PERFORM alv_101_fieldcat.
    *Sorting the output by field position
        SORT iresult BY posnr.
    *ALV for display field details
        CALL METHOD c_alv2->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay2
          CHANGING
            it_outtab       = iresult[]
            it_fieldcatalog = it_fieldcat.
        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.
    ENDMODULE.                 " PBO_0101  OUTPUT
    *&      Module  PAI_0101  INPUT
          text
    MODULE pai_0101 INPUT.
    ENDMODULE.                 " PAI_0101  INPUT
    *&      Form  alv_101_layout
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_layout.
      ty_lay2-grid_title = 'Line Details'.
      ty_lay2-zebra = 'X'.
      ty_lay2-no_toolbar = 'X'.
    ENDFORM.                    " alv_101_layout
    *&      Form  alv_101_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_fieldcat.
      REFRESH it_fieldcat.
    REFRESH it_fcat.
    CLEAR ty_fcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'posnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Item#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'matnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Mat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'zansicat'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'AnsiCat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'zansigrd'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Grade'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'zcurrvaltnarea'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Val Area'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
    ENDFORM.                    " alv_101_fieldcat
    *&      Form  save_alv_layout
          text
    -->  p1        text
    <--  p2        text
    form save_alv_layout.
    ws-alv_save = 'A'.
    ws-alv_variant-report = sy-repid.
    endform.                    " save_alv_layout

    Hello
    Creating fieldcatalogs manually is one of the major error sources in ALV programming.
    There is hardly any reason why NOT to use the standard-fm LVC_FIELDCATALOG_MERGE in order to create a proper fieldcatalog.
    If you need some modification of the standard fieldcatalog (e.g. renaming of columns, etc.) just do your post-processing after calling the fm.
    Regards
      Uwe

  • ALV - Reflect layout change into internal table

    I have an ALV :
    CALL METHOD grid1->set_table_for_first_display
                EXPORTING I_STRUCTURE_NAME = 'Z_ALV_STRUCTURE_01'
                          IS_VARIANT = GS_VARIANT
                          I_SAVE = X_SAVE
                CHANGING IT_OUTTAB = itab
                         IT_FIELDCATALOG = gt_fieldcat_lvc1[].
    This internal table itab has for example the fields: matnr, plant, stock, vendor
    If for example the user changes the sequence of the columns in the ALV grid display into: stock, plant, vendor, matnr
    Is there an easy way to get the layout change reflected in my internal table or is the only possibility to built dynamically a new internal table based on the front end field catalog?
    Kind regards
    Frank

    Hi
    Can't u use the std icone to create an excel file?
    Anyway in this case you should use the method get_frontend_fieldcatalog in order to get the status of the catalog and so fill the table for the excel in the right way.
    I believe the problem should be on how to create the table for the excel, i.e. you need to consider the sequence of the fields in ordert to create the table for the excel.
    Max

  • Problem in modifying the main internal table gt_data

    Hello i have written code for modifying the main internal table. i have read data from ausp table and put into the internal table gt_ausp. now i want to modify my main table GT-DATA with gt_ausp. i am not able to do this.
    LOOP AT gt_data  INTO ls_list.
        lt_temp-objek  =  ls_list-matnr.
        APPEND  lt_temp.                  " 특성값 발췌용도로 저장
        APPEND  ls_list  TO lt_work.      " 핵심작업용도로 저장
      ENDLOOP.
      DESCRIBE TABLE lt_temp.
      IF  sy-tfill  EQ  0.
        pv_flg  =  'X'.
        EXIT.
      ENDIF.
    Get 제품인증(플랜트별).....
      DESCRIBE TABLE lt_cetino_tp.
            플랜트          자재번호
            카타로그-인증   코드그룹-인증   인증코드
            Certi. No.
    Get 자재별 특성값..........
              오브젝트  특성이름  내부특성   내부카운터  특성값
      SELECT    aobjek    batnam   aatinn    aatzhl    a~atwrt
            INTO CORRESPONDING FIELDS OF TABLE  lt_ausp_tp
            FROM ausp AS a  INNER JOIN  cabn AS b
              ON aatinn  =  batinn
             FOR ALL ENTRIES IN  lt_temp
           WHERE a~objek  EQ  lt_temp-objek   " 오브젝트키(자재번호)
             AND a~klart  EQ  '001'           " 클래스유형
           AND a~atzhl  EQ  '001'           " 특성값카운터(최종건만 존재)
                                              자재특성 변경시 변경됨
             AND b~adzhl  EQ  '0000'.
      IF  sy-subrc  EQ  0.
        DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp.
        lt_ausp[]     =  lt_ausp_tp[].
        lt_ausp_tp2[] =  lt_ausp_tp[].
        DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp2.
      Get 특성내역
              내부특성   " 내부카운터
              특성값       특성값내역
        SELECT    aatinn  " aatzhl
                  aatwrt    batwtb
              INTO CORRESPONDING FIELDS OF TABLE  lt_cawn
              FROM cawn AS a  INNER JOIN  cawnt AS b
                ON aatinn  =  batinn  AND
                   aatzhl  =  batzhl  AND
                   aadzhl  =  badzhl
               FOR ALL ENTRIES IN  lt_ausp_tp2
             WHERE a~atinn  EQ  lt_ausp_tp2-atinn  " 내부특성
               AND b~spras  EQ  sy-langu.
      ENDIF.
      SORT  lt_work BY matnr .
      BREAK-POINT.
      LOOP AT lt_work  INTO ls_list.
      특성내역
        READ TABLE  lt_ausp  WITH TABLE KEY  objek = ls_list-matnr
                                             atnam = 'SECTION_WIDTH'.
      수출자재가 아닌 것은 제외
    LS_LIST-SECTION_WIDTH = LT_AUSP-ATWRT.
    MODIFY TABLE GT_DATA FROM LS_LIST  TRANSPORTING SECTION_WIDTH.

    Hi,
    Question before: why dont you just use the std.API for reading the classification data?
    e.g. "BAPI_OBJCL_GETDETAIL"
    Second: a DELETE DELETE ADJACENT DUPLICATES works only only sorted tables.
    Doing this after a select will only succeed randomly depending on the buffers of your data based below.
    ( 90% chance if it is an oracle system)
    To your question:
    Just replace your LOOP AT gt_data into ls_list
    by a LOOP AT gt_data ASSIGNING <current_list_record>.
    then you can access the fields directly:
    <current_list_record>-SECTION_WIDTH = LT_AUSP-ATWRT.
    Cause of your issue:
    "MODIFY" needs a key to to find the record to be updated.
    If your gt_data ist referencing a DDIC table type with a key or a local type with a key
    it has no chance to do it.
    Hope that helps.
    br,

  • How can i know the number of lines in field-symbol internal table

    how can i know the number of lines in field-symbol internal table

    Hi,
    If your field symbol has been defined as an internal table :
    Use std describe as
    Data: l type i.
    describe <fs> lines l.
    'l' will contain the number of lines as needed.
    FYI
    The size of this storage area in a field symbols depends on the number of table lines which is not fixed, but determined dynamically at runtime.
    Regards,
    Amit

  • Printing internal table data

    Hi all,
    I want to print an internal table data without displaying it via ALV. That is when clicked on a button, printing should be started.
    How can I do that?
    Thanks a lot.
    Deniz.

    Hi,
       Check the following code this is exactly what you need I guess....
    FM to generate spool number for the internal table wt_final_prnt.
    CALL FUNCTION 'RSPO_SX_OUTPUT_TEXTDATA'
            EXPORTING
              name        = gv_name
              dest        = gv_dest
              rows        = gv_rows
              startrow    = gv_startrow
              pages       = gv_pages
              rqtitle     = 'Z9CS - STD Search Results'
              rqcopies    = gv_rqcopies
              rqowner     = gv_rqowner
              immediately = gv_immediate
            IMPORTING
              rqid        = gv_rqid
            TABLES
              text_data   = wt_final_prnt
            EXCEPTIONS
              OTHERS      = 1.
          CLEAR : wa_final_prnt, wt_final_prnt[].
    FM to set the print attributes.
          CALL FUNCTION 'GET_PRINT_PARAMETERS'
            IMPORTING
              out_parameters         = wv_pripar
              out_archive_parameters = wv_arcpar
              valid                  = wv_val
            EXCEPTIONS
              archive_info_not_found = 1
              invalid_print_params   = 2
              invalid_archive_params = 3
              OTHERS                 = 4.
    FM to submit to the printer
          CALL FUNCTION 'RSPO_OUTPUT_SPOOL_REQUEST'
            EXPORTING
              spool_request_id = gv_rqid.
    Regards,
    Ram.

  • Really urgent: reagrding alv format for like (internal tables)

    Hi,
    I making a report in which i am using the concept of 2 internal tables and i am usnig the concept of likes in a internal table .
    for instance,
    DATA : BEGIN OF ITAB OCCURS 0,
              ITEMID LIKE CHVW-MATNR,      
              WERKS LIKE CHVW-WERKS,   
              CHARG LIKE CHVW-CHARG,       
              SHKZG LIKE CHVW-SHKZG,       
              MENGE LIKE CHVW-MENGE,     
              MEINS LIKE CHVW-MEINS, 
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0,
               MATNR TYPE BSEG-MATNR,  
               LIFNR TYPE BSEG-LIFNR,       
               AUGDT TYPE BSEG-AUGDT,     
               WRBTR TYPE BSEG-WRBTR,      
             END OF IT_BSEG.
    and i am able to create ALV for 1 itab only as i had declared all fields in a 1 itab ,but now i have to declare 1 more itab and i  dont know how to perform ALV with 2 itabs..
    Plzz help me out as it is really urgent to me.
    Edited by: ric .s on Apr 22, 2008 11:45 AM
    Edited by: ric .s on Apr 23, 2008 7:21 AM
    Edited by: ric .s on Apr 23, 2008 7:55 AM

    Hi Ric,
    Yes, You can .
    Check the sample ALV  program which helps u in displaying output using ALV . Comments have been made everywhere .
    report  zvenkat_alv_2_grid_description.
    types:
          begin of t_mard,
           werks type mard-werks,
           lgort type mard-lgort,
           matnr type mard-matnr,
           insme type mard-insme,
           einme type mard-einme,
           speme type mard-speme,
          end of t_mard.
    data:
          w_mard type t_mard.
    data:
          i_mard type standard table of t_mard.
    " ALV Declarations
    "     ALV internal tables and Structures
    "     To refer ALV tables(slis tables) and structures.SLIS must be
    "     declared under TYPE-POOLS(see below).SLIS is a Type group which is
    "     defined in Dictionary.Internal tables and structures and constants
    "     are defined under type group.(Double click on SLIS).
    * Types Pools
    type-pools:
       slis.
    * Types
    types:
       t_fieldcat         type slis_fieldcat_alv,
       t_events           type slis_alv_event,
       t_layout           type slis_layout_alv.
    * Workareas
    data:
       w_fieldcat         type t_fieldcat,
       w_events           type t_events,
       w_layout           type t_layout.
    * Internal Tables
    data:
       i_fieldcat         type standard table of t_fieldcat,
       i_fieldcat1        type standard table of t_fieldcat,
       i_events           type standard table of t_events.
    *&      START-OF-SELECTION
    start-of-selection.
      perform get_data_from_database .
      "      END-OF-SELECTION
      "     Steps to create simple ALV program
      "      1. Pass an internal table with the set of output information
      "      2. Pass a field catalog as an internal table
      "      3. Pass a structure with general list layout details
    end-of-selection.
      perform build_fieldcatalog.
      perform build_events.
      perform build_layout.
      perform display_data.
      "      Form  build_fieldcatalog
      "     Fieldcatalog Internal table
      "    1. It contains descriptions of the list output fields
      "       (usually a subset of the internal output table fields).
      "    2. A field catalog is required for every ALV list output.
    form build_fieldcatalog .
      clear :
        w_fieldcat,
       i_fieldcat[].
      perform build_fcat using:
            "Field   Int.Table Column headings
            'WERKS' 'I_MARD' 'WERKS',
            'LGORT' 'I_MARD' 'LGORT',
            'MATNR' 'I_MARD' 'MATNR',
            'INSME' 'I_MARD' 'INSME',
            'EINME' 'I_MARD' 'EINME',
            'SPEME' 'I_MARD' 'SPEME'.
    endform.                    " build_fieldcatalog
    *&      Form  display_data
    form display_data .
      data :program like sy-repid value sy-repid.
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = program
          is_layout          = w_layout
          it_fieldcat        = i_fieldcat
          it_events          = i_events
        tables
          t_outtab           = i_mard.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " display_data
    *&      Form  get_data_from_database
    *       text
    form get_data_from_database .
      clear :i_mard,
             i_mard[].
      select werks lgort matnr insme einme speme
      from mard
      into corresponding fields of table i_mard
        up to 100 rows.
    endform.                    " get_data_from_database
    *&      Form  top_of_page
    *       text
    form top_of_page.
      data :
      i_header type slis_t_listheader,
      w_header like line of i_header.
      data:l_date1 type datum,
           l_date2 type datum.
      w_header-typ = 'S'.
      w_header-info = sy-title.
      append w_header to i_header.
      clear w_header.
      w_header-typ = 'H'.
      w_header-info = sy-repid.
      append w_header to i_header.
      clear w_header.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = i_header
          i_logo             = 'ENJOYSAP_LOGO'.
    endform.                    "top_of_page
    *&      Form  BUILD_FCAT
    form build_fcat  using  l_field l_tab l_text.
      w_fieldcat-fieldname = l_field.
      w_fieldcat-tabname   = l_tab.
      w_fieldcat-seltext_m = l_text.
      append w_fieldcat to i_fieldcat.
      clear w_fieldcat.
    endform.                    " BUILD_FCAT
    "      Form  build_events
    "     Events
    "    1. When we use ALV,certain events TOP-OF-PAGE ,END-OF-PAGE,
    "       AT LINE-SELECTION,AT USER-COMMANDs are not triggered.
    "    2. To perform those Functions ,we have to build Events table and
    "       pass this table through REUSE_ALV_LIST_DISPALY Function.
    form build_events .
      clear :
             w_events,i_events[].
      w_events-name = 'TOP_OF_PAGE'.
      w_events-form = 'TOP_OF_PAGE'.
      append w_events to i_events.
      clear w_events.
    endform.                    " build_events
    "&      Form  build_layout
    "     Layouts
    "  Use :We change the display of our list using layouts.
    "  ===
    "  Features
    "  ========
    "    The layouts that you can use vary according to the type of list:
    "   1-->In all lists, you can do the following:
    "       (a).Choose one of the std layouts supplied with the std system.
    "       (b).Change the current layout of the list .
    "   2-->In lists that use only the standard layouts in the std system
    "       you cannot save your changes to the current layout.When you
    "       choose the layouts, only the standard layouts will be proposed.
    "   3-->In some lists, you can also save the layouts that you have
    "       defined as our own layouts.
    "      User-defined layouts are generally saved for all users. They can
    "       then be used by all users. All users will be able to choose from
    "       the user-defined layouts as well as the standard layouts.
    "   4-->In some lists, you can also save user-specific layouts that you
    "       have defined . When you choose the current layout,only these
    "       layouts are available to you.
    "   5-->You can delete or transport layouts, or define them as initial
    "       layouts
    "   6-->STRUCTURE :SLIS_LAYOUT_ALV.
    form build_layout .
      clear:
            w_layout.
      w_layout-colwidth_optimize = 'X'.
    endform.                    " build_layout
    Regards,
    Venkat.O

  • Sy-tabix for internal table in smartform

    Hi friends,
    How to capture the sy-tabix value for the entries in an internal table which has been looped into the loop of table node of a smartform?? I need to print something immedaitely after the end of the table
    For every record the value of sy-tabix is showing 1 !!
    Advance Thanks
    Aadarsh

    Hi Aadarsh,
    Give ur sy-tabix at the end of the loop.
    loop at itab.
    //table node populations.
    endloop.
    give a seperate loop for this.
    loop at itab.
    sy-tabix.
    endloop
    get the total no and print it after the table.
    If u r using do loop then give sy-index.
    Hope tihs helps u,
    Regards,
    Nagarajan.
    Message was edited by: Nagarajan Kumarappan

  • Regarding Exporting and Importing internal table

    Hello Experts,
    I have two programs:
    1) Main program: It create batch jobs through open_job,submit and close job.Giving sub program as SUBMIT.
    I am using Export IT to memory id 'MID' to export internal table data to sap memory in the subprogram.
    The data will be processed in the subprogram and exporting data to sap memory.I need this data in the main program(And using import to get the data,but it is not working).
    Importing IT1 from memory id 'MID' to import the table data in the main program after completing the job(SUBMIT SUBPROGRAM AND RETURN).
    Importing is not getting data to internal table.
    Can you please suggest something to solve this issue.
    Thank you.
    Regards,
    Anand.

    Hi,
    This is the code i am using.
    DO g_f_packets TIMES.
    * Start Immediately
           IF NOT p_imm IS INITIAL .
             g_flg_start = 'X'.
           ENDIF.
           g_f_jobname = 'KZDO_INHERIT'.
           g_f_jobno = g_f_jobno + '001'.
           CONCATENATE g_f_jobname g_f_strtdate g_f_jobno INTO g_f_jobname
                                                  SEPARATED BY '_'.
           CONDENSE g_f_jobname NO-GAPS.
           p_psize1 = p_psize1 + p_psize.
           p_psize2 = p_psize1 - p_psize + 1.
           IF p_psize2 IS INITIAL.
             p_psize2  = 1.
           ENDIF.
           g_f_spname = 'MID'.
           g_f_spid = g_f_spid + '001'.
           CONDENSE g_f_spid NO-GAPS.
           CONCATENATE g_f_spname  g_f_spid INTO g_f_spname.
           CONDENSE g_f_spname NO-GAPS.
    * ... (1) Job creating...
           CALL FUNCTION 'JOB_OPEN'
             EXPORTING
               jobname          = g_f_jobname
             IMPORTING
               jobcount         = g_f_jobcount
             EXCEPTIONS
               cant_create_job  = 1
               invalid_job_data = 2
               jobname_missing  = 3
               OTHERS           = 4.
           IF sy-subrc <> 0.
             MESSAGE e469(9j) WITH g_f_jobname.
           ENDIF.
    * (2)Report start under job name
           SUBMIT (g_c_prog_kzdo)
                  WITH p_lgreg EQ p_lgreg
                  WITH s_grvsy IN s_grvsy
                  WITH s_prvsy IN s_prvsy
                  WITH s_prdat IN s_prdat
                  WITH s_datab IN s_datab
                  WITH p1      EQ p1
                  WITH p3      EQ p3
                  WITH p4      EQ p4
                  WITH p_mailid EQ g_f_mailid
                  WITH p_psize EQ p_psize
                  WITH p_psize1 EQ p_psize1
                  WITH p_psize2 EQ p_psize2
                  WITH spid     EQ g_f_spid
                  TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                  VIA JOB g_f_jobname NUMBER g_f_jobcount AND RETURN.
    *(3)Job closed when starts Immediately
           IF NOT p_imm IS INITIAL.
             IF sy-index LE g_f_nojob.
               CALL FUNCTION 'JOB_CLOSE'
                 EXPORTING
                   jobcount             = g_f_jobcount
                   jobname              = g_f_jobname
                   strtimmed            = g_flg_start
                 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.
               gs_jobsts-jobcount = g_f_jobcount.
               gs_jobsts-jobname  = g_f_jobname.
               gs_jobsts-spname   = g_f_spname.
               APPEND gs_jobsts to gt_jobsts.
             ELSEIF sy-index GT g_f_nojob.
               CLEAR g_f_flg.
               DO.                         " Wiating untill any job completion
                 LOOP AT gt_jobsts into gs_jobsts.
                   CLEAR g_f_status.
                   CALL FUNCTION 'BP_JOB_STATUS_GET'
                     EXPORTING
                       JOBCOUNT                         = gs_jobsts-jobcount
                       JOBNAME                          = gs_jobsts-jobname
                    IMPORTING
                       STATUS                           = g_f_status
    *            HAS_CHILD                        =
    *          EXCEPTIONS
    *            JOB_DOESNT_EXIST                 = 1
    *            UNKNOWN_ERROR                    = 2
    *            PARENT_CHILD_INCONSISTENCY       = 3
    *            OTHERS                           = 4
                   g_f_mid = gs_jobsts-spname.
                   IF g_f_status = 'F'.
                     IMPORT gt_final FROM MEMORY ID g_f_mid .
                     FREE MEMORY ID gs_jobsts-spname.
                     APPEND LINES OF gt_final to gt_final1.
                     REFRESH gt_prlist.
                     CALL FUNCTION 'JOB_CLOSE'
                       EXPORTING
                         jobcount             = g_f_jobcount
                         jobname              = g_f_jobname
                         strtimmed            = g_flg_start
                       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.
                       g_f_flg = 'X'.
                       gs_jobsts1-jobcount = g_f_jobcount.
                       gs_jobsts1-jobname  = g_f_jobname.
                       gs_jobsts1-spname   = g_f_spname.
                       APPEND gs_jobsts1 TO gt_jobsts.
                       DELETE TABLE gt_jobsts FROM gs_jobsts.
                       EXIT.
                     ENDIF.
                   ENDIF.
                 ENDLOOP.
                 IF g_f_flg = 'X'.
                   CLEAR g_f_flg.
                   EXIT.
                 ENDIF.
               ENDDO.
             ENDIF.
           ENDIF.
           IF sy-subrc <> 0.
             MESSAGE e539(scpr) WITH g_f_jobname.
           ENDIF.
           COMMIT WORK .
         ENDDO.

  • How to select the data from a Maintainance View into an internal table

    Hi All,
    Can anybody tell me how to select the data from a Maintainance View into an internal table.
    Thanks,
    srinivas.

    HI,
    You can not retrieve data from A mentenance view.
    For detail check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    Regards,
    Anirban

  • Creating XML file from ABAP internal table data....

    Hello,
    I am fethcing data froma  custom table and I have to write data in XMl format. Following is the XML format in which I want data. Is there any function module iN SAP which will help me in writing data from internal table to XML file ?
    <batch>
      <invoice>
        <StatusCode>10</StatusCode>
        <paymentamount>122.00</paymentamount>
         <ReferenceNumber>70980934</ReferenceNumber>
      </invoice>
      <invoice>
         <StatusCode>90</StatusCode>
        <paymentamount>122.00</paymentamount>
         <ReferenceNumber>70980934</ReferenceNumber>
      </invoice>
      <control>
        <InvoiceCount>2</InvoiceCount>
      </control>
    </batch>
    Please help.
    Regards,
    Jainam.

    I suggest you look into "simple transformations". That's SAP's most recent technology for such purposes, as far as I know.
    http://help.sap.com/abapdocu_70/en/ABENABAP_ST.htm
    Thomas

Maybe you are looking for