How to format a date to display the ISO week number in BI Publisher ?

Hi there,
I need to format a date to display the ISO week number in BI Publisher.
I've tried the following <?format-date:NEED_BY_DATE;'WW'?>, but it returns a week number (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year, which is not what I want.
I want the ISO week number (1-52 or 1-53), the one implemented by the 'IW' format mask of the Oracle PL/SQL TO_CHAR() function for example.
I've tried using 'IW' format mask, but it is not recognised by BI Publisher.
Also, as I'm working on an RTF template, I've tried 'IW' as MS Word date format, but it is not recognised by MS Word :-((
Any help would be much appreciated,
Regards - Hugues

Hi,
Thank you for the post.
The thing is I don't have access to the query, unless I modify a standard E-Businees Suite view (one of those used to generate the PO document in Purchasing).
Regards - Hugues

Similar Messages

  • Display ISO week number instead of date on x axis in Bar Chart

    Hi,
    I've created a simple SSRS report based on bar chart that shows several milestones. Everything works fine for me except I’m not able to convert the date into ISO week number format.
    I played around with different approaches. I was able to convert the date into an ISO week Format directly on the SQL Server. That
    wasn't a problem.
    But unfortunately I’m not able to display the week number on the horizontal axis in my Bar Chart. I tried both fields: TaskFinishDate and TaskFinishDateMS...
    I would like to show the ISO week number instead of the date within the Bar Chart on the horizontal axis.
    Any ideas/hints/help is really appreciated!
    Thanks,
    Mike

    Hi Mike,
    Per my understanding that you want to get the week number of the year based on the field "TaskFinishDate" which is datetime type and display the week number in the x-axis instead of the field "TaskFinishDate", right?
    I have check the snapshot you have provided and it seems you have change the format of the datetime field in the x-axis like "dd.MM.YYYY", If you can't make the week number to display correctly in the x-axis, the issue can be caused by you haven't
    change the format to Number in the category.
    Details information below for you reference:
    I assume you have use expression in the Label like below to convert the datatime TaskFinishDate in to ISO week number like below:
    =DatePart(DateInterval.WeekOfYear,Fields!TaskFinishDate.Value)
    or
    =DatePart("ww",Fields!TaskFinishDate.Value)
    Right click the X-axis and select the "Horizontal Axis Properties", then click the Number to change the format to "Number" as below:
    Preview you will get the weeknumber display in the x-axis correctly.
    If you still have any problem, please feel to ask.
    Regards,
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • How to get ISO week number?

    hi,
    I need to interact with a server that expects to be passed the ISO week number. The Calendar class doesn't seem to support this though (although the documentation claims that it is ISO 8601 compliant).
    For instance the web page here gives today (Jan 10th 2005) as being in Week 2
    http://personal.ecu.edu/mccartyr/isowdcal.html
    but this code snippet returns "Week 3"
    import java.util.*;
    public class WeekOfYear {
         public static void main(String[]arg) {
              Calendar c = Calendar.getInstance();
              System.out.println("Week "+c.get(Calendar.WEEK_OF_YEAR));
    }does anyone know a correct way of getting the ISO 8601 Week number without reimplenting a lot of delicate code?
    thanks,
    asjf
    ps. of course for now, and the rest of 2005, i'm going to hard code subtracting 1 as a gratuitous hack :o)

    hi,
    thanks - i did check the docs :)
    the problem is that Calendar's idea of what the first week in the year is differs from the ISO standard
    the problem is that the ISO standard defines the first week of the year as that containing the first Thursday (ie some days may become part of the previous year's weeks)
    and Calendar defines it as the docs state - so to change the value returned would mean you having to change the "FirstDayOfWeek" or the "MinimalDaysInFirstWeek" - which (without checking recently) I think the ISO standard also defines so you can't safely change these
    I might raise a RFE against Calendar about this in a week or two since it seems quite important?
    thanks,
    asjf

  • How to Read the one Source Column data and Display the Results

    Hi All,
         I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results
    Ex:
    Pr_ProjectType
    AD,AM
    AD
    AM
    AD,AM,TS,CS.OT,TS
    AD,AM          
    like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need
    4.AD,AM,TS,CS.OT,TS in this string we need AD,AM  only.
    this logic we need we have thousand of data in the table.Please help this is urgent issue
    vasu

    Hi Vasu,
    Based on your description, you want to eliminate the substrings (eliminated by comma) that are not AD or AM in each value of the column. Personally, I don’t think this can be done by just using an expression in the Derived Column. To achieve your goal, here
    are two approaches for your reference:
    Method 1: On the query level. Replace the target substrings with different integer characters, and create a function to eliminate non-numeric characters, then replace the integer characters with the corresponding substrings. The statements
    for the custom function is as follows:
    CREATE FUNCTION dbo.udf_GetNumeric
    (@strAlphaNumeric VARCHAR(256))
    RETURNS VARCHAR(256)
    AS
    BEGIN
    DECLARE @intAlpha INT
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
    BEGIN
    WHILE @intAlpha > 0
    BEGIN
    SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
    END
    END
    RETURN ISNULL(@strAlphaNumeric,0)
    END
    GO
    The SQL commands used in the OLE DB Source is like:
    SELECT
    ID, REPLACE(REPLACE(REPLACE(REPLACE(dbo.udf_GetNumeric(REPLACE(REPLACE(REPLACE(REPLACE([ProjectType],'AD,',1),'AM,',2),'AD',3),'AM',4)),4,'AM'),3,'AD'),2,'AM,'),1,'AD,')
    FROM MyTable
    Method 2: Using a Script Component. Add a Derived Column Transform to replace the target substrings as method 1, use Regex in script to remove all non-numeric characters from the string, add another Derived Column to replace the integer
    characters to the corresponding substring. The script is as follows:
    using System.Text.RegularExpressions;
    Row.OutProjectType= Regex.Replace(Row.ProjectType, "[^.0-9]", "");
    References:
    http://blog.sqlauthority.com/2008/10/14/sql-server-get-numeric-value-from-alpha-numeric-string-udf-for-get-numeric-numbers-only/ 
    http://labs.kaliko.com/2009/09/c-remove-all-non-numeric-characters.html 
    Regards,
    Mike Yin
    TechNet Community Support

  • How can I import data in to the digital word generator in Multisim?

    How can I import data in to the digital word generator in Multisim?
    I just  received this comment from a friend, a RADAR engineer, who has just down loaded Multisim.  He has been using HP/Agilent software.  He has a work around using a piecewise linear voltage waveform with data imported from Excel but this is not really a good solution.  It would also be helpful to import data from Mathcad or equivalent.
    "I thought I was about to be impressed with MultiSim but it ended only in disappointment. There is a word generator in the simulation instrument panel which can drive the DAC with a waveform and it can have thousands of lines of values. I opened Excel, wrote the formula to generate the time and voltage points for a chirp, converted to DAC values in Hex and then went back to the word generator in MultiSim to load the values only to find that you have to enter each value manually. It doesn’t even allow you to paste in a list of values from a text file. I’m not going to type 5000 values by hand. If you get the chance to give feedback to National Instruments please ask them if the paste option can be added to the word generator. MultiSim is useful in many regards, but in this case, it left me with the impression that it is considerably limited in capability compared to what I’m used to."

    Hi,
    You can load your data automatically in the Multisim word generator. Follow these steps:
    - Save your data file (in excel .xslx ir .csv format) on your computer
    - Change the extension of the file to ".dp"
    - Double-click the word generator in Multisim and click on Set...
    - In the Settings dialog box, click on Load and then Accept
    - This will prompt you to select the .dp file you have on your computer, select it and you're good to go
    However, in Multisim you have the option of creating your own custom simulation analysis and instrument.
    I will try creating the instrument and send it back to you but it might take some time.
    Multisim and LabVIEW are very powerful in test automation, with the custom instruments you create for Multisim you don't need to export your data file into excel from LabVIEW (or MathCAD or other tools) and then reload it into Multisim. The test procedure is automated instead.
    Please check this reference design about automated simulation
    http://zone.ni.com/devzone/cda/tut/p/id/7825
    Here is how you can create your own custom measurement tool in Multisim and LabVIEW, but as I mentioned, I will create the word generator and come back to you anyways
    http://zone.ni.com/devzone/cda/tut/p/id/5635
    Let me know if you have any questions.
    Mahmoud W
    National Instruments

  • How can I get iTunes to display the tracks from a CD in their original (album) order?

    To be absolutely honest, I don't really understand what this box is for, so I shall just use it to repeat and expand on my question. (I have already sent a "Feedback" comment on the same topic).
    How can I get iTunes to display the tracks from a CD in their original (album) order?
    It seems to me that there is something very basic wrong with the way iTunes handles CD Tracks.
    Professionally produced CD tracks are seldom if ever in a randomised order. Why then does iTunes seem unable to display the tracks in the order they appear on the original CD source - whether from a personally owned CD or from a download from the iTunes Store?
    Some music demands a specific, non-alphabetic sequence in order to make sense. Why does it seem that iTunes only offers Alphabetic, or reverse alphabetic order - both of which make a nonsense of the original, often intended order of tracks?
    Why not replace the so-called "cover-art" in the bottom left hand corner if the iTunes window - which, while it may look attractive to some, gives the barest of information concerning the original disc, with a list of the original CD tracks in their original order, so that the user can easily reestablish the order in which they should be played.
    As I would expect legibility might be a problem with doing this, why could not the original contents, (in their original order), at least, be displayed when the "cover art" is double clicked-on - the result of which at present gives me an enlarged version of the "Cover Art". While on the subject of the contents of the source disc, what about all the album notes which someone takes trouble to write in order to increase the appreciation of the music on the CD and the listener's general background knowledge of the artists involved. Such notes, it seems to me, have considerable intrinsic value in their own account. I would, I think, normally be prepared to buy such "Sleeve notes" - so long as a "taster" was supplied (as it is for the music) - for something like the cost of a single 'Tune" on iTunes.
    These two aspects let Apple iTunes down enormously, in my opinion. I think that by chopping even quite protracted sequences of music up into bits does no one any favours - except perhaps Apple's already quite substantial bank balance. People have to be aware that two and a half, to three and a half minutes is a very short time to develop a piece of worthwhile music, and that there are many, many composers, not all of whom are alive today who have written music that huge masses of mankind value for the enrichment of their lives and the human condition in general.
    Please make the viewing of iTunes tracks in their correct order by default possible. By all means have the alphabetical variations available as offering a different approach to the music, but not the sole approach to it - PLEASE.
    Frustratedly yours
    Alan Whitaker
    PS I work at my old 24" iMac Intel Core 2 machine which runs OS "Tiger" - because it is more beautiful to look at, the screen is more pleasant to work on, and because, in some ways it is more capable (it will run FreeHand MX without needing a "patch"), than my more recent 21.5" which runs "Snow Leopard". (I don't find it that much slower, either).

    Dear Mike
    Thanks for the support. I am utterly amazed that after all the hype about how good iTunes is that it cannot play a downloaded CD in the correct order, and that what that order should be is not available directly from within one's own iTunes installation. (I know that one can go back to the iTunes Store to check what the order should be, but having downloaded the tracks surely iTunes is clever enough to retrieve this important information.
    My iTunes to differ from yours in that I have also noticed that it seems unable to download copies of my "talking books" in the correct order either. But in my case it downloads them - from a CD - in order, but with the first track downloaded first - so that it appears at the bottom of the column of tracks so that it would get played last! (At least this is, while being inexplicable, a relatively "logical" bit of blundering and because of this is relatively easy to put right!).
    I like many genres of music, some of which are not really programmed except perhaps by the artist performing them. I know that Frank Sinatra was very careful to programme his album songs to obtain a particular effect and in relation to the keys of the music. iTunes presumes to know better.
    Film scores may be totally randomly put together, in some cases, but in others the order is vital to one's appreciation of the music as a whole and how it relates to the plot of the film.
    In symphonic music most works are divided into sections and are conceived by the composer that way. Some individual sections may gain a life of their own if played separately, but they are never complete in the sense that the composer envisaged them without being placed in their proper context.
    Opera and probably most choral music too, is similar except that the words may well become meaningless if the order is changed at the whim of a piece of ill-written computer code, while ballet music has to be heard totally within its sequential context or it becomes meaningless.
    Finally, I would venture that iTunes, by jumbling up the order of the tracks as recorded on a CD, does an immense disservice, not only to the music on a particular CD, but to music in general, by expressing everything in terms of "Songs" - which it seems to interpret as stand-alone items of between 2 and 4 minutes whatever the genre. Even the way the iTunes publicity speaks of how many "songs" it can store instead of how many minutes or hours of recorded sound. This has to be another brick in the wall of "dumming-down" of people's expectations, and the shortening of their attention spans.
    I don't know about anyone else, but I feel betrayed by Apple over this. Perhaps the look, feel and general presentation of an item are not the most desirable features of a consumer product. Maybe it should be judged more on it fitness for the purpose for which it was sold. There is one other possibility - that Apple are trying to redefine "Music" - and that everything that lasts longer than about 3.5 minutes or is in the form of what could for want of a better term be called symphonic in the broadest sense is something else - not "Music" within Apple's new definition, at all!
    Well that's off my chest! now I can get down to creating some sort of order in my iTunes Libraries, knowing that I have to reconsult all the sources in order to confirm the source playing order.
    Anyway thanks again. At least I know that it is not just me
    alanfromthatcham

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • Formatting a Date based on the user's Locale

    I'm having some trouble formatting a date based on the user's locale. I'm aware you can do something like this:
       public static String getAsString( Object dateObject, Locale locale ) {
          DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.MEDIUM, locale );
          return dateFormat.format( dateObject );
    However, this is returning something like Jan 21, 2009. I need 01/21/2009. Of course, if this was the UK locale it'd have to be 21/01/2009. Any help would be appreciated.

    another issue I'm running into is that when I'm logged in as a users' locale which uses '-' instead of '/' (i.e. 21-01-2009), I get a parse error. Can anyone provide any input? Thanks.
        * Parse a Date
        * @param dateString
        * @param locale
        * @return parsed Date
       public static Object parseDate( String dateString, Locale locale ) {
          DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale );
          try {
             return dateFormat.parse( dateString );
          catch( Exception exception ) {
             throw new ExceptionUtl( UtlMessageHelper.getMessage( UtlMessageConstants.ERROR_FailedParseDateFromString, dateString ), exception );
        * Format the given value into a DateFormat
        * @param dateObject
        *           Object value to be formatted
        * @param locale
        *           Locale format to use
        * @return dateObject in SimpleDateFormat
       public static String formatDate( Object dateObject, Locale locale ) {
          DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, locale );
          if( dateFormat instanceof SimpleDateFormat ) {
             SimpleDateFormat simpleDateFormat = ( SimpleDateFormat )dateFormat;
             String pattern = simpleDateFormat.toPattern();
             if( !pattern.contains( "yyyy" ) ) {
                pattern = pattern.replace( "yy", "yyyy" );
             if( !pattern.contains( "dd" ) ) {
                pattern = pattern.replace( "d", "dd" );
             if( !pattern.contains( "MM" ) ) {
                pattern = pattern.replace( "M", "MM" );
             simpleDateFormat = new SimpleDateFormat( pattern );
             return simpleDateFormat.format( dateObject );
          return null;
       }

  • Tell me how to format a date retrieved from a MS SQL Server 2000 database?

    Tell me how to format a date retrieved from an MS SQL Server 2000 database for various uses in my JSP page?

    Or if you want to use JSTL instead of a scriptlet see:
    http://forum.java.sun.com/thread.jspa?threadID=676754&tstart=0

  • PLEASE HELP. How can I make a Label in my application display the devices Serial Number?

    I need the label to display the users serial number. Thanks guy, you help alot i apresciate it

    Yes you can get the device id, try following stuff:
    NSString *uuid = nil;
    CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
    if (theUUID) {
      uuid = NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID));
      [uuid autorelease];
      CFRelease(theUUID);
    Now create a label and set string uuid.
    UILabel* label = [[UILabel alloc] init];
    [label setText:uuid];
    [self.view addSubview: label];

  • To Display the Sales docoment Number(VBAk-VBELN) in Business Workplace

    Hi,
    I want to display the sales document number(ie VBAK-VBELN) of Credit blocks orders in the Business Workplace inbox.
    I am able to display the message called "Sales Order Block for Credit Checks ".  I have done the following customizing.
    1. Partner Function KB(Credit Representative) for the Sales Document Header.
    2. Output Determination Procedure.
    3. Output Master Record VV11(KRML) : - Here is there any coding i need to write or can i do it by customizing.
    Regards
    Ravi

    I need to add classification data for sold to party business partner that I created.
    Business partner-->General Data->Classification-->
    Classification -
    > I need to check the check box for customer and also
    Business partner--->General Data-> Classification----->R/3 integration---->Account Group I need to put 0001.
    How should I do this? I am making use of the BAPI BAPI_BUPA_CLASS_ADD.
    Here I need to pass values to CLASSIFICATION.
    I donu2019t know what values I need to pass to this import parameter CLASSIFICATION.
    When I go and see the structure of it, I find that the following fields are there.
    CLASSCAT, CRIT1, CRIT2, CRIT3, CRIT4, CRIT5, ATTRID, VALUE.
    What values should I pass so that I can add classification data to my sold to party business partner such that the Customer check box is checked and in R/3 integration----->Account Group I should fill 0001.
    Regards,
    Jessica Sam
    Edited by: jessica sam on Nov 15, 2008 2:33 PM

  • Urgent ---calculate version  from the current week number

    hi,
         i have an requrenment to modify the charasteric routines
      i have xxx table with parameter i have to read this paramater n  if this parameter contains value 'D' then calculate version(eg:- A00,A01 ...) from the current week number.
    pls advice me which FM i have to call or provide me with some sample codeing.
    points wil be rewarded
    ravi

    There is a FM "WEEKNR_GET".
    This will give you the week no. You need to read the param value from the table that you mentioned and call this FM and updat the version.
    You will need a ABAP person to do this.
    Ravi Thothadri

  • Really urgent: seperation of dates for displaying the stock

    hi,
    I am modifying a report in which i have to display the stock in the following way:-
    1.) If P_DATE(15.03.2008) then it should display the stock of previous month as the stock it stored on always on the last date of each month.
    2.) If P_DATE(16.03.2008) then it should display the stock of this  month as the stock it stored on always on the last date of each month.
    my requierment is how to display it?
    plzz help me out as help will be deifnately rewarded.
    Edited by: ric .s on Mar 15, 2008 6:09 AM
    Edited by: ric .s on Mar 15, 2008 6:15 AM

    HI,
    plz go through the code and try to analyze it ,u will  not be abel to run dis code as it consist of the table which is made by the programmers.
    *& Report  ZPP_INV_COPY1
    REPORT  ZPP_INV_COPY1 NO STANDARD PAGE HEADING LINE-SIZE 150.
    TABLES : MARA, MAKT, MARD, MKPF, MSEG, T001L,ZSTOCKSUM.
    TYPE-POOLS : SLIS.
    **DATA : BEGIN OF STIT OCCURS 0,
          BUDAT LIKE MKPF-BUDAT,
          MATNR LIKE MSEG-MATNR,
          WERKS LIKE MSEG-WERKS,
          LGORT LIKE MSEG-LGORT,
          MENGE LIKE MSEG-MENGE,
          MEINS LIKE MSEG-MEINS,
          ERFMG LIKE MSEG-ERFMG,
          ERFME LIKE MSEG-ERFME,
          SHKZG LIKE MSEG-SHKZG,
          BWART LIKE MSEG-BWART,
    DATA : BEGIN OF STIT OCCURS 0,
           STLDATE LIKE ZSTOCKSUM-STLDATE,
           MATNR LIKE ZSTOCKSUM-MATNR,
           WERKS LIKE ZSTOCKSUM-WERKS,
           LGORT LIKE ZSTOCKSUM-LGORT,
           STSTOCK LIKE ZSTOCKSUM-STSTOCK,
           STDEBIT LIKE ZSTOCKSUM-STDEBIT,
           STCREDIT LIKE ZSTOCKSUM-STCREDIT,
           MEINS LIKE MARA-MEINS,
           MTART LIKE MARA-MTART,
           MATKL LIKE MARA-MATKL,
           NTGEW LIKE MARA-NTGEW,
           GEWEI LIKE MARA-GEWEI,
           WTKG  LIKE MARA-NTGEW,
           STOCK TYPE P LENGTH 10 DECIMALS 3,
           WT TYPE P LENGTH 12 DECIMALS 3,
           END OF STIT.
    DATA : BEGIN OF SLIT OCCURS 0,
           LGORT LIKE T001L-LGORT,
           LGOBE LIKE T001L-LGOBE,
           ROH   TYPE P LENGTH 12 DECIMALS 3,
           ZBOP  TYPE P LENGTH 12 DECIMALS 3,
           FERT  TYPE P LENGTH 12 DECIMALS 3,
           HALB  TYPE P LENGTH 12 DECIMALS 3,
           ZSCR  TYPE P LENGTH 12 DECIMALS 3,
           TOT   TYPE P LENGTH 12 DECIMALS 3,
           crrow type P length 3,
           END OF SLIT.
    DATA : ITAB LIKE STIT OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF ITAB1 OCCURS 0,
           MTART LIKE MARA-MTART,
           END OF ITAB1.
    ******************OLD ITAB2****************
    **DATA : BEGIN OF ITAB2 OCCURS 0,
          LGORT LIKE MSEG-LGORT,
          END OF ITAB2.
    *************NEW ITAB2**********************
    DATA : BEGIN OF ITAB2 OCCURS 0,
           LGORT LIKE ZSTOCKSUM-LGORT,
           END OF ITAB2.
    DATA : V_QTY TYPE P LENGTH 12 DECIMALS 3,
           V_QTY1 TYPE P LENGTH 12 DECIMALS 3,
           V_ALV TYPE C,
           V_MAXROW TYPE P LENGTH 3.
    AT LINE-SELECTION.
        DATA : V_COL TYPE N LENGTH 3,
               V_ROW TYPE N LENGTH 3,
               V_RHDR LIKE T001L-LGORT,
               V_CHDR LIKE MARA-MTART,
               w_msg TYPE string.
        IF SY-LSIND = 1.
          V_COL = SY-CUCOL.
          V_ROW = SY-CUROW.
          V_RHDR = ''.
          V_CHDR = ''.
          PERFORM GET_PARM.
          IF V_ROW <> 999.
            PERFORM PRN_ITSTOCK.
          ENDIF.
        endif.
    start-of-selection.
    selection-screen begin of block par1 WITH FRAME TITLE TEXT-001.
    *PARAMETERS : P_DATE LIKE MKPF-BUDAT OBLIGATORY DEFAULT sy-datum.
    *PARAMETERS : P_WERKS LIKE MSEG-WERKS DEFAULT 'MFPL'.
    PARAMETERS : P_DATE LIKE ZSTOCKSUM-STLDATE OBLIGATORY DEFAULT sy-datum.
    PARAMETERS : P_WERKS LIKE ZSTOCKSUM-WERKS DEFAULT 'MFPL'.
    SELECT-OPTIONS : MAT_TYPE FOR MARA-MTART.
    ****SELECT-OPTIONS : P_MATNR FOR MSEG-MATNR.
    ****SELECT-OPTIONS : P_STLOC FOR MSEG-LGORT.
    SELECT-OPTIONS : P_MATNR FOR ZSTOCKSUM-MATNR.
    SELECT-OPTIONS : P_STLOC FOR ZSTOCKSUM-LGORT.
    SELECTION-SCREEN END OF BLOCK par1.
    ***SELECTION-SCREEN BEGIN OF BLOCK OPSC
    ***WITH FRAME TITLE TEXT-002.
    ***SELECTION-SCREEN BEGIN OF LINE.
    ***PARAMETERS ALV RADIOBUTTON GROUP OP.
    ***SELECTION-SCREEN COMMENT 4(13) TEXT-011 FOR FIELD ALV.
    ***SELECTION-SCREEN END OF LINE.
    ***SELECTION-SCREEN BEGIN OF LINE.
    ***PARAMETERS SCR RADIOBUTTON GROUP OP DEFAULT 'X'.
    ***SELECTION-SCREEN COMMENT 4(13) TEXT-012 FOR FIELD SCR.
    ***SELECTION-SCREEN END OF LINE.
    ***SELECTION-SCREEN END OF BLOCK OPSC.
      AUTHORITY-CHECK OBJECT 'ZPLANT1'
       ID 'WERKS' FIELD P_WERKS.
      IF sy-subrc <> 0.
       MESSAGE e045(zmsg) WITH P_WERKS.
      ENDIF.
    PERFORM GET_INI_DATA.
    PERFORM GET_GRP_DATA.
      V_ALV ='N'.
      PERFORM PRN_SMSTOCK_TXT.
    *&      Form  GET_INI_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_INI_DATA .
    ******************ORG******************************************
    SELECT AMATNR BWERKS BLGORT AMEINS AMTART AMATKL ANTGEW AGEWEI A~NTGEW
    FROM MARA AS A INNER JOIN MSEG AS B ON AMATNR = BMATNR
    INTO TABLE ITAB
    WHERE B~WERKS = P_WERKS
    AND A~MATNR IN P_MATNR
    AND ( MTART = 'FERT' OR MTART = 'HALB' OR MTART = 'ZBOP' OR MTART = 'ZSCR' OR MTART = 'ROH' )
    AND MTART IN MAT_TYPE
    GROUP BY AMATNR BWERKS BLGORT AMEINS AMTART AMATKL ANTGEW AGEWEI A~NTGEW.
    ***************************PREV CHANGE***********************************
    SELECT BBUDAT AMATNR AWERKS ALGORT AMENGE AMEINS AERFMG AERFME ASHKZG ABWART
    CMTART CMATKL CNTGEW CGEWEI C~NTGEW
    FROM MSEG AS A  INNER JOIN MKPF AS B ON AMBLNR = BMBLNR AND AMJAHR = BMJAHR
    INNER JOIN MARA AS C ON AMATNR = CMATNR
    INTO TABLE STIT
    WHERE AWERKS = P_WERKS AND AMATNR IN P_MATNR AND BUDAT <= P_DATE
    AND MTART IN MAT_TYPE
    AND ( MTART = 'FERT' OR MTART = 'HALB' OR MTART = 'ZBOP' OR MTART = 'ZSCR' OR MTART = 'ROH' )
    AND A~LGORT IN P_STLOC.
    *****************************NEW CHANGE AS ON 26.02.2008*********************************
    *AERFMG AERFME ASHKZG ABWART
      SELECT ASTLDATE AMATNR AWERKS ALGORT ASTSTOCK ASTDEBIT A~STCREDIT
      CMEINS  CMTART CMATKL CNTGEW C~GEWEI
      FROM ZSTOCKSUM AS A
      INNER JOIN MARA AS C ON AMATNR = CMATNR
      INTO TABLE STIT
      WHERE AWERKS = P_WERKS AND MTART IN MAT_TYPE AND AMATNR IN P_MATNR AND STLDATE <= P_DATE
      AND ( MTART = 'FERT' OR MTART = 'HALB' OR MTART = 'ZBOP' OR MTART = 'ZSCR' OR MTART = 'ROH' )
      AND A~LGORT IN P_STLOC.
    AND
        ITAB[] = STIT[].
        SORT ITAB BY MATNR WERKS LGORT MEINS MTART MATKL NTGEW GEWEI NTGEW.
        DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR WERKS LGORT MEINS MTART MATKL NTGEW GEWEI NTGEW.
        SORT STIT BY MATNR LGORT.
    *SHKZG
      SORT ITAB BY MATNR LGORT.
      LOOP AT ITAB.
        V_QTY = 0.
        V_QTY1 = 0.
    *************************PREVIOUS**********************s*
       LOOP AT STIT WHERE MATNR = ITAB-MATNR AND LGORT = ITAB-LGORT.
         IF STIT-SHKZG = 'S'.
           V_QTY = V_QTY + STIT-MENGE.
           V_QTY1 = V_QTY1 + STIT-ERFMG.
         ELSE.
           V_QTY = V_QTY - STIT-MENGE.
           V_QTY1 = V_QTY1 - STIT-ERFMG.
         ENDIF.
       ENDLOOP.
    *************************NEW*****************************
    LOOP AT STIT WHERE MATNR = ITAB-MATNR AND LGORT = ITAB-LGORT.
            V_QTY = V_QTY + STIT-STDEBIT - STIT-STCREDIT.
        ENDLOOP.
        IF V_QTY <> 0.
          ITAB-STOCK = V_QTY.
          IF ITAB-NTGEW <> 0 AND ITAB-GEWEI <> 'KG'.
            CALL FUNCTION 'ZGET_ITEM_WEIGHT'
             EXPORTING
               P_BUID         = ITAB-WERKS
               P_ITEMID       = ITAB-MATNR
               P_QTY          = ITAB-NTGEW
               P_UOM          = ITAB-GEWEI
               P_UOM1         = 'KG'
             IMPORTING
               P_RETVAL       = ITAB-WTKG.
        ENDIF.
        ENDIF.
       CONVERTING ITEM QTY IN KG
          ITAB-WT = ITAB-STOCK.
          IF ITAB-MEINS = 'G'.
            ITAB-WT = ITAB-STOCK / 1000000.
          ELSEIF ITAB-MEINS = 'KG'.
            ITAB-WT = ITAB-STOCK / 1000.
          ELSEIF ITAB-MEINS <> 'TO'.
            ITAB-WT = ITAB-STOCK * ITAB-WTKG / 1000.
          ENDIF.
          MODIFY ITAB.
        ENDIF.
      ENDLOOP.
    endform.                    " GET_INI_DATA
    *&      Form  GET_GRP_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_GRP_DATA .
      SELECT LGORT LGOBE FROM T001L INTO TABLE SLIT WHERE WERKS = P_WERKS.
      SORT SLIT BY LGORT.
      SORT ITAB BY LGORT MTART.
      LOOP AT SLIT.
        LOOP AT ITAB WHERE MTART = 'ROH' AND LGORT = SLIT-LGORT AND STOCK <> 0.
          SLIT-ROH = SLIT-ROH + ITAB-WT.
        ENDLOOP.
        LOOP AT ITAB WHERE MTART = 'ZBOP' AND LGORT = SLIT-LGORT AND STOCK <> 0.
          SLIT-ZBOP = SLIT-ZBOP + ITAB-WT.
        ENDLOOP.
        LOOP AT ITAB WHERE MTART = 'HALB' AND LGORT = SLIT-LGORT AND STOCK <> 0.
          SLIT-HALB = SLIT-HALB + ITAB-WT.
        ENDLOOP.
        LOOP AT ITAB WHERE MTART = 'FERT' AND LGORT = SLIT-LGORT AND STOCK <> 0.
          SLIT-FERT = SLIT-FERT + ITAB-WT.
        ENDLOOP.
        LOOP AT ITAB WHERE MTART = 'ZSCR' AND LGORT = SLIT-LGORT AND STOCK <> 0.
          SLIT-ZSCR = SLIT-ZSCR + ITAB-WT.
        ENDLOOP.
        SLIT-TOT = SLIT-ROH + SLIT-ZBOP + SLIT-HALB + SLIT-FERT + SLIT-ZSCR.
        IF SLIT-TOT = 0.
          DELETE SLIT.
        ELSE.
          MODIFY SLIT.
        ENDIF.
      ENDLOOP.
    endform.                    " GET_GRP_DATA
    *&      Form  PRN_ITSTOCK
          text
    -->  p1        text
    <--  p2        text
    form PRN_ITSTOCK .
    Data : hdr type c length 100,
           V_PTYPE LIKE MARA-MTART,
           V_PSTLOC LIKE MSEG-LGORT,
           V_ITEM LIKE MAKT-MAKTX,
           T_QTY1 TYPE P LENGTH 12 DECIMALS 3,
           T_QTY2 TYPE P LENGTH 12 DECIMALS 3,
           T_QTY3 TYPE P LENGTH 12 DECIMALS 3,
           T_WT1 TYPE P LENGTH 12 DECIMALS 3,
           T_WT2 TYPE P LENGTH 12 DECIMALS 3,
           T_WT3 TYPE P LENGTH 12 DECIMALS 3.
    hdr = 'INVENTORY REPORT '.
    IF V_CHDR = 'ROH'.
      CONCATENATE HDR '(RAW MATERIAL) ' INTO HDR.
    ELSEIF V_CHDR = 'ZBOP'.
      CONCATENATE HDR '(BOP) ' INTO HDR.
    ELSEIF V_CHDR = 'HALB'.
      CONCATENATE HDR '(SEMI-FININSHED GOODS) ' INTO HDR.
    ELSEIF V_CHDR = 'FERT'.
      CONCATENATE HDR '(FINISHED GOODS) ' INTO HDR.
    ELSEIF V_CHDR = 'ZSCR'.
      CONCATENATE HDR '(SCRAP) ' INTO HDR.
    ENDIF.
    WRITE : / HDR.
    uline.
    *WRITE : / '              ITEM ID  DESCRIPTION                   UOM  GRP           ITEM WT (KG.)             STOCK QTY.              STOCK TONS'.
    WRITE : / '            ITEM ID  DESCRIPTION                             UOM       GROUP            NET.WT.      STOCK QTY.  STOCK (TONS)'.
    ULINE.
    SORT ITAB BY MTART LGORT MATNR.
    T_QTY1 = 0.
    T_WT1 = 0.
    LOOP AT ITAB1.
      WRITE : / 'MATERIAL TYPE : ', ITAB1-MTART.
      T_QTY2 = 0.
      T_WT2 = 0.
      LOOP AT ITAB2.
        WRITE : / '          STORAGE LOCATION : ' , ITAB2-LGORT.
        T_QTY3 = 0.
        T_WT3 = 0.
        LOOP AT ITAB WHERE MTART = ITAB1-MTART AND LGORT = ITAB2-LGORT.
          SELECT SINGLE MAKTX FROM MAKT INTO V_ITEM WHERE MATNR = ITAB-MATNR.
          WRITE : / '           ' ,(8) ITAB-MATNR,(40) V_ITEM,(3) ITAB-MEINS,'    ', ITAB-MATKL, '    ',(10) ITAB-WTKG,(13) ITAB-STOCK, (13) ITAB-WT.
          T_QTY3 = T_QTY3 + ITAB-STOCK.
          T_WT3 = T_WT3 + ITAB-WT.
        ENDLOOP.
        T_QTY2 = T_QTY2 + T_QTY3.
        T_WT2 = T_WT2 + T_WT3.
        WRITE : / '                                                                                -
        WRITE : / '          TOTAL :                                                                               ',(13) T_QTY3, (13) T_WT3.
        WRITE : / '                                                                                -
      ENDLOOP.
      T_QTY1 = T_QTY1 + T_QTY2.
      T_WT1 = T_WT1 + T_WT2.
    WRITE : / '                                                                                ----------------------------'.
      WRITE : / '    TOTAL       :                                                                               ',(13) T_QTY2, (13) T_WT2.
      WRITE : / '                                                                                -
    ENDLOOP.
    *WRITE : / '                                                                                -
    WRITE : / ' GRAND TOTAL    :                                                                               ',(13) T_QTY1, (13) T_WT1.
    WRITE : / '                                                                                -
    endform.                    " PRN_ITSTOCK
    *&      Form  PRN_SMSTOCK
          text
    -->  p1        text
    <--  p2        text
    form PRN_SMSTOCK_TXT .
      DATA : Q TYPE P LENGTH 12 DECIMALS 3,
             TROH TYPE P LENGTH 12 DECIMALS 3,
             TBOP TYPE P LENGTH 12 DECIMALS 3,
             THALB TYPE P LENGTH 12 DECIMALS 3,
             TFERT TYPE P LENGTH 12 DECIMALS 3,
             TSCR TYPE P LENGTH 12 DECIMALS 3,
             TSL TYPE P LENGTH 12 DECIMALS 3.
      WRITE : / 'INVENTORY REPORT AS ON : ', P_DATE, '         PLANT : ', P_WERKS, '                           PRINTING DATE : ', SY-DATUM, '     CONTROL NO.: FM 888  REV-00'.
      WRITE : / '(in Tons)', 121 'DATE       : 20.11.07'.
      ULINE.
      FORMAT COLOR COL_GROUP ON.
      WRITE : / SY-VLINE,(10) 'ST.LOC.', SY-VLINE, (25) 'ST. LOCATION ', SY-VLINE, (15) 'RAW MATERIAL', SY-VLINE, (15) '     BOP', SY-VLINE, (15) 'FIN. GOODS',
                SY-VLINE, (15) 'WIP GOODS', SY-VLINE, (15) 'SCRAPS', SY-VLINE, (15) ' TOTAL ', SY-VLINE.
      ULINE.
      TROH = 0.
      TBOP = 0.
      THALB = 0.
      TFERT = 0.
      TSCR = 0.
      FORMAT COLOR COL_NORMAL ON.
      LOOP AT SLIT.
        Q = SLIT-ROH + SLIT-ZBOP + SLIT-FERT + SLIT-HALB + SLIT-ZSCR.
        IF Q <> 0.
         TSL = SLIT-ROH + SLIT-ZBOP + SLIT-HALB + SLIT-FERT + SLIT-ZSCR.
          WRITE  : / SY-VLINE,(10) SLIT-LGORT, SY-VLINE, (25) SLIT-LGOBE, SY-VLINE, (13) SLIT-ROH,' ', SY-VLINE, (13) SLIT-ZBOP, ' ', SY-VLINE, (13) SLIT-FERT, ' ',
          SY-VLINE,(13) SLIT-HALB, ' ', SY-VLINE,(13) SLIT-ZSCR, ' ',SY-VLINE,(13) SLIT-TOT, ' ',SY-VLINE.
          ULINE.
          TROH = TROH + SLIT-ROH.
          TBOP = TBOP + SLIT-ZBOP.
          THALB = THALB + SLIT-HALB.
          TFERT = TFERT + SLIT-FERT.
          TSCR =  TSCR + SLIT-ZSCR.
          SLIT-CRROW = SY-LINNO - 2.
          MODIFY SLIT.
          V_MAXROW = SLIT-CRROW.
         WRITE : SLIT-FERT, SLIT-HALB, SLIT-ZSCR.
        ENDIF.
      ENDLOOP.
      TSL = TROH + TBOP + THALB + TFERT + TSCR.
      WRITE  : / SY-VLINE, (38) 'T O T A L ', SY-VLINE, (13) TROH,' ', SY-VLINE, (13) TBOP, ' ', SY-VLINE, (13) TFERT, ' ',
      SY-VLINE,(13) THALB, ' ', SY-VLINE,(13) TSCR, ' ',SY-VLINE,(13) TSL, ' ',SY-VLINE.
      ULINE.
    endform.                    " PRN_SMSTOCK
    *&      Form  PRN_SMSTOCK_ALV
          text
    -->  p1        text
    <--  p2        text
    form PRN_SMSTOCK_ALV .
    endform.
    form user_command using r_ucomm     like sy-ucomm
                            rs_selfield type slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n,
               ITID LIKE MARA-MATNR.
         w_row = rs_selfield-tabindex.
         ITID = rs_selfield-value.
         IF W_ROW <> 0.
           CONCATENATE 'You have clicked row' w_row
                       'field' rs_selfield-fieldname
                       'with value' rs_selfield-value
                       INTO w_msg SEPARATED BY space.
           MESSAGE w_msg TYPE 'S'.
           PERFORM PRN_ITSTOCK.
         ENDIF.
    ENDCASE.
    ENDFORM.
    *&      Form  GET_PARM
          text
    -->  p1        text
    <--  p2        text
    form GET_PARM .
    CLEAR ITAB1.
    REFRESH ITAB1.
    IF V_COL > 44.
      IF V_COL >= 44 AND V_COL <= 60.
        V_CHDR = 'ROH'.
        ITAB1-MTART = V_CHDR.
        APPEND ITAB1.
      ELSEIF V_COL >= 62 AND V_COL <= 78.
        V_CHDR = 'ZBOP'.
        ITAB1-MTART = V_CHDR.
        APPEND ITAB1.
      ELSEIF V_COL >= 80 AND V_COL <= 96.
        V_CHDR = 'FERT'.
        ITAB1-MTART = V_CHDR.
        APPEND ITAB1.
      ELSEIF V_COL >= 98 AND V_COL <= 114.
        V_CHDR = 'HALB'.
        ITAB1-MTART = V_CHDR.
        APPEND ITAB1.
      ELSEIF V_COL >= 116 AND V_COL <= 132.
        V_CHDR = 'ZSCR'.
        ITAB1-MTART = V_CHDR.
        APPEND ITAB1.
      ELSEIF V_COL >= 134 AND V_COL <= 160.
        V_CHDR = 'TOT'.
        ITAB1-MTART = 'ROH'.
        APPEND ITAB1.
        ITAB1-MTART = 'ZBOP'.
        APPEND ITAB1.
        ITAB1-MTART = 'FERT'.
        APPEND ITAB1.
        ITAB1-MTART = 'HALB'.
        APPEND ITAB1.
        ITAB1-MTART = 'ZSCR'.
        APPEND ITAB1.
      ENDIF.
      CLEAR ITAB2.
      REFRESH ITAB2.
      READ TABLE SLIT WITH KEY CRROW = V_ROW.
      IF SY-SUBRC = 0.
        V_RHDR = SLIT-LGORT.
        ITAB2-LGORT = V_RHDR.
        APPEND ITAB2.
      ELSE.
        IF V_ROW > V_MAXROW.
          IF V_CHDR <> 'TOT'.
            DATA : PTXT LIKE MSEG-LGORT.
            SORT ITAB BY MTART LGORT.
            PTXT = ''.
            LOOP AT ITAB WHERE MTART = V_CHDR AND STOCK <> 0.
              IF PTXT <> ITAB-LGORT.
                ITAB2-LGORT = ITAB-LGORT.
                APPEND ITAB2.
                PTXT = ITAB-LGORT.
              ENDIF.
            ENDLOOP.
          ELSE.
            V_ROW = 999.
          ENDIF.
        ELSE.
          V_ROW = 999.
          CLEAR ITAB1.
          REFRESH ITAB1.
        ENDIF.
      ENDIF.
    ELSE.
      V_CHDR = ''.
      V_RHDR = ''.
    ENDIF.
    endform.                    " GET_PARM
    Edited by: ric .s on Mar 15, 2008 7:26 AM

  • How to format my computer without affecting the software installed?

    how do I format my computer without affecting the software installed?

    You can, but if you don't format the drive using the Zero Data option all your personal files will still be accessible to someone who knows how to gain access to them. If that's not a concern then here are two options (easy and not so easy):
    The Easy Way
    1. First, boot from your Tiger DVD, select your language and click on the Continue button, then select Disk Utility from the Utilities menu, select your boot hard drive, go to the First Aid tab, and click the button for Repair Disk. Repeat this until no trouble is found. Then click on the Repair Permissions button. Then quit DU, return to the installer and shutdown the computer for a couple of minutes.
    This will assure that the drive is OK and permissions are OK.
    2. Next, boot to single user mode by restarting and after the chime press and hold down the COMMAND-S keys until a black screen with white type appears.
    3. At the prompt, type the following commands pressing return after each command line:
    /sbin/fsck -yf
    mount -uw /
    rm /private/var/db/.AppleSetupDone
    shutdown -r now
    The second-to-last command above will cause OS X to think that the operating system is newly installed, and when you reboot, it will send you to the startup wizard where you can start a new user without reinstalling.
    The Not So Easy Way
    Follow these instructions step by step to prepare a Mac for sale:
    First, back up the data:
    1) Shut down all Virtual PCs. They cannot be in their "fast saved" state. They must be shut down from inside Windows.
    2) Clone to an external drive using Carbon Copy Cloner.
    Next, prepare the machine for the new buyer:
    3) Deauthorize the computer in iTunes! Deauthorize both iTunes and Audible accounts.
    4) Remove Open Firmware passwords
    5) Turn the brightness full up and volume nearly so.
    Install a fresh OS:
    6) Insert the OS X install CD/DVD.
    7) Restart the computer while holding down the C key to boot from the CD/DVD.
    8) Run Disk Utility from the file menu and erase the internal hard drive (optionally zero all data).
    9) Install OS X.
    10) Reboot the computer.
    11) From the welcome screen, you can skip the registration step by typing command-Q.
    12) When prompted, create an account (it will be an admin account).
    13) From your new admin account, configure networking.
    14) Then use Software Update to bring your system and all of it's applications up to date.
    15) From Disk Utility, repair permissions on the new volume.
    Now delete the account you just created:
    16) Boot from a different volume (e.g. a firewire drive, if available)
    17) Clean up the image using the following terminal commands:
    prompt> rm /Volumes/<imagevol>/var/db/BootCache.playlist
    prompt> rm /Volumes/<imagevol>/var/db/volinfo.database
    prompt> rm -r /Volumes/<imagevol>/var/vm/swap*
    18) Now you can get rid of the admin account you used to set up the machine Use the terminal:
    prompt> nicl -raw /Volumes/<imagevol>/var/db/netinfo/local.nidb -delete /users/<admin>
    prompt> rm -r /Volumes/<imagevol>/Users/<admin>
    prompt> rm /Volumes/<imagevol>/var/db/.AppleSetupDone
    19) Shut down and ship it to your buyer. When they get it, it will boot to the Welcome screen just like a factory Mac, except that it's better because it's completely up to date.

  • How to use '*' as data Element in the NTE(Edi 850) Segment

    Hi All,
    I am facing a field level error while using '*' in EDI 850 (NTE segment). '*' is also used as Data Element.
    For Eg: NTE*GEN*My Text *goes here
    Here, NTE02 should be My Text *goes here. So, how can I use "*" here without changing anything in the EDI message?
    I have asked this question before
    http://social.msdn.microsoft.com/Forums/en-US/1668e8d8-ee99-4d79-961b-8d26f3a496f8/error-while-using-in-the-nte-edi-850-segment-where-is-also-used-as-data-element?forum=biztalkediandas2
    The answer in the above forum was to ask client modify the EDI message.
    Previously, our client was using a different technology (other than BizTalk) which was working fine with this format. So, they are insisting on this format only.
    Thanks,

    Sorry, the answer is the same.
    It doesn't matter what EDI platform either side is using, the '*' in the field content conflicts with the '*' that is the element delimiter. That is invalid EDI, there is no way around that short of writing a custom EDI parser.
    It's not clear if you're sending or receiving this message.  But again, it's really doesn't matter.
    1. Change the Element Delimiter to something other than '*'.  < or > are not uncommon.
    2. If you are receiving the EDI, create a custom Pipeline Component that "handles" NTE02 either by replacing the '*' with a substitute char or deleting it.
    3. If you are receiving, you could add extra elements to NTE to accommodate extra fields (since that's how the parser will see them).  Then you can join them again in a Map.

Maybe you are looking for