Adding column dynamically in alv

*& Report  ZSP_BSID
REPORT  ZSP_BSID.
TYPE-POOLS:SLIS.
"type-pools:abap.
TABLES: BSID.
   "CONSTANTS : lc_structure TYPE tabname VALUE  'ZSXX'.
TYPES: BEGIN OF TY_bsid," OCCURS 0,
         bukrs TYPE bsid-bukrs,
         kunnr TYPE bsid-kunnr,
         monat TYPE bsid-monat,
         TEXT TYPE C,
        total type n,
    END OF TY_bsid.
       "monat like bsid-monat,
*      jan  TYPE  bsid-monat,
*       feb  TYPE  bsid-monat,
*       mar  TYPE  bsid-monat,
*       apr  TYPE bsid-monat,
*       may  TYPE  bsid-monat,
*       jun  TYPE  bsid-monat,
*       jul  TYPE  bsid-monat,
*       aug  TYPE  bsid-monat,
*       sep  TYPE  bsid-monat,
*      oct  TYPE  bsid-monat,
*      nov  TYPE  bsid-monat,
*      dec  TYPE bsid-monat,
DATA: FCAT TYPE SLIS_FIELDCAT_ALV,
       IT_FCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:  T_EVENT TYPE SLIS_T_EVENT,
   W_EVENT TYPE SLIS_ALV_EVENT.
DATA: SORT TYPE SLIS_SORTINFO_ALV,
       IT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA:  MONAT(2) TYPE c.
"CALL SCREEN 2000.
"DATA: FLAG.
"data: lv_pos type i.
DATA: IT_BSID TYPE TY_BSID OCCURS 0 with header line.
"data: it_color TYPE TABLE OF lvc_s_scol.
DATA: WA_BSID TYPE TY_bsid.
  SELECTION-SCREEN: BEGIN OF BLOCK A WITH FRAME TITLE B.
    SELECT-OPTIONS: CMP_CODE FOR BSID-BUKRS." OBLIGATORY.
    SELECT-OPTIONS: CUST_NME FOR BSID-KUNNR." OBLIGATORY.
    SELECT-OPTIONS: MONTH FOR BSID-MONAT.
    SELECTION-SCREEN: END OF BLOCK A.
data: num1(2) type c,
       num2(2) type c.
       "monat type n.
     num1 = MONTH-low.
     num2 = MONTH-high.
  monat = num2 - num1(01) + 1.
field-symbols: <it_bsid> type STANDARD TABLE.
    START-OF-SELECTION.
    PERFORM SELECT.
    PERFORM FIELDCAT.
    PERFORM DISPLAY.
    "PERFORM DISPLAY1.
   "perform format_field_catolog.
"   PERFORM DISPLAY1.
*&      Form  SELECT
*       text
*  -->  p1        text
*  <--  p2        text
FORM SELECT.
   SELECT bukrs kunnr monat FROM BSID INTO TABLE IT_BSID
*    WHERE BUKRS IN CMP_CODE AND
*         kunnr IN CUST_NME and
          where monat eq MONTH.
ENDFORM.
                    " SELECT
  "create DATA w_dref TYPE STANDARD TABLE OF (month).
*ASSIGN w_dref->* to <it_bsid>.
*SELECT * FROM (month) into table <it_bsid>.
*&      Form  FIELDCAT
*       text
*  -->  p1        text
*  <--  p2        text
form FIELDCAT .
"do 12 times.
  " result = sy-index ** 12.
fcat-col_pos       = '1'.
   fcat-tabname       = 'IT_BSID'.
   fcat-fieldname     = 'BUKRS'.
   fcat-seltext_m     = 'CUSTOMER NAME'.
   fcat-hotspot       =   'X'.
   fcat-emphasize    = 'C666'.
   APPEND FCAT TO it_fcat.
   CLEAR fcat.
   fcat-COL_POS = '2'.
fcat-SELTEXT_L = 'COMPANY CODE'.
fcat-FIELDNAME = 'KUNNR'.
  APPEND FCAT TO IT_FCAT.
   CLEAR  FCAT.
"do 12 times.
  " result = sy-index ** 12.
  DO MONAT times.
   "RESULT = SY-INDEX ** 12.
"WRITE:/ sy-index EQ RESULT.
   fcat-col_pos       = '3'.
   fcat-tabname       = 'IT_BSID'.
   fcat-fieldname     = 'MONAT'.
   fcat-seltext_m     = 'MONTH'.
     APPEND FCAT TO it_fcat.
   CLEAR fcat.
enddo.
*fcat-col_pos       = '4'.
*  "fcat-tabname       = 'IT_BSID'.
*  fcat-fieldname     = 'MONAT'.
*  "FCAT-no_totalline  = 'X'.
*  fcat-seltext_m     = 'TOTAL'.
*  FCAT-DO_SUM        =  'X'.
*  FCAT-NO_OUT       =  'X'.
*"  fcat-hotspot       =   'X'.
* " fcat-emphasize    = 'C666'.
*  APPEND FCAT TO it_fcat.
*  CLEAR fcat.
*fcat-col_pos       = '4'.
*  "fcat-tabname       = 'IT_BSID'.
*  fcat-fieldname     = 'MONAT'.
*  "FCAT-no_totalline  = 'X'.
*  fcat-seltext_m     = 'TOTAL'.
*  FCAT-DO_SUM        =  'X'.
*  "FCAT-NO_OUT       =  'X'.
*"  fcat-hotspot       =   'X'.
* " fcat-emphasize    = 'C666'.
*  APPEND FCAT TO it_fcat.
*  CLEAR fcat.
*SORT-fieldname = 'MONAT'.
*SORT-SUBTOT  = 'X'.
*APPEND SORT TO IT_SORT.
*CLEAR SORT.
endform.
                   " FIELDCAT
*&      Form  DISPLAY
*       text
*  -->  p1        text
*  <--  p2        text
form DISPLAY .
   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
*     I_INTERFACE_CHECK                 = ' '
*     I_BYPASSING_BUFFER                = ' '
*     I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = SY-REPID
*     I_CALLBACK_PF_STATUS_SET          = ' '
*     I_CALLBACK_USER_COMMAND           = ' '
*     I_CALLBACK_TOP_OF_PAGE            = ' '
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*     I_CALLBACK_HTML_END_OF_LIST       = ' '
*     I_STRUCTURE_NAME                  =
*     I_BACKGROUND_ID                   = ' '
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
*     IS_LAYOUT                         =
      IT_FIELDCAT                       = IT_FCAT
*     IT_EXCLUDING                      =
*     IT_SPECIAL_GROUPS                 =
      IT_SORT                           = IT_SORT
*     IT_FILTER                         =
*     IS_SEL_HIDE                       =
"     I_DEFAULT                         = 'X'
*     I_SAVE                            = ' '
*     IS_VARIANT                        =
"     IT_EVENTS                         = T_EVENT
*     IT_EVENT_EXIT                     =
*     IS_PRINT                          =
*     IS_REPREP_ID                      =
*     I_SCREEN_START_COLUMN             = 0
*     I_SCREEN_START_LINE               = 0
*     I_SCREEN_END_COLUMN               = 0
*     I_SCREEN_END_LINE                 = 0
*     I_HTML_HEIGHT_TOP                 = 0
*     I_HTML_HEIGHT_END                 = 0
*     IT_ALV_GRAPHICS                   =
*     IT_HYPERLINK                      =
*     IT_ADD_FIELDCAT                   =
*     IT_EXCEPT_QINFO                   =
*     IR_SALV_FULLSCREEN_ADAPTER        =
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER           =
*     ES_EXIT_CAUSED_BY_USER            =
     TABLES
       t_outtab                          = IT_BSID
*   EXCEPTIONS
*     PROGRAM_ERROR                     = 1
*     OTHERS                            = 2
   IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
endform.                    " DISPLAY
*&      Form  FORMAT_FIELD_CATOLOG
*       text
*  -->  p1        text
*  <--  p2        text
*form FORMAT_FIELD_CATOLOG .
*  beg_month = listbox1.
*end_month = listbox2 .
*dO.
*if beg_month gt end_month.
*  exit.
*ENdif.
*enddo.
*endform.                    " FORMAT_FIELD_CATOLOG
*CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
*  EXPORTING
*    p_fecha              = SY-DATUM
** IMPORTING
**   NUMBER_OF_DAYS       =
*&      Form  DISPLAY1
*       text
*  -->  p1        text
*  <--  p2        text
*form DISPLAY1 .
*CALL FUNCTION 'MONTH_PLUS_DETERMINE'
*  EXPORTING
*    months        = 12
*    olddate       = SY-DATUM
* IMPORTING
*   NEWDATE       = RESULT.
*endform.                    " DISPLAY1
"DATA: T_OUTPUT TYPE REF TO DATA.
"FIELD-SYMBOLS: &LTT_OUTPUT&GT TYPE TABLE.
"Call Method CL_ALV_TABLE_CREATE->CREATE_DYNAMIC_TABLE
"Exporting
"IT_FIELDCATALOG = T_FIELDCAT
"Importing
"EP_TABLE = T_OUTPUT.
"ASSIGN T_OUTPUT->* TO &LT;T_OUTPUT&GT;.
"*&      Form  DISPLAY1
"*       text
"*  -->  p1        text
"*  <--  p2        text
"form DISPLAY1 .
"CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
" EXPORTING
"*   I_BUFFER_ACTIVE              =
"   I_STRUCTURE_NAME             = sy-repid
"*   I_CLIENT_NEVER_DISPLAY       = 'X'
"*   I_BYPASSING_BUFFER           =
"*   I_INTERNAL_TABNAME           =
"  CHANGING
"    ct_fieldcat                  = it_fcat
"* EXCEPTIONS
"*   INCONSISTENT_INTERFACE       = 1
"*   PROGRAM_ERROR                = 2
"*   OTHERS                       = 3
"IF sy-subrc <> 0.
"* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
"*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
"ENDIF.
"endform.                    " DISPLAY1
please check the code....

Hi Suprit Patil,
First you need to create table with   CL_ALV_TABLE_CREATE->CREATE_DYNAMIC_TABLE to assign value to field.
Now logic is simple.
Create fieldcat, add aditional field to fieldcat ( in your case months ), now create table with this fieldcat. You need to add your dynamic field to fieldcat manualy.
select needed data to template table. now to assign field to created table you need to now fieldname.
Here is the example : http://scn.sap.com/message/14468651#14468651
and adding this example to assign sipecific field:
FIELD-SYMBOLS  : <field> TYPE any.
in your loop. assign your dynamic field like this : you need to know field name.
ASSIGN COMPONENT 'FIELDNAME' OF STRUCTURE <fs_line> TO <field>.
for example : fieldname = 'FEB'.
ASSIGN COMPONENT 'FEB' OF STRUCTURE <fs_line> TO <field>.
IF bsid-monat EQ '02'.
     <field> = bsid-wrbtr.
ENDIF.
Regards
Tolga

Similar Messages

  • Adding column dynamically

    Hi all
    I have a requirement of adding the columns to a Classic Table at run time.. the number of columns are not fixed. the number of The data in there columns will be dispaled from the view initialized at run time.
    I tried searching out threads on adding column dynamically but didtn get one..
    pls help me out ..
    naveen

    Of course you can add columns dynamically, but this always needs to be from the same VO, a OA table cannot be based on more than one VO.
    So if it all the columns are from the same VO, why take the pain of adding and removing columns, why not just either render it or hide it.
    Thanks
    Tapash

  • Adding columns dynamically

    Hello all,
    i have problem i need your help on the same.i have three tables
    prod,prod_attribute,prod_attributeval
    Table will hold the values like
    prod
    prod_id prod_desc
    1 shirt
    2 Pant
    3 Trouser
    prod_attribute
    attribute_id name prod_id
    1 color 1
    2 size 1
    3 color 2
    4 color 3
    5 size 3
    6 type 3
    prod_attributeval
    attribute_val_id name attribute_id prod_id
    1 red 1 1
    2 XXl 2 1
    3 blue 3 2
    4 black 4 3
    5 xl 5 3
    6 sample 6 3
    i want o/p like
    prod_id prod_desc attribute_id color size type
    1 shirt 1 red xxl null
    2 pant 2 blue null null
    3 trouser 3 black xl sample
    if this not the right forum for this question plz guide me the correct forum
    Thanks in advance

    user8963876 wrote:
    Hello all,
    i have problem i need your help on the same.i have three tables
    prod,prod_attribute,prod_attributeval
    Table will hold the values like
    prod
    prod_id prod_desc
    1 shirt
    2 Pant
    3 Trouser
    prod_attribute
    attribute_id name prod_id
    1 color 1
    2 size 1
    3 color 2
    4 color 3
    5 size 3
    6 type 3
    prod_attributeval
    attribute_val_id name attribute_id prod_id
    1 red 1 1
    2 XXl 2 1
    3 blue 3 2
    4 black 4 3
    5 xl 5 3
    6 sample 6 3
    i want o/p like
    prod_id prod_desc attribute_id color size type
    1 shirt 1 red xxl null
    2 pant 2 blue null null
    3 trouser 3 black xl sample
    if this not the right forum for this question plz guide me the correct forum
    Thanks in advanceThat scarily looks like your heading toward an Entity Attribbute Value model design for your database. Warning!. . . . DON'T DO IT!
    EAV databases are notoriously poor in performance, difficult to maintain (even though the design is supposed to make maintenance easier) and removes any ability for the database engine to utilise simple SQL queries.
    Take a read of this: [Bad CaRMa|http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/]
    I've come across a database that is designed using EAV and whilst, in principle it's a simple application and business process that should be able to run on a single medium level server, the EAV model has caused it to require the two most powerful servers in the company with other load balancing hardware... and still the application for the users runs slowly. There are very few applications (if any) that EAV is suitable for.

  • Dynamic column change in Alv

    Hello friends,
                       Can any1 pls tell me if there is a function module available which can be used for dynamic column change in ALV.
                      Pls also elaborate how to use it.....

    While filling the field catalog you can specify witht IFcondition.
    Just see a example below...
    FORM field_fill USING pt_fieldcat TYPE slis_t_fieldcat_alv.
      DATA : ls_fieldcat TYPE slis_fieldcat_alv,
             pos TYPE i VALUE 1.
      ls_fieldcat-col_pos       = pos.
      ls_fieldcat-fieldname     = 'C_ICON'.
      ls_fieldcat-seltext_m     = 'Change Status'.
      ls_fieldcat-tabname       = 'IT_OUTPUT'.
      APPEND ls_fieldcat TO pt_fieldcat.
      CLEAR ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       = pos.
      ls_fieldcat-fieldname     = 'BUKRS'.
      ls_fieldcat-ref_fieldname = 'BUKRS'.
      ls_fieldcat-ref_tabname   = 'ANLA'.
      APPEND ls_fieldcat TO pt_fieldcat.
      CLEAR ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       = pos.
      ls_fieldcat-fieldname     = 'ANLN1'.
      ls_fieldcat-ref_fieldname = 'ANLN1'.
      ls_fieldcat-ref_tabname   = 'ANLA'.
      APPEND ls_fieldcat TO pt_fieldcat.
      CLEAR ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       = pos.
      ls_fieldcat-fieldname     = 'ANLN2'.
      ls_fieldcat-ref_fieldname = 'ANLN2'.
      ls_fieldcat-ref_tabname   = 'ANLA'.
      APPEND ls_fieldcat TO pt_fieldcat.
      CLEAR ls_fieldcat.
      pos = pos + 1.
      IF p_farea = 'X'. " Conditional Based OUTPUT
        ls_fieldcat-col_pos       = pos.
        ls_fieldcat-fieldname     = 'GRUFL'.
        ls_fieldcat-ref_fieldname = 'GRUFL'.
        ls_fieldcat-ref_tabname   = 'ANLA'.
        APPEND ls_fieldcat TO pt_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos       = pos.
        ls_fieldcat-fieldname     = 'GRUFL_N'.
        ls_fieldcat-seltext_l     = 'New Floor Area'.
        ls_fieldcat-tabname       = 'IT_OUTPUT'.
        APPEND ls_fieldcat TO pt_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
      ENDIF.
      IF p_ldate = 'X'. " Conditional Based OUTPUT
        ls_fieldcat-col_pos       = pos.
        ls_fieldcat-fieldname     = 'LEABG'.
        ls_fieldcat-ref_fieldname = 'LEABG'.
        ls_fieldcat-ref_tabname   = 'ANLA'.
        APPEND ls_fieldcat TO pt_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos       = pos.
        ls_fieldcat-fieldname     = 'LEABG_N'.
        ls_fieldcat-seltext_l     = 'New Lease St.Date'.
        ls_fieldcat-tabname       = 'IT_OUTPUT'.
        APPEND ls_fieldcat TO pt_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
      ENDIF.
      ls_fieldcat-col_pos       = pos.
      ls_fieldcat-fieldname     = 'MESSAGE'.
      ls_fieldcat-seltext_l     = 'Status Message'.
      ls_fieldcat-tabname       = 'IT_OUTPUT'.
      APPEND ls_fieldcat TO pt_fieldcat.
      CLEAR ls_fieldcat.
      pos = pos + 1.
    ENDFORM.                    " field_fill
    Regards
    Gopi

  • Adding the columns dynamically in crystal report

    Hi,
      I am developing a application using asp.net and crystal report. In a report the column is created dynamically( ie, the report gets input from a sp which returns N no. of columns). Since i dont know the column name and no. of columns at design time i am not able to create the report. If any of you have any idea on adding the columns dynamically please send me the code or the link.
    Thanks
    Sankar

    Hello Sankar,
    please see CS code for VS 2005 below to add a database field to a report using inproc RAS.
    This sampels retrieves the table column name from the database and adds it to the report.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Add_Field_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
            CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject boFieldObject;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    AddField.rpt");
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                //Get the first section in the details section
                   boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                   //Create the field object that we will add to the report and set all of its properties
                   boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                   boFieldObject.DataSourceName = "{Customer.City}";
                   boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                   boFieldObject.Left = 4 * 1440; //1440 twips per inch
                   boFieldObject.Width = 3 * 1440;
                   boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                   boFieldObject.FontColor.Font.Name = "Arial";
                   boFieldObject.FontColor.Font.Size = 10;
                   boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                   //Add the object to the report
                   boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Get the first section in the details section
                boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                //Create the field object that we will add to the report and set all of its properties
                boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                boFieldObject.DataSourceName = "{Customer.City}";
                boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                boFieldObject.Left = 4 * 1440; //1440 twips per inch
                boFieldObject.Width = 3 * 1440;
                boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                boFieldObject.FontColor.Font.Name = "Arial";
                boFieldObject.FontColor.Font.Size = 10;
                boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                //Add the object to the report
                boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;

  • ADDING A COLUMN TO THE ALV

    HI Experts,
              im here with a problem , i want to know if its possible to add an extra column to the ALV display my problem is im using the  dictionary table directly not using any structures and hence  iv not declared any field catalog....the output of this one extra field has to be hard coded  and added to the display so it appears with the displayed alv at all times.
    is this possible can i get help pls?
    Thanks & Regards,
    Goldie.

    Hi,
    Append one more field to the field catalog & populate the same in the output internal table of ALV.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.

  • Adding mark column into an alv

    Hallo ladies and gentlemen,
    how can i easily add an mark column to an alv-list?
    thanks a lot,
    Marcel

    hi,
    DATA : wf_slis TYPE  slis_t_fieldcat_alv.
    PERFORM build_catalog USING wf_slis[].
    FORM build_catalog USING wf_slis TYPE slis_t_fieldcat_alv.
    .ur old fields....
    *new field mark
      CLEAR wf_str_slis.
      wf_str_slis-fieldname = 'WF_MARK'.
      wf_str_slis-checkbox = 'X'.
      wf_str_slis-edit = 'X'.
      APPEND wf_str_slis TO wf_slis.
    endform.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         i_callback_program             = sy-cprog
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
         it_fieldcat                    =  wf_slis[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          t_outtab                       = int_zone[]
       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.
    rgds
    anver
    Message was edited by: Anversha s

  • Addition of new column in standard ALV

    Hi,
    Can somebody help on
    How to add new col in the ALV and also addition of a custom button.

    Check this..
    for adding column
        data lo_cmp_usage type ref to if_wd_component_usage.
        lo_cmp_usage =   wd_this->wd_cpuse_alv1( ). " alv1 is my alv component name
        if lo_cmp_usage->has_active_component( ) is initial.
          lo_cmp_usage->create_component( ).
        endif.
        data lo_interfacecontroller type ref to iwci_salv_wd_table .
        lo_interfacecontroller =   wd_this->wd_cpifc_alv1( ).
        data lo_value type ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        data: lo_column1 type ref to cl_salv_wd_column.
        lo_column1 = lo_value->if_salv_wd_column_settings~create_column( 'ATTRIBUTE NAME IN CAPITAL ).
    Regards
    Srinivas

  • Adding column headings

    I am using RAS server to create dynamic columns in my report. But the column headings are not coming.
    Isnt there any way to set the heading for the newly added columns?   
    Any idea what i am missing?   
    Here is a code i am using
        Private Sub AddTableFromDataSet(ByVal ds As System.Data.DataSet, ByVal crTable As CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable)
            ' Add the dataset as a data source to the report
            m_boReportClientDocument.DatabaseController.AddTable(crTable, DBNull.Value)
            m_boReportClientDocument.DatabaseController.SetDataSource(DataSetConverter.Convert(ds), "TEST")
            Dim ifield As Integer
            ' Add a field to the report canvas
            Dim CrField As CrystalDecisions.ReportAppServer.DataDefModel.ISCRField
            For Each dtfield In m_boReportClientDocument.Database.Tables(0).DataFields
                ifield = m_boReportClientDocument.Database.Tables(0).DataFields.Find(dtfield.Name.ToString, CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault)
                CrField = DirectCast(m_boReportClientDocument.Database.Tables(0).DataFields(ifield), Field)
                CrField.HeadingText = CrField.Name
                CrField.Description = "TEST"
                m_boReportClientDocument.DataDefController.ResultFieldController.Add(-1, CrField)
            Next
        End Sub
    Thanks in advance

    You either have to add the heading yourself, or you can use
    reportClientDoc.ReportDefController.ReportObjectController.AddByName("{Orders.OrderID}", "OrderID")
    This doesn't let you set anything about the objects, so it would probably be better to add them separately.

  • New column in the ALV output of transaction phap_admin_pa

    Hello All,
    I want to display a new column in the ALV output of transaction phap_admin_pa. Is this possible? If so, could anyone please give some guidance how to proceed. The new column willl contain the elements from appraisal catalog. Do u think there will be any BADi's to achieve this or I am not sure if a custom program need to be created?
    Thank you very much,
    Rush

    Hi
    I had same problem of adding felds from additional data into the ALV and when I asked SAP they told me to implement BADI HRHAP00_REPORTING.
    I am still trying to get some info on how to implement it if you find any documentation of someone who has implemented appreciate you tell me.
    regards
    Pravin

  • Variable Columns Dispaying in ALV Report

    Hi ,
    I am working on ALV report . I am displaying 40 static fields and variable fields . Those varaible fields dependent on internal table . In the internal table 3 fields are available
    if it contains 1 row then in report variable fields are   3  OR
    if it contains 2 rows then in report variable fields are 6  OR 
    if it contains 3 rows then in report variable fields are 9  OR
    if it contains n rows then in report variable fields are 3n.
    Example :  1)  Internal table have 3 fields sd_active , sd_close , sd_term .
                               Internal table is i_a936 , Work area w _a936 .
                                 w_a936-sd_active = 'A1'.
                                 w_a936-sd_close  = 'B1'.
                                 w_a936-sd_term    = 'C1'.
                                 append w_a936 to i_a936.
                                 w_a936-sd_active = 'A2'.
                                 w_a936-sd_close  = 'B2'.
                                 w_a936-sd_term    = 'C2'.
                                 append w_a936 to i_a936.
                      Then in final internal table it should display  6 columns like w_final-sd_Active1 ,w_final-sd_close1,w_final-sd_term1 , w_final-sd_Active2 ,w_final-sd_close2,w_final-sd_term2 . Columns in Internal table varies from i_a936 rows .
    I am trying to use Dynamic internal table .
    Regards
    Srihari Nerella

    Hi,
           I think this may help you . Use CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    see the link
    Dynamic fields to be displayed in ALV
    Dynamic column change in Alv
    Dynamic Number of Columns in ALV

  • Multiple Rows and Columns selection on ALV

    Hi all,
    What is the best solution to allow the multiple selection or combination of selection (rows and columns) on an ALV ?
    I would like to be able to select some rows and some columns and to get the result cells in order to update them.
    Thanks in advance for your help.
    David

    Thanks Srinivas and Seela,
    I forgot to precise that my ALV is dynamic, I used the method 'add_new_child_node'.
    I tried the different possibilties with method attributes but I don't find the good attributes combination to allow columns selection.
    I add also that I have to be able to select several no adjacent columns.
    What do you think about this workaround :
    Is it possible to add a line on my ALV with checkbox between the header line (with column title) and data line.
    I will search using the method add_cell_variant but I don't know if it's possible with dynamic ALV.
    Thanks.
    David

  • How to switch off column coloring of alv grid printouts?

    Hello World!
    Is there any possibility (a customizing option or a parameter) to switch off cell/column coloring of alv grid printouts?
    It is very useful to see colored columns in screens, but they are darkened in printouts. How to avoid it?
    Thanks and regards,
    Vladimir

    Hi,
    You can have different layouts for a ALV report and each layout the look and feel can be different.
    So, the manual activity is the user will have to switch to the B/W layout before printing. I am not sure if you have enabled the LAYOUT option for the user to change it by himself.
    I hope I am able to get across my point.
    If you are using OO ALV control, you can dynamically change the layout using set_frontend_layout  method. The user can also change the layout --
    choose Change layout or Settings ® Layout ® Change.
    The Change Layout dialog box shows you which columns are currently displayed and which additional columns can be displayed.
    Regards,
    Ravi
    Note - Please mark the helpful answers
    Message was edited by: Ravikumar Allampallam

  • Stock Requirement List - MD04 - adding columns in this list

    Dear All,
    I am working on the Stock Requirement list ( transactioncode MD04) and the customer wants to add columns with the fields STPO-DATUV ,date of change of a drawing, and the drawing number with revision level STPO-YY_DZEINR.
    There is a badi MD_ADD_COL_EZPS which provides in adding columns, but according the structures MDPSX , MDEZX and MDSUX there are no fields in thoser structures, which directly match with the required fields; somebody has a clue to help me out and get it working.
    For instance: Vendor- and Customer data  can be added by using the pushbuttons and those fields are available from above mentioned structures.
    Thanks in advance and kindest regards,
    Rene.

    Hi Utpal Mishra
    You guessed correctly. I missed to inform our Strategy. We are using Strategy group  11  Make-to-stock prod./gross reqmts plnning.
    User is not able to do PGI or create delivery. He says I have enough stock in MMBE but why system is not allowing.
    Here there are some pending document like -
    1. Pending sales order
    2. Pending deliveries (picking not done)
    2. Delivery created & Picking Done but PGI not done. These things will have a commitment against the stock. But we are interested in getting these document numbers, so that we can take come action against them.
    MD04 simply shows the mrp element as order / delivery but the document number is not available. How to find these documents.
    Please help. Is there any table or a standard transaction ??
    Thanks

  • Display data column wise in alv

    my problem is i want to display data in column wise in alv grid display
    for example it will display
    Name1    Amount
    GTS       12000
    TSL        8970
    MJB        4678
    but i want like:
    GTS    TSL    MJB
    12000 8970  4678
    Edited by: jadav_avani on Nov 15, 2010 8:33 AM
    Moderator Message: Search for available information.
    Edited by: kishan P on Nov 15, 2010 1:50 PM

    my problem is i want to display data in column wise in alv grid display
    for example it will display
    Name1    Amount
    GTS       12000
    TSL        8970
    MJB        4678
    but i want like:
    GTS    TSL    MJB
    12000 8970  4678
    Edited by: jadav_avani on Nov 15, 2010 8:33 AM
    Moderator Message: Search for available information.
    Edited by: kishan P on Nov 15, 2010 1:50 PM

Maybe you are looking for

  • How do you check if the replacement phone is a refurb or new one ?

    Hi Guys Can anyone tell me what does the Facotry code 70 stands for ? because I am getting a replacement phone and I see that the Serial number starts with 70. when I checked in the below site.. its not giving me any information about whether refurbi

  • Changing 'layout' of testsystem ?

    hi, is there some way how to differ a production-system from a test-system ? i want to have a BIG DIFFERENCE between the 2 system, not only the very little status-bar, which tells me on which system i am. and i don't want to change colours. is there

  • Photos not syncing in order

    The photos I want loaded to my ipod are not syncing in the same order they are in the file on my computer. I have tried renaming them in the order I want them and as far as I can tell they aren't loading based on file size, or the date they were crea

  • Can someone tell me how to install app at nokia 58...

    i have buy nokia 5800 at taiwan , but when i try to install app from download . i can't install . it keep appear " certificate expired" fail to install. only files with jar format can install, with sis totally cannot. i dont why even i download from

  • How to start Photoshop CC on Creative Cloud

    I dont know how to start photoshop cc on creative cloud..