Flat file header diferent from remaining file (function module GUI_UPLOAD)

Hello gurus,
I need to upload a flat file but the header is the control record with the number of lines in the file, and has a diferent structure from remaining file records.
I'm using GUI_UPLOAD in ASCII mode for the flat file and my first line with the control record does not "fit" the structure of the remaining records.
Whats the best way I read diferent line structures in the flat file so I can have a counter from the first line and all other lines in an internal table?
Using GUI_UPLOAD twice with diferent internal tables will have performance degraded...
regards.
Sérgio.

Hi,
Declare an itab as
ITAB TYPE STANDARD TABLE OF STRING
Variable for Tab limited
data :gc_con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
pass the control record to the internal table first then.
loop at it_final into wa_final.
concatenating gc_con_tab will add TABs in your output.
CONCATENATE wa_final-f1 wa_final-f2
into ITABl separated by gc_con_tab.
append ITAB.
endloop.
Then use GUI_DOWNLOAD to download ITAB.
Regards,
Shanmugavel chandrasekaran

Similar Messages

  • Read an avi file using "Read from binary file" vi

    My question is how to read an avi file using "Read from binary file" vi .
    My objective is to create a series of small avi files by using IMAQ AVI write frame with mpeg-4 codec of 2 second long (so 40 frames in each file with 20 fps ) and then send them one by one so as to create a stream of video. The image are grabbed from USB camera. If I read those frames using IMAQ AVI read frame then compression advantage would be lost so I want to read the whole file itself.
    I read the avi file using "Read from binary file" with unsigned 8 bit data format and then sent to remote end and save it and then display it, however it didnt work. I later found that if I read an image file using "Read from binary file" with unsigned 8 bit data format and save it in local computer itself , the format would be changed and it would be unrecognizable. Am I doing wrong by reading the file in unsined 8 bit integer format or should I have used any other data types.
    I am using Labview 8.5 and Labview vision development module and vision acquisition module 8.5
    Your help would be highly appreciated.
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    read avi file in other data format.JPG ‏26 KB

    Hello,
    Check out the (full) help message for "write to binary file"
    The "prepend array or string size" input defaults to true, so in your example the data written to the file will have array size information added at the beginning and your output file will be (four bytes) longer than your input file. Wire a False constant to "prepend array or string size" to prevent this happening.
    Rod.
    Message Edited by Rod on 10-14-2008 02:43 PM

  • 求助: 如何使用write to spreadsheet file.vi 和 read from spreadsheet file.vi, 并且如何定义它们的路径???

    请问如何使用write to spreadsheet file.vi 和 read from spreadsheet file.vi,我知道spreadsheet file.vi只支持.txt文件,但我应该在哪里设置它们的路径呢,请各位帮忙指点,能不能具体说明下,谢谢...

    write to spreadsheet file.vi 和 read from spreadsheet file.vi,支持.xls文件.
    可以在path处设置它们的路径.

  • Issue with use of Function Module GUI_UPLOAD

    Hi Experts,
    I have an issue in using the Function Module GUI_UPLOAD for uploading the contents of an Excel file on the Presentation Server to an internal table in an ABAP Program.
    My file consists of around 300 records but the FM succeeds in uploading only the first 6 lines to the Internal Table specified while calling the FM.
    I dont have any idea why this happens. Any pointers in this direction will be helpful.
    Thanks in advance.
    Regards,
    Keerthi

    Hi,
    Kindly go through this link below:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=60655105
    Hope it helps you
    Regards
    Mansi

  • Why can't I run a powershell file I created from a powershell function

    Ok so admittedly I am still learning a lot about powershell so this may have a very easy explanation/solution
    So I have this script file and this is it in its entirety 
    function Add-DriveFunctions($Provider, $Path)
    foreach ($Drive in $Provider.Drives)
    if ((Get-Command | where Name -eq "$($Drive.Name):") -eq $null)
    [String]"function $($Drive.Name):() {Set-Location $($Drive.Name):}" | Out-File $Path -Append
    $Path = C:\Temp\test.ps1
    """Adding Drives""" | Out-File $Path
    foreach ($Provider in Get-PSProvider)
    Add-DriveFunctions -Provider $Provider -Path $Path
    C:\Temp\test.ps1
    When I run it it happily creates the ps1 file whose content looks like this
     "Adding drives"
    function Alias:() {Set-Location Alias:}
    function Env:() {Set-Location Env:}
    function Function:() {Set-Location Function:}
    function HKLM:() {Set-Location HKLM:}
    function HKCU:() {Set-Location HKCU:}
    function Variable:() {Set-Location Variable:}
    But the last line to actually load and run the ps1 file does nothing
    even calling C:\Temp\test.ps1 does nothing
    but if I load the file into ISE and run it from there
    it works.
    Unless I'm completely missing something I would think being able to call other ps1 files from other ps1 files or the command line would be a pretty important part of powershells flexibility.
    So if anyone could tell me why in this case it does not work I would greatly appreciate that
    Cheers,
    Quidquid latine dictum sit, altum videtur

    Ok i'm a little confused 
    in ISE if I write a ps1 file and i have just a function in it not anything calling that function when i run or debug it loads that functions definition into the current session and then from my console i can access my function. so Is that what the . is supposed
    to do?
    When i tried the . I get this
    The term '.C:\Temp\test.ps1' is not recognized as the name of a cmdlet, function, script file, or operable 
    program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
    again.At C:\Users\rjs012978\Downloads\FunctionTest.ps1:20 char:1
    + .C:\Temp\test.ps1
    + ~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (.C:\Temp\test.ps1:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    Also I know i can do that with the mono letter drive but working on a network over half the alphabet is taken up by my actual network mapped drives.
    And the provider i'm writing is connecting to multiple Space IDs that i'm making into my drives so I would quickly run out of letters.
    proof of concept i know what i'm doing works if I do it manually
    I know it's kind of silly but for me the amount of time i spend in powershell especially administering SCCM, the registry and AD being able to just type hklm: and hitting enter is a huge time save over the long haul than typing cd hklm: even though it's
    just 3 more characters
    Quidquid latine dictum sit, altum videtur

  • How to open saved files using 'read from text file' function

    Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?
    Here are some screenshots on part of my program  
    let me know if you guys would need more information / screenshots thank you!
    Attachments:
    ss_save.jpg ‏94 KB
    ss_open.jpg ‏94 KB
    modified_writetotextfile.jpg ‏99 KB

    Ohmy, thanks altenbach. oh yeah i forgot about those sub VIs. will upload them now. Was rather demoralized after reading the comments and really struck me on how weak i'm at on labview really hope to get this done. But of course i have to study through and see how it works. Actually i am going to replace those 'signal generators sub vi' with ThoughtTechonology's sample code so i can obtain data waveforms real-time using Electrocardiography (ECG) ,Electromyography (EMG ) and Electroencephalography (EEG) hopefully i can find out how to connect the sample code.
    ( ps . cant connect it now unless my program is working otherwise labview will crash ) 
    ( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose )
    The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project
    Attachments:
    frequency detactor.vi ‏53 KB
    signal generator.vi ‏13 KB
    attachment.ashx.vi ‏40 KB

  • How to extract html file and folder from jar file

    Hi all ,
    I should to submit my project tomorrow . plz help me .
    In my project jar file I have html page that should run when I use the program, I can't extract it . Also it have folder that contain some files that My program should use it . I dont know how to use it from jar file or how to extract it . plz help me.
    If you could I need java could for that.
    Thanks alot.

    Hi all ,
    I should to submit my project tomorrow . plz help me .
    In my project jar file I have html page that should run when I use the program, I can't extract it . Also it have folder that contain some files that My program should use it . I dont know how to use it from jar file or how to extract it . plz help me.
    If you could I need java could for that.
    Thanks alot.

  • Include text file and display from text file

    Ok. I'm found the site with the monkey on the the flash thing and all it shows is a name, email and something else and I used it and it works by including a txt file and displaying text from that file as putting down this information
    name.text = this.name;
    and I can't find the site anymore to get help.
    I want to know how to include a PHP script that shows this information like this
    text=something I need&username=My Name&email=[email protected]
    I want to show this stuff on the flash but every time I execute by using it as localhost/test.php, it will show a sentax error.
    This is really stressing me out and I need a lot of help on this stuff.
    Can someone help me?

    ok. let me describe something else.
    there's 3 text boxes that is dynamic text.
    one of them is called name
    the other one is called email
    and last one is called location
    in the text file, it shows this for importing to the flash file
    name=My Name&email=EMAIL&location=My Location
    When viewing the flash file that you created, it shows the name, it shows the email, and it shows location.
    When I do it on my own even with a text file, it keeps on saying that there is an error on line 1.
    I found a site that shows how to do it and it shows what to put in a text file, and it shows the action script. On the FLA file that he shows me has a monkey on the flash file and it has 3 text boxes that I described above. As well as the text file, it is the same. I used the example and it worked but I can't find the example again. I don't know what happened to the website and I don't know what happened to the download I had but it is not downloaded any more. I have adanced systemcare pro so it clears out my recent web searches and my recent downloads so I can't find it. I did a google search on anything about action scripts. I even did a monkey action script search and I couldn't find it.
    It's making me mad and I don't know what to do. This is stressing me out way more than you think.
    UPDATE:
    I did a google search on a file I found in my www folder and I found it. finally.
    Here's the site.
    http://www.kirupa.com/developer/mx/externaldata.htm
    now, I need to figure out how to load it from a PHP file.

  • How to run .ksh file in unix from .jsp files

    Hi frnd,
    How to connect unix servers from .jsp file & I want to run unix scripts .ksh files from .jsp files
    Thanku
    bhupathipawan

    It is usually a bad idea to do any major processing directly within a JSP. It is better to create a helper class and invoke methods on that. This helper class can then be tested outside of the inhospitable JSP environment.
    To run the '.ksh' file you will need to use either Runtime.exec() or the more modern ProcessBuilder. You will save yourself a lot of grief if you read thoroughly the 4 sections of http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and then implement the recommendations.
    Note - although the 'traps' article is written around the use of Runtime.exec(), it's content is equally applicable to ProcessBuilder.

  • How can i get currency values from flatfile to function module

    Dear All,
               I have to take  currency values from flat file and i have to assign those flat file value to function module .
    Eg: "Convert_to_local_currency".  I need technical code how to calculate those amount in work area and how to assign those amount value function module. 
              I need sample program for currency conversion from flat file to function module.  My requirement is based on flat file amount i have to calculate in work area and assign those work area to function module. 
    With Regards,
    Baskaran

    Hi Satish or Baskaran,
    First conform in which format the flat file is present, as abhi mentioned if it is there in notepad
    try to use F.M GUI_UPLOAD as shown below...
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
    FILENAME = 'C:\Desktop\rpf1.TXT'
    TABLES
    DATA_TAB =  ITAB.
    Now loop at ITAB Into Work_area and press the respect currency fields which you want and in the same way
    if the file is in EXCEL format use F.M ALSM_EXCEL_TO_INTERNAL_TABLE
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename = P_FNAME
          i_begin_col = 1
          i_begin_row = 1
        TABLES
          intern = ITAB
    LOOP AT ITAB INTO WA.
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
            EXPORTING
              foreign_currency = wa-waers
              local_currency   = wa-waers
               IMPORTING
              local_amount     = tvals-gross.
        ENDIF.
    endloop.
    And as mentioned loop the records into work area and process the currenct field which is present in the
    ITAB according to its field name. And make sure within the loop you call your function module.
    Regards
    VEnk@
    Edited by: Venkat Reddy on Dec 9, 2009 5:51 PM

  • Data from tables in function module

    Dear friends,
                   I am trying a PO smartfrom in the driving program I have hanged in a situation where in the subroutine i am calling a function module (this FM takes a po number and a item number and returns the contition types and values accordingly.)
    But the problem:-when i loop the itab its returning only the last feteched item no detials . I think some prob in workarea append king of things....Please help and rectify the code.
    data ITAB_KOMV LIKE KOMV OCCURS 1 WITH HEADER LINE.
    PERFORM GET_ITEM_DETAILS.
    loop at itab_komv.
    write :/ itab_komv-kposn, itab_komv-KSCHL, itab_komv-kwert.
    endloop.
    FORM GET_ITEM_DETAILS.
      SELECT EBELN
             EBELP
             EMATN
             TXZ01 "specification ----EKPO--TXZ01
             BANFN
             ANFNR
             WERKS
             MEINS
             MENGE
             NETPR
             MWSKZ "tax code
             PSTYP
             ADRNR
             FROM EKPO
             INTO CORRESPONDING FIELDS OF
              ITAB_EKPO WHERE EBELN EQ PO_NUMBER.
    ***tax calulattions
              CALL FUNCTION 'ZMM_CALCULATE_TAX_ITEM'
      EXPORTING
        P_EBELN        = itab_ekpo-ebeln
        P_EBELP        = itab_ekpo-ebelp
       TABLES
         it_komv2       = itab_komv
               append itab_ekpo.
    endselect.
    output:-
    00140 13000 like that
    but it shd give,
    00010
    00020
    00140..
    pls  help with the code.
    Edited by: Matt on Jul 9, 2009 7:49 AM

    HI,
    You are bound to get the last record because you are writing after the loop.
    data ITAB_KOMV LIKE KOMV OCCURS 1 WITH HEADER LINE.
    PERFORM GET_ITEM_DETAILS.
    loop at itab_komv.
    write :/ itab_komv-kposn, itab_komv-KSCHL, itab_komv-kwert.
    endloop.
    FORM GET_ITEM_DETAILS.
    SELECT EBELN
    EBELP
    EMATN
    TXZ01 "specification ----EKPO--TXZ01
    BANFN
    ANFNR
    WERKS
    MEINS
    MENGE
    NETPR
    MWSKZ "tax code
    PSTYP
    ADRNR
    FROM EKPO
    INTO CORRESPONDING FIELDS OF
    ITAB_EKPO WHERE EBELN EQ PO_NUMBER.
    ***tax calulattions
    CALL FUNCTION 'ZMM_CALCULATE_TAX_ITEM'
    EXPORTING
    P_EBELN = itab_ekpo-ebeln
    P_EBELP = itab_ekpo-ebelp
    TABLES
    it_komv2 = itab_komv.
    append itab_ekpo.
    * basically your write statement should be here
    *loop at itab_komv.
    *write :/ itab_komv-kposn, itab_komv-KSCHL, itab_komv-kwert.
    *endloop.
    endselect.
    So that with every loop pass of the select statement the conditions are printed for every line item.
    What i pointed out to you is the mistake which you are doing.
    But the solution is not the correct one.
    Within SELECT-ENDSELECT you should never code anything so as to avoid performance problems.
    First try to get all data from EKPO into an internal table for the PO.
    Do as follows
    SELECT EBELN
    EBELP
    EMATN
    TXZ01 "specification ----EKPO--TXZ01
    BANFN
    ANFNR
    WERKS
    MEINS
    MENGE
    NETPR
    MWSKZ "tax code
    PSTYP
    ADRNR
    FROM EKPO
    INTO CORRESPONDING FIELDS OF TABLE
    ITAB_EKPO WHERE EBELN EQ PO_NUMBER.
    loop at itab_po.
    refresh : itab_komv.
    CALL FUNCTION 'ZMM_CALCULATE_TAX_ITEM'
    EXPORTING
    P_EBELN = itab_ekpo-ebeln
    P_EBELP = itab_ekpo-ebelp
    TABLES
    it_komv2 = itab_komv.
    loop at itab_komv.
    write :/ itab_komv-kposn, itab_komv-KSCHL, itab_komv-kwert.
    endloop.
    endloop.
    I hope you get my point.
    Regards,
    Ankur Parab
    Edited by: Ankur Parab on Jul 9, 2009 11:25 AM

  • Call WDA from ABAP via function module

    Hi WDA experts,
    is there any possibility to call a WDA within a ABAP report AND include it in the process.
    The best would be to call a WDA via a function module - make some inputs on the WDA side - press submit and the function module gives me the data from the webdynpro back to my application.
    I know that I can call a WDA via the function CALL_BROWSER, but in this case the WDA application is fully independent from the report and I am not able to post any data back to the report.
    I also know FM WDY_EXECUTE_IN_PLACE, but in this case I need a HTML container to display the WDA and there it seems that I also never get back any data back to the report.
    Any hints are appreciated.

    Not too hard:
    CALL WDA passing in a KEY on start plug.
    write the data to a shared memory object using the key passed as the
    key to a shared memort object on the submit.
    (see blogs on writing Shared maemory objects in ABAP)
    Then simply exit APP.
    On return read the data from the Shared memory Object.
    The shared memory object lives across the 2 sessions.
    cheers
    Phil.

  • How to exit from an update Function Module

    Hi Friends,
    I am using an Update Function Module in my program.The Program also has various other logics implemented in it. The Update Function Module gets triggered only when it finds COMMIT WORK statement. Now, I want that when the FM gets triggered and inside it, sy-subrc <> 0 at any stage, it should exit the complete processing and come to my main screen.
    I tried to use Exit, STOP commands in the FM, but they only make the processing to exit from the FM.
    Please suggest what shud I do.
    Helpful suggestions will be surely rewarded.
    Thanks in advance.
    Regards,
    Himanshu

    hi hemansu,
    after coming out from function module check value of sy-subrc
    and
    if sy-subrc ne 0
      exit.  or leave to screen 0 [module pool progarm] or stop.
    endif.
    if helpful reward some points.
    with regards,
    suresh babu aluri.

  • How to get structure from Idoc using function module?

    Hi all,
    I am looking for a function module in order to get the structure of a message type used for iDoc. The aim is to get the data element from the different fields in order to check authority if the data element is BUKRS.
    Thanks for your help!
    David

    Hi David,
    You can use the FM "IDOC_TYPE_COMPLETE_READ" which will get you the complete details of the IDOC type along with data elements referred for each fields in the segments.
    The aim is to get the data element from the different fields in order to check authority if the data element is BUKRS.
    Not sure if i understood the above requirement, if you could provide more info on the requirement, i guess you might get better a better solution from the forum. As there are other data elements with different names for company code (just look up *BUKRS* in SE11 under Data Elements to see what i mean), not sure if you can cover it all.
    Regards,
    Chen

  • How to access Business object type attribute from a method/function modul ?

    Hello,
    i have created a business object type object along with attributes and methods. Now inside the method i want to access the attributes. inside the method i am writing:
    data a type XXX.
    a = me->attribute
    this is creating a compilation error.
    Now the method is defined as a function module in some package, so can anyone inform me how to access object attributes from the function module ?
    pointes are awarded
    Regards

    Hello,
    thanks for your answer, but this too did not work, "=>" is for static attributes and the attributes i have are not static. Moreover, i tried it but it gave the same error :
    the abap error was when i was checking the code is :
    the type me=>documenttype is unknown
    as you know in SWO1 i created an object and when i create a method you link it to a function module and this is where you have the implementation of the method, so from this method how can i access the attributes on the main object that i created in SWO1
    regards

Maybe you are looking for

  • Crystal Report for SAP B1 8.8

    Hi All ! I can not finish for designing template layout for Sales Quotation by Crystal Report 2008 for SAP 8 8 I have already done for template of sale quotation but when i print preview in SAP for this one, system did not understood and it get all d

  • How to limit the creation of Contract in reference to a PR?

    hi to all, my scenario is as follows: i create service activity in cj20n.  the Purch Requisition # that is generated is made into a quantity contract (ME31K). however i noticed that i can create many contracts for that item.  what i want is to be abl

  • Specific order for web gallery photos

    I am publishing a web gallery (newbie) and the photos need to be in a certain order-its a wedding album. How do I get them in the correct order. I put them in order in iphoto, but when the gallery publishes, they are random. Thanks

  • O.S 4.6!

    Has anyone tried 4.6 on the pearl 8130 for verizon wireless?

  • DSC 8 custom timestamp

    Is there a way to write a custom timestamp to a published shared variable in DSC 8.0, as we could in older DSC versions with VI-based servers?