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

Similar Messages

  • Tranfering data from alv display to a transaction with table control.

    Hi all, 
    I am having some problem transfering data from my alv display to a trasaction which needs to display some values in a table control base on criterias which I have selected from my alv report.
    When selecting an entry in my alv report.
    1. The program should check whether there is an entry in a z table(already created), if so it retrieves data fro the z table base on the selected criteria.
    2.otherwise it search from the data from other tables and then saves it in the z table and display the values in the tc.
    my program is as follows.
    FORM button_click USING p_ucomm TYPE sy-ucomm
                            p_selfield TYPE slis_selfield.
      CASE p_ucomm.
        WHEN 'SALES'.
          READ TABLE gt_alvdisplay
          INDEX p_selfield-tabindex
          INTO gs_alvdisplay.
          SET PARAMETER ID:  *I dont know how to pass the para to the tc.....
          CALL TRANSACTION 'ztrans_test".
    ENDFORM.          
    Note: TC is already created and it retrieves data from the z table but am having prob just to pass the parameters.
    Ill be very grateful to you all

    Hello,
    Yes you can create text field without using screen painter as follows:
    PARAMETERS P1 TYPE CHAR12 MEMORY ID mid.
    Here, this code will create text box with name P1 and parameter id "mid"
    You can assign meaning text to p1 using menu link GO TO --> TEXT ELEMENTS --> SELECTION TEXTS.
    So before call transaction which contains this field you can write below statement.
    SET PARAMETER ID mid VALUE <value variable>.
    * Here vlaue variable is the variable from which you want to pass value to parameter id mid.
    Refer [SAP Help|http://help.sap.com/saphelp_nw70/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm] for more information.
    Hope this helps!
    Thanks,
    Augustin.

  • Get ALV Report's Result Into Internal Table

    Hello everyone,
    is there a way to get a alv reports result into an internal table?
    For example: is it possible to get the values from transaction S_ALR_87012078.
    I mean i want to write a function an it will give you the alv reports result as internal table, so  you won't have to dig the reports code in.
    thanks to any answers from now. bye.

    Hi
    This is a wrapper program which will execute the standard program and capture the output as we are using list to memory
    Then after we will be using LIST_FROM_MEMORY and 'LIST_TO_ASCI'
    submit rhrhaz00 exporting list to memory
    and return
    with pchplvar = pchplvar
    with pchotype = pchotype
    with pchobjid in pchobjid
    with pchsobid in pchsobid
    with pchseark = pchseark
    with pchostat = pchostat
    with pchistat = pchistat
    with pchztr_d = pchztr_d
    with pchztr_a = pchztr_a
    with pchztr_z = pchztr_z
    with pchztr_m = pchztr_m
    with pchztr_p = pchztr_p
    with pchztr_y = pchztr_y
    with pchztr_f = pchztr_f
    with pchobeg = pchobeg
    with pchoend = pchoend
    with pchtimed = pchtimed
    with pchbegda = pchbegda
    with pchendda = pchendda
    * with pchwegid = pchwegid
    * with pchsvect = pchsvect
    * with pchdepth = pchdepth
    with infty in infty
    with subty in subty
    with vdata = vdata
    with info = info.
    data: list like abaplist occurs 0 with header line.
    data: txtlines(1024) type c occurs 0 with header line.
    clear list.
    refresh list.
    clear tbl_reportlines.
    refresh tbl_reportlines.
    call function 'LIST_FROM_MEMORY'
    tables
    listobject = list
    exceptions
    not_found = 1
    others = 2.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    call function 'LIST_TO_ASCI'
    * EXPORTING
    * LIST_INDEX = -1
    * WITH_LINE_BREAK = ' '
    * IMPORTING
    * LIST_STRING_ASCII =
    * LIST_DYN_ASCII =
    tables
    listasci = txtlines
    listobject = list
    exceptions
    empty_list = 1
    list_index_invalid = 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.
    else.
    tbl_reportlines[] = txtlines[].
    call function 'LIST_FREE_MEMORY'.
    endif.
    Here is the simple example program
    *Example Code (Retrieving list from memory)
    DATA BEGIN OF itab_list OCCURS 0.
    INCLUDE STRUCTURE abaplist.
    DATA END OF itab_list.
    DATA: BEGIN OF vlist OCCURS 0,
    filler1(01) TYPE c,
    field1(06) TYPE c,
    filler(08) TYPE c,
    field2(10) TYPE c,
    filler3(01) TYPE c,
    field3(10) TYPE c,
    filler4(01) TYPE c,
    field4(3) TYPE c,
    filler5(02) TYPE c,
    field5(15) TYPE c,
    filler6(02) TYPE c,
    field6(30) TYPE c,
    filler7(43) TYPE c,
    field7(10) TYPE c,
    END OF vlist.
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = itab_list
    EXCEPTIONS
    not_found = 4
    OTHERS = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
    list_index = -1
    TABLES
    listasci = vlist
    listobject = itab_list
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    IF sy-subrc NE '0'.
    WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.
    Re: alv to internal table

  • Search Help values to Internal table

    Dear Friends,
    Is it possible to export Search Help values to Internal table?
    On screen, when user click on Search button, the SAP standard search help will call (Customer Search). After entering values, some result get displayed and this result need to export to the internal table.
    Thanks in stack
    Nilesh

    Hi:
    try this:
    DATA : wa_shlp TYPE shlp_descr,
               it_records LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    wa_shlp-SHLPNAME = 'MAT0M'.   "one of elementary search help name from mara-matnr.
    wa_shlp-SHLPTYPE = 'SH'.
    CALL FUNCTION 'F4IF_SELECT_VALUES'
         EXPORTING
           shlp                   = wa_shlp
      MAXROWS                = 0
      SORT                   = ' '
      CALL_SHLP_EXIT         = ' '
    IMPORTING
      MAXROWS_EXCEEDED       =
        TABLES
      RECORD_TAB             =
      RECDESCR_TAB           =
          return_tab            = it_records
    LOOP AT it_records.
      WRITE:/ it_records.
    ENDLOOP.
    Follows is how to get the search help name:
    CALL FUNCTION 'DD_SHLP_GET_HELPMETHOD'
      EXPORTING
        tabname                 = 'MARA'
        fieldname               = 'MATNR'
        langu                   = sy-langu
      NO_CHKTAB_MAPPING       =
      GET_ENTITYTAB           = ' '
       CHANGING
         shlp                    = wa_shlp
      callcontrol             = callcontrol
      EXCEPTIONS
        field_not_found         = 1
        no_help_for_field       = 2
        OTHERS                  = 3
    CALL FUNCTION 'F4IF_EXPAND_SEARCHHELP'
       EXPORTING
         shlp_top = wa_shlp
       IMPORTING
         shlp_tab = shlps.
    好运,
    启明星

  • 3rd largest value in internal table

    How to find the third largest value in internal table.
    please give me logic without using sort statement?
    and how to find the 3rd largest value with using sort on internal table.
    please give the both logic separately?
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 5:28 PM

    First sort the internal table. and read the 3 record by index.
    if duplicate exists use delete adjacent duplicates and read the 3 record.
    second method.
    loop at itab into wa_itab.
    if sy-tabix = 1.
    lv_high = wa_itab-value.
    else.
         if lv_high > wa_itab-value.
         else.     
         lv_high = wa_itab-value.
         endif.
    endif.
    endloop.
    loop at itab into wa_itab < lv_high.
    if sy-tabix = 1.
    lv_sechigh = wa_itab-vlaue.
    else.
    if lv_shigh > wa_itab-value.
    else.
    lv_sechigh = wa_itab-value.
    endif.
    endif.
    endloop.
    loop at itab into wa_itab < lv_sechigh.
    if sy-tabix = 1.
    lv_thirdhigh = wa_itab-vlaue.
    else.
    if lv_thirdhigh > wa_itab-value.
    else.
    lv_thirdhigh = wa_itab-value.
    endif.
    endif.
    endloop.

  • How do we pass values and Internal tables to Sub-routines

    how do we pass values and Internal tables to Sub-routines

    Hi,
    You can use the USING..or TABLES..or Changing addition..
    Check this example.
    DATA: T_MARA TYPE STANDARD TABLE OF MARA.
    PERFORM DISPLAY USING T_MARA.
    FORM DISPLAY USING LT_MARA LIKE T_MARA.
    DATA: WA TYPE MARA.
    LOOP AT LT_MARA INTO WA.
      WRITE: / WA-MATNR.
    ENDLOOP.
    ENDFORM.
    Thanks
    Naren

  • Fetch the values from internal table inside an internal table (urgent!!)

    data : BEGIN OF PITB2_ZLINFO occurs 0,
             BEGDA LIKE SY-DATUM,
             ENDDA LIKE SY-DATUM,
             PABRJ(4) TYPE N,                       "Payroll Year
             PABRP(2) TYPE N,                       "Pay. Period
             ZL LIKE PC2BF OCCURS 0,
           END OF PITB2_ZLINFO.
    I have a internal table like this,
    How to Fetch the values from internal table inside an internal table.
    Kindly Help me on this..
    Regards,
    Ram.

    Hi,
    Try this....
    Loop at PITB2_ZLINF0.
    Loop at PITB2_ZLINF0-ZL.
    endloop.
    Endloop.
    Thanks...
    Preetham S

  • HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE

    HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE.
    DATA : BEGIN OF ITAB OCCURS 0,
               FIELD1(2) TYPC C DEFAULT   '12',
               FIELD2     TYPE C ,
               END OF ITAB1.
    IT'S GIVING ERROR MESSAGE.
    PLZ LOOK INTO THIS AND GIVE ME CORRECT SOLUTION.
    THANKS
    SURI

    DATA : BEGIN OF ITAB OCCURS 0,
    FIELD1(2) TYPC C,
    FIELD2 TYPE C ,
    END OF ITAB1.
    itab-field1 = '12'.
    itab-field2 = 'A'.
    append itab.
    clear itab-field2.
    itab-field1 = '12'.
    itab-field2 = 'B'.
    append itab.
    clear itab-field2.
    Now everytime u'll have the value for field1 = '12'.
    Regards
    Vasu

  • How can i pass calculated value to internal table

    Hi
    i have to pass calculated value into internal table
    below field are coming from database view and i' m passing view data into iznew1
    fields of iznew1
                 LIFNR  LIKE EKKO-LIFNR,
                 EBELN  LIKE EKKO-EBELN,
                 VGABE  LIKE EKBE-VGABE,
                 EBELP  LIKE EKBE-EBELP,
                 BELNR  LIKE EKBE-BELNR,
                 MATNR  LIKE EKPO-MATNR,
                 TXZ01  LIKE EKPO-TXZ01,
            PS_PSP_PNR  LIKE EKKN-PS_PSP_PNR,
                 KOSTL  LIKE EKKN-KOSTL,
                 NAME1  LIKE LFA1-NAME1,
                 NAME2  LIKE LFA1-NAME2,
                 WERKS  LIKE EKPO-WERKS,
                 NETWR  LIKE EKPO-NETWR,
                 KNUMV  LIKE EKKO-KNUMV,
                 GJAHR  LIKE EKBE-GJAHR,
    and now i want to pass
    one field ED1  which i has calculated separatly and i want to pass this value into iznew1
    but error is coming that iznew1 is a table with out header line  has no component like ED1.
    so how can i pass calculated value to internal table iznew1,

    When you declare your internal table , make an addtion occurs 0
    eg . data : begin of iznew occurs 0 ,
                    fields ...
       add the field here ed1.
               end of iznew.
    now when you are calculating the value of ed1,
    you can pass the corresponding value of  ed1 and modify table iznew.
    eg
    loop at iznew.
    iznew-ed1 = ed1.
    modify iznew.
    endloop.

  • How to find value in internal table

    Hi,
    I'm trying to search a value in internal table by using the FIND TABLE syntax but there's an error message saying In CHAR MODE a character-like, or in BYTE MODE a byte-like field is expected as the row type for the table "ITABLE".  The internal table already has character-like field.
    Here's the code:
    FIND ALL OCCURRENCES OF w_itable-ordno IN TABLE itable RESULTS results.
    Wherein:
    w_itable-ordno contains the value that I need to find
    itable is the internal table that has data
    Thanks.
    Kath

    Hi Kathy,
    I dont think you can use the given syntax in unicode envoirnment.
    As i understand, you are trying to find a value in your internal table. Why dont you make use of LOOP or READ statements. That would be a better option.
    Best Regards,
    Ram.

  • How to update value in internal table from cdpos taking fname n value_new?

    hello everyone,
              i want to insert  value in internal table from cdpos table taking field name  from fname and value from value_new.but the problem is i am not getting how to map the corresponding field of internal table with fname value  which is the field name.
    for example
    i
    fieldname
    value
    name1
    raj
    name2
    sharma
    i want to update field name1. this name1 is there in fname with updated value in value_new  how to make name1 with fname value
    thanks and regards
    laxmikant soni

    Hi Laxmikant,
    If I have understood your requirement correctly, you need to update an internal table with latest 'value_new' from cdpos table where  'fname' = 'fieldname' .
    Hope the below logic will help you:
    FIELD-SYMBOLS: <wa_intab> LIKE LINE OF lt_intab.  "the internal table you want to change
    LOOP AT lt_intab ASSIGNING <wa_intab> .
       READ TABLE lt_cdpos INTO wa_cdpos           "lt_cdpos contains latest data selected from CDPOS
        WITH KEY fname = <wa_intab>-fieldname.
       IF sy-subrc = 0.
         <wa_intab>-value = wa_cdpos-value_new.    
       ELSE.
         "//logic if the name is not there in CDPOS
       ENDIF.
       CLEAR  wa_cdpos.
    ENDLOOP.
    If you wish to improve performance, I suggest using
    1. "transporting value_new" addition in READ TABLE,
    2.  select only the data which you require from CDPOS,
    3.  create the internal tables with only fields which you require,
    4.  when you are using SELECT,LOOP AT statements, limit records by using WHERE condition
    Regards,
    Kavya

  • Read integer values from spreadsheet and display the values in a table

    Hi all,
    I have integer values to read from a spreadsheet and display them in a table. I am using 'Read from spreadsheet file' in 'integer' mode. I would like to display these values in a table. The problem is that the table takes only 2d-array of string as input but not integer.  
    It works fine if I change the mode of 'Read from spreadsheet file' from 'integer' to 'string' but I want to read integers and have to use the integer values for further calculations. Please give any suggestions on displaying integers to a table.
    Thank you. 
    Solved!
    Go to Solution.

    No don't take element by element just convert as a whole. See the attached example
    Good luck
    The best solution is the one you find it by yourself

  • A global internal table - retaing values of internal table

    Hi,
    I needed some help in the creation of a internal table whose content don't change in the recursive call to the method.
    I call a method  M1 which returns me an standard internal table (i1) as an import parameter and has two export parameters ( exp_p1,exp_p2).
    I call this method(m1) recursively in the method m1 itself. I find that when i call this mehtod m1 , second time the data that was there in the internal table M1 on first call of the method is cleared out.
    what shoudl i do , so that i can to reatin the the value of the internal table.
    Like for example , i have one record in the internal table in the first call to the method M1 and before the second call of method is made.
    Once the call to method M1 is made ( meaning to say a second call is made) ,the internal table contains zero records.
    while creating the internal table i use a the append keyword to add rows in the method.
    In Programming language 'C', for recursion function , if any variable is made as static, that variable retains it value during successive calls to the function.I am looking for something similar to it.
    Regards,
    Om

    Use a static class. 
    report zrich_0002.
    *       CLASS lcl_app DEFINITION
    class lcl_app definition.
      public section.
        <b>class-data:</b> it001 type table of t001.
        <b>class-data:</b> xt001 type t001.
        <b>class-methods:</b> get_data,
                       write_data.
    endclass.
    start-of-selection.
      call method lcl_app=>get_data.
      do 2 times.
        call method lcl_app=>write_data.
        skip 1.
      enddo.
    *       CLASS lcl_app IMPLEMENTATION
    class lcl_app implementation.
      method get_data.
        select * into table it001 from t001.
      endmethod.
      method write_data.
        loop at it001 into xt001.
          write:/ xt001-bukrs, xt001-butxt.
        endloop..
      endmethod.
    endclass.
    REgards,
    Rich Heilman

  • Passing a value from internal table to a powerpoint slide

    Hi,
    Does anyone know how to pass a value from internal table to a powerpoint slide?  I would also need some codes with regards to the coding to open the powerpoint and insert the value in.
    Thanks.
    Points will be awarded.
    Hope to hear from you soon.
    Lawrence

    geez!! do feel sorry for you
    you can fire FM WS_EXECUTE to open power point but passing a variable at run-time i'm not sure, sorry.

  • How to assign select-option values to internal table

    hi all,
    how to assign select-option values to internal table
    thanks in advance.

    Hi,
    You just need to loop at your select-option field and take the values from low and high fields.
    for. e.g
    loop at s_werks .
    move:s_werks-low to <your itab>
    if not s_werks-high is initial .
    move: s_werks-high to <youritab>
    endif .
    append <your itab>
    endloop .
    OR use select statement.
    regards,
    Omkar.
    Message was edited by:
            Omkaram Yanamala
    Message was edited by:
            Omkaram Yanamala

Maybe you are looking for

  • My Past, Present & Future with Creative Sound Blaster cards

    I wrote a small product review of a Z-series card i regrettably purchased and creative responded. I replied to them and copied+pasted it here. First and foremost please understand this is just an open letter talking about my love for and mostly posit

  • IPhone 4s, still on iOS 6, is slow, can't connect to the internet, and overheats a lot,

    I've have my iPhone 4s for about a year now, and up until when the iOS 7 update was released, I never had any problems with it.  I still haven't updated my phone, though. I prefer the interface that comes with iOS 6, and in my opinion it's easier to

  • Time Machine stops writing to drive at 380 of 390 GB

    I'm using Time Machine to do a full backup of my computer for the first time. I have a WD MyBook Pro Edition II set as a striped 1T raid connected via FW800 with no other FW devices connected. After 4 hours the progress bar stopped at 380 of 390 GB a

  • How to calculate a percentage of a Running Total?

    Post Author: pvang CA Forum: Formula Hi folks,    Quite new here to the forum and to Crystal Report. As you can tell, I've already stumbled upon a roadblock. Here is what I'm trying to do:I am grabbing employee names and the number of cases that they

  • ITunes 7 icon not showing in windows

    I noticed that the iTunes 7 icon becomes a blank box as if the program is missing. However when I click it the program does start. I don't even have the option to investigate or assign an icon manually as in the properties dialog box unlike other pro