Issue with data populated in excel attachment

Hi Folks,
Im an emailing the report output as excel attachement. In the excel file, im getting only the header line and NOT the details, pls help me where im going wrong.
regds,
BG

hi pls find the code im using as below.
TYPES : BEGIN OF ty_output,
              no(18) TYPE c,
       soh(13) TYPE c,
       qty(13) TYPE c,
       matnr TYPE mara-matnr,
       maktx TYPE makt-maktx,
       labst TYPE mard-labst,
       avl_qty TYPE bapicm61v-wkbst,
       END OF ty_output.
DATA:
docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
tab_lines TYPE sy-tabix.
DATA: lv_labst(13) TYPE c,
         lv_avl_qty(13) TYPE c,
         t_output TYPE STANDARD TABLE OF ty_output,
          wa_output LIKE LINE OF t_output.
CONSTANTS: con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
             con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
Body
docdata-obj_name = 'Mail_Excel_File'.
docdata-obj_descr = 'Excel file attachment'.
objtxt = 'Attached is the sample Excel file'.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
Attachment
*i_data-a = 'Sample'.
*i_data-b = 'File'.
*CONCATENATE i_data-a i_data-b INTO objbin.
*APPEND objbin.
CONCATENATE 'NO 'SOH'
              'QTY' 'MATNR ' 'MAKTX'
              'LABST' 'AVL_QTY'  INTO objbin SEPARATED BY con_tab.
  CONCATENATE con_cret objbin INTO objbin.
  APPEND objbinst.
  CLEAR objbin.ut
wa_output-no = '123456'.
wa_output-soh = '39000'.
wa_output-qty = '39000'.
wa_output-matnr = '123-456'.
wa_output-maktx = 'test'.
lv_labst = '39,000'.
lv_avl_qty = '39,000'.
    CONCATENATE wa_output-no wa_output-soh
                wa_output-qty wa_output-matnr
                wa_output-maktx lv_labst
                lv_avl_qty
                INTO objbin SEPARATED BY con_tab.
    CONCATENATE con_cret objbin INTO objbin.
    APPEND objbin.
    CLEAR objbin.
DESCRIBE TABLE objbin LINES tab_lines.
objpack-doc_size = tab_lines * 255.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'XLS'.
docdata-obj_name = 'Excel_File_Attachment'.
objpack-obj_descr = 'Excel File Attachment'.
APPEND objpack.
Create the list of recipients
reclist-receiver = mail address.
reclist-rec_type = 'U'.
reclist-express = 'X'.
APPEND reclist.
Send the e-mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    document_data              = docdata
    put_in_outbox              = 'X'
    commit_work                = 'X'
  TABLES
    packing_list               = objpack
    contents_bin               = objbin
    contents_txt               = objtxt
    receivers                  = reclist
  EXCEPTIONS
    too_many_receivers         = 1
    document_not_sent          = 2
    document_type_not_exist    = 3
    operation_no_authorization = 4
    parameter_error            = 5
    x_error                    = 6
    enqueue_error              = 7
    OTHERS                     = 8.
COMMIT WORK.

Similar Messages

  • Issue with data download to excel

    Hi all,
    iam downloading data from table to excel sheet.
    when i see in the excel sheet i don't see the leading zero's
    say if i have value in table as 0001234 but in excel when i download i see as 1234
    instead i want it exactly it is in my table
    this is the code
    data : begin of it_heading occurs 0,
            line(30) type c,
           end of it_heading.
    it_heading-line = 'ABC'.
    append it_headING.
    it_headING-line = 'XYZ'.
    append it_headING.
    call function 'WS_DOWNLOAD'
    exporting
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
       filename  = p_file
       filetype                      = 'DAT'
        mode                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = it_data
        fieldnames                    = it_heading
    exceptions
       file_open_error               = 1
       file_write_error              = 2
       invalid_filesize              = 3
       invalid_type                  = 4
       no_batch                      = 5
       unknown_error                 = 6
       invalid_table_width           = 7
       gui_refuse_filetransfer       = 8
       customer_error                = 9
       others                        = 10
    if sy-subrc eq 0.
    endif.
    Thanks
    Kajol

    The date field has nothing to do with the progarm, only with excel sheet. you can try increasing the length in the progam for the date field before pushing to excel and check it.
    gui_download has got some extra features when compared to ws_download.
    You can check this for some info
    http://help.sap.com/saphelp_erp2005/helpdata/en/79/c554a3b3dc11d5993800508b6b8b11/frameset.htm
    http://www.sapdevelopment.co.uk/file/file_otherpc.htm
    WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
    The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
    Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.
    award points if it helps.

  • Issue with Data download to excel from ALV

    Hi,
    I am trying to download data to excel from ALV.
    The number of records are 26000.
    When I am trying to download I am getting an error displaying a pop up saying that
    problems came up in the following areas during the load
    TABLE
    The log displayed is not clear.
    I need to know the limitations while downloading to excel... I tried in SDN but of no use. I am using office 2007.
    What is the max downloading limit(MB)
    What must be the Length of line that can be downloaded.
    Regards

    Hi ,
    First check whether your ALV grid OUTPUT   is Consistent or Not   .
    if there are any inconsistency  then you need to rectify that  .
    for Checking COnsistency / Inconsistency  .do following steps
    1) execute ALV report 
    2) Press Shift+Mouse Right Button (Twice)  in blank area of report 
    3) you will get result   whether ALV is good or not .
    regards
    Deepak.

  • Issue with Data Provider name in variable screen for BEx Analyzer

    Hello all,
    We got an issue with Data Provider name in Variable screen in BEx Analayzer.
    We want to change the DataProvider name there to Description of the report instead of its Technical name.
    Any inputs are appreciated.
    Thanks
    Kumar

    You have to create a workbook to do this.
    Refresh your query/report. In Bex analyser, there is one toolbar named BEx design toolbox, If you are not able to see it in analyser, right click on the toolbar space of BEx analyser and click on BEx design toolbox. Here, goto to design mode, by clicking on a sysbol like 'A'. after that place the curser where you want to see the Query description. and click on insert text (T) in BEx toolbox. click on it and check "Query description" in constant tab. in the general tab you need to assign a dataprovider, for that assign your query name in workbook settings (in Bex design toolbox). also check the "display caption" in general tab.
    Pravender

  • Issue with data dictionary -Table maintanance generator

    Hi all,
    I have an issue with Data dictionary, table maintenance generator. I have entered some records in a custom table (ZBCSECROLETOGRP) and changed the delivery class from C to A. When I create the table maintainance generator, I am encountered with the following errors:
    1)Field ZBCSECROLETOGRP-PORTALGROUP shortened (new visible length: 000032)
    2)0012 could not be generated
    3)In TCTRL_ZBCSECROLETOGRP field LENGTH has the invalid value 01
    My main motto is to create the table maintainace generator and transport to the furthur systems .
    Please help.
    ThnX in advance,
    Vishal..

    HI,
    Regenerate the table maintenance by selecting the checkbox of "Modified field structure" => new entry & then save.
    Also ensure that the new changes are not affecting old data bcz of data type changes. If that is the case, then delete the old records, regenerate table maint. & re-enter those records which you had deleted.
    Thanks,
    Best regards,
    Prashant

  • Has anyone had issues with Microsoft Word or Excel requiring initial set-up again after a software update?

    Has anyone had issues with Microsoft Word or Excel requiring a set-up after software udates?  I do not have product key, so unable to set up again.

    This laptop has original Microsoft word & excel provided by Mac when purchased and is legal copy.
    Do I understand you bought a Mac and it came with Microsoft Office?    I could be wrong, but I wasn't aware that was an option.  Or am I not parsing that sentence correctly and you bought a Mac and bought a legal copy of Office to install on it?  In which case, never mind.

  • Issue with Date Format

    Hi All,
    I m facing an issue with Date format in the prompt. I have used date presentation variables in my column formula as shown below:
    FILTER("SKU Order Details"."Fulfilled Quantity" USING Time."Calendar Date" <= DATE '@{todate}{2900-01-01}')
    The report returns data when I don't select any date range for start & end date prompts on the page. But when I select the start & end date values in the prompt, I m getting the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46047] Datetime value 10/22/2009 12:00:00 AM from 10/22/2009 12:00:00 AM does not match the specified format. (HY000)
    I included the following formulas for start & end date prompts:
    Start Date prompt: case when 1=2 then License."Ips Creation Date" else cast ('1.1.1900' as date) end
    End Date prompt: case when 1=2 then License."Ips Creation Date" else cast ('1.1.2900' as date) end
    Can you please help me resolve the issue.
    Thanks,
    Kartik

    Hi Nico,
    I tried putting the format that you mentioned, I m getting an error message.
    My prompts have the following formula :
    Start: case when 1=2 then License."Creation Date" else cast('1.1.1900' as DATE) end
    End: case when 1=2 then Time."Calendar Date" else cast('1.1.2900' as DATE) end
    My column formula has the following syntax:
    FILTER("SKU Order Details"."Fulfilled Quantity" USING Time."Calendar Date" between DATE '@{start}{1900-01-01}' AND DATE '@{end}{2999-01-01}')
    Error Message:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46047] Datetime value 11/17/2009 from 11/17/2009 does not match the specified format. (HY000)
    Can you please let me know if something needs to be changed.
    Thanks,
    Kartik

  • Problem with Emailing the Internal table data as an excel attachment

    Hi Friends,
    I am facing problem with Emailing an internal table data as an excel file. I am using standard function module "SO_NEW_DOCUMENT_ATT_SEND_API1" which is using SOLI structure can have record with 255 character length. But my Internal table having each record means after concatenating all the fields it is going to be morethan 450 characters. so i t is not displaying all the data in excel file.
    Can somebody help me if there is any other function module or any other way that i need to follow.
    thanks for help
    venkat.

    You must use the the :
    CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB as a field seperator and
    CL_ABAP_CHAR_UTILITIES=>CR_LF as a record seperator.
    Check this example:
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Regards,
    Naimesh Patel

  • Issue with Date and Time Picker on Windows 8.1 and Office 2013

    We are having a issue with the Developer tool in Excel called the Date and Time Picker which puts a calendar field into the spreadsheet where you can select a date from the calendar popup
    If we change this date field and then save and close and reopen it reverts back to the previous date before the change was made
    If we do the same process on a Windows 7 machine with Office 2013 it saves the changes we made to the Date and Time picker field

    Hi jdono2,
    I'm using Windows 8 and Office 2013,and I can't reproduce this issue.
    Please make sure you have already upgraded to the latest version of excel, try to reregister the MSCOMCT2.OCX.
    Also you can try to use another date picker add-in to test this issue.
    http://social.msdn.microsoft.com/Forums/office/en-US/36f83f24-cd76-4f8e-aa7b-5f166666e7d3/excel-2013-popup-calendar?forum=exceldev
    Wind Zhang
    TechNet Community Support

  • Analyzer 7.0 issue with dates

    Hi experts,
    We have an upgraded BI to version 7.0 with a latin language and date format DD/MM/YYYY instead of MM/DD/YYYY.
    Most users still use the 3.X versions of Analyzer, Query designer... This version works fine.
    But Analyzer 7.0 has a date issue.
    For example, using list_cube we can see that the value for the date key figure is 01.02.2011 and using Analyzer 3.X the value is 01/02/2011.
    But if we use Analyzer 7.0, it changes the day and month and we see 02/01/2011 instead of the correct date 01/02/2011, like the analyzer 7.0 sends the date value to excel with english format (MM/DD/YYYY) instead of the latin format (DD/MM/YYYY).
    We are using Microsoft Excel 2007.
    Sap Bex: BI AddOn 7.X (based on 7.20)
    Support Package 0
    Revision 634
    Any ideas ?
    Thanks in advance.

    Change the format in regional settings...
    Control Panel -> Regional settings -> Additional settings -> Goto Date tab and change the short date format to DD/MM/YYYY.
    And then restart your analyzer and see if this works.
    --- Thanks..

  • Issues with Data Grid Combo Boxes

    Hi,
    I am trying to implement, 3 combo boxes for each row in extended data grid but unable to find the solution. Can someone please help?
    Problem in detail:
    The issue is after populating the data grid i want to give users 3 options  using 3 combo boxes(i.e each row in data grid will now have 3 options , which is basically converting 1 row into 3 rows with 3 options),so that they are able to do their computations.
    This is reallly urgent, any help would be highly appreciated.
    Thanks & Regards
    Pankaj

    "In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion."
    In the "Results" tab, Click Ctrl & Tab keys (at the same time) or with mouse click on any cell other than the first column (a sequence or rownum), you will be able to navigate using the arrow keys.
    "Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check."
    The 0.0134 seconds could be the result of the most recently executed successful statement. Check the Script Output tab for errors. Use F5 (Run Script option) instead of F9.
    "I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql."
    On the SQL statement (or code), Right Click -> Format SQL (or press Ctrl & B), proper formatting would help.
    I use version 1.0.0.15.57 and seems to be working allright.
    - Babu Rangasamy

  • Issues with data usage Samsung S5

    Over the past few months I have been paying outrageous bills due to one of my lines eating all my data when there is no one even touching the phone. I have 3 phones and a tablet on my plan and I am paying 288.00 a month and last month they charged me 15.00 for overage usages because it went over on the last day of the billing cycle. Once again that one line ate up all the data even though it's connected to our wifi or just sitting dormant. I am getting sick of paying these outrageous prices and am about to go somewhere else. I was tricked into the 10.00 a month tablet fee when I signed two phones up under the verizon edge plan. the sales clerk did not tell me I could not cancel the 10.00 a month fee because it would be under a year contract nor did I sign anything saying that, but when I went back in to change the 3rd line over to the Edge plan they told me it would be a $300 or so disconnect charge. So of course I am still paying 10.00 a month for no reason because I have wifi in my home and I only use the tablet in my home. so i need help with trying to figure out the data issues with just one of my lines. I do not have bluetooth on or location. I have went to the play store and uninstalled everything I could. I constantly close out of my applications and clear history etc.,,

    So you thought they would just give you a free tablet at $10 a month and it didn't need to be in a contract like phones?  I took the free tablet too but common sense told me it was locked into a contract, I didn't even ask as I just knew that would be the case but I didn't care.  Mary

  • Performance issues with data warehouse loads

    We have performance issues with our data warehouse load ETL process. I have run
    analyze and dbms_stats and checked database environment. What other things can I do to optimize performance? I cannot use statspack since we are running Oracle 8i. Thanks
    Scott

    Hi,
    you should analyze the db after you have loaded the tables.
    Do you use sequences to generate PKs? Do you have a lot of indexex and/or triggers on the tables?
    If yes:
    make sure your sequence caches (alter sequence s cache 10000)
    Drop all unneeded indexes while loading and disable trigger if possible.
    How big is your Redo Log Buffer? When loading a large amount of data it may be an option to enlarge this buffer.
    Do you have more then one DBWR Process? Writing parallel can speed up things when a checkpoint is needed.
    Is it possible using a direct load? Or do you already direct load?
    Dim

  • Issue with Date showing Null in interactive report

    I created an interactive report for a customer and was confused to see blanks or more specifically dashes where there should be dates in one of the fields. I knew this field should have data so I did some testing and this is what I have found:
    The sql I am running is:
    select
    assigned_to_company,
    last_resolved_date,
    incident_id
    from
    rhpd0009_im_adherence_rpt2_vw
    When I run the command in SQL workshop I get the following results with data in the last_resolved_date field:
    [http://i83.photobucket.com/albums/j299/yogibayer/apexdateissuesqlcommand.jpg]
    I copied and pasted the SQL from SQL workshop and created a new interactive report and got the following results with no last_resolved_dates showing up:
    [http://i83.photobucket.com/albums/j299/yogibayer/apexdateissueinteractivereport.jpg]
    For some reason the order is different, but the first one INC1117629 shows up in both of them and has a last_resolved_date in SQL workshop, but not in the interactive report. Any help would be appreciated.
    Thank You
    Scott

    Varad,
    It seems to be related to the function we use to convert Remedy dates to Viewable dates. Remedy dates are stored as an integer that represents the absolute number of seconds from Jan 1, 1970 at 12:00 AM. We use a function that converts this number into a human readable date. I have tried encapsulating the result of the function in a TO_DATE and a TO_CHAR with the same results as before. There is something about the resulting data from the date convert function that Apex doesn't like. It would be interesting to isolate what exactly the issue is, but right now I'm just trying to find a work around.
    Thank You
    SCott

  • Issue with Date format - ABAP to XML

    Dear Users,
    We are currently facing an issue with the date formats in XML.
    We have a system (.Net), which has a webservice that we are calling for information from SAP. We created a Proxy class in SAP from the WSDL file and have attempted to use the method that gets us required information based on the Timestamp passed from SAP. However, the timestamp that the INPUT structure uses has a data element XSDDATETIME_Z.
    All we can send from SAP is a simple TIMESTAMP, but the .Net system doesn't accept it since it wants the timestamp in XML format i.e. <dd-mm-yyyy>T<hh:mm:ss>Z. SAP documentation says that the field should automatically do conversion from ABAP to XML format, but that doesn't happen. We don't want to build a string from Timestamp in the XML format and send it out since we might surely miss out on the different cases involved.
    Can anyone please suggest a way for us to send the date out in the required XML format?
    Many thanks!

    Hi Vijay,
    Look at the below sample code and it works fine, i guess there is something wrong in your code or conversion, post the actual code if you are still not able figure it out with the below example.
    DATA: l_xml_string TYPE string,
          l_dat_time TYPE xsddatetime_z.
    CALL FUNCTION 'CACS_DATE_GET_TIMESTAMP'
    EXPORTING
       I_DATE                         = sy-datum
       I_TIME                         = sy-uzeit
    IMPORTING
       E_TIMESTAMP                    = l_dat_time
    EXCEPTIONS
       DATE_NOT_FILLED_BUT_TIME       = 1
       DATE_HAS_NO_VALID_FORMAT       = 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.
    CALL TRANSFORMATION id
      SOURCE root = l_dat_time
      RESULT XML l_xml_string.
    IF sy-subrc EQ 0.
    write: l_xml_string.
    ENDIF.
    Regards,
    Chen

Maybe you are looking for

  • Will the old 23" ACD work with the Mini DisplayPort to Dual-Link DVI Adapte

    Will the old 23" ACD work with the Mini DisplayPort to Dual-Link DVI Adapter and the new MacBook Pro? Apple Store says it is for the 30" only. Thanks ... Ken

  • Ipod touch 4 isnt showing on itunes. PLEASE HELP

    hey everyone my new ipod touch 4 isnt showing up on itunes i have the latest itunes installed and im not sure why it isnt working. it used to show up fine since i have had it for about 2weeks and then i tried to restore it and it has stopped showing

  • Firefox mobile does not work in Samsung Fascinate, only get a blank screen for any search.

    I downloaded Firefox Mobile to my Samsung Fascinate. I had no problem with the download or installation. When I tried to do a search, all I got was a blank screen in the Firefox window. The Samsung Fascinate is set up to run only Bing. It does not li

  • Getting warning in SMD Home page

    Hello All, I have installed Solution Manager 7.0 EHP1 ( SP18 ) I am getting the warning while opening the link http://10.39.4.107:50000/smd 1)Upgrade status for the current version is outdated. Please upgrade now. 2)Maintenance mode is enabled. Some

  • Leading Zeros Padding in PI

    I have a incoming field account number which is 10 integers into PI . I need to add leading zeros to it if the length is less than 10 integers. Can you please let me know which function to use? I tried format fucntion but obviously that does not work