Open and Close Dataset problem

Hi All,
I am facing a weird problem in transferring data to application server.
I have used Open dataset to write my file in text format to the application server.
Now everything works fine when small amount of data is there.When the number of records increases and when it takes lot of time , the format of the text file is completely distorted.
I have used tab as the delimiter. Please suggest me some solution for this.
Is this due to the time taken?
Regards.

Hi
in the above program , when i had created 1st i had same problem
then i had worte the logic likethis
parameter: file_nm type localfile.
types : begin of it_tab1,
        f1(20),
        f2(40),
        f3(20),
       end of it_tab1.
data : it_tab type table of ALSMEX_TABLINE with header line,
       file type rlgrap-filename.
data : it_tab2 type it_tab1 occurs 1,
       wa_tab2 type it_tab1,
       w_message(100)  TYPE c.
at selection-screen on value-request for file_nm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
  PROGRAM_NAME        = SYST-REPID
  DYNPRO_NUMBER       = SYST-DYNNR
  FIELD_NAME          = ' '
   STATIC              = 'X'
  MASK                = ' '
  CHANGING
   file_name           = file_nm
EXCEPTIONS
   MASK_TOO_LONG       = 1
   OTHERS              = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
refresh it_tab2[].clear wa_tab2.
file = file_nm.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                      = file
    i_begin_col                   = '1'
    i_begin_row                   =  '1'
    i_end_col                     = '10'
    i_end_row                     = '35'
  tables
    intern                        = it_tab
EXCEPTIONS
   INCONSISTENT_PARAMETERS       = 1
   UPLOAD_OLE                    = 2
   OTHERS                        = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>loop at it_tab.
  case it_tab-col.
   when '002'.
    wa_tab2-f1 = it_tab-value.
   when '004'.
    wa_tab2-f2 = it_tab-value.
  when '008'.
    wa_tab2-f3 = it_tab-value.
endcase.
at end of row.
  append wa_tab2 to it_tab2.
clear wa_tab2.
  endat.
endloop.</b>
data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
  IF sy-subrc NE 0.
    MESSAGE e001(zsd_mes).
    EXIT.
  ELSE.
*---Data is downloaded to the application server file path
    LOOP AT it_tab2 INTO wa_tab2.
      TRANSFER wa_tab2 TO p_file.
    ENDLOOP.
  ENDIF.
*--Close the Application server file (Mandatory).
  CLOSE DATASET p_file.
loop at it_tab2 into wa_tab2.
  write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
endloop.
with the bold letters above
i had wrote that logic for that
reward if usefull

Similar Messages

  • Open/Transfer/close Dataset and delimiting

    Hi people hi have a situation regarding open/transfer/close dataset and delimits.
    I have a submit program that calls any other via variants. It works fine with using list_to_memory, convert to ascii, and open dataset. I can download the report in excel format to an application server.
    Problem is that the reports arent delimited properly in the excel report. Usually there is a vertial line "|" placed after each column and it would be eazy to mauiplate it during viewing the actual file.
    However I want this done automatically. My question is, is there a way to delimit the list before/during using open/transfer/close dataset?
    My solution before was to convert the vertical lines to a comma and just save the file as a CSV file. Problem here is the data could be affected as comma is being used normally. So the excel report would get messed up.
    Hope I get some help soon. Thanks guys and good day.

    Lets say you have fields A, B, C and D to be transfered to the dataset. You can use the below logic.
    concatenate a b c d into l_text separated by '$'.
    transfer l_text to dsn.
    Now, when you open the text file in excel it would ask you whether the file is delimeted or fixed width...if you select delimited..in the next screen you would be able to select the delimiter.
    Regards
    Anurag

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • Hello  I have a problem with Mac Pro, iPhoto does not want to stay open and close as I can figure this out?  thanks

    Hello  I have a problem with Mac Pro, iPhoto does not want to stay open and close as I can figure this out?  thanks

    Refer below link once
    App doesn’t open | Progress wheel spins continually

  • Open dataset and close dataset

    Hi
    I need to write log file in fileshare.
    I am using the following FM to create the file.
    Z_FILE_OPEN_OUT_UNICODE'
    I have following qns
    1. do i need to use open dataset and close dataset stmts, even I create the files with the FM?

    Hi,
    you can fill in the name of the FM in transaction SE37, then click 'Display' and look at the source code and the 'Tables' tab.
    It's a custom build FM, so you might have to look at the import parameters it needs... ( Tab 'Import' and 'Tables' ).
    To answer your question, as the name of the FM suggests it will write the file for you, so no open/close dataset. Please doublecheck tab 'Source code' and you might find these statements there...
    hope that helps,
    Rolf

  • I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch.

    I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch, it Should be having so much problems. Thanks for your help.
    iPad, iOS 7.0.4

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Find open and close smart quotes

    Dear scripter,
    Here I am trying find whether all the open double smart quotes(") are closed with close double smart quotes("). Here is my small work to find how many open and close quotes.
    myopenqu=app.activeDocument.search("^{", false, false, "^{");
    myclosequ=app.activeDocument.search("^}", false, false, "^}");
    myopenqulength = myopenqu.length;
    myclosequlength = myclosequ.length;
    if(myopenqulength!=myclosequlength)
    alert("Quotes not matched\n"+ myopenqulength +" Open quotes found\n" + myclosequlength +" Close quotes found")
    It works well, the script just alert if I have 25 open quotes and 23 close quotes
    Quotes not matched
    25 Open quotes found
    23 close quotes found
    Now I want to find the quote set where the 24,25th set close quotes are missing?
    Is there any way to find the misisng quotes
    Thanks in advance
    regards
    a r u l
    vpublish.net

    You'd have to look for unmatched quotes, in this case two cases of two open quotes without an intervening closed quote. This is difficult to script in CS2 because it doesn't have GREP natively and because of footnote problems. In CS3/4 it should be possible. But even then it will work only if you don't have quotes within quotes.
    Peter

  • My apps dance open and close on their own in my IPad 2 what can be the prob? I have already restored

    I got the charger flex or pin changed and now the apps dance on the screen, photos open and zoom in, then out, the other apps open and close. I have already restored the device with Itunes and prob is still there. What can be the problem? Any suggestion will be welcome. Thank you

    THANKS for your prompt reply  Bluetooth is off in my laptop and IPhone.. and in fact the reset is the only thing that can make it back to normal. But for a lil while. I wonder if it is the touch, or the home botton... both things are very expensive to replace, so I wouldn't like to spend $$ and continue having the prob.....

  • Apps in iPad 1 open and close quickly

    Hello,
    My mother has an iPad 1 (she has her own itunes account) but had never synced and updated her iPad with a computer (pc or mac).
    Today I had to use it and connected to my iTunes on the pc but only to update her iOS on the iPad wich was 3.x. After the whole update process (wich went normal and smooth) almost every app that I woud open, closed imeadtly. I say ALMOST because, a few from the default apps (like Mail, Photos, Safari, System, etc) opens normaly. Though iBooks doesnt and all 3rd party apps also doesnt open normaly.
    I've tryed to reboot it one more time thinking it was some kind of strange bug or something but didn't work. The apps continue to open and close almost instantly.
    I'd like to know if anyone had a similar problem and how they solved it or if my only resource is to roll back to the iPad backup made in my pc.
    Thanks in advance.
    Luis Felipe

    Try double-tapping the home button, then holding the app icon until the minus sign appears. Touch the minus sign to kill all the apps. Then restart the iPad with the home/power buttons (hold for ten seconds) until the apple appears.

  • Open and Close Front Panel of SubVI

    Hi all,
    Running LabVIEW 2011 on Windows 7 x64.  I am trying to get a subVI front panel to open from my main FP with the press of a button and then close with a button press in the subVI.  Here is the piece from my main FP that calls the VI and opens the FP 
    Plots is defined in another loop and all of the loops are in a flat sequence.  I did it this way because I want it to start with the first press and not stop my main loop from running.  I have moved the item in the left loop around a lot so I'm not sure if I can run that in the same loop as the event or not.  Either way opening the VI seems to work fine.
    The problem shows up when trying to close the subVI for the SECOND time.  The code is here:
    As I said, the first time I open and close the VI everything works as I expect it should.  I am then able to open it again but now the "blank button" doesn't function and I can't close the window or even open the block diagram to probe anything.  I have been trying to figure this out for awhile, any insite would be greatly appreciated!
    Thanks
    Solved!
    Go to Solution.

    Its good that you found the bug.
    This code may serve as a way for you to compare notes.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Open and close posting period authorization control TCODE: S_ALR_87003642

    HI All,
    Is there any chance to control the user to open and close another company code posting period variant in TCODE: S_ALR_87003642.
    In our system we are using the same client for different countries. So user can able to change the other country company code posting periods.
    We would like to control either on the country (or) organizational unit(company code) (or) posting period variant so that user can only open/close  their country / company code posting periods.
    Our present authorization role for open and close posting period contain the auth.Obj. : S_TABU_DIS.
    Please share your knowledge if you come across this problem..
    Thanks in advance..

    Hey Sandhya,
    Congratz, this can be done using linbe item authorization with the object S_TABU_LIN.
    Field ORG_CRIT - Value 02
    Field ORG_FIeld1 - Value ZT001B
    We have successfully done it in our client.
    You need to contact your BASIS consultant for this.
    Thanks,
    Nitish

  • Open and Close OnScreen Keyboard while focus gain on JTextField

    Hi
    I have a Jtextfield when ever I click on textfield I want to open OSK(On Screen Keyboard) of Windows 8 OS and windows 7.
    I tried in below mentioned way to open and close in focus listener focusGained() and focusLost() but it is not working. could some body do needful.
    Opening OSK:
    builder = new ProcessBuilder("cmd /c " + sysroot + " /System32/osk.exe");
    Closing Osk:
    Runtime.getRuntime().exec("taskkill /f /im osk.exe");

    You need to start() the ProcessBuilder and you need to split the command like this:
    builder  = new ProcessBuilder("cmd", "/c", sysroot + " /System32/osk.exe");
    builder.start();
    And naturally you should wrap the call in a new Thread or use an ExecutorService to avoid EDT problems.

  • Project Takes FOREVER to Open and Close

    We have a large RoboHTML project that outputs to a WebHelp
    system. The version of RoboHelp is X 5, possibly a version after
    that, I think - but dated 2004. Two of us share this project, but
    we don't use Version Control. The size of the project is about 45
    MB, and includes several subfolders of topic HTMs. My coworker has
    the same issues, possibly a bit faster than what I have, but still
    excessive Open and Close Project times.
    It takes an extremely long time to open, like about 10
    minutes or more. When I select to Close Project, the CPU Usage
    shown in Task Manager is up to 100 % and stays there, so the
    closing process is maxed out and frozen, and obviously isn't happy.
    Even when I close other applications, the project can take over 30
    minutes to close - no error messages, just hourglassing. While I'm
    using the project, it doesn't max out. There have been times when,
    as much as I hated to do it, I had to do an End Task with Task
    Manager because the project wasn't closing (and I had to leave).
    Also, note that the CPD file of this project is over 4 MB. I
    just was reading about deleting the CPD file, so I plan on doing
    that.
    I'm not sure of any more details I can provide. While I'm
    working on the project, there are usually no freezes or response
    time problems. Just the extremely long Open Project time - and even
    longer Close Project time.
    I would so appreciate any solutions or ideas. Thanks!!!
    Susan

    Update - I deleted the CPD file, and it opened a lot faster!!
    It also closed in a reasonable amount of time - however, I did not
    work in the project for a while before I closed it. So we'll see
    what happens when I close it at the end of the day.
    So, the deletion of the CPD file may have solved the problem.
    However, if anyone wants to offer feedback on this possible
    solution, I would appreciate it.
    Thanks!
    Susan

  • [bdb bug]repeatly open and close db may cause memory leak

    my test code is very simple :
    char *filename = "xxx.db";
    char *dbname = "xxx";
    for( ; ;)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    I try to run my test program for a long time opening and closing db repeatly, then use the PS command and find the RSS is increasing slowly:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 466 588 4999 980 0.3 -bash
    2615 pts/0 R 0:01 588 2 5141 2500 0.9 ./test
    after a few minutes:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 473 588 4999 976 0.3 -bash
    2615 pts/0 R 30:02 689 2 156561 117892 46.2 ./test
    I had read bdb's source code before, so i tried to debug it for about a week and found something like a bug:
    If open a db with both filename and dbname, bdb will open a db handle for master db and a db handle for subdb,
    both of the two handle will get an fileid by a internal api called __dbreg_get_id, however, just the subdb's id will be
    return to bdb's log region by calling __dbreg_pop_id. It leads to a id leak if I tried to open and close the db
    repeatly, as a result, __dbreg_add_dbentry will call realloc repeatly to enlarge the dbentry area, this seens to be
    the reason for RSS increasing.
    Is it not a BUG?
    sorry for my pool english :)
    Edited by: user9222236 on 2010-2-25 下午10:38

    I have tested my program using Oracle Berkeley DB release 4.8.26 and 4.7.25 in redhat 9.0 (Kernel 2.4.20-8smp on an i686) and AIX Version 5.
    The problem is easy to be reproduced by calling the open method of db handle with both filename and dbname being specified and calling the close method.
    My program is very simple:
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/time.h>
    #include "db.h"
    int main(int argc, char * argv[])
    int ret, count;
    DB_ENV *dbenvp;
    char * filename = "test.dbf";
    char * dbname = "test";
    db_env_create(&dbenvp, 0);
    dbenvp->open(dbenvp, "/home/bdb/code/test/env",DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_INIT_MPOOL, 0);
    for(count = 0 ; count < 10000000 ; count++)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    dbenvp->close(dbenvp, 0);
    return 0;
    DB_CONFIG is like below:
    set_cachesize 0 20000 0
    set_flags db_auto_commit
    set_flags db_txn_nosync
    set_flags db_log_inmemory
    set_lk_detect db_lock_minlocks
    Edited by: user9222236 on 2010-2-28 下午5:42
    Edited by: user9222236 on 2010-2-28 下午5:45

  • Software issue iphone 4s:Apps open and close by themselves almost as if someone is pressing the buttons, anyone have this issue?

    Recieved my 3rd iphone  4s due to battery issues and got another dud. While in use, the apps  will open and close on there own, email will get deleted while I'm reading them or archived. while looking through my contacts directory, the phone will select a contact creating an outbound call. This is frustrating. Any one else have this issue?

    Hi Ralph9430,
    I've tried this numerous times and have the same issue. I've even restored the phone to factory settings and removed everything and problem persists.
    Cheers

Maybe you are looking for