Attribute order changed

Hello all!
I'm developing a webapplication with JSP technology.
i have to manage xml files, change and rewrite them.
i use those pakage for manage and edit xml files :
"javax.xml.parsers.DocumentBuilder and DocumentBuilderFactory"
and that one for rewrite in a file:
"javax.xml.transform"
Now the problem is that the xml file edited had a particular element attribute order. the file rewrited change this order into an alphabetical order.
i want to mantein the previous order.
Is that possible? how?
Thanks!

No you get over it. The spec doesn't say it, but it is clearly an oversight by engineers more concerned with computer consuming XML then humans. One of the big selling points is that it is human readable and editable, this goes right against that.
Now that XML is more of a standard, programming languages and other things are being generated using it. Configuration files and all sorts of things. Consider you have a tag like <function name="" comment="" >
Suppose comment becomes really long while name is very short. Right now XSLT will reverse these attributes..now comment comes before the name and the file becomes unreadable....XML is used by humans too!
The spec also doesn't say you need it or not. Java and the rest of the community have actively decided to be like you, a complete dick, for no reason and not support it. Just lazying coding for no reason. I guess maybe open standards are a bad way to go huh? Man up and have the right attitude...no reason not to make it an option other then total disregard for other peoples real world ( not virtual specification ) problems.

Similar Messages

  • Maintain attribute order in XML with a structure?

    I'm using xmlParse() to read an XML file into a structure, and then process the structure (replace some of the XML attributes) and then write the structure back out as an XML file. The problem is that I loose the original ordering of XML attrbutes when I convert to a structure, and instead end up with a new attribute order for each element that is alphabetical.
    In otherwords: <element c="text" d="text" a="text" />
    gets rewritten as: <element a="text" c="text" d="text" />
    which is a problem for this application.
    Is there a way to work with XML in CF but maintain attribute ordering (LinkedHashMap instead of a structure, maybe)?
    Thanks.
    Walter

    but using ColdFusion to process XML in this way is making a pretty big change in the XML structure.
    No, it's not changing the structure in any meaningful way: the attribute ordering isn't meaningful in XML, so if the order of them changes, then that's not a meaningful change.  In any way that XML should be used, it doesn't matter.
    When CF reads an string (like file contents) and parses it as XML, it needs to create an XML object; that XML object will adhere to the rules of XML; one of which is "atribute order has no significance", so it will not (and ought not) bother to "remember" the order that the attributes were in in the original string.  When one converts that object back into a string, some sort of ordering needs to be used to write them back, and CF seems to arbitrarily use alphabetical order.  But it cannot refer back to information that it doesn't have (the original ordering), so the original ordering can't be preserved.
    There's nothing unreasonable or that shouldn't be expected in this process, unfortunately (for you, I mean).
    Adam

  • Attribute Order

    Hi,
    I have a data type that amongst other things has an element which has three attributes. Those attributes look correct when I view the data type. However, in the message mapping the attribute order has changed. Surely the attributes should be in the order defined in the data type. I hope the example below helps
    DATATYPE
    ..Element1
    .....Attribute1
    .....Attribute2
    .....Attribute3
    MAPPYING
    ..Element1
    .....Attribute1
    .....Attribute3
    .....Attribute2
    This is causing problems as the order of the attributes in the XML output to the client is different to that agreed. I would appreciate your help with this.

    I have tested this by created a message type with the attributes (sorry but I couldn't upload a screen shot)
    TREE                            CATEGORY            TYPE
    TEST                             ELEMENT               TEST             
    .....A                              ELEMENT                           
    ..........B                         ELEMENT                       
    ...............C                    ELEMENT               XSD:STRING
    ....................CA            ATTRIBUTE              XSD:STRING
    ....................CB            ATTRIBUTE              XSD:STRING
    ....................CC            ATTRIBUTE              XSD:STRING
    I then created a message type and a message mapping. When in the message mapping the message type appears as follows
    TREE                            CATEGORY            TYPE
    TEST                             ELEMENT               TEST             
    .....A                              ELEMENT                           
    ..........B                         ELEMENT                       
    ...............C                    ELEMENT               XSD:STRING
    ....................CA            ATTRIBUTE              XSD:STRING
    ....................CC            ATTRIBUTE              XSD:STRING
    ....................CB            ATTRIBUTE              XSD:STRING
    Notice that attributes CC and CB have swapped places.

  • Report for Sales Order Change History   CDPOS and CDHDR

    How to take a report of the data for the Sales Order Change history for a particular period of time. It is required to take a report of all the Sales Orders for which the basic price has been changed. Please let me know the procedure. I could not get the data from the table CDPOS and CDHDR
    Helpful answer would be rewarded.
    Regards
    Praveen

    Dear Praveen Kumar
    Have you tried with VBAP where sale order details at item level would be stored.
    Moreover, to my knowledge, there won't be any changes as for as pricing is concerned at sale order level but there is at billing level.  Normally, any price increase / decrease would reflect in billing.  So why dont you to table join through SQVI VBAP (for sale order details) and VBRP (for billing details) so that you can compare the selling price in sale order with billing. 
    Thanks
    G. Lakshmipathi

  • Sale Order changes View

    Dear Guru's
    Is there any T-Code for verifying Sale Order changes (Step wise), as in my company Invoices are generated with lot of changes which not matching with Sale Order conditions. So I would like to moniter the Sale Order conditions changes. Kindly help me out.
    Thanks in advance

    Hi
    Sales order changes can be seen in the report only if the changes are made by any user(userid). If your problem is with changes in pricing conditons...then before comparing the sales orders and invoices, I advise you to check the copy controls and the price type used in the copy controls. If the price type selected is to redetermine the pricing, then you should check the validity of the conditon records. Sometimes, the conditon records may be different during sales order creation and invoice creation.
    Thanks,
    Ravi

  • Sale Order change BAPI - Storage loc not updated

    Hi Everybody,
    Iam using "BAPI_SALESORDER_CHANGE", to change the sale order items.
    First iam calling above bapi with switch B, for new pricing & then second time for material change.
    When i change any material number, it is getting updated correctly.
    But the storage location, even though iam passing in the bapi it is not updated, & is blank - updation flag is also passed.
    When i execute sale order change again it is updated - ie, for any material change for first bapi call, storage loc is not updated - for 2nd bapi call storage loc is updation - for same input in both the cases.
    Is there any way to update the storage loc is first call of sales order change bapi.
    Below is the parameters iam passing in bapi :
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT      = LS_SALESDOCUMENT
          ORDER_HEADER_IN    = LT_HEADER_IN
          ORDER_HEADER_INX   = LT_HEADER_X
        TABLES
          RETURN                            = LT_RETURN
          ORDER_ITEM_IN               = LT_ITEMS
          ORDER_ITEM_INX             = LT_ITEM_X
          ORDER_CFGS_REF          = LT_CFGS_REF
          ORDER_CFGS_INST         =  LT_PARTS
          ORDER_CFGS_VALUE     = LT_VALUES
          ORDER_CFGS_BLOB        = LT_CUBLOB
          ORDER_CFGS_VK            = LT_CUVK
          ORDER_CFGS_REFINST   = LT_CUREF
          SCHEDULE_LINES            = LT_SCHEDULE_L
          SCHEDULE_LINESX         = LT_SCHEDULE_X
          ORDER_TEXT                   = LT_TEXT
          CONDITIONS_IN                = LT_CONDITION_L
          CONDITIONS_INX              = LT_CONDITION_X.
    Any help is appreciated.
    Regards,
    Nagarajan.J

    Hi,
    Storage location is updated only when same sale order bapi is called another time with required details.
    rgs,
    Nagarajan J

  • Sales Orders Change Log question

    Hi All,
    I am currently working on a project that involves querying SAP Database to get custom reports via web browser, I've made a lot of advances and most of the site is ready but I'm missing just one item that I hope you could help me.
    Thing is I am working with the Sales Order change log and the problem comes one a user deletes a row. If I go to the change log inside SAP and see the differences a new record will be shown saying that row X was deleted and
    if I go to the database (ADOC and ADO1 tables) I don't have a way to see wich row was deleted.
    My way of doing this is to check for the number of rows on the current state of the sales order and check the same on the previous instance of the SO and see if a line was deleted. Then I would have to check row by row between instances what rows are there and what row is missing and store that info. I think this kind of approach will definitively kill the server.
    I was wondering if some one can give me a hint about how to approach this problem. Does any body know how SAP works on this area?
    I'm working with SAP2005A and SQL Server 2005 Standard Edition.
    Any help is greatly appreciated.
    Thanks!
    Alejandro.-

    Hola Alejandro,
    Thanks for your answer, as I see it I'm doing exactly what you proposed but the problem comes with the following scenarios:
    a.- If I post a new SO with two lines I will have on the ADO1 table two records with the values 0 and 1 for each line respectively but if I delete the item on LineNum = 1 and then I add a new item, this last item will be also created with LineNum value = 1. This is not a complicated thing to do but the problem comes when the user is used to work with SOs with several items at detail level and is used to add and erase lines once in a while and as I see it it's very difficult for me to track those specific changes. There's also the fact that on the Log table a new instance is created every time the user hits the update button regardless if a modification was actually made or not. I mean I would know that a line was deleted or added but I would have to start comparing each field on each line of a sales order with it's previous instance to check what was actually added/deleted and I'm afraid that this may affect the server performance. I know that SAP does this without affecting to much the system resources and that is what I'm trying to find.
    I forgot the other scenario I was considering he he I will post again as soon as I remember it but I hope I'm explaining this ok (I'm not very good at explaining...) If not let me know and I'll try to explain again.
    I'm also working on trying to get another approach to see what comes up...
    Thanks for checking this thread, your answers are helpful.
    Regards.

  • Crystal didn't show the BEx query Attributes description changes/Values

    We experiencing the BEx query attributes/crystal report  issue.
    I create a crystal report using BW- BEx query. Bex query displays the attributes values. But in crystal report side it didn;t show up the values as well as description changes.
    But If I change the display properties of attributes (different from one attribute to another) the crystal report reflect the values. But crystal report didn't show the Attribute description changes , the one i did it in BEx query side.
    Example:
                         Bex has a Masterdata as well as attribute Field1, Field2 etc.. I changed the description like Field_Test1 and Field_Test2. Also I changed the display property for Field_Test1 is Key and text and long , Field_Test2 is Text & LOng text.
    I  got the attribute values is crystal report Xi R2. But crystal didn't reflect the description changes?
    Suggestions Please?

    Post your question to the Business Object Integration Kits forum

  • Calling a Sales Order Change BAPI in a Sales Order Exit

    Functional Requirement:
    While creating a Sales Order with Reference to another Sales Order, on saving the new sales order, change something in the referenced sales order.
    I am trying to achieve the same by doing the following:
    In the standard SAP user exit called during saving the new sales order USEREXIT_SAVE_DOCUMENT I am calling the BAPI BAPI_SALESORDER_CHANGE on the referenced Sales Order.
    However the BAPI is unable to change the other sales order giving an error Enter the document number. I am specifying the Document Number while calling the BAPI, so I know that is not the error.
    I just wish to know whether it is technically possible to call a BAPI to update another Sales Order while we are currently saving one Sales Order.

    Hi Girish,
    If it works correctly when run seperately and you are sure the data passed into the BAPI is exactly the same then it may be something like table locks or similar causing your original problems...
    What about packaging up your working Z program into a custom function module and calling that from within USEREXIT_SAVE_DOCUMENT as a seperate task (IN NEW TASK) and building in a slight delay of say 5 seconds at the start of your code?
    I'll be honest, this isn't an ideal solution but might be sufficient to resolve your issues.  I'd be inclined to see if you could just run your Z program as a background process every 5 minutes or so to capture any changes and perform updates but if this is a no no from your functional people I'm not sure what else to suggest sorry.  I've never personally had to update a document from within the save routine of another document so can't give any advice based on my own experiences sorry.
    Gareth.

  • Add a new field to Co02 ( production order change )

    Hello, I need to add a new field to the transaction Co02. I've found the following customer exit, but don't know which is the proper one. Maybe none of them can meet my requirement. Does anybody has any idea or experience?
    Exit name     Short text
    PPAPO002     Publication of APO Data in Transfer from APO to R/3
    PPAPO003     Production Order R/3->APO: Check if Operation is APO-Relev.
    PPAPO004     Planned Order Conversion from APO: New BOM Explosion?
    PPAPO005     Enh. of Relationships in Proc. Order during Transfer to APO
    PPAPO006     Influencing Initial Supply of Manufacturing Orders
    PPAPO007     Overriding Checkbox Fields for Production Order APO -> R/3
    PPAPO008     Override Order Type for Planned Order Conversion
    PPAPO009     Customer Exit for Addition of Components and Items
    PPAPO010     Filtering Components out of Quantity Propagation
    PPAPO011     Performance-Related Adjustment of Remaining Duration
    PPCO0001     Application development: PP orders
    PPCO0002     Check exit for setting delete mark / deletion indicator
    PPCO0003     Check exit for order changes from sales order
    PPCO0004     Sort and processing exit: Mass processing orders
    PPCO0005     Storage location/backflushing when order is created
    PPCO0006     Enhancement to specify defaults for fields in order header
    PPCO0007     Exit when saving production order
    PPCO0008     Enhancement in the adding and changing of components
    PPCO0009     Enhancement in goods movements for prod. process order
    PPCO0010     Enhancement in make-to-order production - Unit of measure
    PPCO0012     Production Order: Display/Change Order Header Data
    PPCO0013     Change priorities of selection crit. for batch determination
    PPCO0014     Select process orders for external relationships
    PPCO0015     Additional check for document links from BOMs
    PPCO0016     Additional check for document links from master data
    PPCO0017     Additional check for online processing of document links
    PPCO0018     Check for changes to production order header
    PPCO0019     Checks for changes to order operations
    PPCO0020     Process order: Display/change order header data
    PPCO0021     Release Control for Automatic Batch Determination
    PPCO0022     Determination of Production Memo
    PPCO0023     Checks changes to order components
    PPCP0001     P.Cost Planning: Additional Cost Elements for Person
    PPEACT01     Customer Fields at Mode D
    PPECMP01     Customer Fields: CMP Nodes
    PPECMP02     Customer Fields: CMP Variants
    PPEGEN01     General Engineering Node: Customer Fields
    PPERES01     Customer Fields at RES Node
    BTW, if this is impossible, can I rename a field (field name on the screen) of Co02 that I don't need, and add my own values to it?
    Thanks.
    Nuno

    Hi Nuno,
    how did you solve this problem?
    tks

  • BAPI_SALESORDER_SIMULATE can be used in case of Sales Order Change?

    Hi All,
    I'm using FM 'BAPI_SALESORDER_CHANGE' to update sales order.
    It's working fine even multiful item (delete, add, changing item).
    But I need to give simulated information to SAP portal before changing Sales order.
    This 'BAPI_SALESORDER_SIMULATE' FM looks like for creating new Sales Order.
    Is there any other simulation BAPI FM for Sales order change?
    Thanks.

    Hi,
    You can use
    BAPI_ORDER_CHANGE_STATUS_GET   Change status for order                                                  
    BAPI_SALESORDER_CHANGE         Sales Order: Change Sales Order                                          
    Thanks
    Sarada

  • User exit to populate profit center in production order change (CO02)

    Hello,
    The requirement is to populate the profit center in production order change (Tcode CO02). I know the user exit that can populate profitcenter in CO01 but it's not called in CO02. Ther other user exits that I found are for checking but not for changing
    Is there a user exit /BADI that can acheive this requirement?
    Thanks a lot for your advise.
    Joe

    Hi,
    Use the user exit PPCO0007 ,function module EXIT_SAPLCOZV_001
    HEADER_EXP-PRCTR
    Thanks,
    Shailaja Ainala.

  • Authorization at Sales Order Change (Item level)

    Hello Experts,
    Is there any standard authorization object at sales order for adding new items? As I want to restrict some users to add new item lines at sales order change ( VA02 )
    Regards,
    Amr

    Hello,
    How can I use this object V_VBAK_AAT to disallow users to add
    some item lines from VA02 but users can change any other functions
    at the sales order (e.g. update pricing conditions)?
    As I see on this object V_VBAK_AAT, If I revoked ACTVT = 02 'Change',
    It will revoke all change functions from users.
    I think the best solution for your requirment would be to seek the help of Basis folk to create a new User ID which would be having access to Change mode of Sales Order (VA02). Then you can restrict addition of Material line item with the help of Technical consultant by putting up code in following User exit.The logic in the code will be addition of Material line item will be restricted if the User Name is the newly created one...
    1:- MV45AFZB -- USEREXIT_CHECK_VBAP
    2:- MV45AFZZ -- USEREXIT_MOVE_FIELD_TO_VBAP
    3:- MV45AFZZ -- USEREXIT_SAVE_DOCUMENT_PREPARE
    Regards,
    Sarthak
    PS : On information note, you can refer the t-code SU24 to see the standard authorization object for change mode of Sales Order.

  • BAPI for Process order change

    Hi,
    Can any buddy tell me the Bapi used for Process order change
    with following scenarios:
    Quantity change
    Resource change
    Rescheduling
    Control key change
    RM Change
    Recipe change
    TECO
    REVOKE
    Material shortage check
    Best Regards,
    Sheetal.

    Hi,
    BAPI_PROCORD_CREATE for process order create
    BAPI_PROCORD_CHANGE - Change Process Order
    BAPI_PROCORD_CLOSE - Close Process Order
    BAPI_PROCORDCONF_CANCEL for Cancel Process Order
    Confirmation.
    BAPI_PROCORD_COMPLETE_TECH - Complete Technically
    BAPI_PROCORD_RELEASE - Release Process order
    BAPI_PROCORD_SET_DELETION_FLAG - Deletion Flag
    BAPI_PROCORD_REVOKEUSERSTATUS - Cancel User Status
    BAPI_PROCORD_SCHEDULE - Carry Out Scheduling
    pls refer below link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/200dd1cc-589e-2910-98a9-bb2c48b78dfa
    http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
    Regards,
    Sankaran

  • I am trying to find a function module or BAPI for internal order change. I

    I am trying to find a function module or BAPI for internal order change. I did come across a function module ALE_INTERNALORDER_DB_CHANGE which directly updates the internal order using insert statements. Can i use this for internal order change or this is any other Function module for updating the internal order.
    I dont want to use BDC as a option. Please suggest.

    This is possible using the Rotator Component Widget from Infosemantics.com.au but it is only compatible with  SWF output, not HTML5.
    Go to this page and scroll down to the video tutorials about the Rotator Component widget:
    http://www.infosemantics.com.au/adobe-captivate/youtube-video-tutorials

Maybe you are looking for

  • Slow Performance BI Launch Pad - BI 4 SP2 patch 8

    Hi experts, i have this seriuos problem: i have installed BI 4 SP2 patch 8 on windows server 2008 server based on 12 GB Ram but when tree user access at the same time at BI Launch Pad, the server has an lowering performance and to access in BI Launc

  • Create dinamic component

    i want to create as many image component as many are in an array For example private var data:ArrayCollection = new ArrayCollection(); data[0] = "pic0.jpg"; data[1] = "pic1.jpg"; data[2] = "pic2.jpg"; data[3] = "pic3.jpg"; data[4] = "pic4.jpg"; in th

  • New directory permission

    I'm developing a vi that will create a directory and then immediately create a text file inside the directory. The attached vi is what I have so far. I can create the folder, but any vi I use to write to the folder generates error 8 about file permis

  • Table - po release date

    Hi experts, Please tell me the table & field which stores the PO release date best regards, rajneesh gulati

  • HT1386 how to delete all of my photos on my ipad 2

    I have an ipad 2 and am out of memory.  The only thing I can remove are my photos (close to 4K of them) but am having trouble removing them. When I go into edit and check certain photos, the delete button does not allow me to delete.  I need to updat