FLAT file creation

Hi,
I want to create a .txt file at the time of Sharepoint feature activation. I am able to create that file using this code
string fullFilePath = string.Format("{0}{1}", filePath, fileNmae);
if (!System.IO.File.Exists(fullFilePath))
FileStream fs = File.Create(string.Format("{0}{1}", filePath, string.Format(fileNmae)));
fs.Close();
But Whenever I am trying to open and write something into that file,its giving an error "file is being used by another process".
f (System.IO.File.Exists(fullFilePath))
using (FileStream fileStream = File.OpenRead(fullFilePath))
File.WriteAllText(string.Format("{0}{1}", filePath, fileNmae), string.Join("{0}\n{1}\n{2}\n{3}", DateTime.Now.ToString(), msg, stackTrace, "xxxx"));
Can you please tell me where I am wrong.
Shubho

Hi,
I am able to resolve the issue.
if (System.IO.File.Exists(fullFilePath))
TextWriter tw = new StreamWriter(fullFilePath, true);
tw.WriteLine("{0}\n{1}\n{2}\n{3}", DateTime.Now.ToString(), "xxx", "yyy", "zzz");
tw.Close();
Shubho

Similar Messages

  • RFBIBL00 Flat File Creation issue

    Hello All,
    I'm using "RFBIBL00" to post the FI documents, and the input to the FB01 transaction screen is obtained from a flat file from AL11 directory.
    The issue here is regarding the date format of the Document date and Posting date. If the date format is as YYYYMMDD in the flat file, and if I'm using the date parameter (in the default option of one's SAP own data) other than starting with YYYY, the document is not getting posted and it is throwing error saying that date format is not correct. If I have chosen the date format starting with YYYY, then the document is getting posted successfully.
    Any suggestions/ideas to make the date format as independent?
    Thanks,
    Bharath.

    Hi Bharath
    I think you'll have to use the appropriate conversion exit for the same. Choose from the below options which suit you.
    SAP Internal format is 'YYYYMMDD' Example: '19990123'
    1. CONVERT_DATE_TO_EXTERNAL
    2. CONVERT_DATE_TO_INTERNAL
    3. CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
    4. CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
    5. CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit
    6. CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit
    7. CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    8. CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit
    9. CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    The date coming in from the flat file will certainly tick to one particular format i guess.
    Hope this helps.
    Harsh

  • FBS1 and RFBIBL00 Flat File Creation

    Hello All,
    I am creating a file for processing by RFBIBL00 I am using the data structures that are supposed to be used by the program to consume the file created. They are:
      data: lv_session TYPE BGR00,  - Session Var
              lv_hdr TYPE BBKPF,         - Header
              lv_rec TYPE BBSEG,        - Detail
    the file gets created and consumed fine by RFBIBL00 however, when I go to sm35 to complete the Session and it goes through the FBS1 screen the formats of the data are not correct?
    The dates must be created in the format per the structure which is: 06232009
    when the session is going through validation is complains that the format is not correct?
    It wants the date to be in this format 06.23.2009 but, I cannot put the '.' in because the length of the variable for the date is only 8 long
    Anyone else had this issue?
    Thanks

    >
    keith warnock wrote:
    > When I pass the date of 20090623, the session gets created OK.
    >
    > When you run the session the date appears on screen as so: '20.09.0623'
    >
    > The error is: ' For the ML Fiscal year variant, no period is defined for 20.09.0623'
    Hello Keith,
    Just try to pass the date in the format DDMMYYYY & check.
    BR,
    Suhas

  • Billing document to flat file

    Hi,
    I have a scenario in which i need to create a flat file and store in a local folder upon saving a billing document. This flat file will have certain selected information from the VBRK/VBRP tables.
    This flat file will be read by another interface software to print a bar code so that the invoice from SAP along with bar code print has to be sent to a particular customer.
    I am not able to find any user exit (only upon saving billing document) so that I can program to trigger a flat file creation in local folder.
    Can any body help as to how to address this requirement?
    Regards

    Hi Karthik,
               Try with these User exits
    1.USEREXIT_PRINT_ITEM (Module pool SAPLV61A, (program RV61AFZB)
    2.USEREXIT_PRINT_HEAD (Modulpool SAPLV61A,     (Programm RV61AFZB)
    I hope it will help you
    Regards,
    Murali.

  • When we go for Flat File creatin

    Hi gurus,
              When we go for flat file creation.Can any one give me one Scenario with example.
    Thanks in advance

    Hello Srikar,
    How r u ?
    We go for flat file in some scenarios like,
    1. The source system could not be connected to the BW System (here u could generate a FlatFile)
    2. If the Customer asks for a different kind of report (in our case we do FlatFile Creation for a complex time management - Employee Working Time is 1st merged with R/3 data, then we combine both together as 1 FlatFile)
    3. Sometimes the customer will give the FlatFile data generated by them
    4. We also take FlatFile reports from Data Targers, using InfoSpokes
    More scenarios are there,
    Best Regards....
    Sankar Kumar
    +91 98403 47141

  • Creation of Inbound IDOC from a flat file.

    Hi all,
    I hav to create Purchse Order using inbound IDOC in which I hav to take data from a .xls or any flat file.
    Can any one help me with this. i.e wat r the steps involed to do so.
    Regards.
    Rahul

    Hello,
    Why do u want to create a Idoc for creating PO from flat file - you can simply use BAPI. Ok if you want to create PO only using Idoc.
    I think message type is ACC_PURCHASE_ORDER0.
    I just made one sample program to you how to create a PO with Idoc method. Here i am doing for Material Master Creation. Let me know if want any clarification.
    ********Poorna********
    TABLES : MARA, MAKT, EDP13.
    DATA : I_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE,
          I_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    PARAMETERS : P_MATNR LIKE MARA-MATNR.
    START-OF-SELECTION.
      REFRESH I_EDIDC.
      SELECT * FROM EDP13 WHERE MESTYP = 'ZMATMASTER'.
        MOVE-CORRESPONDING EDP13 TO I_EDIDC.
        I_EDIDC-IDOCTP = EDP13-IDOCTYP.
        APPEND I_EDIDC.
      ENDSELECT.
      READ TABLE I_EDIDC INDEX 1.
      I_EDIDD-SEGNAM = 'ZMATMASTER'.
      SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.
      SELECT SINGLE * FROM MAKT WHERE MATNR = P_MATNR
                                  AND SPRAS = SY-LANGU.
      I_EDIDD-SDATA+0(18) = MARA-MATNR.
      I_EDIDD-SDATA+18(40) = MAKT-MAKTX.
      I_EDIDD-SDATA+58(4)  = MARA-MTART.
      I_EDIDD-SDATA+62(1)  = MARA-MBRSH.
      I_EDIDD-SDATA+63(3)  = MARA-MEINS.
      APPEND I_EDIDD.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
        EXPORTING
          master_idoc_control                  = I_EDIDC
       OBJ_TYPE                            = ''
       CHNUM                                = ''
        tables
          communication_idoc_control          = I_EDIDC
          master_idoc_data                    = I_EDIDD
    EXCEPTIONS
       ERROR_IN_IDOC_CONTROL                = 1
       ERROR_WRITING_IDOC_STATUS            = 2
       ERROR_IN_IDOC_DATA                  = 3
       SENDING_LOGICAL_SYSTEM_UNKNOWN      = 4
       OTHERS                              = 5
      COMMIT WORK.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • Data Source creation for Master Data from Flat File to BW

    Hi,
    I need to upload Master Data from Flat File. Can anybody tell step by step right from begining of creation of DataSource up to Loading into Master Data InfoObject.
    can any body have Document.
    Regards,
    Chakri.

    Hi,
    This is the procedure.
    1. Create m-data with or without attributes.
    2. Create infosource .
        a) with flexible update
             or
        b) with direct update
    3. Create transfer rules and assign tyhe names of m-data and attribute in "Transfer rules" tab and transfer them to communication structure.
    4. Create the flat-file with same stucture as communication structure.
    5. if chosen direct update then create infopackage and assign the name of flat-file and schedule it.
    6. if chosen flexible update the create update rule with assigning name of the infosource and the schedule it by creating infopackage.
    Hope this helps. If still have prob then let me know.
    Follow this link also.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
    Assign points if helpful.
    Vinod.

  • Flat File Active Sync doesn't work for account creation without unique id

    Hi,
    I'm trying to set up a FlatFileActiveSync for creation and update of accounts in IDM 7.0. I've followed the below steps for this purpose :-
    1) Create a correlation rule (confirmation rule not reqd in my case).
    2) Create a proxy admin and assign him a empty form. Also give him control over Top organisation.
    3) Create a Flat-File Resource Adapter.
    4) Create ActiveSync input form using the (Active Sync) wizard.
    5) Start Active Sync...
    My feed file contains only 3 fields firstname, lastname, email Id.
    My correlation rule has the logic of matching up with IDM accounts(Lighthouse accountId) by taking first letter of firstname and concat with lastname from the data coming from feed file.
    Now everything works fine for account updates i.e. if I change somebody's email Id who already exists in IDM I can actually see the changed email Id in Configurator's console.
    But if I put in a record that doesn't exist, and which I expect to be created, it gives me an error.
    Although, if I introduce a unique identifier in my feed file and link it with Lighthouse.accountId the account creation works fine.
    Is this a limitation or I'm not doing something right ?
    Exception I saw in resource log with log level 4 :
    2007-04-30T10:02:12.291-0400: Error Processing Line: {lastname=Pogu, firstname=Gogu, [email protected]}
    com.waveset.adapter.iapi.IAPIException: There was a conflict with the record [{lastname=Pogu, firstname=Gogu, [email protected]}]
    and no resolution process has been specified on the adapter.
    It is recommended that you define the process for handling unmatched accounts
    on this load process.
    2007-04-30T10:02:12.292-0400: Poll complete.
    2007-04-30T10:02:12.292-0400: SARunner: loop 1076
    2007-04-30T10:02:12.314-0400: Started, paused until Mon Apr 30 10:07:12 EDT 2007
    2007-04-30T10:07:12.024-0400: Pause completed
    2007-04-30T10:07:12.038-0400: Polling
    2007-04-30T10:07:12.056-0400: Error Processing Line: {lastname=Poker, firstname=Hoker, [email protected]}
    com.waveset.adapter.iapi.IAPIException: There was a conflict with the record [{lastname=Poker, firstname=Hoker, [email protected]}]
    and no resolution process has been specified on the adapter.
    It is recommended that you define the process for handling unmatched accounts
    on this load process.

    That logic is in my correlation rule as I specified in my initial post and here's the XPRESS code for it :-
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE Rule PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <!-- MemberObjectGroups="#ID#Top" description="Find out if a resource account is correlated to an IDM account" id="#ID#D23CC16ECF6E5D42:-4527465C:11224925657:-769F" lastMod="61" lastModifier="Configurator" name="HR_DB_CORR" subtype="SUBTYPE_ACCOUNT_CORRELATION_RULE"-->
    <Rule subtype='SUBTYPE_ACCOUNT_CORRELATION_RULE' id='#ID#D23CC16ECF6E5D42:-4527465C:11224925657:-769F' name='HR_DB_CORR' creator='Configurator' createDate='1177449448746' lastModifier='Configurator' lastModDate='1177686884156' lastMod='61'>
    <Description>Find out if a resource account is correlated to an IDM account</Description>
    <cond>
    <and>
    <notnull>
    <ref>firstname</ref>
    </notnull>
    <notnull>
    <ref>lastname</ref>
    </notnull>
    </and>
    <block>
    <concat>
    <substr>
    <ref>firstname</ref>
    <i>0</i>
    <i>1</i>
    </substr>
    <ref>lastname</ref>
    </concat>
    </block>
    <s>false</s>
    </cond>
    <MemberObjectGroups>
    <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
    </Rule>
    Although this is not specified in Active Sync input form but in the correlation rule attribute of Active Sync config (using the wizard). Do I need to specify it there using the Field function.
    Also, I figured out today that I needed to restart IDM instance after changing the value of "Create Unmatched Accounts" flag and now the error is as below :-
    <WavesetResult>
    <ResultItem type='error' status='error'>
    <ResultError throwable='com.waveset.util.WavesetException'>
    <Message id='SES_VIEW_CHECKIN_ERROR'>
    </Message>
    <StackTrace>com.waveset.util.WavesetException: Unable to checkin view. No account ID specified.&#xA;&#x9;at com.waveset.view.UserViewer.checkinView(UserViewer.java:1165)&#xA;&#x9;at com.waveset.object.ViewMaster.checkinView(ViewMaster.java:727)&#xA;&#x9;at com.waveset.sync.IAPIUserImpl.processCommand(IAPIUserImpl.java:526)&#xA;&#x9;at com.waveset.sync.IAPIUserImpl.submitCreate(IAPIUserImpl.java:195)&#xA;&#x9;at com.waveset.sync.IAPIUserImpl.submit(IAPIUserImpl.java:749)&#xA;&#x9;at com.waveset.adapter.FlatFileActiveSyncAdapter.processLine(FlatFileActiveSyncAdapter.java:404)&#xA;&#x9;at com.waveset.adapter.FlatFileActiveSyncAdapter.processFlatFile(FlatFileActiveSyncAdapter.java:350)&#xA;&#x9;at com.waveset.adapter.FlatFileActiveSyncAdapter.poll(FlatFileActiveSyncAdapter.java:307)&#xA;&#x9;at com.waveset.task.SARunner.doRealWork(SARunner.java:288)&#xA;&#x9;at com.waveset.task.Executor.execute(Executor.java:154)&#xA;&#x9;at com.waveset.task.TaskThread.run(TaskThread.java:132)&#xA;</StackTrace>
    </ResultError>
    </ResultItem>
    </WavesetResult>

  • Orders creation from flat file

    experts
    I am having a flat file like below
    hd ponumber customer number podate delivery date
    it material1 materialtext quantity price plant
    it material2 materialtext quantity price plant
    it material3 materialtext quantity price plant
    hd ponumber customer number podate delivery date
    it material1 materialtext quantity price plant
    it material2 materialtext quantity price plant
    it material3 materialtext quantity price plant
    so here hd represents the header data and it represents the item data for the above header.
    so in above i am having 2 sales orders data.
    the only way that i can distinquish is with the field hd and it ie what is header and what is item.
    I want to pass only one set of data to the idoc function  to create the order.
    so i want to pass the header and relevant item info.
    my itab internal table is having all the data in the above format.
    loop at itab into waitab.
    *at end of field1 " is not working
    here i will be populating the header and item data to create one sales order.
    endloop.
    so please tell me how to pass at a time one set of data ie header data and relevant item data then next time again header and relevant item data. please help
    this is similar to below theread, but belwo theread is using po number but here i dont have that sepearation
    order creation logic how to pass line items

    hd ponumber customer number podate delivery date
    it material1 materialtext quantity price plant
    it material2 materialtext quantity price plant
    it material3 materialtext quantity price plant
    hd ponumber customer number podate delivery date
    it material1 materialtext quantity price plant
    it material2 materialtext quantity price plant
    it material3 materialtext quantity price plant
    Hi,
    Can u try thsi logic.
    DATA : L_CNT TYPE I VALUE 1,
                ITAB_TEMP AS SAME STARUCTRE OF ITAB.
    LOOP AT ITAB INTO WA_ITAB FROM INDEX 1.
    IF WA_ITAB+0(2) EQ 'HD'.
    L_CNT = L_CNT +1
    ENDIF.
    IF L_CNT EQ 2
    hd ponumber customer number podate delivery date
    it material1 materialtext quantity price plant
    it material2 materialtext quantity price plant
    it material3 materialtext quantity price plant
    APPEND THIS DATA TO TEMP TABLE.
    ELSEIF L_CNT EQ 3
    WE WONT APPEND DATA TO TEMP TABLE.
    PROCESS TEMP DATA TO IDOCS.
    DELETE ITAB FROM TEMP ITAB . " SO IN ORIGINAL ITAB WE WONT HAVE FIRST ORDER ITEM DETAILS.
    REFREST TEMPITAB.
    ENDLOOP.
    ENDIF.
    if u have any further issues u can try while looping itab use sy-tabix appropriately.
    Regards,
    BSVASU.

  • Why transferstructure creation in the same sequence of Flat file?

    Hello Guru,
    why transferstructure creation in the same sequence of Flat file?

    Hi,
    It is very simple see the following ex..
    Transfer Structutre:
    Material | Quantity
    Flat File:
    Quantity | Material
    SO the mapping is like below:
    Material-->Quantity
    Quantity-->Material
    So is it possible?. NO. SO you must follow the sequence.
    Thanks
    Reddy

  • Creation of flat file

    HI,
    In flat file extraction my Business Scenario is Enhancements to the BI-located GL Account Master Data Table
    In the NW Natural context the Unit of Measure and Statistical Key Figure Type values are GL Account-specific.
    In data source maintain screen in BW when i click on the preview data  then it shows an  error as Error 'Unit GJ is not created in language EN...' at conversion exit CONVERSION_EXIT_CUNIT_INPUT (field UNIT record 2, value GJ)
    my flat file  is
    0STKFTYP,0UNIT
    SK0002,BOT
    SK0003,CD
    SK0004,GJ
    SK0005,TST
    SK0006,EA
    please do favor............

    hope this helps http://forums.sdn.sap.com/thread.jspa?threadID=1896188
    http://forums.sdn.sap.com/thread.jspa?threadID=305892

  • Creation of Flat file in Application Server

    Hi,
    Can you please clarify what is Logical file path and Physical file pathe.
    Also how to create a flat file in Application Server with Logical and Physical file paths.
    Thanks

    Hi Yasaswini,
    Physical file is what you see from the OS level.
    Logical file is what ABAP code can call certain functions to read/write.
    Transaction FILE would link them together. Typically the logical path ends with "<FILENAME>", and the logical file refers to the logical path. You can check the help for more info.
    http://help.sap.com//saphelp_erp2004/helpdata/EN/8d/3e4edc462a11d189000000e8323d3a/frameset.htm
    Good luck,
    Victor

  • Rdbms table to flat file: error at creation of flat file

    hi
    i created a mapping in which , i want to transfer data from a rdbms table to a flat file.I created the flat file using owb and gave the location of the flat file as E:/........./folder.When i try to deploy the mapping. The flat file isnt getting created .validation and scripts are ok, but deployment is failed with the below,error.
    ORA-01031: insufficient privileges.
    Create failed.

    With 11gR2 of OWB you will need to either grant CREATE ANY DIRECTORY privileges to the target user so that when the directory is created when the OWB connector is deployed will work. Or the other option which is more secure is to have the dba create a directory and grant read/write privs on this directory (and when creating the connector in OWB, reference this SQL directory in the database). The CREATE ANY DIRECTORY option is ok above to get up and running and understand what is going on.
    Cheers
    David

  • Flat file to IDOC creation

    hi all,
    I'm looking for the ABAP (sample) Program which can help me out in generating IDOC from the Flat file.
    Flat file will be residing on local PC.
    I required this for Purchase Order Confirmation Step (MSG Type ORDRSP).
    If any had done it, then let me know.
    Regards,
    S Anand

    Hi
    Sorry it is not copied properly.
    Read the data from flst file using function module GUI_UPLOAD and for each entry of internal table fille the control recor and data record and pass to function module IDOC_INBOUND_ASYNCHRONOUS to generate IDOC.
    Sample code which i have used in my report to update customer master using IDOC
    PARAMETERS:p_kunnr TYPE kna1-kunnr,
    p_zahls TYPE knb1-zahls,
    p_tlfns TYPE knb1-tlfns,
    p_intad TYPE knb1-intad.
    START-OF-SELECTION.
      PERFORM idocgeneration.
    *&      Form  idocgeneration
          IDOC Generation
    FORM idocgeneration.
      DATA:wa_knb1 TYPE knb1,
      wa_kna1 TYPE kna1,
      wa_controlrecord LIKE edi_dc40,
      wa_detailrecord  LIKE edi_dd40,
      wa_e1kna1m TYPE e1kna1m,
      wa_e1knb1m TYPE e1knb1m.
      DATA:it_controlrecord TYPE STANDARD TABLE OF edi_dc40,
      it_detailrecord  TYPE STANDARD TABLE OF edi_dd40.
      CONSTANTS: cedidc40    LIKE edi_dc40-tabnam  VALUE 'EDI_DC40',
                 cdebmas06   LIKE edi_dc40-idoctyp VALUE 'DEBMAS06',
                 czdebmas06  LIKE edi_dc40-cimtyp  VALUE 'ZZDEBMAS06',
                 cdebmas     LIKE edi_dc40-mestyp  VALUE 'DEBMAS',
                 ce1kna1m    LIKE edi_dd40-segnam  VALUE 'E1KNA1M',
                 ce1knb1m    LIKE edi_dd40-segnam  VALUE 'E1KNB1M',
                 c_2       TYPE c VALUE '2'.
    Control Record
      CLEAR: wa_controlrecord,it_controlrecord[].
      wa_controlrecord-tabnam  = cedidc40.
      wa_controlrecord-mandt   = sy-mandt.
      wa_controlrecord-direct  = c_2.
      wa_controlrecord-idoctyp = cdebmas06.
      wa_controlrecord-cimtyp  = czdebmas06.
      wa_controlrecord-mestyp  = cdebmas.
      wa_controlrecord-mesfct  = space.
      wa_controlrecord-sndpor  = 'SAPPLD'.
      wa_controlrecord-sndprt  = 'KU'.
      wa_controlrecord-sndprn  = 'A000'.
      wa_controlrecord-rcvpor  = 'SAPPLD'.
      wa_controlrecord-rcvprt  = 'KU'.
      wa_controlrecord-rcvprn  = 'A000'.
      APPEND wa_controlrecord TO it_controlrecord.
    Remove the contents in detail record internal table
      REFRESH it_detailrecord.
    Create detailed data
    Assign values to the segment fields
      CLEAR:wa_kna1,wa_e1kna1m.
      SELECT SINGLE * FROM kna1 INTO wa_kna1 WHERE kunnr = p_kunnr.
      IF sy-subrc IS INITIAL.
        MOVE-CORRESPONDING wa_kna1 TO  wa_e1kna1m.
        wa_e1kna1m-msgfn = 'INT'.
    Create the detail record
        CLEAR wa_detailrecord.
        wa_detailrecord-segnam  = ce1kna1m.
        wa_detailrecord-mandt   = sy-mandt.
        wa_detailrecord-segnum  = '000001'.
        wa_detailrecord-psgnum  = '000000'.
        wa_detailrecord-hlevel  = '01'.
        wa_detailrecord-sdata   = wa_e1kna1m.
        APPEND wa_detailrecord TO it_detailrecord.
      ENDIF.
    *assign values to the segment fields
      CLEAR:wa_knb1,wa_e1knb1m.
      SELECT SINGLE * FROM knb1 INTO wa_knb1 WHERE kunnr = p_kunnr.
      IF sy-subrc IS INITIAL.
        MOVE-CORRESPONDING wa_knb1 TO  wa_e1knb1m.
        wa_e1knb1m-msgfn = 'INT'.
        wa_e1knb1m-intad = p_intad.
        wa_e1knb1m-zahls = p_zahls.
        wa_e1knb1m-tlfns = p_tlfns.
      ENDIF.
    Add segment to the detail record
      CLEAR wa_detailrecord.
      wa_detailrecord-segnam  = ce1knb1m.
      wa_detailrecord-mandt   = sy-mandt.
      wa_detailrecord-segnum  = '000003'.
      wa_detailrecord-psgnum  = '000001'.
      wa_detailrecord-hlevel  = '02'.
      wa_detailrecord-sdata   =  wa_e1knb1m.
      APPEND wa_detailrecord TO it_detailrecord.
      CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
        TABLES
          idoc_control_rec_40 = it_controlrecord
          idoc_data_rec_40    = it_detailrecord.
      IF sy-subrc IS INITIAL.
        WRITE:/ 'Sucessfully Update'.
      ENDIF.
    ENDFORM.                    "IDOC Generation

  • IDOC creation from flat file.

    Hello Friends.
    I need to create a custom program for posting goods receipts for a purchase order. 
    I think  a custom program needed to achieve this task because i need to do mappings prior to create an IDOC. Now using a flat file what are the function modules or steps involved. can any one of you able to help me on this.
    Thanks

    Sorry, I'm trying to remember the name of the function module I used....I had a similar situation...I had a flat file which I processed and constructed an IDOC which I then saved as an incoming IDOC using the FM....  Because we had our settings (standard SAP process code, standard SAP FM IDOC processor, etc.) set to automatically fire off the IDOC processing, the result was that I read the file, saved the IDOC and SAP then immediately grabbed and posted the IDOC.  I will do a little search for the FM I used to create the IDOC in my own system and get back to you if you think that would be helpful.  Sorry for my memory lapse....

Maybe you are looking for

  • Dual Monitor HDMI Dock for MBP Retina?

    Hello, Just purchased a MBP 15 Retina for home and work. At my office I have 2 HDMI Monitors that I would like to continue to use. I know I can do this through the ports on the MBP, My question however is: Does anyone know of a docking station that s

  • Scanner changes size of pages

     Everytime i scan a regular 8 1/2 x 11 page, it will show up on the screen smaller than that size (reduced to like 75%) and with black smears at the bottom taking up the rest of the page. Not sure how to adjust this but really need to get it sorted a

  • ATV keeps on re-syncing. Caution file deleters

    I made 2 changes, 1 of which changed the syncing behavior of my ATV. 1. I upgraded to version 2 2. I synced 1 of my smart music play lists Now whenever I open iTunes it tries to sync to ATV, syncing 1 or 2 TV shows that I haven't watched yet and have

  • I'm on the latest version and on many websites that have links to others those links will not load.

    I'm on the latest version and on many websites that have links to others those links will not load. Links within a site work but anything that sends me elsewhere will no longer load in a new tab. I'm on a mac running Lion.

  • Two sites one problem

    Hi all, I have two sites I have published using a domain name I purchased. Site is hosted by mobileme. My first site is my companies website. The second site I created is for a client both get published to mobileme. The problem I am having now is tha