dynamic way to create record with pipe delimited

Hi guys,
I got one program currently doing this to create record in a flat txt file
APPEND WA_OUTPUT TO GT_OUTPUT.
Now, client comes back and says they want pipe delimiter ( | ) between each field of record.
So I know I can do something like this.
CONCATENATE WA_OUTPUT-REC1 WA_OUTPUT-REC2 WA_OUTPUT-REC3.....INTO GT_OUTPUT-LINE SEPERATED BY "PIPE".
The thing is, wa_output structure has like hundreds of field, and I do not want to do a long concatenate syntax.
Is there anyway to go around this situation?
Thanks in advance!
BB

Ok Alejiandro and Keshav,
Let me get this straight, sorry in advance if I get it wrong.
My work area in my program always has the first field populated since it's record type value and it's hard-coded. I would assume that it would be safe to check if lv_string is initial in the DO loop as is in the original code. What do you think?
In case my work area first  field is blank, I did this below?
ASSIGN COMPONENT sy-index OF STRUCTURE ls_kna1 TO <lv_field>.
    IF sy-subrc EQ 0.
      " add record to string, if it's the first field don't use separator
      IF <lv_field> IS INITIAL.
        WRITE <lv_field> TO lv_string_field.
        CONCATENATE lv_string '|' INTO lv_string.
      elseIF lv_string IS INITIAL.
        WRITE <lv_field> TO lv_string_field.
        lv_string = lv_string_field.
      elseIF lv_string(1) = '|' and sy-index = 2.
        WRITE <lv_field> TO lv_string_field.
        CONCATENATE lv_string lv_string_field INTO lv_string.
      ELSE.
        WRITE <lv_field> TO lv_string_field.
        CONCATENATE lv_string '|' lv_string_field INTO lv_string.
      ENDIF.
    ELSE.
      " add string to our table and leave the DO-ENDDO-loop for this KNA1 record
      APPEND lv_string TO lt_string.
      EXIT.
    ENDIF.
I tested it, and it should work if the first field of the record is blank.
Thanks,
Edited by: Ben Boman on Aug 12, 2010 1:06 AM
Edited by: Ben Boman on Aug 12, 2010 1:07 AM

Similar Messages

  • How to create schema for Header and Footer with pipe delimiter file BPEL11g

    Hi all,
    I have issule creating Schema for Header and Footer with body file .The file format is Pipe delimiter.The following format below like is...
    Softeware Components:File Adapter(Read) 11g,
    1|1211|000|577|5444
    1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
    1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
    1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
    1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
    1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
    1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
    1|4544|000|yted
    I hope get the sollution for this from this Forum..Please help me out..Thankyou.

    You mean how many rows or columns..?
    If coloumns means 5 and rows only one(1).

  • How to create Schema Header and footer with Pipe delimiter file..?

    Hi all,
    I have issue with creating Schema Header and footer with body file ..The file format is Pipe delimiter.. The follwing file below like is...
    Adapters:File Adapter(Read)-11g.
    1|000|2025|SDFG|54787
    1|2055|244|9566|000|000|044|2577|361147|45554|wweqw|52555|564|000|647|464
    1|2027|344|4566|000|000|044|8577|361147|45554|wweqw|82555|564|000|647|844
    1|2024|444|6566|000|000|044|9577|361147|45554|wweqw|12555|564|000|647|544
    1|2023|544|8566|000|000|044|5577|361147|45554|wweqw|52555|564|000|647|442
    1|2022|644|3566|000|000|044|7577|361147|45554|wweqw|02555|564|000|647|448
    1|0000|546|25544|454
    If you have sollution for this, please help me out..Thank you.

    You mean how many rows or columns..?
    If coloumns means 5 and rows only one(1).

  • Report script. with pipe delimited?

    hi
    when i create script to extract some selective data with tab delimited it was ok
    but how abt pipe delimited isit possible ?
    i tried checking in oracle technical help but no use
    for example
    Account | Year | Period | instead of Account Year Period ( present script)
    cheers

    i really appreciate ur help glenn
    but i have this kind of issue
    {Tabdelimited Rowrepeat no indentgen outmbrnames
    supemptyrows supmissingrows supfeed sup commas supheading}
    { decimal 8 } {indentGen -5}
    <row("year","period","scenario","Account".....blah blah
    and i get output like this
    jan FY09 Actual SG cust1
    jan FY09 Actual UK
    jan FY09 Actual IND
    But iam looking for this
    JKSG | 1 | FY09 | Actual | SG
    JKUK | 2 | FY09 | Actual | UK
    JKIND | 3 | Fy09 | Actual | IND
    Tab delimited = pipe delimited
    here i want to join Jk with calculating legal entity but what i wonder is Jk is not present in OUtline how can i keep in <ROW(....)
    Can possible?
    Edited by: user8800516 on Mar 9, 2010 12:02 AM

  • Need help knowing best way to create record

    What is the best way to create a new record... I have a form pulling info from about 20 tables. When the user wants to create a new record, I want a new form to open and allow them to select the values based on the foreign key fields so it makes more sense than just random numbers.
    The problem I'm having is knowing when and how to insert. Should the "new record" form be it's own database block that inserts from within it. (but then when they go back to the original form they must requery to see the new value.) Or what about copying each field back to the original form. I'm new to forms and would appreciate any insight and tips.

    would a wire like this help me?
    I doubt it. You want FireWire.
    Take look at the Canopus ADVC300. It comes with a nice Macintosh application that works flawlessly with iMovie 06.
    http://www.canopus.com/products/ADVC300/index.php
    Yes, it does cost more but it works.

  • Error in sharepoint external list while creating record with same id (this id is primary key)

    Hi,
    I have created one external content type in sharepoint designer to insert/update/delete table data.
    This table contains Primary key constraint.
    Then I have added this external content type to Sharepoint out of box List.
    Insert/Update/Delete is working fine. But when I am trying to insert record with the same id which is already exist in table, page crashed and its giving me following error:
    “Violation of PRIMARY KEY constraint 'PK_tbl_Accounts'. Cannot insert duplicate key in object 'dbo.tbl_Accounts'.
    The duplicate key value is (1). The statement has been terminated.”
    So I want to handle this exception. Can we show any popup message to hide this error?
    Thanks & Regards
    Rajni

    Avoid entering of primary from form  if possible.
    if not try to customize the new form with infopath and place your custom logic there.
    http://lightningtools.com/uncategorized/modifying-external-list-forms-with-infopath-2010/
    http://salnikan.wordpress.com/2011/07/26/prevention-of-duplicate-entries-based-on-two-or-more-columns-in-a-sharepoint-list/
    Bala

  • Best way to create frame with stroke around a paragraph?

    What is the best way to create a frame with a stroke around text? I
    always thought it was with an inline frame, but now I see that trying to
    put the cursor in the text is very difficult because the frame blocks
    the cursor. Is there a better way?

    Thanks guys.
    What I was doing was putting the anchored frame in an empty paragraph
    above the paragraph that needed the box. The problem was when I tried to
    put the cursor in the text the anchored frame blocked it. Why is an
    anchored frame on top of text?
    The easy solution would be to cut/paste the text into the anchored frame
    (which would be similar to Ole's single cell table idea). I didn't want
    to go this route for two reasons:
    1) I don't want to cut and paste every paragraph.
    2) I didn't want the story to be broken up. I wanted it to be one long
    flow of text. It makes tings easier just in case the paragraphs have to
    break across two pages.
    Jongware's underline/strikethrough idea is another good one, but I don't
    like the idea of putting in all those extra characters.
    What I ended up doing was using paragraph rules. I set the rule above to
    1pt larger on all sides than the rule below so it looked like a box with
    a stroke. Of course, the problem with paragraph rules is getting it the
    right size. I wrote a script that calculates the size of the text and
    sets the rule size the correct amount.
    Of course this still has its problems when the boxes need to break pages...

  • Create record with manual guid / primary key

    Hi All,
    Is this possible to create record in some entity in dynamics crm with set manual id / primary key / guid?
    like this:
    Entity entity = new Entity("new_test");
          entity.Attributes["new_testid"] = new Guid("688008C8-F95D-4158-BAB2-A3F695D7BEEF");
          entity.Attributes["trs_name"] = "AAAAA";
          organizationservice.Create(entity);
    is there any impact if I do that?
    please advise.
    thanks

    I have try it my development server, and it's work
    actually, this question for my requirement that need do integrate between another system to CRM, which the another system has guid as their PK (primary key) and they push their record to CRM using CRM web service and put their PK / guid value as Id in CRM's
    entity that they pushed.
    but, I have consult with microsoft support with this technique and I don't want get trouble in later time, and they said this is not recommended from microsoft, even it work as I said before.
    thanks.

  • Any way to create tablespace with name greater than 30 characters ?

    Is there any way to create tablespace greater than 30 characters on solaris 10 and Oracle 10g. Any way ? because i have no other option.

    desc dba_tablespaces
    So clearly the answer is NO.
    Tablespace names are invisible and irrelevant. Why the question?

  • Fastest way to export to a pipe-delimited text file

    I'm using Oracle 9i and need to export a table that has 150 million rows into a text file (or multiple text files based on a query that divides the table). I'd like it to be pipe-delimited and without quotes around strings.
    How can this be done so that it runs fast? Keep in mind, I'm kind of a newbie.

    I don't know what the fastest method would be but I would put quite a bit of money on it not being the Oracle SQL Developer tool, which is the subject of this forum.

  • Best way to create output with only topics that are not finalized

    I'm nearing the end of a project and I need to isolate the topics that still have questions. I keep trying things, but nothing gives me what I need. Any suggestions? Here's what I tried.
    I'm using RoboHelp 9 (RH9).
    Status
    I can get a report of the topic names and their status using Tools > Reports > Topic Properties and then setting the Options to include only Topic Status, but this isn't useful; that gives me a list of 396 topics, in alphabetical order.
    For each topic, you end up with 3 lines. For example:
    Adding Customers - Adding_Customers.htm
    Status:
    Status: Ready for Review
    I saved the report as TXT and opened it in Word and did a global replace of Status:^p (that is, Status, colon, new line) and then Status, colon, tab. That reduced it to 2 lines for each topic:
    Adding Customers - Adding_Customers.htm
    Ready for Review
    So that's still not very useful. I would have to write a macro or something in either the Word file or once I got it into Excel to concatentate those two lines.
    And even then, I could sort the data and get rid of the lines that show Complete (using an Excel formula), but how would I print out just those topics? If there are only a few, that's no problem, but there are at least 30. (Things changed and topics changed and now some need re-review, and some still have questions.)  Could I make an index out of those lines? No, that would involve a lot of work to write out the XML.
    Okay, so I tried another approach...
    Conditional Text
    I created a duplicate Table of Contents and applied my Questions condition to three topics. I then created a Printed Doc output and specified an Advanced condition saying to include only Questions. That gave me more than the three topics, but not all of the topics. The help says that you can use an Advanced Conditional Build Tag Expressions, and that if you want just those topics with a specific tag ("All topics to which one tag has been applied"), just include that tag.
    BUT it also says: "Topics and topic text to which you have applied no conditional build tag are included in the output."
    So, if I want only those topics to which I've applied a TOC condition of Questions, I need to create another condtion (for example, DONE), and apply that to all the topics that I don't want to print.
    So, assuming I have 30 topics with the condition Questions, I would have to apply my new DONE condition to 366 topics. Yes, I know you can apply a tag to more than one at a time, but I would be wary of doing more than 5-10 at once.
    Still, that looks like the best solution so far. I'm going to back up my project and then start doing that. In the meantime, does anyone have any other way of doing it?
    I'm using RoboHelp 9 (RH9).

    First, no reason to be concerned about applying a tag in the topic list to many topics.
    Before my time the company had an author who wrote in a topic "This is ****" intending to return to it later. He did when a customer phoned asking if the statement was true!
    What I have done is institute a simple method that also helps with reviewing. We add three hash marks ### to any topic at the top or at the point where it is incomplete. We do that using a character style rather than a paragraph so that the text can be within a paragraph. The style is called AuthorComment and we also apply a tag called AuthorComment. Both have a vivid colour applied. EXAMPLE ### Let me know if you have a problem with this.
    When we generate for internal review, we leave that stuff in as it grabs the attention of reviewers so they respond to the comment / question.
    When we generate for external use we add the tag to the build expression but we also do a search of all topics for ### using a third party find and replace tool. TextCrawler for example.
    It's simple and it works beautifully.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Create record with 1:N relationship based on condition

    Hi SDNers,
    Need your suggestions..
    The below is the issue:
    I have fields with values:
    Field_A    I  Field_B
    100           I       P
    100           I       Q
    100           I       R
    200           I       X
    200           I       Y
    200           I       Z
    If in Field_A I select the value 100 , for Field_B .. i shud have the option to select only P or Q or R .
    Similarly, in Field_A if  I select the value 200 , for Field_B .. i shud have the option to select only X or Y or Z .
    I have already tried the below:
    1. i have tried it with Nested lookup. The reason it does not work in this case is, we see it as a combination. For ex:
       100;P
       100;Q etc..
    2. If i am using Field_A as Non-Qualifier and Field_B as Qualifier and imported the data. So, next time i create a record, selecting    Field_A as 100 , in Field_B .. all the values are displayed.. i.e P,Q,R,X,Y,Z ... whereas we want only P, Q, R to be displayed.
    Please suggest.
    Thanks,
    Priti

    Hi,
    As per you requirement, it seems like a Field in main table is look up to Flat table which contains Two fields say Field A and Field B both as display fields. Field A has two values 100 and 200 only and Field B has six values P, Q, R, X, Y, Z.
    You want whenever you select Field A as 100 then only P, Q, R comes.
    I firmly believe that this is not achievable as per MDM capability using Fields. But you can run Validations to cross check that if it is 100 then correspondingly value of Field B should be from P, Q and R only. IIy, for 200 it should be from X, Y and Z.
    Alternatively, I can suggest you to go for Taxonomy. Create 2 categories say category name Field100 and Field200.
    Field100 category is linked with attribute 100 which has values P, Q and R.
    Field200 category is linked with attribute 200 which has values X, Y and Z.
    So whenever you select category Field100 associated linked attribute 100 will come and whose values can be populated using P, Q and R only.
    lly, when you select category Field200 associated linked attribute 200 will come and can be populated using X,Y and Z only. Whenever for a record in main table you select this category field as Field100 and Field200 correspondingly linked Attribute comes with Predefined set of legal values.
    Thanks and Regards,
    Mandeep Saini

  • Is there any way to create smartlists with MPAA ratings?

    The only "ratings" field available seems to be the silly star rating field (which I don't use). I want to create smart playlists that use rating (like G or PG for my kids).
    I can't find a way to do this - does anyone know a good work-around?
    Thanks in advance,

    You could use one of the other fields such as Grouping. Put the rating in that field. You would then be able to sort on that field or use the value in a smart playlist.
    Comments is also an option.

  • Best way to create button with multiple lines of display text

    now i am using html to do it.
    for example: new button("<html> ABC<br> DEF");
    but this is ok if there is only 2 lines of text. however if there is 3 or more lines of text, the text looks very bad and some case it hides some part of the text.
    also its display also depends on the version of sdk.
    Is there a better way to do it ?
    Thanks

    now i am using html to do it.
    for example: new button("<html> ABC<br> DEF");
    but this is ok if there is only 2 lines of text.
    however if there is 3 or more lines of text, the text
    looks very bad and some case it hides some part of
    the text.
    also its display also depends on the version of sdk.
    Is there a better way to do it ?Alternatives may be:
    (1)Use a layout manager that doesn't honor component's preferred
    size, such as GridLayout. Use a BIG window.
    (2)Override button's getPreferredSize() method. Make it thick.

  • Any way to create procedure wither procedure?

    create or replace procedure P1
    IS
    begin
    procedure p1_child
    IS
    begin null end;
    null;
    end;
    /

    SQL> create or replace
      2  procedure outer_proc is
      3
      4     procedure inner_proc is
      5     begin
      6        dbms_output.put_line('inner');
      7     end;
      8
      9  begin
    10
    11     dbms_output.put_line('outer');
    12     inner_proc;
    13
    14  end;
    15  /
    Procedure created.
    SQL> exec outer_proc;
    outer
    inner
    PL/SQL procedure successfully completed.

Maybe you are looking for

  • FILE NOT FOUND ERROR WHILE INSTALLING ORACLE EM GRID CONTROL 10.2.0.1

    FILE NOT FOUND ERROR ON FILES: generalstup, seedstup during the setup phase and when i click ignore from a list of cancel, retry and ignore it moves to the configuration phase and rapidly moves from 63% to 100% and gives the error OUI-10133 invalid s

  • Error in Opening Document - error messgae as "First Define Numbering Series

    Dear All With new financial year starting one of our customer define new posting periods (12 periods for each month) and assigned one period indicator for all the periods. They also defined some user groups and assigned this groups to document number

  • Array pointer in array

    Can anybody tell me how to create pointers in an array pointing to other arrays?

  • Customizing the CAD-Desktop

    Hello Guru, I just want to ask you, if it's possible to integrate a button on the CAD-Desktop or at least in the transaction mm02, cl02 ... Because I'm gone need to call an external program using some kind of server path, but to do this I need some i

  • Less Than 25K Songs in Library in Total Yet Match thinks I have More..

    I have just under 25,000 total songs in my Music Library after cleaning it up prior to doing iTunes Match.  Now when I Update Match it says the recent additions put me over the 25K limit.  I'm confused.  Originally I had over 30K songs (still less th