Duplication of fields headings...

Hi All
I have three fields from different tables (mara-lvorm, marc-lvorm, mard-lvorm), they displaying fine on the alv grid but when i export the data to excel the column headings are duplicated. What can i do to solve this problem beacuse i have created 1 internal table for all of my fields.
Regards,
Fred.

Ru using export to excel in ALV or r u using some function modules for export?

Similar Messages

  • More than one Row Field headings in ALV

    Hello Everyone,
             i have one requirement wher i need to give more than one row of field heading. one main heading and sub field headings. Following is structure which will  give an idea.
    Current PIR Quantities|   -> Main heading
    Qty1|Date1Qty2|Date2|   -> Sub headings
           |       |        |        |   -> report values will come here
           |       |        |        |   ->     -
    do----
    Can you please let me know how can we get this lay out in field catalogue for field headings??
    Thanks in Advance
    Siva
    Message was edited by:
            Siva Velama

    Hi Atish,
            Thanks for your reply. i dont have data in two levels for Hierarchial-sequential ALV. Data is just one row. But field headings(fieldcatalogue in alv) will have two rows. That means one row of main headings and second row with detailed fields. One main heading may have more than one subheading. ultimately we display values for Subheading fields.
    hope you have understood the requirement.
    Thanks
    Siva

  • Field headings display in clasical report

    Hi ABAPERS
    iam working on clasical report. in that i have to display 16 field headings.
    when executing the report, the column headers should be frozen at the top so that when the user is scrolling down, they can see what the column title is.
    how can i over come this problem.

    Put your colum headers in TOP-OF-PAGE Event.
    This should give you your desired result.

  • Export multiple forms to xml/excel - field headings are missing

    I have created a dynamic flow multiple page form in Livecycle.  When I first tested the form I would export -> multiple forms to a spreadsheet -> an xml file that I would then open in excel.  This worked great and the field headings showed at the top.
    I did some edits to my form and now when I run the export to xml and then open in excel, the field headings are gone.  What controls this variable, does anyone know how I can correct this?
    Thank you in advance!

    Hi,
    The heading are in the table pt_fcat - you don't seem to be passing that in form....
    PERFORM setup_and_display_alv_ver2
    USING
    it_out_alvp "Parameter structure
    it_output[] "Internal Data table(header table)
    it_output[]. "Dummy table for Hierarchical ALV!!(item table)
    which I guessing in in one of the includes?
    Saying that the extract pof code does not show where you are calling form it_out_alv_fieldcat_before ...which populates the headings...
    Regards
    Stu

  • FIeld headings in ALV Grid by label

    Hi
    I want disply the headings in alv grid display like this format.
    I want write my own label in the output. (not in Normal LIST DISPLAY)
    Sno |      Sname |    Marks
        |           |     M1 |  M2  | M3
    How it is possible?
    Edited by: Krishna Bommisetty on Sep 11, 2008 10:55 AM

    Hi,
      Check the below code.
    WA_FCAT-SELTEXT_M   = TEXT-073.
      WA_FCAT-DDICTXT      = 'M'.
    We can define the name of the field label as mentioned above, where texto073 is nothing but the field label you want to give to the particular field.
      DDICTXT you have to mention the length as small 'S', medium 'M' and large as 'L'.

  • Field Headings Problem

    Hello, we have just upgraded to ECC 6.0 from 4.6B and we have noticed that when we look at bespoke tables in SE16 some of the headings appear as the name of the field and not the Label as is written in the short description on the table in SE11 - just wondering has anyone come across this before and/or similar.
    I konow that we can switch the layout using -> Settings -> User Parameters but the problem is that when we switch to ALV Grid Display, we see that the headings display the field name, some of these tables are used in Queries (SQ01)
    Thanks,
    Conor.

    Hi,
    First give field labels in the data element level for the particular fields then you  have to delete the existing table maintainence of that table and recreate it then it will display the field anme correct. if you have already given the field label then recreate the table maintainence.
    Reward if usefull.
    thanks,
    Muthu

  • ALV Reporting with Field Headings

    Hi ,
    Can anyone  tell..
    Can we Display Field heading with Some Common Heading for a group in ALV grid Reporting.
    Below is the format...
                GROSS Block                               DEP RESEREVE                    
         GL CODES   SAP register       Unit`s Trial     Check           GL CODES     SAP register     Unit`s Trial     Check     
         311100     38810062.33     38810062.33     0                0.00         0.00     0     0     
         311200     0     0     0                0.00         0.00     0     0     

    Hi ,
    Can anyone  tell..
    Can we Display Field heading with Some Common Heading for a group in ALV grid Reporting.
    Below is the format...
                GROSS Block                               DEP RESEREVE                    
         GL CODES   SAP register       Unit`s Trial     Check           GL CODES     SAP register     Unit`s Trial     Check     
         311100     38810062.33     38810062.33     0                0.00         0.00     0     0     
         311200     0     0     0                0.00         0.00     0     0     

  • Fixed and dynamic field headings in field catalog

    i have to develop an ALV Report where certain column headings are fixed and other column heading will be changing from time to time.
    is there any method to do so.
    that is i have to show the report for 3 months and the names of months will be changing in due course.
    Waiting for a reply.
    A.Reshma

    hi,
    you have 4 texts
    SELTEXT_L
    SELTEXT_M
    SELTEXT_S
    and   DDIC_TEXT  (not sure about spelling)
    change this text dynamicly with month of your choice.
    Rgds

  • Reg: Field Names in GUI_DOWNLOAD

    Hi Sapers,
    I want to keep the Field Headings in XLS file.Here I am using the FM GUI_DOWNLOAD, and passing the Tables parameter(i.e, fieldnames) .But my heading is truncated to 10 char.
    as the way the FM does.
    How can I satisfy my client.Plz help me out.
    regards,
    sri...

    yah, sure.
    here is my code, from type-pools....
    *---- TYPE-POOLS DECLARATION -*
    TYPE-POOLS:truxs.
    *---- SELECTION SCREEN BLOCK -*
    SELECTION-SCREEN BEGIN OF BLOCK sri. " WITH FRAME TITLE INPUT'.
    PARAMETERS   p_bukrs TYPE t001-bukrs OBLIGATORY VALUE CHECK.
    PARAMETERS : pperiod(2) TYPE c,
                 pyear(4)   TYPE c,
                 p_file TYPE rlgrap-filename OBLIGATORY default 'C:\Documents and Settings\srikanth\Desktop\rep1.xls'.
    PARAMETERS : csvfile  RADIOBUTTON GROUP rg1,     "factfile RADIOBUTTON GROUP rg1,
                 excel    RADIOBUTTON GROUP rg1 default 'X',
                 text     RADIOBUTTON GROUP rg1.
    SELECTION-SCREEN END OF BLOCK sri.
    *---- TYPES DECLARATION -*
    TYPES : BEGIN OF ty_faglflext,
              tslvt TYPE faglflext-tslvt,
              tsl01 TYPE faglflext-tsl01,
              tsl02 TYPE faglflext-tsl02,
              tsl03 TYPE faglflext-tsl03,
              tsl04 TYPE faglflext-tsl04,
              tsl05 TYPE faglflext-tsl05,
              tsl06 TYPE faglflext-tsl06,
              tsl07 TYPE faglflext-tsl07,
              tsl08 TYPE faglflext-tsl08,
              tsl09 TYPE faglflext-tsl09,
              tsl10 TYPE faglflext-tsl10,
              tsl11 TYPE faglflext-tsl11,
              tsl12 TYPE faglflext-tsl12,
              zzetbrnum TYPE zetbrmap-zzetbrnum,
            END OF ty_faglflext.
    TYPES :BEGIN OF ty_bukrs,
              bukrs TYPE bukrs,
           END OF ty_bukrs.
    TYPES :BEGIN OF ty_etbrtot,
              zzetbrnum TYPE zetbrmap-zzetbrnum,
              totamt TYPE tslxx12,
           END OF ty_etbrtot.
    TYPES :BEGIN OF ty_currtostr,
             dfld(1) type c,
              zzetbrnum LIKE zetbrmap-zzetbrnum,
              totamt(26) TYPE c,
           END OF ty_currtostr.
    TYPES : BEGIN OF ty_csv,
              comma(80) TYPE c,
            END OF ty_csv.
    TYPES : BEGIN OF ty_txt,
              hfld(1) TYPE c,
              dfld(1) TYPE c,
              zzetbrnum LIKE zetbrmap-zzetbrnum,
              totamt(26) TYPE c,
              tfld(1) TYPE c,
            END OF ty_txt.
    TYPES : BEGIN OF header_record,
              hfld(1) TYPE c,
              filler1(13) TYPE c,
              loc(5) TYPE c,
              filler2(10) TYPE c,
              ppyy(4) TYPE c,
              filler3(47) TYPE c,
            END OF header_record.
    TYPES : BEGIN OF detail_record,
              dfld(1) TYPE c,
              gl(4) TYPE c,
              subbacc(5) TYPE c,
              bal(18) TYPE n,
              sign(1) TYPE c,
              filler(4) TYPE c,
              code(2) TYPE c,
              filler1(45) TYPE c,
            END OF detail_record.
    TYPES : BEGIN OF trailer_record,
              tfld(1) TYPE c,
              filler(79) TYPE c,
            END OF trailer_record.
    *---- DATA DECLARATION -*
    *---- Work Area Declaration -*
    DATA : wa_infaglflext TYPE ty_faglflext,
           wa_inetbrtot TYPE ty_etbrtot,
           wa_currtostr TYPE ty_currtostr,
           wa_csv TYPE ty_csv,
           wa_txt TYPE ty_txt,
           wa_header_record TYPE header_record,
           wa_detail_record TYPE detail_record,
           wa_trailer_record TYPE trailer_record.
          wa_xls type ty_xls.
    *---- Internal Tables Declaration -*
    DATA : infaglflext TYPE STANDARD TABLE OF ty_faglflext,
           inetbrtot TYPE STANDARD TABLE OF ty_etbrtot,
           i_currtostr TYPE TABLE OF ty_currtostr,
           i_csv TYPE STANDARD TABLE OF ty_csv,
           i_txt TYPE STANDARD TABLE OF ty_txt.
          i_xls type table of ty_xls.
    DATA: BEGIN OF dlpivot OCCURS 1.
              INCLUDE STRUCTURE excelpivot.
    DATA: END OF dlpivot.
    DATA : t_bukrs TYPE STANDARD TABLE OF ty_bukrs WITH HEADER LINE.
    DATA : BEGIN OF infieldnames OCCURS 1,   " Internal Table to Hold Headings in file.
            text(50),
           END OF infieldnames.
    *---- Variables -*
    DATA : v_temp TYPE tslxx12,
           v_amt TYPE tslxx12.
    DATA : v_mon(2) TYPE c,
           v_year(4) TYPE c,
           v_yr(4) TYPE c.
    DATA : v_pfile TYPE string.
          p_filetyp type string.
    DATA : v_len TYPE i,
           v_ext(4),
           v_exts(4),
           v_fpath TYPE string.
    *---- INITIALIZING PARAMETERS -*
    INITIALIZATION.
      v_mon   = sy-datum+4(2).
      v_year  = sy-datum+0(4).
      pperiod = v_mon.
      pyear   = v_year.
    *---- VALIDATIONS -*
    *---- COMPANY CODE VALIDATION -*
    AT SELECTION-SCREEN ON p_bukrs.
      SELECT bukrs FROM t001 INTO TABLE t_bukrs WHERE bukrs = p_bukrs. " COMP CODE
      IF sy-subrc NE 0.
        MESSAGE 'enter valid company code' TYPE 'E'.
      ENDIF.
    *---- MONTH VALIDATION -*
    AT SELECTION-SCREEN ON pperiod.
      IF ( pperiod LT 1 OR pperiod GT 12 ).
        MESSAGE 'Enter valid month ' TYPE 'E'.
      ENDIF.
    *---- YEAR VALIDATION -*
    AT SELECTION-SCREEN ON pyear.
      v_yr = v_year - 2.
      IF ( pyear GT v_year OR pyear LT  v_yr ).
        MESSAGE 'Enter valid Year(Not less than current minus 2 or Greater than current) ' TYPE 'E'.
      ENDIF.
    *---- File Extension Validation -*
    AT SELECTION-SCREEN.
      PERFORM get_ext.
      IF ( ( NOT ( excel EQ 'X' AND v_ext EQ '.xls' ) ) and
      ( NOT ( csvfile EQ 'X' AND v_ext EQ '.csv' ) ) and
      ( NOT ( text EQ 'X' AND v_ext EQ '.txt' ) ) ).
        MESSAGE e001(zgmam_msg).   "'choose the correct file format' TYPE 'E'.
      ENDIF.
    *---- F4 FUNCTIONALITY FOR FILE PATH -*
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
    *---- START-OF-SELECTION -*
    START-OF-SELECTION.
      SELECT a~tslvt
             a~tsl01
             a~tsl02
             a~tsl03
             a~tsl04
             a~tsl05
             a~tsl06
             a~tsl07
             a~tsl08
             a~tsl09
             a~tsl10
             a~tsl11
             a~tsl12
             b~zzetbrnum
         INTO TABLE infaglflext
         FROM faglflext AS a
           INNER JOIN zetbrmap AS b
             ON arbukrs = bbukrs  AND
                aracct  = bhkont
         WHERE a~ryear   = pyear.
      IF sy-subrc EQ 0.
        LOOP AT infaglflext INTO wa_infaglflext.
         CLEAR v_amt.
          v_amt = v_amt + wa_infaglflext-tslvt.
          DO pperiod TIMES
            VARYING v_temp
            FROM   wa_infaglflext-tsl01
              NEXT wa_infaglflext-tsl02.
            v_amt = v_amt + v_temp.
          ENDDO.
          wa_inetbrtot-zzetbrnum = wa_infaglflext-zzetbrnum.
          wa_inetbrtot-totamt    = v_amt .
          APPEND wa_inetbrtot TO inetbrtot.
          CLEAR : wa_inetbrtot,
                  wa_infaglflext,
                  v_amt.
        ENDLOOP.
        PERFORM header.
        IF ( excel EQ 'X' AND v_ext EQ '.xls' ).
          PERFORM download_to_xls.
        ELSE.
          IF ( csvfile EQ 'X' AND v_ext EQ '.csv' ).
            PERFORM download_to_csv.
          ELSE.
            IF ( text EQ 'X' AND v_ext EQ '.txt' ).
              PERFORM download_to_text.
            ENDIF.
          ENDIF.
        ENDIF.
      ELSE.
        WRITE :/ 'NO RECORDS FOUND'.
      ENDIF.
    -------------------SUBROUTINES----------------------------------**
    *&      Form  download_to_xls
          text
    FORM download_to_xls.
    *wa_xls-head1 = 'GENERAL LEDGER'.
    *wa_xls-head2 = 'AMOUNT'.
    *APPEND WA_XLS TO I_CSV.
    *CLEAR WA_XLS.
    *loop at inetbrtot into wa_inetbrtot.
    wa_xls-zzetbrnum = wa_inetbrtot-zzetbrnum.
    wa_xls-totamt    = wa_inetbrtot-totamt.
    append wa_xls to i_CSV.
    clear wa_xls.
    *endloop.
    CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
      EXPORTING
        file_name                       = p_file
      CREATE_PIVOT                    = 0
       DATA_SHEET_NAME                 = 'EXCEL'
      PIVOT_SHEET_NAME                = ' '
      PASSWORD                        = ' '
      PASSWORD_OPTION                 = 0
    TABLES
       PIVOT_FIELD_TAB                 = dlpivot
       DATA_TAB                        = inetbrtot
       FIELDNAMES                      = infieldnames
    EXCEPTIONS
       FILE_NOT_EXIST                  = 1
       FILENAME_EXPECTED               = 2
       COMMUNICATION_ERROR             = 3
       OLE_OBJECT_METHOD_ERROR         = 4
       OLE_OBJECT_PROPERTY_ERROR       = 5
       INVALID_PIVOT_FIELDS            = 6
       DOWNLOAD_PROBLEM                = 7
       OTHERS                          = 8
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         filename                      = v_pfile
         filetype                      = 'DBF'
         WK1_N_SIZE                    = 15
         WK1_T_SIZE                    = 15
         append                       = 'X'
      CONFIRM_OVERWRITE               = 'X'
       TABLES
         data_tab                      = inetbrtot
         fieldnames                    = infieldnames.
    ENDFORM.                    "download_to_xls
    *&      Form  download_to_csv
          text
    FORM download_to_csv.
      DATA : v_data TYPE string.
      CLEAR wa_inetbrtot.
      LOOP AT inetbrtot INTO wa_inetbrtot.
        v_data = wa_inetbrtot-totamt.
        CONDENSE  v_data NO-GAPS.
        CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
          EXPORTING
            betrg                         = v_data
        WAERS                         = ' '
        NEW_DECIMAL_SEPARATOR         =
        NEW_THOUSANDS_SEPARATOR       =
         IMPORTING
           string                        = wa_currtostr-totamt
        wa_currtostr-zzetbrnum = wa_inetbrtot.
        APPEND wa_currtostr TO i_currtostr.
        CLEAR wa_currtostr.
      ENDLOOP.
      LOOP AT i_currtostr INTO wa_currtostr.
        CONCATENATE wa_currtostr-zzetbrnum
                    wa_currtostr-totamt
                    INTO wa_csv-comma
                    SEPARATED BY ','.
        APPEND wa_csv TO i_csv.
        CLEAR wa_csv.
      ENDLOOP.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                      = v_pfile
       filetype                         = 'ASC'
      WRITE_FIELD_SEPARATOR           = 'X'
        TABLES
          data_tab                      = i_csv
         fieldnames                   = infieldnames.
    ENDFORM.                    "download_to_csv
    *&      Form  DOWNLOAD_TO_TEXT
          text
    -->  p1        text
    <--  p2        text
    FORM download_to_text. " using p_filetyp type string.
      DATA : BEGIN OF head OCCURS 1,                             " Internal Table to Hold Headings in file.
              text(1) VALUE 'H',
             END OF head.
      DATA : v_data TYPE string.
      CLEAR wa_inetbrtot.
      CLEAR wa_header_record.
      wa_header_record = space.
      wa_header_record-hfld = 'H'.
    wa_txt-hfld = 'H'.
      wa_header_record-ppyy+0(2) = pperiod.
      wa_header_record-ppyy2(2) = pyear2(2).
      APPEND wa_header_record TO i_csv.
      APPEND wa_txt TO i_txt.
      CLEAR wa_txt.
      LOOP AT inetbrtot INTO wa_inetbrtot.
        CLEAR wa_detail_record.
        wa_detail_record = space.
        wa_detail_record-dfld = 'D'.
       wa_txt-dfld         = 'D'.
       wa_txt-zzetbrnum    = wa_inetbrtot-zzetbrnum.
        wa_detail_record-bal = '0000000000000000000000'.
       wa_detail_record-bal = wa_
        v_data              = wa_inetbrtot-totamt.
        wa_detail_record-gl = wa_inetbrtot-zzetbrnum.
        CONDENSE  v_data NO-GAPS.
        CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'           "CONVERT ITAB-DATA TO STRING, AS THE ITAB CONTAINS A CURRENCY FIELD.
          EXPORTING
            betrg                         = v_data
        WAERS                           = ' '
        NEW_DECIMAL_SEPARATOR           =
        NEW_THOUSANDS_SEPARATOR         =
         IMPORTING
           string                         = wa_txt-totamt
        wa_detail_record-bal = wa_txt-totamt.
        IF ( wa_inetbrtot-totamt LT 0 ).
          wa_detail_record-sign = '-'.
        ELSE.
          wa_detail_record-sign = ' '.
        ENDIF.
        APPEND wa_detail_record TO i_csv.
        APPEND wa_txt TO i_txt.
        CLEAR wa_txt.
      ENDLOOP.
      wa_trailer_record-tfld = 'T'.
      APPEND wa_trailer_record TO i_csv.
      CLEAR wa_txt.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                      =
         filename                         = v_pfile
         filetype                         = 'DAT'
        append                          = 'X'
         header                         = 'abcd'
         replacement                    = '#'
      WRITE_FIELD_SEPARATOR             = ','
      CONFIRM_OVERWRITE                 = 'X'
        TABLES
          data_tab                        = i_csv
        fieldnames                      = HEAD.
    ENDFORM.                    " DOWNLOAD_TO_FILE
    *&      Form  header
          text
    -->  p1        text
    <--  p2        text
    FORM header .
      infieldnames-text = 'GeneralLedger Account'.
      APPEND infieldnames.
      CLEAR infieldnames.
      infieldnames-text = 'Amount'.
      APPEND infieldnames.
      CLEAR infieldnames.
    ENDFORM.                    "header
    *&      Form  get_ext
          text
    FORM get_ext.
      v_pfile = p_file.
      v_len   = STRLEN( v_pfile ).
      v_len   = v_len - 4.
      v_ext   = v_pfile+v_len(4).
    ENDFORM.                    "get_ext
    Message was edited by:
            srikanth vadlamani

  • Responses missing column headings

    Hi,
    My responses, when viewed using the "view responses" tab, or when downloaded as a .csv have lost most of their field headings.
    The form has 8 field headings.  The view responses / .csv has only two.
    See below.
    I understand there are no responses - this is not the issue. 
    Even when I had some responses to download, the field heading were missing.  I deleted the responses to see if this would refresh things.
    Thanks
    Simon

    Might you have accidentally deleted those headings?  There is a "History" at the bottom right of the View Responses tab where you might see if you had previously deleted those column headers, you can expand the history by clicking on the clock icon.
    You can re-enter or copy and paste the names back into those headings.  In order to match them up correctly you could fill out the form entering the field label into each field and submit that, then you could copy that data into the column headers and you'd be sure to put the right labels in each column header.
    Thanks,
    Josh

  • Clasical Report column headings display

    Hi ABAPERS
        iam working on clasical report. in that i have to display 16 field headings.
    when executing the report, the column headers should be frozen at the top so that when the user is scrolling down, they can see what the column title is.
    how can i over come this problem.

    Hi,
    you mean the column headings should be displayed even though
    the user scrolls down the output.
    For classical reports, according to me it is not possible.
    We will be using the write statement to display the records,
    so it is static for the report.
    If you want the output what you are expecting then go for ALV's.
    Regards,
    Venkatesh

  • Field Headinds for some Z fields does not appear in SE16n

    For some custom defined fields, headings does not appear if we use transaction SE16n. But that appears if SE16.
    Please reply if you got similar issue.
    Thanks
    Manish

    Hello Manish,
                            This is because all the the custom fields those are not created with reference to a data element won't display the filed names in Se16n.
    So if you want you can make your custom field of the append structue to refer a data element.
    Thanks,
    Greetson

  • Facing problem in populating a output field only

    Hi,
    I have created two fields on the screen with names code and description. My requirement is to get F4 help on code field and on selecting value from the popup, the description field as well should filled. I am using FM 'MD_POPUP_SHOW_INTERNAL_TABLE' to get a popup. The popup I am getting is alright as it is showing values for both columns i.e. code and its description. But anyhow when I select a value from the popup list, code field gets filled but the other field remains empty.
    I even debugged the program, and there I found that control is assinging values to both fields, but its not showing on screen for description field.
    Need help.
    Thanks,
    Ram

    Hi,
    Check this function module MD_SHOW_PLANNING_REQUESTS.It is using that function module.
    Check this code.May be it can help you.
                           Tables Declaration
    tables : vbap.         " Sales Document: Item Data
                         Constant Declaration                                      *
    CONSTANTS:
      C_X TYPE C VALUE 'X'.     " Translate to Uppercase
                         Variable Declaration                                      *
    Variable for Table index
      data v_sytabix like sy-tabix.
    Variable for Program name
      data L_NAME LIKE SYST-REPID.
                            Ranges Declaration                                     *
    Range for getting values form selection screen
    DATA: BEGIN OF range1 OCCURS 0,
             SIGN(1),
             OPTION(2),
             LOW  LIKE vbap-vbeln,
             high like vbap-vbeln,
          END OF range1.
                            Structure Declaration                                  *
                       Internal table Declaration                                  *
    Internal table for Report output
      data: begin of i_vbap occurs 0,
              vbeln like vbap-vbeln,            " Sales Document
              posnr like vbap-posnr,            " Sales Document item
            end of i_vbap.
    Internal table for output to the F4 help
      data: begin of I_DISPLAY occurs 0,
              vbeln like vbap-vbeln,            " Sales Document
              posnr like vbap-posnr,            " Sales Document item
            end of I_DISPLAY.
    Internal table for return value form function module
      DATA: BEGIN OF I_RETURNVAL OCCURS 0.
              INCLUDE STRUCTURE DDSHRETVAL.     " Interface Structure Search
      DATA: END OF I_RETURNVAL.
    Internal table for F4 help field heading
      DATA: I_FIELDTAB LIKE DFIES OCCURS 0 WITH HEADER LINE.
    Internal table for getting screen values from selection screen
      data L_SCR_FIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
                         Field-Symbols                                   *
                         Selection-screen                                *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME title text-001.
      select-options:
            S_VBELN for vbap-vbeln no intervals,
            S_POSNR for vbap-posnr no intervals.
    SELECTION-SCREEN end OF BLOCK B1.
                         AT SELECTION-SCREEN ON VALUE-REQUEST            *
    at selection-screen on value-request for s_posnr-low.
      clear: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
      refresh: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
      L_NAME = SYST-REPID.
      MOVE 'S_VBELN-LOW' TO L_SCR_FIELDS-FIELDNAME.
      APPEND L_SCR_FIELDS.
    Call the Function module DYNP_VALUES_READ to get the values form
    selection screen
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME                         = L_NAME
          DYNUMB                         = SYST-DYNNR
          TRANSLATE_TO_UPPER             = C_X         " X
        TABLES
          DYNPFIELDS                     = L_SCR_FIELDS
       EXCEPTIONS
         INVALID_ABAPWORKAREA           = 1
         INVALID_DYNPROFIELD            = 2
         INVALID_DYNPRONAME             = 3
         INVALID_DYNPRONUMMER           = 4
         INVALID_REQUEST                = 5
         NO_FIELDDESCRIPTION            = 6
         INVALID_PARAMETER              = 7
         UNDEFIND_ERROR                 = 8
         DOUBLE_CONVERSION              = 9
         STEPL_NOT_FOUND                = 10
         OTHERS                         = 11
      IF SY-SUBRC eq 0.
        LOOP AT L_SCR_FIELDS.
          range1-sign = 'I'.
          range1-option = 'EQ'.
          range1-low = L_SCR_FIELDS-FIELDVALUE.
          range1-high = space.
          append range1.
        ENDLOOP.
      ENDIF.
    F4 help Field headings
      I_FIELDTAB-TABNAME = 'I_DISPLAY'.
      I_FIELDTAB-FIELDNAME = 'VBELN'.
      I_FIELDTAB-POSITION = '1'.
      I_FIELDTAB-OUTPUTLEN = '10'.
      I_FIELDTAB-INTTYPE = 'C'.
      I_FIELDTAB-INTLEN = '10'.
      APPEND I_FIELDTAB.
      I_FIELDTAB-FIELDNAME = 'POSNR'.
      I_FIELDTAB-POSITION = '2'.
      I_FIELDTAB-OFFSET = '10'.
      I_FIELDTAB-OUTPUTLEN = '6'.
      I_FIELDTAB-INTTYPE = 'N'.
      I_FIELDTAB-INTLEN = '6'.
      APPEND I_FIELDTAB.
    Retrieve sales document, Sales document item from table Sales
    Document: Item Data(VBAP).
    Primary keys used for selection: VBELN
      select vbeln posnr from vbap
                   into table i_display
                   where vbeln in range1.
    Call the function module F4IF_INT_TABLE_VALUE_REQUEST for F4 values
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD               = 'POSNR'
          WINDOW_TITLE           = 'Line Item'
          VALUE_ORG              = 'S'
          MULTIPLE_CHOICE        = C_X           " (for muliple selection)
        TABLES
          VALUE_TAB              = I_DISPLAY
          FIELD_TAB              = I_FIELDTAB
          RETURN_TAB             = I_RETURNVAL
        EXCEPTIONS
          PARAMETER_ERROR        = 1
          NO_VALUES_FOUND        = 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.
    Star for For single values
      READ TABLE I_RETURNVAL INDEX 1.
       S_POSNR-LOW = I_RETURNVAL-FIELDVAL.
    End for the single values
    Start For multiple selection
       loop at i_returnval.
         s_posnr-sign = 'I'.
         s_posnr-option = 'EQ'.
         s_posnr-low = I_RETURNVAL-FIELDVAL.
         append s_posnr.
       endloop.
       sort s_posnr.
       read table s_posnr index 1.
    End for multiple selection
      ENDIF.
                         Start-of-selection                                        *
    start-of-selection.
    Retrieve sales document, Sales document item from table Sales
    Document: Item Data(VBAP).
    Primary keys used for selection: VBELN
      select vbeln posnr from vbap
                        into table i_vbap
                        where vbeln in s_vbeln
                          and posnr in s_posnr.
    if the above selection is successful continue the process else exit *
    form the report
      if sy-subrc ne 0.
       message e002 with 'No data to display'.
      endif.
                           End-of-selection                                        *
    end-of-selection.
      if not i_vbap[] is initial.
        loop at i_vbap.
          write:/ i_vbap-vbeln, i_vbap-posnr.
        endloop.
      endif.

  • Field Texts for Dynamic Internal Tables

    Hi All,
    I want to know whether there is any way to get the field Headings (Not the field names)
    Below is my CODE
    For ex :
    CLASS lvl_met DEFINITION.
       PUBLIC SECTION.
         METHODS : l_met IMPORTING m_itab TYPE STANDARD TABLE.
    ENDCLASS.
    CLASS lvl_met IMPLEMENTATION.
    METHOD l_met.
    data : l_t_fields TYPE abap_compdescr_tab." WITH HEADER LINE.
    field-symbols:
        <p_data>      type any,
        <p_field>     type any,
        <p_component> type abap_compdescr.
    CREATE DATA MY_WA LIKE LINE OF m_itab.
    ASSIGN MY_WA->* TO <P_DATA>.
    DESC_STRUC ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <P_DATA> ).
    *I want the field Headings(Field Text) - In this case i want some thing like Material Number and Plant
    I can read this texts if i know atleast the data element
    At this point i see <p_data> in degbug mode under absolute type column i see \TYPE=WERKS_D aganst werks field
    I don't know how to capture the \TYPE=WERKS_D this thing so atleast i can read field Text based on Data Element
    Is there any other way to find out the field text
    ENDCLASS.
    TABLES : marc.
    DATA : l_met TYPE REF TO lcl_met.
    types : BEGIN OF t_itab,
      matnr like marc-matnr,
      werks like marc-werks,
      end of t_itab.
    data  : itab type table of t_itab.
    START-OF-SELECTION.
      IF l_met IS INITIAL.
        CREATE OBJECT l_met.
      ENDIF.
    select matnr werks from marc into TABLE itab up to 10 rows.
    l_met->get_headertext( EXPORTING m_itab = itab ).
    Thanks
    David

    Hi  Naimesh,
    I tried exactly what you said
    lt_comp = desc_struc->get_components( ). "Get the fields of the structure
    loop at lt_comp into ls_comp.
    lo_elem_desc ?= cl_abap_elemdescr=>describe_by_name( ls_comp-name ).
    lf_dfies = lo_elem_desc->get_ddic_field( ).
    WRITE: / lf_dfies-scrtext_s,
           / lf_dfies-scrtext_m,
           / lf_dfies-scrtext_l.
    WRITE:/ ls_comp-name. " Write the column names
    endloop.
    It Works fine for Matnr because field name and data element are same but when it comes to werks it gives me a dump because the date element is different werks_d
    I just tried hard coding werks_d and it works fine
    lo_elem_desc ?= cl_abap_elemdescr=>describe_by_name( 'WERKS_D' ).
    lf_dfies = lo_elem_desc->get_ddic_field( ).
    WRITE: / lf_dfies-scrtext_s,
           / lf_dfies-scrtext_m,
           / lf_dfies-scrtext_l.
    Let me know how
    Thanks
    David
    Edited by: DAVID KITSO on Nov 23, 2009 10:09 PM

  • Synched contacts lose custom headings

    Hi,
    Longtime Mac-user, first time iPod owner.
    A little disappointed to find that my custom field headings aren't synched from my Address Book to my iPod Nano. For example, under my Greyhound Buses contact, I have "work, work, work, work, work..." instead of "Customer Services, Lost Property, Timetables etc..." (truncated where appropriate). Is this something everyone experiences? How about other iPod models?
    Disappointed at the lack of attention to detail,
    SiR G.

    I've found similar problems with my iPod 5th generation. The custom headings I've created for phone numbers etc in Address Book are not reflected on my iPod. Also second addresses are completely missing.
    I've been totally unsuccessful in finding any other info on this issue.
    Has anyone found similar problems or can anyone suggest a fix for this.
    If this issue migrates on to iPhone then I'm having second thoughts

Maybe you are looking for

  • File based event not triggering

    We are facing issue in file based event  scheduling. Files are getting created on the server path.But the event server is not  trigerring the event upon file creation. File Path is also correct. I checked the event server metrics ,In List of Monitore

  • Iphoto freezes when I try to open it.

    Iphoto freezes when I try to open it.

  • Bug in oracle embedded http listener

    Hi there, I've discovered a bug in the Oracle embedded http listener for our Oracle on RHEL database version 11.1.0.6 where it will return HTTP-400 bad request errors if a cookie is created with a bare comma in the cookie value. To see for yourself,

  • Safari not rendering Verdana

    I cleaned up my fonts today when Font Book flagged several fonts were duplicates or had other problems. I removed the fonts as suggested by FB and there were no immediate problems anywhere, not even Safari. This morning, without having logged out or

  • Lion does not allow disk sleep?

    Background: MacBook Pro 17" Early 2011 MC725LL/A Mac OS X Lion 10.7.1 Lion OS is installed to SSD located in OptiBay. Synopsis: Lion OS prevents my HDD drive located in primary HDD slot from sleeping: HDD spins up every few minutes. I do not manually