Need a cc flag to align structs on stack

I get a SIGBUS casting sockaddr to sockaddr_in,
but only if sockaddr was declared on the stack.
I am using Forte C/C++ for Sparc WS6U2.
Getting right to the point, is there a way to have
the compiler strictly align structs declared on the
stack, similar to malloc always returning strictly
aligned memory?
Is there any other workaround, other than using
-misalign (bad performance), or fixing each and
every instance of a struct on the stack?
This seems like such a common scenario that
a reasonable workaround should be available.
Thanks in advance,
-Ralph
Details follow...
The following code fragment contains an alignment bug
when casting a sockaddr to a sockaddr_in. The bug
occurs when the sockaddr is declared on the stack, but
not if it is malloc'd. While a call to malloc will return
strictly aligned memory, simply declaring a struct on
the stack will cause it to be aligned only as strictly as
is necessary according to the struct definition. Since
sockaddr requires only short aligned memory, later
casting it to sockaddr_in (a very very frequent case)
is dangerous because it requires long aligned memory.
The sockaddr only requires short alignment, since the
sa_family_t is a short, and the generic address is an
array of char.
However, the sockaddr is very very frequently cast into
a sockaddr_in, which requires long alignment, since the
IPv4 address can be viewed as a 32-bit unsigned integer.
/usr/include/sys/socket.h:
struct sockaddr {
sa_family_t sa_family; /* address family */
char sa_data[14]; /* up to 14 bytes of direct address */
/usr/include/netinet/in.h
struct sockaddr_in {
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
unsigned char sin_zero[8];
struct in_addr {
union {
struct { uint8_t s_b1, s_b2, s_b3, s_b4; } Sun_b;
struct { uint16_t s_w1, s_w2; } Sun_w;
in_addr_t Saddr;
} Sun;
int SomeClass::SendViaSocket( char *pszMessage )
// some code
struct sockaddr Socket;
// some code
SetIPv4SocketAddress( &Socket );
// some code
void SomeClass::SetIPv4SocketAddress( struct sockaddr *pSocket )
// some code
memset( pSocket, 0, sizeof(*pSocket) );
struct sockaddr_in pIPv4Socket = (struct sockaddr_in)pSocket;
pIPv4Socket->sin_family = AF_INET;
pIPv4Socket->sin_port = htons((unsigned short)nPort);
pIPv4Socket->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
// SIGBUS occurs, sometimes, if the moon is full, in previous line
// some code

Try the following:
1) Use cc -misalign file.c
2) Add #pragma pack(1) before your structures to pack them
It's more likely the 1) helps
Quang

Similar Messages

  • Need CC flag to align structs on stack

    I get a SIGBUS casting sockaddr to sockaddr_in,
    but only if sockaddr was declared on the stack.
    I am using Forte C/C++ for Sparc WS6U2.
    Getting right to the point, is there a way to have
    the compiler strictly align structs declared on the
    stack, similar to malloc always returning strictly
    aligned memory?
    Is there any other workaround, other than using
    -misalign (bad performance), or fixing each and
    every instance of a struct on the stack?
    This seems like such a common scenario that
    a reasonable workaround should be available.
    Thanks in advance,
    -Ralph
    Details follow...
    The following code fragment contains an alignment bug
    when casting a sockaddr to a sockaddr_in. The bug
    occurs when the sockaddr is declared on the stack, but
    not if it is malloc'd. While a call to malloc will return
    strictly aligned memory, simply declaring a struct on
    the stack will cause it to be aligned only as strictly as
    is necessary according to the struct definition. Since
    sockaddr requires only short aligned memory, later
    casting it to sockaddr_in (a very very frequent case)
    is dangerous because it requires long aligned memory.
    The sockaddr only requires short alignment, since the
    sa_family_t is a short, and the generic address is an
    array of char.
    However, the sockaddr is very very frequently cast into
    a sockaddr_in, which requires long alignment, since the
    IPv4 address can be viewed as a 32-bit unsigned integer.
    /usr/include/sys/socket.h:
    struct sockaddr {
    sa_family_t sa_family; /* address family */
    char sa_data[14]; /* up to 14 bytes of direct address */
    /usr/include/netinet/in.h
    struct sockaddr_in {
    sa_family_t sin_family;
    in_port_t sin_port;
    struct in_addr sin_addr;
    unsigned char sin_zero[8];
    struct in_addr {
    union {
    struct { uint8_t s_b1, s_b2, s_b3, s_b4; } Sun_b;
    struct { uint16_t s_w1, s_w2; } Sun_w;
    in_addr_t Saddr;
    } Sun;
    int SomeClass::SendViaSocket( char *pszMessage )
    // some code
    struct sockaddr Socket;
    // some code
    SetIPv4SocketAddress( &Socket );
    // some code
    void SomeClass::SetIPv4SocketAddress( struct sockaddr *pSocket )
    // some code
    memset( pSocket, 0, sizeof(*pSocket) );
    struct sockaddr_in pIPv4Socket = (struct sockaddr_in)pSocket;
    pIPv4Socket->sin_family = AF_INET;
    pIPv4Socket->sin_port = htons((unsigned short)nPort);
    pIPv4Socket->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
    // SIGBUS occurs, sometimes, if the moon is full, in previous line
    // some code

    Thank you for your reply, but why isn't this a Forte compiler issue?
    Are you saying that the compiler has absolutely no influence over
    the choice of [%fp - 0x10], e.g. that a Solaris call is made at run-time
    in order to allocate space on the stack? If not, how does this involve
    the Solaris gurus? Even so, the comiler could still allocate more than
    is needed to ensure that %fp is suitably aligned after the fact. It would
    appear that this is actually default behavior for the gcc compiler.
    (dbx) list -i 489 +2
    489 pDestIPAddr->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
    0x00299a50: GetTargetAddress+0x00d0: sethi %hi(0x7f000000), %l1
    0x00299a54: GetTargetAddress+0x00d4: or %l1, 0x1, %l1
    0x00299a58: GetTargetAddress+0x00d8: ld [%fp - 0x10], %l0 <---------- look here ------
    0x00299a5c: GetTargetAddress+0x00dc: st %l1, [%l0 + 0x4]
    *** SIGBUS frequently occurs in previous machine instruction ***
    I understand that throwing the -misalign CC flag enables the kernel
    memory alignment trap handler to interpret byte-wise access after
    a failed long-word access, instead of generating a SIGBUS signal.
    Does anyone know the official name of this hardware trap, and/or
    how to use the dbx debugger to detect when/if it has occurred?
    Or is that not possible because the trap occurs entirely in kernel?
    Can anyone confirm that -misalign has a performance impact only
    when/if the memory alignment trap handler is invoked?
    Can anyone point me to a better forum if this one is inappropriate?
    Thanks,
    -Ralph

  • Need help with a decimal align tab script for CS5

    I have a list that consists of 6 tabbed headers in helvetica bold, followed by a list of numbers that should right align under the headers, and these need to be in helvetica regular. The list is currently in arial font. Is it possible to change both the fonts and set the tabs to align right by using a script? If so, is there one 'out there' somewhere? I am desperate, this is for my daughter's basketball team and they need it asap!
    I am working in indesign cs5 and know how to load and run a script.
    Please HELP!
    Thank you
    Heather

    Hi,
    For some reason I can not download any attached documents from the forums, a bug?
    But anyway, send me an e-mail at "mail (curlya) nobrainer.dk" with the example doc, and i will have a look - no promisses :-)
    Thomas B. Nielsen
    http://www.nobrainer.dk

  • Need to maintain "Flag" column

    Hello,
    I am trying to maintain a "Flag" that identifies an address as the primary. The latest updated address for each member_id should be the primary with its primary_flag=Y and all the others for the member_id set to N. I have added a small sample of the data but my table has 2.3 million rows so performance is key. The records are updated and inserted using a MERGE query into my members table from an external table and this works very well.
    I am on 11gR1
    After my MERGE this is what I might see:
    member_id    address_id  primary_flag   last_updated
         12         232          N             1/2/2011
         12         324          Y             2/14/2011
         12         376          N             2/29/2011
         25         256          N             1/13/2011
         28         278          N             1/20/2011
         28         291          Y             1/25/2011
         30         389          Y             3/1/2011What I would like to see:
    member_id    address_id  primary_flag   last_updated
         12          232          N             1/2/2011
         12          324          N             2/14/2011
         12          376          Y             2/29/2011
         25          256          Y             1/13/2011
         28          278          N             1/20/2011
         28          291          Y             1/25/2011
         30          389          Y             3/1/2011I have come up with a few 2-Pass (SQL Updates) but I would like to do it in one (It would be real nice if I could do it in the MERGE statement).
    Thanks for any help!

    Hi,
    Thanks for posting the sample data. The results you said you wanted included only 4 columns; don't you want to set the other columns, in particular last_update_date, as well? I included all columns in the INSERT nad UPDATE; you can easily remove them if you don't want them.
    This does what I think you want:
    merge into
        MEMBER_ADRESS MA
        using (
         WITH     new_data     AS
            select
             NULL                    AS address_id,
                ML.MEMBER_ID,
                SUBSTRB (ML.ADDRESS_1, 1, 30)     AS address_1,
                SUBSTRB (ML.ADDRESS_2, 1, 30)     AS address_2,
                SUBSTRB (ML.CITY,         1, 25)     AS city,
                ML.STATE,
                ML.ZIP_CODE          AS zipcode,
             SYSDATE          AS creation_date,
             SYSDATE          AS last_update_date,
             NULL          AS primary_flag,
                ML.ADDITIONAL_COMPANY_INFO,
                to_number ( regexp_replace ( ML.ADDITIONAL_COMPANY_INFO     ||
                              SUBSTRB (ML.ADDRESS_1, 1, 30)     ||
                              SUBSTRB (ML.ADDRESS_2, 1, 30)     ||
                              SUBSTRB (ML.CITY,     1, 25)     ||
                              ML.STATE                ||
                              ML.ZIP_CODE
                              , '[^[:digit:]]'
                    )      as MATCH_VALUE,
             NULL          AS match_cnt
            from MEMBER_LOAD_V2 ML
         ,     primary_flag_y     AS
              SELECT     o.*
              ,     COUNT ( CASE
                            WHEN  o.match_value = n.match_value
                            THEN  1
                        END
                         )  OVER ( PARTITION BY  o.member_id
                              )          AS match_cnt
              FROM     member_adress     o
              JOIN     new_data     n  ON       o.member_id     = n.member_id
              WHERE     o.primary_flag     = 'Y'
         ,     combined_data     AS
              SELECT  *
              FROM     primary_flag_y
              WHERE     match_cnt     = 0
             UNION
              SELECT     *
              FROM     new_data
         SELECT     address_id, member_id, address_1, address_2, city, state
         ,     zipcode, creation_date, last_update_date
         ,     CASE
                   WHEN  ROW_NUMBER () OVER ( PARTITION BY  member_id
                                               ORDER BY        last_update_date  DESC
                                   ) = 1
                   THEN  'Y'
                   ELSE  'N'
              END               AS primary_flag
         ,     additional_company_info, match_value
         FROM     combined_data
         ) L
    on (MA.MEMBER_ID = L.MEMBER_ID and MA.MATCH_VALUE = L.MATCH_VALUE)
    when matched then
    update set
        MA.ADDRESS_ID          = L.ADDRESS_ID,
        MA.ADDRESS_1           = L.ADDRESS_1,
        MA.ADDRESS_2           = L.ADDRESS_2,
        MA.CITY                = L.CITY,
        MA.STATE                = L.STATE,
        MA.ZIPCODE                = L.ZIPCODE,
        MA.CREATION_DATE          = L.CREATION_DATE,
        MA.LAST_UPDATE_DATE          = L.LAST_UPDATE_DATE,
        MA.PRIMARY_FLAG           = L.PRIMARY_FLAG,
        MA.ADDITIONAL_COMPANY_INFO      = L.ADDITIONAL_COMPANY_INFO
    when not matched then
    insert (MA.ADDRESS_ID, MA.MEMBER_ID, MA.ADDRESS_1, MA.ADDRESS_2, MA.CITY, MA.STATE, MA.ZIPCODE,
            MA.CREATION_DATE, MA.LAST_UPDATE_DATE, MA.PRIMARY_FLAG, MA.ADDITIONAL_COMPANY_INFO)
    values (
            MEMBER_CNTCT_SEQ.NEXTVAL,
            L.MEMBER_ID,
            L.ADDRESS_1,
            L.ADDRESS_2,
            L.CITY,
            L.STATE,
            L.ZIPCODE,
         L.CREATION_DATE,
         L.LAST_UPDATE_DATE,
            L.PRIMARY_FLAG,
            L.ADDITIONAL_COMPANY_INFO
            );The cruical part is that, for each member_id in the source table, it finds the row with primary_flag='Y' that's already in the table (if a row with with the same member_id and match_value isn't already in the source table), and does a UNION to include those rows, so that an existing primary_flag may get changed from 'Y' to 'N'.
    It looks like the address_1, address_2 and city columns are the same length in both tables, so I don't see why you're using SUBSTR. I left it in, in case you have some reason.
    You might consider a user-defined function to caluculate match_value, and use that function bioth in the definition of the virtuyal column and in the MERGE. That way, you can be sure it is being computed the same in both places, and if, in the future, you change how match_value is computed, you only need to change it in one place. Match_value looks like just the kind of thing you might refine in the future, For example, you might decide that, on the rare occassions when city or state contains digits, it suits your needs better to ignore those digits.

  • Need to put flag in one of the column of internal table

    TYPES : BEGIN OF ty_bseg.
              INCLUDE STRUCTURE bseg.
    TYPES : flag(1) TYPE c.
    TYPES : END OF ty_bseg.
    DATA : gt_bseg TYPE TABLE OF ty_bseg.
    SELECT * FROM bseg
                INTO TABLE <b>gt_bseg</b>
                FOR ALL ENTRIES IN gt_bsak
                WHERE bukrs = gt_bsak-bukrs
                AND   belnr = gt_bsak-belnr
                AND   gjahr = gt_bsak-gjahr.
    Now I have to fill 'X' in the internal table gt_bseg.
    how can I fill all the records of itab gt_bseg with flag 'X'.
    For better performance... is there any command like  modify  or...?

    Hi Sam,
    Use the following code.
    *Code start
    loop at gt_bseg.
    gt_bseg-flag = 'X'.
    modify table gt_bseg transporting flag.
    endloop.
    *Code ends
    Cheers,
    Vikram
    Pls reward for helpful replies!!

  • Need "test run" flag for change BAPI of fixed assets

    Hi Experts,
          There will be 'Test Run Flag' in the Bapi.Please tell where it will be given with in the BAPI . For example, in 'BAPI_FIXEDASSET_CREAT'.
    Thanks,
    gsaasg.
    Edited by: Julius Bussche on Sep 5, 2009 11:28 PM
    Please use meaningfull subject titles

    Hi,
    Test Run flag field is not available for the requested BAPI, but it is in the BAPI  BAPI_FIXEDASSET_CREATE1
    VALUE(TESTRUN) LIKE  BAPI1022_MISC-TESTRUN OPTIONAL
    Please test this new BAPI whether it will meet your requirement or not.
    Thanks,
    Mahesh.

  • Please Help needed  - Inconsistent update flags error

    Hello Experts,
    I am experiencing an error in the Middleware and I am not able to find a solution.
    When I create sales order in CRM, they get replicated correctly to R3. Nevertheless, I never receive the notification from R3 to CRM and the Bdoc remains in Intermediate status with the message 'ERP adapter is called'.
    When I modify the sales order in R3, I receive a notification from R3 to CRM with the error 'Inconcistent update flags'.
    Can anyone help me to fix this issue? Why I am not receiving the notification from R3 to CRM once the sales order is replicated?
    Thanks a lot.
    Regards,
    Oliver

    Hello Oliver,
    This means that the BDoc is still awaiting a response from ECC.It is likely that an outbound queue in ECC is in stop mode or waiting mode. Can you please check the outbound queue in ECC?
    The message "R/3 adapter is called" is not an actual error or problem, it is just a flow message saying that the flow has left CRM. In your case, the flow made it to R/3 where it has got stuck most likely due to some conversion error /an application error.
    With report CRM_ODE_CHECK_CFG on CRM system check all necessary settings for data exchange of sales orders between CRM and R/3. Please check if application BC-MID is active in table TBE11 on R/3 side.
    Thanks,
    Rohit

  • Need a help on Item Alignment

    I am trying to align the first name, middle name and last name in my demo example. Item are not placed directly after the items. There is some gap between them.
    I know one way by adding an item of type Stop and Start HTML Table in the middle of the region but that caused 2nd row lable alignment.
    Please have a look on.
    http://apex.oracle.com/pls/otn/f?p=21900:4:549087666080845:::::
    Please help....
    Thanks

    Ayadav,
    Set the Emp Special Info ColSpan to 3 and Emp Manager ColSpan to 2.
    That should do the work.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Do I need to activate anything to align colour on screen with colour from printer

    If I scan art work I do not always get a 'true color' result.
    Is there any way of 'improving color'?

    rowing rod wrote:
    If I scan art work I do not always get a 'true color' result.
    Is there any way of 'improving color'?
    You need a printer that supports Pantone color registration, and a monitor as well, these are not low cost devices but do a Googgle search for Pantone Compliant printing systems.

  • Need assistance with font(number) alignment.

    I am in the process of updating many of the forms that our office uses to live forms and am not finding any information on how to format the font such that the number (first character in a line) will align correctly. As you can see from the image, the alignment is ocurring from the front edge of the character. This gives the appearance that the formatting is incorrect, when in fact all of the boxes are aligned at .5. We are in the final stages of editing the forms and this keeps arising as an issue with the management team that the numbers are not aligned correctly. I am using the Arial font.
    Is there any way I can manipulate any of the font settings to correct this issue? Any other suggestions? If not, I'll just have to tell my team that this is how it is designed.
    Thanks for any suggestions you might have to improve the display of alignment.

    See Paragraph properties > Indents > First. Select 'Hanging' from drop-down and tweak the size.

  • Need help writing to a TD2 struct

    Hello everyone.
    I´m kinda new to the world of LabView.
    I´m using a LabView program to create a 3d classification model. The main program is written in Visual C++ (native)
    I got this struct
    typedef struct {
    long dimSizes[3];
    unsigned char Numeric[1];
    } TD2;
    typedef TD2 **TD2Hdl;
    A classification model created by using
    static BOOL bCreateClassification3DModel()
    hClassification3DModel_g = (TD2**)DSNewHandle(sizeof(TD2) + (sizeof(BYTE) * ((lSizeA_g * lSizeB_g * lSizeC_g) - 1)));
    if (hClassification3DModel_g == NULL)
          return FALSE;
    (*hClassification3DModel_g)->dimSizes[0] = lSizeA_g;
    (*hClassification3DModel_g)->dimSizes[1] = lSizeB_g;
    (*hClassification3DModel_g)->dimSizes[2] = lSizeB_g;
    return TRUE;
    Now i want to write to the model. How do I set values into this model?
    Is (*hClassification3DModel_g)->Numeric = 4; the rigth way to go?

    Kresh wrote:
    Hello everyone.
    I´m kinda new to the world of LabView.
    I´m using a LabView program to create a 3d classification model. The main program is written in Visual C++ (native)
    I got this struct
    typedef struct {
    long dimSizes[3];
    unsigned char Numeric[1];
    } TD2;
    typedef TD2 **TD2Hdl;
    A classification model created by using
    static BOOL bCreateClassification3DModel()
    hClassification3DModel_g = (TD2**)DSNewHandle(sizeof(TD2) + (sizeof(BYTE) * ((lSizeA_g * lSizeB_g * lSizeC_g) - 1)));
    if (hClassification3DModel_g == NULL)
          return FALSE;
    (*hClassification3DModel_g)->dimSizes[0] = lSizeA_g;
    (*hClassification3DModel_g)->dimSizes[1] = lSizeB_g;
    (*hClassification3DModel_g)->dimSizes[2] = lSizeB_g;
    return TRUE;
    Now i want to write to the model. How do I set values into this model?
    Is (*hClassification3DModel_g)->Numeric = 4; the rigth way to go?
    Ouch, 3D arrays! And now what you suggest is ABSOLUTELY bad.
    (*hClassification3DModel_g)->Numeric is the pointer to the data area and not a number in itself. This tells me that your understanding of C and pointers is at best unsufficient.
    You will have to do something along the lines of
    a, b, c  are the variables that define the current indices into the 3D array ranging between 0 and lSizeA_g -1 , lSizeB_g - 1 , lSizeC_g - 1 respectively.
    (*hClassification3DModel_g)->Numeric[a + lSizeA_g * b + (lSizeA_g + lSizeB_g) * c] = whatever;
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Need to assign a multi datatype struct to a single field in Unicode system

    Hi all,
    I had posted an earlier question related to this to understand what the issue is. Few responses helped. Then now I have gone thru the conversion rules in Unicode systems related to assigning a structure (with different data types) to a single field and looking for a solution for my case. The current code written in 4.6 says
    l_bapiparex-valuepart1 = l_bape_vbap
    where
    l_bape_vbap is a structure of type bape_vbap and
    l_bapiparex of type bapiparex.
    So according to the rules, when I do this kind of an assignment in ECC , the first field's length (i.e. VBELN) must be min 240 characters long. Only then this assignment will be error free, am I right ?
    Or Is this an inadmissable assignment situation ?
    If not then is there any other way how I can achieve the same result by fixing this issue ? I am not able to think of any !! Has any one come across this kind of an issue during upgrade? Please do suggest.
    Just for your reference I have pasted the rule details from SAP help..
    Conversion in Unicode Programs
    The following rules apply in Unicode programs when converting a flat structure to a single field and vice versa:
    If a structure is purely character-like, it is processed during conversion like a data object of the type c (Casting). The single field can have any elementary data type.
    If the structure is not purely character-like, the single field must have the type c and the structure must begin with a character-like fragment that is at least as long as the single field. The assignment takes place only between this fragment and the single field. The character-like fragment of the structure is treated like a data object of the type c (Casting) in the assignment. If the structure is the target field, the remaining character-like fragments are filled with blanks and all other components with the initial value that corresponds to their type.
    No conversion rule is defined for any other cases, so that assignment is not possible.
    Note
    If a syntax error occurs due to an inadmissible assignment between flat structures and single fields, you can display the fragment view of the corresponding structure when displaying the syntax error in the ABAP Editor by choosing the pushbutton with the information icon.
    thanks

    Try this way
          call method cl_abap_container_utilities=>fill_container_c
            exporting
              im_value               = l_bape_vbap
            importing
              ex_container           = l_bapiparex-valuepart1
            exceptions
              illegal_parameter_type = 1
              others                 = 2.

  • Need to delete flag "quantity incomplete" for table COSP (periodic repost)

    Hello.
    Step 1. I writed-off fuel to Internal order(unit of measure Liter ) ,
    Step 2  Posted SKF,
    Step 3  Execute Actual periodic reposting.
    The issue is that receivers Internal orders has "empty" field quantity, it is because in table COSP  field MUVO (quantity incomplete)= 'X'.
    So I want to make it(MUVO) empty to see quantity in Receiver orders . How can I do this (BADI, user-exit), and what is the problem that I can face after that?
    By the way, I'm not going to post fuel in Milliliters.

    Hi,
      For primary cost elements, the system keeps a control record in Table COKA for each object, cost element, fiscal year, and origin, which defines for all postings in a fiscal year whether and in which unit of measure quantities are transferred to the totals record. Basically, the posted quantity (COEP-MBGBTR) is updated in the posted unit of measure (COEP-MEINB) in the line item. Whether the quantity is transferred to the totals record depends on the control record valid for the object. If the quantity is transferred to the totals record, the total quantity field (COEP-MEGBTR) is also filled in the line item.
      The control (COKA) record is created with the first posting in the fiscal year an cannot be changed during the year. In the cost element master record, you can store a default value for the unit of measure and set the "Manage quantity" indicator. If the indicator is set, the system sends a warning, if an actual posting is made without an entry for the unit of measure. If the unit of measure is changed subsequently in the cost element master, this does not affect quantity update, if there had already been postings in the fiscal year concerned.
    If another posting is made to the same cost element at a later time, the system checks whether the posted quantity can be converted to the unit defined in the COKA record. If this is the case, the quantity is converted accordingly (e.g. kg to t) and transferred to the totals record. Otherwise, it is not transferred. To indicate that there had been such a posting (which is not contained in the total quantity) in period xxx, the "Quantity incomplete" indicator (COSP-MUVxxx) is set in the totals record.
    Hope this information is helpful for you.
    regards
    Waman

  • Need to show a data in weeks for stacked column

      I need to show the data broken down in weeks if you choose the start date and end date.   I have to show in a stacked column chart. I am trying to show the values if you choose for example last month i need to show it by weeks for example 
    week    user name   total approved first approved    last aprovedDate  totalitemsAdded
    week 1   XYZ                 3                10/01/2012       10/05/2012         5
    week2   XYZ                  5                 etc                      etc            
      etc
    week 3 
    Below is the code and the result  i am getting now . 
    Current Results
    UserName TotalApproved
    FirstApprovedDate LastApprovedDate
       TotalItemsAdded
    XYZ            9
               2011-11-19 16:56:49.960
         2011-11-19 18:18:20.783
                   2
    DECLARE @StartDate DATETIME
    DECLARE @EndDate DATETIME
    SET @StartDate = '10/1/2012 '
    SET @EndDate = '10/31/2012'
    ;with Items as(
           SELECT
                  UserName = Profile.Description,
                  TotalItems = COUNT(TransactionID),
                  FirstAddedDate = MIN(UTCDate),
                  LastAddedDate = MAX(UTCDate)
           FROM Transactiondatabase.dbo.transaction
                    JOIN Biography.dbo.Profile ON transaction.ProfileId = Profile.ProfileID
           WHERE 
                  Data like '%ItemAdded%'
                    AND UTCDate BETWEEN @StartDate AND DATEADD(dd,1,@EndDate)
           GROUP BY
                  Profile.Description 
    Approved as
           SELECT 
                  UserName = Profile.Description,
                  TotalApproved = COUNT(TransactionID),
                  FirstApprovedDate = MIN(UTCDate),--Demo
                  LastApprovedDate = MAX(UTCDate)                 
           FROM Transactiondatabase..transaction
                    JOIN Biography.dbo.Profile ON transaction.ProfileId = Profile.ProfileID
           WHERE 
                  Data like '%Approved%'
                    AND UTCDate BETWEEN @StartDate AND DATEADD(dd,1,@EndDate)
           GROUP BY
                    Profile.Description
    Select Distinct Approved.*, TotalItemssAdded = sum(distinct Items.TotalItems)
    from Items, Approved  
    Group by Approved.UserName, Approved.FirstApprovedDate, Approved.LastApprovedDate, Approved.TotalApproved
    using ssrs 2005 

    Hi Sunny04,
    If I understand correctly, you want to display the data by weeks in a stacked column chart. If in this case, we can add a calculated field named week to display the week name, and then group it. For more details, please see the following steps:
    Right-click the dataset to add a calculated field with the values below:
    Name: Week
    Calculated field: =DatePart(DateInterval.WeekOfYear,Fields!FirstApprovedDate.Value,0,0)
    Add Week field to category group area in a stacked column chart.
    Right-click Week field to open the Properties dialog box, modify the expression of Label to like this:
    ="week"&Fields!Week.Value
    Add TotalApproved or TotalItemsAdded field to data area in the chart.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Ability to Flag *all* images in a Stack

    Hi,
    I shoot for HDR using auto-bracketing, and then auto-stack and collapse-all-stacks to have just the top (0ev) shot showing, and then navigate through the shots from a session in full screen to Pick them before using Refine.
    But, I then have to go back through all of the shots to find & expand the stacks that are picked to set the Pick flag for all of the other images in the stacks - it would be sooooo much easier if I could just set 'Pick' on all of the images with one keystroke!
    Please  ........?
    Gary

    I love a man with a sense of Humor
    Your the man!  Thanks so much.  I bracket all my shots and load them into the  HDR editor in Ps; my workflow will go so much smoother now.

Maybe you are looking for

  • Ipod does not work with new usb

    i got my computer cleaned and a usb 2.0 pci card put in and now my ipod does not work with it, can anyone help

  • Printing to a windows Vista shared printer.

    Hello, I have a shared Canon PIXMA MP160 attached via USB to a windows Vista box. I have tried several ways to print to this printer form my macbook. I have tried the normal 'Windows Printing' with no success. It pops up a box with user name and pass

  • Can no longer print from my i phone or i pad

    I have a hp photosmart plus e- all in one B210 printer. When I set up my i phone and ipad I was able to print.  But I can no longer. My lap top is also set up and is running ok as well as my husbands i phone.

  • Table footer printed in next page without upper border line

    Hi Experts I am faceing a problem regarding printing of smartform. I have 2 tables under one LOOP control, TABLE2 and TABLE1 respectivelity. TABLE2 display the Header data and TABLE1 displays the Item data under Main window. TABLE2 has no ROWs  under

  • How to Specify the environment variable JCE_POLICY_ZIP and restart

    Hello All, I am installing the ABAP SAP NetWeaver 7.01 SR1 ABAP Trial Version. sapinst.exe installed successfully. I am installing the sapinstgui.exe but I got the following message: Program is starting... Please wait!   Path: C:\Users\George\AppData