Format and formula

Hi there, I'm currently trying to set up a report that will show me the correct margin by percentage, currently my DB has a column that gives me the margin, but it's the wrong margin.
Example 1.
if a item had been sold 10 times and I get 10 margin for each time that is being sold, my db and crystal report will take all 10 margin and add it all up and divided by 10 and give me the total margin of the item; however, the real margin should be calculated by my total of all 10 Gross profit  and all 10 of my sales amount. I talk the total sum of my gross profit and divided the total sum of my sales amount and that is the real margin.
Example 2.
Margin
44.18604651
55.05617978
55.05617978
51.61290323
55.05617978
55.05617978
44.18604651 Total Margin% is 51.46% and is the wrong margin
correct Margin that is being calculated is
Grost profit                                                 
171
382.2
411.6
230.4
264.6
720.3
47.5
total of 2227.6
Sales Amount
387
694.2
747.6
446.4
480.6
1308.3
107.5
total of 4171.6
"Gross Profit" 2227.6 / "Sales Amount" 4171.6 = 53.40%
I would like to know how do I go about format the correct formula in my reports, I had already go to my formula field and set up a formula of sum ({gross.profit}) / sum ({sales.amount}) and it didn't work. I had also set up a formula to get my Gross profit and my sales amount within Crystal report than take the 2 formula and / against each and no go. I had also create group and summarize group of my sum total of my gross profit and sales amount and set up formula to divide my to summarize group and no go.
I have over 3000 items within a excel sheet and each item fell after another item so I set up a group against my item code, so the item code wont' repeat it self.

in crystal to create percents
(sum ({gross.profit}) / sum ({sales.amount}) *100)
make sure you have the () and the *100

Similar Messages

  • Missing Tool, Format and Formula Bars

    I am new to Numbers and cannot figure out how to bring up the Tool Bar, the Format bar and the Formula bar also the Sheets pane on a spreadsheet. Is it because I cannot find the "View" button?

    Hi Norm,
    Well, if you don't have the Toolbar showing, then you won't find the View button.
    Fortunately, that's not the only place to find "Show Toolbar."
    You can also toggle the display of the Toolbar using the keyboard shortcut shown in the menu—option-command-T.
    Regards,
    Barry

  • I have a numbers spreadsheet for tracking company data.  I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year.  How do I do that?

    I have a numbers spreadsheet for tracking company data.  I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year.  How do I do that?

    click and hold on one cell, then drag to select the range, then release, then type the delete key.  Only inlude cells in the range you do not want to keey the contents of the cell.  You can remove one-off cells by holding the command key and clicking cells to add or remove as needed.
    You can download the Numbers users guide here:
    http://support.apple.com/manuals/#productivitysoftware

  • Numbers' Functions and Formulas in Multiple Cells, Tables, and Sheets

    Hello,
    I'm stuck with specifics that center around usage, and I get the funny feeling I'm overlooking a simple detail or two.
    If I may, here goes.
    I'm working with a single spreadsheet that has several sheets within it, and each sheet has an identical table. Each table is used to record various data, and I use an additional table in a separate sheet to consolidate some of the information, so that I can track results, at a glimpse, by looking at averages, totals, etc.
    Each data table is organized for consolidation by tracking wins, ties, or losses. It is important to know that each data table only records a single win, tie, or loss along with its other applicable data. And on the actual consolidation table I am trying to tally specific data fields by the use of Numbers' functions and formulas, yet I wish to keep these tallied results organized by the determining factor of whether or not they were gathered from a table that recorded a win, a table that recorded a tie, or a table with a loss.
    To illustrate, each table contains data fields that record start time, finish time, elapsed time, the day of the week, etc. Let's say I have eight tables, and the first two are winning tables, three more are tables that record a tie, and the last three are losing tables. For example, on my consolidated data table I wish to enter a function and formula capturing which of the eight tables are wins, ties, and losses so that I can, at a glance, see how much time elapsed to obtain the wins, ties, and losses. So then, in this example, for wins I want to determine which of those wins took 20 minutes, or which of them took 15 minutes, etc. So then, out of the two wins, let's say both of them took 20 minutes each. I need the numeral 2 to be counted and recorded on the consolidation table since only two tables match the criteria. And I would do the same for all remaining data fields (e.g., start time, finish time, etc.). Just so long as everything is determined by wins, ties, and losses, and then organized by the respective data fields. Simply put, this example determines a total of two wins that meet the data field requirement of 20 minutes. Out of the eight tables (one table per sheet) any other wins would then be organized according to the specific data in the elapsed time data field on it's data table (e.g., 5 minutes, 15 minutes, etc.).
    The exact syntax structure of the functions and formula I'm unsuccessfully using follows below. It only seems to return a result of 1, and I think it is returning this value from the IF Statements. By the way, the Win, Tie, or Loss cell in each data table is cell formatted as a pop-up so I can either select None or 1. But in this example I'm basing this on the time period of 20 minutes, and out of the eight data tables I have two wins which also record the time period as 20 minutes, so I should see 2 and not 1 in the 20 minutes column of the consolidated data table. Also, I tried changing the syntax where I would type "=1" in the IF Statements, but it returned a result of =1, and if I don't include the equals sign and quotation marks the result just shows up as 1.
    My Syntax:
    IF(Trade 1::'Data Recorded (1)' '* Win', 1, IF(Trade 2::'Data Recorded (1)' '* Win',1, IF(Trade 3::'Data Recorded (1)' '* Win',1, IF(Trade 4::'Data Recorded (1)' '* Win',1, IF(Trade 5::'Data Recorded (1)' '* Win',1, IF(Trade 6::'Data Recorded (1)' '* Win',1, IF(Trade 7::'Data Recorded (1)' '* Win',1, IF(Trade 8::'Data Recorded (1)' '* Win',1, IF(COUNTIFS(Trade 1::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 2::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 3::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 4::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 5::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 6::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 7::'Data Recorded (1)' '* Time in Trade (in minutes)', "=20m")+COUNTIFS(Trade 8::'Data Recorded (1)' '* Time in Trade (in minutes)'))))))))))
    Please bear in mind that the COUNTIFS portion of the above syntax structure is something I'm already successfully using to count the totals of other things not mentioned above, and I'm hesitant to delete it since it already works to my satisfaction when I want to, for example, determine the total number of overall wins. So, just for illustration purposes, I might have an overall wins column in my consolidation table that records how many wins there are, regardless of organization by elapsed time, or any other data field. In other words, the COUNTIFS syntax structure already works to my satisfaction. I'm not sure if it's possible to alter it so that it isn't so long, but what's there does work just when counting total numbers, as just mentioned.
    In summary, I'm wondering which function I can use with the COUNTIFS function to determine which of my eight data tables are winning tables, but break those wins down further based on criteria like elapsed time, and in the above example the time elapsed is 20 minutes. As you may see above, I'm unsuccessfully using the IF function. Finally, I've looked at the function browser descriptions of things like LOOKUP, HLOOKUP, VLOOKUP, INTERSECT.RANGES, and a few others. And so far I haven't made good use of any of them the way I've done when I use the COUNTIFS function by itself when only counting overall totals. But now I must determine totals that meet certain criteria, as explained above.
    Please help if you dare (smile). This is a huge project I'm undertaking, and so as not to cause confusion I have not included all of the details. But rather, I've taken a small sampling and set it to the side for experimentation. If this small sample works out to my satisfaction I can simply copy and paste the syntax in all other respective cells in the consolidation table, changing only reference locations, and perhaps conditions or values. One thing is certain, I don't intend on giving up on it.
    Thank you for your time and advice.
    Blessings!
    Message was edited by: solo68
    Added image.

    I'd like to edit the last paragraph of my second posting, but for some reason an entirely new posting is being created when I attempt to do this. So when reading this post, please use it to replace only the last paragraph of my second post containing the four inserted images.
    Last paragraph begins:
    In closing, I need each cell in each column of each row in my consolidation table to remain as is. I have my reasons for doing this, and they all serve a specific purpose. The only exception would be the formatting of the last three rows as footer rows. Most importantly, and I should have made this abundantly clear earlier, my apologies, I need a single function and formula in cell E7 of my consolidation table that will firstly determine which data tables are winning tables while secondly and simultaneously counting which of those winning tables have elapsed times of 20 minutes. Perhaps, now this better explains why my syntax is written the way it is written. In the example I provided, if the proper function and formula were written it would result as 2 in cell E7 in my consolidation table. If there is anything else specific you need of me in order to assist me, please request it. Thank you.
    Last paragraph ends:
    Additionally, to t quinn:
    First off, thank you for returning to assist me. I really do appreciate your efforts. Please be aware that I'm avoiding going into details about each and every portion of my spreadsheet because I wish to avoid discussion that is off topic. As I stated earlier, I'm new to using these features of Numbers. My spreadsheet encompasses a much larger amount of data than I'm referring to in the example in my first post. But in my example I'm isolating just the information concerning what I'm now trying to accomplish to finish my spreadsheet project. Moreover, most of what I've done up to this point I was able to figure out on my own, or get help from watching videos on YouTube, or simply using the application help menu. Please be aware that I consulted all of these, repeatedly. I even contacted AppleCare, and was told this sort of support is not available. In spite of this, I've accomplished a great deal in my first large spreadsheet project. Please be aware that when I wrote my second post and specifically responded to you, I didn't want to be rude or ungrateful, and I still don't, but maybe the suggestions you and Hiroto made about gathering the count of wins, ties, and losses are something I've already done. I think I've done that separately. These counts are already in separate cells, and they are working fine. In my first post where I inserted only one image you can see examples of this in my consolidation table image, in cells B3 and E6. I apologize for not making this abundantly clear earlier. Furthermore, the portion of my syntax that shows the COUNTIFS is the exact way I accomplished this, and it is written the way it is written because I need separate sheets, each with their own data tables. Again, in cell E7 I need to determine which of the eight data tables that record wins are also recording 20 minutes, but I need this in a single function and formula with the result appearing only in cell E7. Once this is figured out I will adjust the syntax to do the same thing with every column (these are not shown but they exist) in my consolidation table for the last three footer rows, named Win Column Totals, Tie Column Totals, and Loss Column Totals. The last three rows being footer rows may not be necessary, and if so, I can convert them back to normal rows. Nonetheless, my consolidation table is counting the totals of all data in all data tables. This much I've already accomplished. Now I have one last function and formula I'm working on in order to determine which of the eight data tables record wins, ties, or losses while it simultaneously counts which of the wins, ties, or losses fall within certain categories like elapsed time, and this will be shown on my consolidation table only in the last three rows. Yes, I've gotten the total wins counted, and separately counted the total number of times 20 minutes was the elapsed time used, but so far, just looking at my consolidation table I don't know if the total number of times 20 minutes was used was with a win, tie, or loss. That's what I need to know now. Everything else is already accomplished. So then my consolidation table will show the totals for all data fields in my eight data tables as illustrated in cells B3 and E6. The last three rows of my consolidation table will break this down in a single function and formula with one row for wins, a second for ties, and a third for losses. And each of these respective last three rows will in the same function and formula determine if the win, tie, or loss also is one of the data fields in my eight data tables. How? By the use of columns in my consolidation table. Remember, each of my eight data tables are identical. In the example in my first post I only used one data field, elapsed time (Time in Trade), to illustrate in one column on my consolidation table what I'm trying to accomplish with all of the columns not shown in my consolidation table. Once this is figured out I can adjust it to complete the remainder of the consolidation table. Thank you, t quinn.
    To all reading this and attempting to offer assistance, if for any reason I'm still not explaining myself clearly, please continue to ask me more specific questions. I realize it's hard to communicate this way, and if Apple allowed us to upload the actual spreadsheet it would make this entire forum a better place to communicate. But that's going off topic, so let's simply focus on the matter at hand. Thank you.
    Blessings!

  • Waveburner : Time Format and Track start marker insertion ?

    Hi,
    I am exporting the Markers from a Final Cut Pro project to get their position.
    I copy/paste this time code in a Track start marker in Waveburner to set it in the right position.
    The problem is that in Final Cut Pro the time is set in HH:MM:SS:Fps  (Frames per seconds (25 fps in my PAL project)
    And in CD tracks window (sorry I am translating from a French user interface) it's not the same time format : CDDA frame (1/75th of a second)...
    so the track position is approximative (less than 1 second)
    I have selected the right time unit in the Wave View : Min:Sec:Im (25fps)
    In preferences I checked "Set Time Format Globally checkbox"
    But it's still in CDDA when I insert  a track marker...
    How could I manage that ?
    Thanks for your help
    Eric

    Seems there is no edit button here.
    After having another go at this problem, I think I have found a better solution that solves both formatting and date entry problem. The only downside is that you'll need to make 5 columns for a single date rather than 1.
    Step 1.
    For each date entry, create the following columns:
    | FormattedDate | NumbersDate | Day | Month | Year |
    FormattedDate is the final date displayed according to our format.
    NumbersDate is the internal Numbers date representation.
    Day, Month, Year columns are the ones you use for data entry.
    Step 2.
    Create/convert our 3 columns date (Day, Month, Year) into Numbers internal date.
    So, in NumbersDate column, insert this formula:
    NumbersDate: =DATE(Year, Month, Day)
    Step 3.
    Apply our own formatting for the date output display. In this example, I want an output in the form of Dayname, Day Month Year (Saturday, 24 September 2011).
    FormattedDate: =DAYNAME(NumbersDate) & ", " & (Day) & " " & MONTHNAME(Month) & " " & (Year)
    This way, changing the raw date input is as simple as changing the respective column. If any discrepancy between entered and displayed data exist, it is easily spotted by comparing between the raw date columns and the formatted output.
    Another advantage is reducing the risk of data corruption to the date, since the date is now simply represented as integer values in their respective columns.

  • Currency format and Regional Settings

    Is it possible for WebI reports to honor Regional Settings (client system or BO system or BO setup) and correctly handle the currency format without making any changes to the report?
    Neeraj Bhatia

    There might be a smarter way, but you could use alerters and the GetLocale() function.
    Create a new variable called, Currency Type with the formula
    =If GetLocale() InList("en_AU";"en_US") THEN "Dollar" ELSE "Euro"
    Or whatever. Then use an alerter where the "Filtered object or cell" is the Currency Type variable, and the Operand is "Dollar" then click Format... then at the top click Default next to Number Format and set the appropriate currency format.
    Add a sub-alerter to do the same for Euro, and whatever other currencies you must allow for.
    Hope that helps.

  • Use the default format and partition step to format disk0 partition 1 in multiple disks sutiation

    As we know,we need to disable the default format and partition step in ts to let mdt deploy os on C and leave the other partitions stay safe when there is only one disk on pc,and the way of installing operation system is logical drive letter store in a varible.
    But what if there are 2 disks on pc,and for a record the disk 0 is always the OS disk,don't need to confirmed this.How can we modify the format and partition step to format only C on disk0 under this condition?then lead the mdt to do the rest deployment
    by itself.
    Thanks

    You are pushing up against the design limits of MDT, and the more complex and/or arbitrary the disk configuration the harder it is for MDT to perform installations.
    If you want to maintain the *existing* disk configuration, and just update the OS present, then the recommended course of action is to run MDT from *within* the OS (cscript.exe
    \\server\deploymentshare$\scripts\litetouch.vbs), not from WinPE. When you do this, it's called a "refresh" scenario. MDT can capture the user files via USMT, and it knows which
    partitions to use, because it's launched from within the OS itself.
    Disabling the default Format and Partition step has other unintended consequences.
    Keith Garner - Principal Consultant [owner] -
    http://DeploymentLive.com

  • Unable to open .eps file "unknown format and cannot be opened" ?

    A client sent me an .eps file (logo). I tried opening it in Illustrator AND photoshop (just to see if it was saved in one vs the other program) - however to no avail.
    Illustrator gives me a message "unknown format and cannot be opened"
    Photoshop gives me a message "photoshop was unable to parse the postscript".
    I'm using Adobe CS4, and I've never seen this message before—would love to know what this means and how to resolve?
    File attached if anyone is able to open / fix it?
    Thanks kindly,
    Chemol

    Thanks for the advice Scott - does compression improve the .eps?  Is it
    silly for me to ask them to compress it since the file is only 766 KB
    (that's how big the attachment is in my email - though I am unable to open
    it)?
    My friend is able to open it on his end - however the 3rd person (client) is
    the one who sent it, and I have already requested a different version - no
    response from them yet.  Unfortunately what the company "has" is what he
    will likely give to me again (ie: same file / unable to open).  So ... I am
    curious about how I can resolve this issue on my end - if possible?
    Do you know what the AI and Photoshop error messages mean? Could the issue
    be a mac vs PC concern? Or is it a corrupt file? Could it be a software
    version issue (old vs new) ... or Quark incompatibility?
    .... just guessing at this point....Any insight as to what different
    scenarios may apply in this situation would be greatly appreciated ..thank
    you.

  • I'm trying to find out how to export my apple contacts to the Salesforce software and they need to be in a csv format and I don't know if this is possible and how to do it if it is?

    I'm trying to find out how to export my apple contacts to the Salesforce software and they need to be in a csv format and I don't know if this is possible and how to do it if it is?

    I think there are third-party programs which will do that, but you can also do it with Automator:
    See the links in my post, here: https://discussions.apple.com/message/22390873#22390873
    The file or clipboard contents will be in Tab Separated vars, so you'll have to open with a spreadsheet program and save as Comma Separated Vars format.

  • ALV output converted into PDF format and send that PDF to user through mail

    Hi Experts,
    I have report earlier its output was in alv grid.
    Now i want that ALV output converted into PDF format.And that PDF output send to user through mail.
    Can u please tell how to do?
    My code is here(output is displaying in ALV grid).
    INCLUDE <icon>.
    TYPE-POOLS: slis, kkblo.
    TABLES : zmsd_freight_hdr, zmsd_freight_det, zmsd_blinfo, zmsd_diheader.
    TABLES : lfa1.
    DATA : t_hdr   LIKE   zmsd_freight_hdr   OCCURS 0 WITH HEADER LINE,
           T_DET   LIKE   ZMSD_FREIGHT_DET   OCCURS 0 WITH HEADER LINE,
           t_bl    LIKE   zmsd_blinfo        OCCURS 0 WITH HEADER LINE,
           t_di    LIKE   zmsd_diheader      OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_det OCCURS 0.
            INCLUDE STRUCTURE zmsd_freight_det.
    DATA    type(30).
    DATA: END OF t_det.
    DATA: v_target2(30),
          v_zsammg LIKE t_det-zsammg,
          v_gsttotal LIKE t_det-zamount.
    DATA : BEGIN OF t_data OCCURS 0,
             zsammg       LIKE  zmsd_freight_hdr-zsammg,
             zdidbl       LIKE  zmsd_freight_hdr-zdidbl,
             zvkorg       LIKE  zmsd_freight_hdr-zvkorg,
             zinvno       LIKE  zmsd_freight_hdr-zinvno,
             zttlamt      LIKE  zmsd_freight_hdr-zttlamt,
             zstatus      LIKE  zmsd_freight_hdr-zstatus,
             ztype        LIKE  zmsd_freight_hdr-ztype,
             zconfirm     LIKE  zmsd_freight_hdr-zconfirm,
             zconfirmdate LIKE  zmsd_freight_hdr-zconfirmdate,
             erdat        LIKE  zmsd_freight_hdr-erdat,
             ernam        LIKE  zmsd_freight_hdr-ernam,
             erzet        LIKE  zmsd_freight_hdr-erzet,
             aedat(10),
             aenam        LIKE  zmsd_freight_hdr-aenam,
             aezet        LIKE  zmsd_freight_hdr-aezet,
             zline        LIKE  zmsd_freight_det-zline,
             zfptype      LIKE  zmsd_freight_det-zfptype,
             zchrcode     LIKE  zmsd_freight_det-zchrcode,
             zcurcode     LIKE  zmsd_freight_det-zcurcode,
             zqty         LIKE  zmsd_freight_det-zqty,
             zuom         LIKE  zmsd_freight_det-zuom,
             zrate        LIKE  zmsd_freight_det-zrate,
             zamount      LIKE  zmsd_freight_det-zamount,
             zexrate      LIKE  zmsd_freight_det-zexrate,
           zccode       LIKE  zmsd_blinfo-zccode,      "MADK991565
             zccode       like  ZMSD_FREIGHT_HDR-zfcode, "MADK991565
             zbldate(10),
             zbl          LIKE  zmsd_blinfo-zbl,
             type(3),
             waerk        LIKE  zmsd_freight_det-zcurcode,
             zamountl     LIKE  zmsd_freight_det-zamount,
           END OF t_data.
    DATA : w_layout      TYPE   slis_layout_alv,
           w_catalog     TYPE   slis_fieldcat_alv,
           t_catalog     TYPE   slis_t_fieldcat_alv,
           w_sort        TYPE   slis_sortinfo_alv,
           t_sort        TYPE   slis_t_sortinfo_alv.
    DATA   V_ZINVNO    like   T_HDR-ZINVNO.                   "MADK991565
    DATA : v_count  TYPE  i.
    SELECTION-SCREEN BEGIN OF BLOCK a0 WITH FRAME TITLE text-001.
    PARAMETERS     :  p_zvkorg LIKE zmsd_freight_hdr-zvkorg  OBLIGATORY .
    SELECT-OPTIONS :  s_zdidbl FOR  zmsd_freight_hdr-zdidbl             ,
                      s_zccode FOR  lfa1-lifnr                          ,
                      s_status FOR  zmsd_freight_hdr-zstatus            ,
                      s_ztype  FOR  zmsd_freight_hdr-ztype              ,
                      s_erdat  FOR  zmsd_freight_hdr-erdat              ,
                      s_ernam  FOR  zmsd_freight_hdr-ernam              ,
                      s_zconfd FOR  zmsd_freight_hdr-zconfirmdate       .
    PARAMETERS     :  p_zconf  AS   CHECKBOX                            .
    SELECTION-SCREEN END OF BLOCK a0.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-002.
    PARAMETERS     :  p_hdr    RADIOBUTTON GROUP rad DEFAULT 'X'        ,
                      p_det    RADIOBUTTON GROUP rad                    .
    SELECTION-SCREEN END OF BLOCK a1.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM process.
      PERFORM display.
    END-OF-SELECTION.
      PERFORM fm_get_num_pages.
    AT USER-COMMAND.
    AT LINE-SELECTION.
    TOP-OF-PAGE.
      PERFORM fm_top_of_page USING '7010' sy-title space.
    FORM get_data.
      SELECT   *
        FROM   zmsd_freight_hdr
        INTO   TABLE t_hdr
       WHERE   zvkorg        EQ  p_zvkorg
         AND   zdidbl        IN  s_zdidbl
         AND   zstatus       IN  s_status
         AND   ztype         IN  s_ztype
         AND   erdat         IN  s_erdat
         AND   ernam         IN  s_ernam
         AND   zconfirmdate  IN  s_zconfd
         AND   ZFCODE        IN  S_ZCCODE.                      "MADK991565
      IF p_zconf = 'X'.
        DELETE t_hdr WHERE zconfirm NE 'C'.
      ENDIF.
      CHECK NOT t_hdr[] IS INITIAL.
      SELECT   *
        FROM   zmsd_blinfo
        INTO   TABLE t_bl
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_bl BY zsammg.
      SELECT   *
        FROM   zmsd_diheader
        INTO   TABLE t_di
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_di BY zsammg.
    IF P_DET = 'X'. "MADK933361
      SELECT   *
        FROM   zmsd_freight_det
        INTO   TABLE t_det
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg  =  t_hdr-zsammg
       AND ZINVNO =  T_HDR-ZINVNO .                           "MADK991565
    SORT t_det BY zsammg zline.                            "MADK991565
       SORT T_DET BY ZSAMMG ZINVNO ZLINE.                     "MADK991565
    ENDIF. "MADK933361
    ENDFORM.
    FORM process.
      REFRESH t_data.
      CLEAR v_gsttotal.                                         "MADK933361
      LOOP AT t_hdr.
    Start of MADK933361
        CLEAR: v_target2.
        v_zsammg = t_hdr-zsammg.
        V_ZINVNO = T_HDR-ZINVNO.                                "MADK991565
       AT NEW zsammg.                                         "MADK991565
         AT NEW ZINVNO.                                         "MADK991565
          PERFORM get_gst_value.
        ENDAT.
    End of MADK933361
        PERFORM move_header.
        CHECK t_data-zccode IN s_zccode.
        IF p_det = 'X'.
    CSF Project Changes Starts   DEV34    MADK985782
        LOOP AT T_DET WHERE ZSAMMG = T_HDR-ZSAMMG..
          LOOP AT t_det WHERE zsammg = t_hdr-zsammg AND
                              zinvno = t_hdr-zinvno.
    CSF Project Changes Ends     DEV34    MADK985782
            PERFORM move_header.
            CHECK t_data-zccode IN s_zccode.
            MOVE-CORRESPONDING t_det TO t_data.
            t_data-zamountl = t_data-zamount * t_data-zexrate.
            APPEND t_data.
            CLEAR t_data.
          ENDLOOP.
        ELSE.
          APPEND t_data.
          CLEAR t_data.
        ENDIF.
        AT END OF zsammg.
          CLEAR v_gsttotal.
        ENDAT.
    *Start of changes for  IS090901289-PIA MADK991565
        AT END OF ZINVNO.
          CLEAR V_GSTTOTAL.
        ENDAT.
    *End of changes for  IS090901289-PIA MADK991565
      ENDLOOP.
    ENDFORM.
    FORM move_header.
      MOVE-CORRESPONDING t_hdr TO t_data.
      t_data-zttlamt = t_data-zttlamt + v_gsttotal.             "MADK933361
      t_data-waerk = 'SGD'.
      IF NOT t_hdr-aedat IS INITIAL.
        WRITE: t_hdr-aedat TO t_data-aedat.
      ELSE.
        CLEAR : t_data-aedat.
      ENDIF.
      READ TABLE t_bl WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
      IF sy-subrc EQ 0.
      t_data-zccode  = t_bl-zccode.   "MADK991565
        T_DATA-ZCCODE = T_HDR-ZFCODE.   "MADK991565     
        IF NOT t_bl-zbldate IS INITIAL.
          WRITE: t_bl-zbldate TO t_data-zbldate.
        ENDIF.
        t_data-zbl     = t_bl-zbl.
        t_data-type    = 'DBL'.
      ELSE.
        READ TABLE t_di WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
        IF sy-subrc EQ 0.
        t_data-zccode  = t_di-zdiforcode.     "MADK991565
          T_DATA-ZCCODE = T_HDR-ZFCODE.         "MADK991565
          t_data-type    = 'DI'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM display.
      IF t_data[] IS INITIAL.
        MESSAGE s398(00) WITH 'No Data Selected'.
        EXIT.
      ENDIF.
      DATA : l_repid LIKE sy-repid.
      l_repid = sy-repid.
      REFRESH t_catalog.
      CLEAR   t_catalog.
      w_layout-cell_merge = 'X'.
      PERFORM map_fields.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = l_repid
                i_callback_user_command = 'ALV_USER_COMMAND'
                is_layout               = w_layout
                it_fieldcat             = t_catalog[]
                i_grid_title            = sy-title
                i_save                  = 'A'
                it_sort                 = t_sort[]
           TABLES
                t_outtab                = t_data
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.
    FORM map_fields.
    Sort Order
      CLEAR v_count.
      PERFORM sf USING 'ZDIDBL'   'X'  'X'.
    Fields to be displayed
      CLEAR v_count.
      IF p_hdr = 'X'.
        PERFORM af USING :
       DESCRIPTION       FIELD        LEN   RTABLE             RFIELD
        'DI/DBL         ' 'ZDIDBL'     '14' '                ' '        ',
        'Type           ' 'TYPE'       '04' '                ' '        ',
        'Forwarder Code ' 'ZCCODE'     '14' '                ' '        ',
        'BL Number      ' 'ZBL'        '14' '                ' '        ',
        'BL Date        ' 'ZBLDATE'    '10' '                ' '        ',
        'Invoice Number ' 'ZINVNO'     '15' '                ' '        ',
        'Extraction     ' 'ZSTATUS'    '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type   ' 'ZTYPE'      '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation   ' 'ZCONFIRM'   '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date   ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount   ' 'ZTTLAMT'    '18' '                ' '        ',
        'Created On     ' 'ERDAT'      '10' '                ' '        ',
        'Created By     ' 'ERNAM'      '10' '                ' '        ',
        'Changed On     ' 'AEDAT'      '10' '                ' '        ',
        'Changed By     ' 'AENAM'      '10' '                ' '        '.
      ELSE.
        PERFORM af USING :
       DESCRIPTION         FIELD     LEN   RTABLE             RFIELD
        'DI/DBL           ' 'ZDIDBL'   '14' '                ' '        ',
        'Type             ' 'TYPE'     '04' '                ' '        ',
        'Forwarder Code   ' 'ZCCODE'   '14' '                ' '        ',
        'BL Number        ' 'ZBL'      '14' '                ' '        ',
        'BL Date          ' 'ZBLDATE'  '10' '                ' '        ',
        'Invoice Number   ' 'ZINVNO'   '15' '                ' '        ',
        'Extraction       ' 'ZSTATUS'  '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type     ' 'ZTYPE'    '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation     ' 'ZCONFIRM' '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date     ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount     ' 'ZTTLAMT'  '18' '                ' '        ',
        'Freight Payment  ' 'ZFPTYPE'  '14' '                ' '        ',
        'Charge Code      ' 'ZCHRCODE' '10' '                ' '        ',
        'Currency         ' 'ZCURCODE' '08' '                ' '        ',
        'Quantity         ' 'ZQTY'     '13' '                ' '        ',
        'UoM              ' 'ZUOM'     '04' '                ' '        ',
        'Rate             ' 'ZRATE'    '15' '                ' '        ',
        'Amt(Foreign Curr)' 'ZAMOUNT'  '16' '                ' '        ',
        'Exchange Rate    ' 'ZEXRATE'  '13' '                ' '        ',
        'Amt(Local Curr)  ' 'ZAMOUNTL' '16' '                ' '        ',
        'Created On       ' 'ERDAT'    '10' '                ' '        ',
        'Created By       ' 'ERNAM'    '10' '                ' '        ',
        'Changed On       ' 'AEDAT'    '10' '                ' '        ',
        'Changed By       ' 'AENAM'    '10' '                ' '        '.
      ENDIF.
    ENDFORM.
    FORM af USING text
                  field
                  len
                  table
                  reffield.
      v_count = v_count + 1.
      w_catalog-col_pos       = v_count.
      w_catalog-fieldname     = field.
      w_catalog-ref_tabname   = table.
      w_catalog-ref_fieldname = reffield.
      w_catalog-seltext_s     = text.
      w_catalog-seltext_m     = text.
      w_catalog-seltext_l     = text.
      w_catalog-outputlen     = len.
      IF field = 'ZTTLAMT' OR field = 'ZAMOUNTL'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'WAERK'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
    IF FIELD = 'ZRATE' OR FIELD = 'ZAMOUNT'.
      IF field = 'ZAMOUNT'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'ZCURCODE'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
      IF field = 'ZQTY' OR field = 'ZRATE'.
        w_catalog-no_zero     = 'X'.
        w_catalog-datatype  =  'DEC'.
      ENDIF.
      APPEND w_catalog TO t_catalog.
      CLEAR  w_catalog.
    ENDFORM.
    FORM sf    USING   fieldname  sortup  group.
      v_count = v_count + 1.
      CLEAR w_sort.
      w_sort-fieldname = fieldname.
      w_sort-spos      = v_count.
      w_sort-up        = sortup.
      w_sort-group     = group.
      APPEND w_sort TO t_sort.
    ENDFORM.
    FORM alv_user_command USING  in_ucomm    LIKE sy-ucomm
                                 in_selfield TYPE slis_selfield.
      DATA: lfs_data LIKE t_data.
      IF in_ucomm = '&IC1'.
        READ TABLE t_data INDEX in_selfield-tabindex INTO lfs_data.
        CHECK NOT lfs_data-zdidbl IS INITIAL.
        IF lfs_data-type = 'DBL'.
          DATA: l_zdbl LIKE zmsd_diheader-zdinum.
          l_zdbl = in_selfield-value.
          EXPORT l_zdbl TO MEMORY ID 'VBL'.
          CALL TRANSACTION 'ZMSD_BL01'.
        ENDIF.
        IF lfs_data-type = 'DI'.
          DATA: v_dinum LIKE zmsd_diheader-zdinum.
          v_dinum = in_selfield-value.
          EXPORT v_dinum TO MEMORY ID 'VDI'.
          CALL TRANSACTION 'ZMSD_DI01'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM get_gst_value.
      LOOP AT t_det WHERE zsammg = v_zsammg
         AND ZINVNO = V_ZINVNO.                              "MADK991565
        CHECK t_data-zccode IN s_zccode.
        t_det-zamount  = t_det-zamount * t_det-zexrate.
        SELECT SINGLE  y0mmtarget2
                INTO   v_target2
                FROM   y0mmipstranslate
                WHERE  y0mmdatatype = '70' AND
                       y0mmsource = t_det-zchrcode.
        SELECT SINGLE y0mmtarget1
               INTO   t_det-type
               FROM   y0mmipstranslate
               WHERE  y0mmdatatype = '76' AND
                      y0mmsource = v_target2.
        IF t_det-type NE '3Z'.
          v_gsttotal    = v_gsttotal +
                               ( t_det-zamount * 5 / 100 ).
        ENDIF.
      ENDLOOP.
    Regards,
    Raj.

    Hello,
    Following is the procedure to convert alv output to spool and then it to PDF Format.
    After we display the ALV, we can check whether it is running in the background using system field u2018sy-batchu2018. Then,we call an function module named u2018GET_JOB_RUNTIME_INFOu2019 to get the current job information. Then go to spool request table tbtcp to get the spool id.
    Get current job details
      CALL FUNCTION u2018GET_JOB_RUNTIME_INFOu2019
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                               AND jobcount = gd_jobcount
                               AND stepcount = gd_stepcount
                               AND listident <> u20180000000000u2032
                               ORDER BY   jobname
                                                   jobcount
                                                   stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
    Finally, we can call function module u2018CONVERT_ABAPSPOOLJOB_2_PDFu2018 to convert spool reqeust(which is stored in OTF format) to PDF format. Then we can call either function module u2018SO_DOCUMENT_SEND_API1u2032 or SAP BCS (Business Communication Service) to send the pdf as an email attachment.
    CALL FUNCTION u2018CONVERT_ABAPSPOOLJOB_2_PDFu2019
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount = gd_bytecount
           TABLES
                pdf = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
    Regards,
    Sayali
    Edited by: Sayali Paradkar on Apr 20, 2010 12:51 PM

  • Convert the spool to xls format and email through attachment to the user

    Hi all,
    When I execute a report in background, I get spool. I need to convert the spool to xls format and email through attachment to the user.The xls file should not be saved on local system.
    If I use the Spool Recepient tab in SM37 it mails the spool list as .txt file to the mail receipient. But I need to send it as an .xls file.
    Can any one help me on this

    Did you get the solution? i have the same problem.

  • To convert Smart Form output to PDF format and send it via email.

    Hi Friends,
    Could any one please tell me, how to convert the Smart Forms output to PDF format and send it via email to customer. If any one have the code, kindly mail me to [email protected]
    Thanks & Regards,
    John

    Refer the links -
    how to convert smartform into pdf and send through mail
    Smartform as PDF attachment to a mail.
    smartform pdf and mail
    smartform to pdf to mail
    Regrads,
    Amit
    Reward all helpful replies.

  • Restored our SSRS 2008 R2 from one server to another; Dates are in UK format and not US

    We have restored our SSRS 2008 R2 from one server to another. The original server was in US locale/culture. The new server was in UK locale/culture, when the restore happened. However it should have been in US locale/culture. We have made this change and
    new reports work OK.
    However existing reports (i.e. saved by a user) are still trying to use the US dates in a UK format and as a result throwing a date cant be below 1753 error.
    Has anyone seen this issue before or have any idea what we need to do to fix it?
    Thanks
    Kimberlad

     Hi Kimberlad
    Have you checked any changes in the Collation? 
    Please verify Reporting Server Databases and Server Collation is there any mismatch with your Source Server.
    and also please post complete Error message..
    Nag Pal MCTS/MCITP (SQL Server 2005/2008) :: Please Mark Answer/vote if it is helpful ::

  • Is there any way to keep the old mail, phone, calendar format and yet switch to IOS7?

    Is there anyway to keep our old mail, calendar, and phone format and yet use IOS7?  I find the new system so plain that it is difficult to see.  I keep missing new emails because the little numbers are so small they barely show up and the plain white screens are so bright they are hard to look at.  I would just go back but I really like some of the new features.

    Man I am with you!
    The new user interface for iOS7 is just dreadful.  I turned down the brightness but the lack of shading or delineation between UI elements makes it difficult to read. 
    It feels like they're chasing Android.

  • How to export a video at a moderate certain format and size in premiere CC 2014: No Huge File Results!

    I have the latest version of Adobe Premiere, CC 2014 but whenever I want to render and export a video that is typically 70 megabytes in size I can't seem to always see how big the file will end up being for all the formats and I don't want to end up with a video larger than 250 to 300 megabytes in size just for the extremely best or highest quality even though I want the video to be well polished and in better quality than I usually get thee, These videos are usually imported as mp4. What file version of mp4 or otherwise would give me an originally imported video of 70 megabytes an output of no more than or around 300 megabytes or even less without compromsing video quality? I don't want a huge file size as I am uploading it to my YouTube channel via their web interface on another person's machine and they don't have Premiere and only has a DSL connection. So what video output settings should I use for a good quality video that isn't smaller than the original but the same size or a bit higher and not extremely large like MOVs and sometimes mp4s usually are depending on what you do to it and it is outputted.?

    Export
    Format: H.264
    Preset: YouTube (make sure this matches the dimensions of your sequence)
    You could further adjust the Target Bitrate but the preset is already setup for a good quality file for upload.
    You can also do further reading on Video Bitrates.

Maybe you are looking for