XSL Looping Query for Short Text PO Attachments

I am using XML Publisher to revise a custom Purchase Order.
This is a sample skeleton layout of the XML data:
<PO_DATA>
<LINES>
     <LINES_ROW>
          <LINE_NUM>1</LINE_NUM>
          <ITEM_DESCRIPTION>blah1.</ITEM_DESCRIPTION>
          <PO_HEADER_ID>535404</PO_HEADER_ID>
          <PO_LINE_ID>879135</PO_LINE_ID>
          <LINE_SHORT_TEXT>
               <LINE_SHORT_TEXT_ROW>
                    <PO_LINE_ID>879135</PO_LINE_ID>
                    <SHORT_TEXT>Attachment for line 1</SHORT_TEXT>
               </LINE_SHORT_TEXT_ROW>
               <LINE_SHORT_TEXT_ROW>
                    <PO_LINE_ID>879135</PO_LINE_ID>
                    <SHORT_TEXT>Another Attachment for line 1</SHORT_TEXT>
               </LINE_SHORT_TEXT_ROW>
               <LINE_SHORT_TEXT_ROW>
                    <PO_LINE_ID>879135</PO_LINE_ID>
                    <SHORT_TEXT>Header Attachment</SHORT_TEXT>
               </LINE_SHORT_TEXT_ROW>
          </LINE_SHORT_TEXT>
     </LINES_ROW>
     <LINES_ROW>
          <LINE_NUM>2</LINE_NUM>
          <ITEM_DESCRIPTION>Blah2</ITEM_DESCRIPTION>
          <PO_HEADER_ID>535404</PO_HEADER_ID>
          <PO_LINE_ID>879136</PO_LINE_ID>
          <LINE_SHORT_TEXT>
               <LINE_SHORT_TEXT_ROW>
                    <PO_LINE_ID>879136</PO_LINE_ID>
                    <SHORT_TEXT>Attachment for line 2</SHORT_TEXT>
               </LINE_SHORT_TEXT_ROW>
               <LINE_SHORT_TEXT_ROW>
                    <PO_LINE_ID>879136</PO_LINE_ID>
                    <SHORT_TEXT>Header Attachment</SHORT_TEXT>
               </LINE_SHORT_TEXT_ROW>
          </LINE_SHORT_TEXT>          
     </LINES_ROW>
</LINES>
</PO_DATA>I would like to be able to list the bold lines (text attachments) on the PO.
I have been able to list the first <SHORT_TEXT> attachment for the 1st line, but then all of the other attachments are not listed, and I can't work out why.
This is the xsl / codey bits from the rtf template:
<xsl:variable name="lineID" select="../../PO_LINE_ID" />  
<xsl:for-each select="/PO_DATA/LINES/LINES_ROW/LINE_SHORT_TEXT/LINE_SHORT_TEXT_ROW/PO_LINE_ID">
<xsl:if test="$lineID = .">
<xsl:variable name="lineID" select="position()" />
<xsl:value-of select="/PO_DATA/LINES/LINES_ROW/LINE_SHORT_TEXT/LINE_SHORT_TEXT_ROW/SHORT_TEXT[$lineID]" />
</xsl:if>
</xsl:for-each>I don't understand why the attachment for line1 (Attachment for line 1) is listed, but then none of the others are. Presumably I'm doing something stupid, but I can't work out what.
edit - I've printed some of the variables out as the loop is incremented - the problem seems to be that the PO_LINE_ID is not incremented for the line in bold above. It just stays the same - hence why it works for the first line, where the PO_LINE_ID matches, and not for any of the other lines. So the problem is how to get that bold line to increment the PO_LINE_ID?Thanks
null

Sorry to labour the point.
When I used this code against the XML:
<xsl:for-each select="/PO_DATA/LINES/LINES_ROW">
<xsl:value-of select="PO_LINE_ID" />
<xsl:for-each select="./LINE_SHORT_TEXT/LINE_SHORT_TEXT_ROW">
<xsl:value-of select="SHORT_TEXT" />
</xsl:for-each></xsl:for-each>
It generated this against every line:
879135
Attachment for line 1
Another Attachment for line 1
Header Attachment
879136
Attachment for line 2
Header Attachment
879137
Attachment for line 3
Header Attachment
This is my reasoning for the code that works:
<xsl:variable name="bobby1" select="../../PO_LINE_ID" />
Make up a variable name, and give it the value of the current lines PO_LINE_ID
<xsl:for-each select="/PO_DATA/LINES/LINES_ROW/LINE_SHORT_TEXT/LINE_SHORT_TEXT_ROW">
Loop through XML structure e.g.:
<LINE_SHORT_TEXT>
     <LINE_SHORT_TEXT_ROW>
          <PO_LINE_ID>879135</PO_LINE_ID>
          <SHORT_TEXT>Attachment for line 1</SHORT_TEXT> 
     </LINE_SHORT_TEXT_ROW>
     <LINE_SHORT_TEXT_ROW>
          <PO_LINE_ID>879135</PO_LINE_ID>
          <SHORT_TEXT>Another Attachment for line 1</SHORT_TEXT> 
     </LINE_SHORT_TEXT_ROW>
     <LINE_SHORT_TEXT_ROW>
          <PO_LINE_ID>879135</PO_LINE_ID>
          <SHORT_TEXT>Header Attachment</SHORT_TEXT> 
     </LINE_SHORT_TEXT_ROW>
</LINE_SHORT_TEXT><xsl:variable name="bobby2" select="PO_LINE_ID" />
And each time through the loop, assign the 'bobby2' variable the value of the PO_LINE_ID.
<xsl:if test="$bobby1=$bobby2">
This condition is neeed - because lets say that the 'PO_LINE_ID' of the current line is 879135, and the value of the 'PO_LINE_ID' listed in the LINE_SHORT_TEXT_ROW is 879136, then I don't want to output the value of the 'SHORT_TEXT' because it doesn't relate to the PO_LINE_ID of the line currently being checked. In your shorter code version, there is no checking to see if the PO_LINE_ID in the LINE_SHORT_TEXT_ROW section matches the parent PO_LINE_ID, so it just lists all LINE_SHORT_TEXT_ROW data, regardless of whether it is related to the parent line or not.
<xsl:value-of select="SHORT_TEXT" />
</xsl:if>
</xsl:for-each>
I'd be happy to email you over the .rtf and .xml file so you can see what I'm talking about.
Thanks again for your time and help with this. As I said, without your initial help with the for-each loop I would not have fixed it.

Similar Messages

  • Query for short keys

    Hi,
    i have used tabbed pane and added short keys for tabs.
    i have setMenoniceAt method for short keys.
    For windows working perfectly. Means when go panel it show's tooltip for short keys and works.but on unix it is not working
    Like short keys for second panel is Alt+A.
    for unix it is not working for alt button but if i used Alt Gr+A then it works.
    are these button different?
    and is it platform dependent?As java is platform independent.
    thank you,
    Arati

    Tell Oracle Forms Services to use resource file fmrpcweb.res
    set parameter term (1) in file formsweb.cfg or (2) Oracle Fusion Middleware Control > forms > Web Configuration > select configuration > advanced > term
    term=C:\Oracle\Middleware\asinst_1\config\FormsComponent\forms\fmrpcweb.res

  • Reg Query For Multiple Text Fields

    Hi all
    I am New to this forum..
    I am developing an application for generating reports.
    In my application i have multiple text fields.
    The user might enter any of the textfields or even enter all the fields.
    In those cases how to use the query when some fields are empty??

    Welcome to the forum.
    It always helps to post a small, simplified example of what it is you're trying to achieve.
    (When posting examples, put the {noformat}{noformat} tag before and after the example, so it will get posted formatted on this forum.)
    In those cases how to use the query when some fields are empty??If your textfields serve as parameters/bind variables for you query, then you could use NVL.
    Something like:select ...
    from some_table
    where col1 = nvl(p_col1, col1)
    and col2 = nvl(p_col2, col2)
    And how about wildcards (the '%' or '_' sign), by the way? Are they allowed as well?
    You also might want to read about this approach:
    http://www.oracle.com/technology/oramag/oracle/09-jul/o49asktom.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Name table of short text for activitycode, object part code,.....

    Hi
    I'm looking for the table or tables in SAP which is the Short Text for Object Part Code,Short Text for Problem Code and Short Text for Activity Code
    Ie: QMMA, QMSM, QMUR are QMUR tables codes But I don't know the table of the Short text for this codes
    Thinks in advance.

    hi,
    If you are using catalogues in notification and looking for short text of each codes, look for them in table QPGT.
    cheers
    Rav

  • PR TO PO "SHORT TEXT" CHANGED IN PO ERROR MSG

    Sir,
    while making po with pr for short text if user changes the PR short text description in PO
    error message should be issued
    ply help
    regards
    amey

    In standard SAP you can set the configuration to issue a message if the PR is different than the PO.
    Examples
    055   Purchase requisition &, item &, not released for ordering
    056   Purchase requisition &, item &, has a different material number
    057   Purchase requisition &, item &, has a different plant
    058   Purchase requisition &, item &, has a different supplying plant
    059   Purchase requisition &, item &, has different account assignment category
    068   Requisition & item & has different purchasing group
    076   Materials of requisition & item & alr. ordered in full
    However, if there is no material master involved and the text is altered from PR to PO during PO creation, there is very little that can be done.  You may be able to check this with some customer exit, but I do not normally use them.  Hopefully someone with customer exit knowledge can advise you in that area.
    Regards

  • Short Text in PO change History

    Hi Experts,
    I am developing a report for changes in PO History.
    I have fetched each and every field except the  the field for short text
    The way to see the PO history change is
    Tcode: ME23n
    Select any item from item details, and follow the path in menu bar Environment-->Item Changes.
    A new window will get open.
    There the third field is of short text description. I want this field. 
    Plz tell me the table nameu2026
    hav a gr8 day ahead..
    Regards,
    Apoorv sharma

    Hi Apoorva,
    To get short text, you have to get the fieldname and tablename and that you can get from CDPOS. After getting that :
    1.Pass Table name and fieldname to DD03L table and get field value of fieldname 'ROLLNAME'.
    2.Pass this value to table DD04T and get field DDTEXT.
    For example, you want to get the short text and Table name has EKPO and fieldname has MENGE. Then once you pass field name MENGE and table name EKPO to table DD03L, then you will get field DD03L-ROLLNAME as BSTMG.With DD03L-ROLLNAME as BSTMG pass to table DD04T and get field DDTEXT, you will get Purchase Order Quantity.
    Thanks & Regards,
    Faheem.

  • Copy Purchase Requisition - Material Short Text

    When creating a new purchase requisition by copying an existing purchase requisition using the document overview in ME51N, the material short text is always copied from material master (makt-MAKTX) instead of the line item (eban-TXZ01) from the source purchase requisition.
    Is there a way to set up copy control for short texts as there is for long texts ?
    using ECC 6.0
    thanks in advance

    Hello Thomas,
    Unfortunately no, when you copy the PR from another PR the System redetermined some  fields from the material master,these fields are :
    Planned Delivery Time,
    Unit of Measure,
    Material Short Text  
    Goods Receipt Processing Time,
    Material Category,
    MRP Controller...
    This system behaviour is intended since many companies more often change the data in the material master rather than copying a purchase requisition that contains changed material data.
    Regards,
    Mauro

  • How to increase maximum input length of a short text object in SE63

    Hi All,
    In se63 translation transport when a object name is provided for short text translation, fields like technical information, modified/ Decision Required and maximum input length are displayed, how can maximum input length of a text can be increased if we want to enter more characters than specified in the maximum input length field.
    Regards,
    Shruthi

    Increase the length of the source field, which you are translating..
    Cheers!
    Mishra

  • Report is by defualt picking up short text for variable selection screen.

    Hi all,
    Reports(WAD/BEX) by default pciks short text of the master data , i want it to pick long text ; any idea ?
    Thanks ,
    Madhav

    Hi Madhav,
    The BEx query setting made in infoobject can be overwritten by the settings made in the query .
    You need to select Long Text in the query for that characteristic.
    This setting will overwrite whatever is made in the info object level and so make will diplay the long text.
    Hope it helps:)
    Regards,
    Asha

  • Pulling Job short text in Ad Hoc query

    Hi All,
    I want to pull the 'short text' field defined in Job into my ad-hoc query. If we select the Output as 'Text only' for Job in IT0001 the output is always the long text e.g. Director of Human Resource. I want to output the short text e.g. DIRHR in my ad hoc query. Both short text and long texts are defined in IT1000 while creating a new Job however the queries from infoset PNPCE only pulls the long text. I can pull the short text in ad hoc query from a OM infoset but for the business requirements we have to use PNPCE. Is there a way to achieve this?
    Thanks for your help.
    Sanghamitra

    This field's text is not available in PNPCE based infosets, you have to create a custom field and write a select statement to fetch the data from table HRP1000. You can find the steps on [how to create custom fields here|/people/shafiq.rehman3/blog/2008/06/16/sap-adhoc-query-sq01-sq02-sq03]:

  • Uploading Short Text Attachments to Assets

    Hi,
    I need to develop a script for batch uploading short text attachments to Assets in Oracle Applications. I googled and find there are a number of API recommended but I'm not sure which one is better/correct, need only 1 of them or a combination of some of them.
    So far I found these API mentioned in blogs and posts:
    1. FND_ATTACHED_DOCUMENTS_PKG.Insert_Row
    2. FND_DOCUMENTS_PKG.Insert_Row
    3. FND_DOCUMENTS_PKG.Insert_tl_row
    4. OE_FND_ATTACHMENTS_PUB.CREATE_SHORT_TEXT_DOCUMENT and OE_FND_ATTACHMENTS_PUB.ADD_ATTACHMENT
    Can anyone share their experience of using API to upload attachments? Thanks a lot!
    Best Regards,
    klai
    Edited by: klai on Apr 18, 2013 10:31 AM
    Edited by: klai on Apr 18, 2013 10:32 AM

    Hussein Sawwan wrote:
    Please see the following links.
    http://oracleappsengineering.blogspot.ca/2010/04/attachments-api-fnddocumentspkg.html
    http://oraclemaniac.com/2012/01/07/attach-concurrent-program-output-to-the-apps-transaction/
    http://garethroberts.blogspot.ca/2007/08/document-attachments-private-stuff.html
    http://imdjkoch.wordpress.com/2010/09/02/attachment-in-oracle-application/
    You may also Google those APIs for a sample code.
    Thanks,
    HusseinThanks Hussein,
    I modified the script from the first link and successfully upload the short text. I just have 1 more question:
    After the upload, the short text is in view only status. Is there any parameter in the script I can change so after the upload the text attachment can be edible?
    Many thanks!
    Regards.
    klai
    Updated:
    I solved it now. I set the x_usage_type to 'O' then I can edit the text. Thanks!
    Edited by: klai on Apr 18, 2013 2:26 PM

  • How to display the 'language code' for language dependent 'Short text' ?

    Hi,
    I am new to BW.
    Can somebody help me with the following issue?
    I have an attribute 'Material category description'  and I chose short text exists and made it language dependent. I had loaded the master data successfully.
    Now I want to know how to check the 'language code' for this material category description. When I display the data, will the language code display by defalult?
    I had checked the text table using SE11
    It displays the following fields over there.
    /BIC/TS1_MCT_DS   [  /BIC/TS1(InfoObject name)  ]
    LANGU
    TXTSH
    I appreciate your help!
    Thank you
    Sekhar

    Dinesh,
    I went to RSD1 -> info-object -> Master Data/text tab. It shows my language selections there (Short text selected, language time dependent etc.) with everything grayed out.
    In SE16, I could display the data in the following format.
    /BIC/ST_PRID                TXTSH                 TXTMD
    P01                                   umbrella                 rainyday
    P02                                  tent                         waterproof
    etc.
    I want to see the 'language code' as one of the columns in this table.
    Can you help me do that?
    Thank you,
    Sekhar

  • Finding short text description of Fixed values for value range for domain

    Hi,
    When I got to Dictionary: Dispaly Domain and click on tab value range; I get the template showing Fix. Val and its associated short text.
    I want to fetch the short text for a particular fix. val for a domain.
    How can I do that ? What table can I use it ? Or do I need to use some function module ?
    Lets say I want to fetch the short text for a given Fix val. for domain VBELN.
    Please help me out.

    Hi,
    You can use Function Module 'FM_DOMAINVALUE_CHECK' to get the fixed values of any domain.
    Regards,
    Atanu

  • Function Module or BAPI to update Short text  for sales order item(vl02n)

    Hi All,
    I need to update the Short text for sales order item in vl02n transaction from an internal table with Delivery number and other relevant details .
    Does any body know any Function Module or BAPI which can accomplish this purpose .
    Or else writing BDC is the only option I have got ? .
    Please clarify .
    Thanking you in advance .
    With Regards,
    Suriya .

    Hi
    You can try using BAPI_SALESORDER_CHANGE if you want to change sales order
    Regards
    MD

  • How to display header title for 0MATERIAL texts in the query output?

    Dear Bwers,
    I have a requirement where i need to display headers titles for 0MATERIAL texts in the query output. (example "Material description"). Any ideas on how to do this?
    Thanks
    Raj

    Kamal,
    Its is as below:
    <b>Vendor</b>    <b>Vendor Name</b>
    1001 ---            Bright Industries
    1002 ---            Glow Industries
    I want to display the header title "Vendor Name" as the  title in the column instead of displaying the text without any header title.
    Thanks
    Raj
    Message was edited by:
            Raj Singh
    Message was edited by:
            Raj Singh

Maybe you are looking for

  • Error while executing the WorkBook

    Hi, While executing WorkBook, I am facing an error "A critical program error has occured. The program will now terminate.Please refer to the trace for further information". When I check in the trace, the error description is "System.NullReferenceExce

  • IS there any way to pass a value in the view as a variable

    Hi I have 2 views and 1 view on top of them that calls the 2 views e.g. View1 select ename, deptno, date from emp; View2 select sal, date from salary; view3 select v1.ename, v1.deptno, v2.sal from view1, view2 where date = SOME VARIABLE; sql query Se

  • How do you find the right replacement for a hard drive

    i have a 2007 macbook and the hard drive just went out and i want to find a new one that would be combatible

  • Problem executing RMI tutorial "Getting Started Using RMI"

    I am trying to execute the RMI tutorial located at http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html I use JDK 1.3.1, and Windows XP Pro. I follow the info on the URL http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html And all i

  • Storage System in Data Management System (DMS)

    Hi Gurus, I am working with defining storage system where I have named the content respository as DMS_C2 , storage type as R/3 database, Version as 0045. I would like to know if this storage system would be used to save my documents let say my CAD fi