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.

Similar Messages

  • Inputs requried to create purchase order report from flat file

    inputs requried to create purchase order report from flat file

    At a guess, I'd say purchase order data.
    If you don't give us a clue what you are actually trying to do we can't really help you too much.
    Do you want to call a BAPI?  Do a BDC?  Use an IDOC?  Or just generally muck up the system by doing inserts into the purchasing tables?
    No doubt if you tell us, you'll get lots and lots of suggestions.
    Gareth.

  • 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....

  • Upload PO data into SRM system from flat file

    Hi all,
    I need to create conversion program to upload Open Purchase order data from flat file to System.
    I am trying to create po using bapi BAPI_POEC_CREATE. but getting error .
    should any one give the details of parameter need to  pass the bapi .
    Thanks in advance
    Sharad

    Sharad,
    Not the very best piece of code, but should be helpful.
    REPORT  zkb_po_create.
    DATA: ls_po_header   TYPE bapi_po_header_c.
    DATA: ls_e_po_header TYPE bapi_po_header_d.
    DATA: ls_po_items    TYPE bapi_po_item_c.
    DATA: ls_po_accass   TYPE bapi_acc_c.
    DATA: ls_po_partner  TYPE bapi_bup_c.
    DATA: ls_po_orgdata  TYPE bapi_org_c.
    DATA: ls_return      TYPE bapiret2.
    DATA: lt_po_items   TYPE TABLE OF bapi_po_item_c.
    DATA: lt_po_accass  TYPE TABLE OF bapi_acc_c.
    DATA: lt_po_partner TYPE TABLE OF bapi_bup_c.
    DATA: lt_po_orgdata TYPE TABLE OF bapi_org_c.
    DATA: lt_return     TYPE TABLE OF bapiret2.
    * Header Details
    ls_po_header-businessprocess = 1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = ls_po_header-businessprocess
      IMPORTING
        output = ls_po_header-businessprocess.
    ls_po_header-process_type = 'EC'.
    ls_po_header-doc_date = sy-datum.
    ls_po_header-description = 'Test for BAPI_POEC_CREATE'.
    ls_po_header-logsys_fi = 'Backend'.
    ls_po_header-co_code = '1000'.
    ls_po_header-currency = 'GBP'.
    * Item Details
    ls_po_items-item_guid    = 2.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = ls_po_items-item_guid
      IMPORTING
        output = ls_po_items-item_guid.
    ls_po_items-parent        = ls_po_header-businessprocess.
    ls_po_items-product_guid  = '4678E74FFFC380AD000000000A8E035B'.
    ls_po_items-product_id    = '400030'.
    ls_po_items-product_type  = '01'.
    ls_po_items-category_guid = '4627B461073F40FC000000000A8E035B'.
    ls_po_items-category_id   = '1.04.0500'.
    ls_po_items-quantity      = 10.
    ls_po_items-deliv_date   = sy-datum + 10.
    ls_po_items-price = '25'.
    APPEND ls_po_items TO lt_po_items.
    * Account Assignment
    ls_po_accass-guid = 3.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = ls_po_accass-guid
      IMPORTING
        output = ls_po_accass-guid.
    ls_po_accass-parent_guid = ls_po_items-item_guid.
    ls_po_accass-distr_perc  = 100.
    ls_po_accass-g_l_acct    = '<gl acc>'.
    ls_po_accass-cost_ctr    = '<cost centre>'.
    ls_po_accass-co_area     = '<Ctrl area>'.
    APPEND ls_po_accass TO lt_po_accass.
    * Partner Functions
    ls_po_partner-partner_fct  = '00000019'.
    ls_po_partner-partner      = 'Vendor'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_partner-partner_fct  = '00000016'.
    ls_po_partner-partner      = 'Requester'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_partner-partner_fct  = '00000020'.
    ls_po_partner-partner      = 'Receipient'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_partner-partner_fct  = '00000075'.
    ls_po_partner-partner      = 'Location'.
    ls_po_partner-parent_guid  = ls_po_items-item_guid.
    APPEND ls_po_partner TO lt_po_partner.
    ls_po_orgdata-proc_org_ot = 'O'.
    ls_po_orgdata-proc_org_id = 'Pur Org'.
    ls_po_orgdata-proc_group_ot = 'O'.
    ls_po_orgdata-proc_group_id = 'Pur Group'.
    ls_po_orgdata-parent_guid = ls_po_items-item_guid.
    APPEND ls_po_orgdata TO lt_po_orgdata.
    CALL FUNCTION 'BAPI_POEC_CREATE'
      EXPORTING
        i_po_header  = ls_po_header
      IMPORTING
        e_po_header  = ls_e_po_header
      TABLES
        i_po_items   = lt_po_items
        i_po_accass  = lt_po_accass
        i_po_partner = lt_po_partner
        i_po_orgdata = lt_po_orgdata
        return       = lt_return.
    READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.
    IF sy-subrc NE 0.
      COMMIT WORK AND WAIT.
      WRITE:/ ls_e_po_header-doc_number, ': created successfully'.
    ELSE.
      WRITE:/ 'The below errors occurs during PO creation.'.
      LOOP AT lt_return INTO ls_return.
        WRITE:/ ls_return-message.
      ENDLOOP.
    ENDIF.
    Regards, Kathirvel

  • 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.

  • Loading transaction data from flat file to SNP order series objects

    Hi,
    I am an BW developer and i need to provide data to my SNP team.
    Can you please let me know more about <b>loading transaction data (sales order, purchase order, etc.,) from external systems into order based SNP objects/structure</b>. there is a 3rd party tool called webconnect that gets data from external systems and can give data in flat file or in database tables what ever required format we want.
    I know we can use BAPI's, but dont know how. can you please send any <b>sample ABAP program code that calls BAPI to read flat file and write to SNP order series objects</b>.
    Please let me know ASAP, how to get data from flat file into SNP order based objects, with options and I will be very grateful.
    thanks in advance
    Rahul

    Hi,
    Please go through the following links:
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4180456
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4040057
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=3832922
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4067999
    Hope this helps...
    Regards,
    Habeeb
    Assign points if helpful..:)

  • Cube creation & Data loading from Flat file

    Hi All,
    I am new to BI 7. Trying to create a cube and load data from a flat file.
    Successfully created the infosource and Cube (used infosource as a template for cube)
    But got stucked at that point.
    I need help on how to create transfer rules/update rules and then load data into it.
    Thanks,
    Praveen.

    Hi
    right click on infosource->additional functions->create transfer rules.
    now in the window insert the fields you want to load from flat file->activate it.
    now right click on the cube->additional functions->create update rules->activate it.
    click on the small arrow on the left and when you reach the last node(DS)
    right click on it->create info package->extenal data tab->give your FLAT file path and select csv format->schedule tab->click on start.
    hope it helps..
    cheers.

  • Loading data from flat file...

    Hello,
    I am actually experiencing a problem where I cant load data from a flat file into a table. I have actually reverse engineered the flat file into ODI. But the thing is I don't know how to load the data that is reversed into a RDBMS table. Added, I don't know how create this RDBMS table form within ODI to be reflected on the DB. Added, don't know how to load the data from the flat file onto this table without having to add the columns in order to map between the flat file and the table.
    In conclusion, I need to know how to create an RDBMS table from within ODI on the database. And how to automatically map the flat file to the DB table and load the data into the DB table.
    Regards,
    Hossam

    Hi Hossam,
    We can used ODI procedure to create table in the DB.
    Make sure you keep the column name in the table name same as the column name in FLAT FILE so that it can automatically map the column.
    and regarding Loading data from FLAT File i.e. our source table is FLAT FILE till ODI 10.1.3.4 we need to manually insert the datastore since the file system cannot be reversed.
    Please let me know Hossam if i can assis you further.
    Thanks and Regards,
    Andy

  • Income Statement Report from Flat File

    Dear Gurus,
    I'm in the process of creating an INCOME STATEMENT report from Flat File as for my learning purpose , can you please help me where to start in order to create the Flat File and how many KEY FIGURES & CHAR do I need.
    Thanks,
    -Neha

    Hi,
      As this is for your learning purpose, create the fields as per your requirement. Then create info objects of the same type in BI. Then you try to load the info cube from the flat file.
    for example: if my req is to have 4 fields like student name, marks, grade as my info objects. i have create the same fields in the flat file.
    Note: you can create the flat file in excel and save it as csv format.
    Edited by: arthishri on Sep 20, 2010 1:46 PM

  • How to upload the BP master details in huge amount from flat file to CRM database

    Hi,
    Could you any body please help me initially the best method to upload Business partner data from flat file and if possible with any sample code available?
    Basically I am an ABAP consultant. In ERP I used to do BDC or lsmw  in generally?
    This is a mission critical thing for me.

    Hi Chitturi,
    I did not come across the scenario for custom include fields from BAPI of partner creation. But if the fields are not appearing in the import/tables structure fields then you probably need to update the corresponding DB Table for those fields separately,else BAPI will update the same. You will get partner guid and partner number from export parameters of the BAPI.
    Regards,
    Dipesh
    Message was edited by: Joaquin Fornas

  • Data loading from flat file into bw

    Hi Experts,
    When we load data from flat file into BW the <b>sequence of fields in flat file</b> should be matched with the <b>transfer structure</b> or <b>communication structure</b>?
    wid thanX,
    arijit

    Arijit,
    The sequence of fields in a flat file must be the same as this one in the transfer structure.
    The comm and tran structures are the same after the first creation of datasource from flat file source system. After that someone could change the sequence in the CS -- if the mapping of fields in transfer rules remains unchanged, then the load is to be succesful.
    In case of changing the sequence in TS you'll get either error or wrong load (values to be loaded into some infobjects will go to another ones.)
    Best regards,
    Eugene

  • Importing data from Flat file

    Hi all Experts,
    I am a ABAPer and trying to learn BW by my own. I wanted to import data from flat file and generate some reports on that.
    Can anybody tell me the steps starting from the infocubes(guess its the first step), to achieve it. Any help will be a great help for me.
    Thanks in Advance,
    Smita

    1.to start with create infoareas, infoobjects(accoring to what u have in flat file).
    2.then create a cube which will include these infoobj's and activate it.
    3.create an application component and then create infosource,right click and assign ds to infosource and specify ur PC file source system(whatever system u've), 4.then u'll go to the infosource screen where u need to maintain the exact order of ur file in transfer structure tab, then maintain transfer rules, activate it.
    5.create upate rules for ur cube by mentioning this infosource name.
    6.create infopackages and schedule them. after data is loaded to cube, use tcode rrmx and logon to bex and find ur cube and then create queries on them.

  • Create inbound invoice from flat file

    Hi Folks,
    for periodic creation of PO invoice from flat file, what would be the best way to go?
    Thanks and Rg. Jimbob

    1. Read the file using OPEN DATASET and read and fill up the segment info and fill the EDIDC header data
    and then call function
    CALL FUNCTION 'INBOUND_IDOC_PROCESS'
        TABLES
          IDOC_CONTROL       =  i_edidc
          IDOC_DATA          =  i_edid4.

  • Purchase Order Creation from ME5A Report

    Hi experts,
    My client wants Purchase Order Creation from ME5A Report.
    He wants show Open Purchase Requisition through ME5A report then he will select Purchase Requisition Number or line item for po creation from there only.
    Please advice how I can map this process in sap.
    Thanks in advance,
    Chandhu

    Why don't you use ME57 to display open PRs and then assign sources and convert them to PO?
    Or use ME57 to assign sources and ME59 to automatically convert them to PO.
    You can create your very own format for report display using  custom "Scope Of List" for ME57.
    Look in SPRO under Purchasing>Reporting>Maintain Purchase requisition lists.

  • IDOC/BAPI for Production order creation from Legacy system

    Hi all
    We are using an interface to create Production orders from legacy to SAP. Would you recommend an IDOC or a BAPI to create Production orders. If IDOC or BAPI then could you please mention which one?
    thanks a bunch

    Hi John,
    For your purposes, please use BAPI for production order creation from legacy system. There is no standard inbound IDoc available to use. SAP has an IDoc for outbound interface only (message type LOIPRO).
    If there is an inbound IDoc available, I would recommend to use an IDoc.
    IDoc technology has excellent error handling and will allow you to reprocess an error (if any).
    BAPI is also good approach to use and fast in term of  processing.
    For BAPI approach, you can use BAPI BAPI_PRODORD_CREATE.
    Hope this will help.
    Regards,
    Ferry Lianto

Maybe you are looking for

  • ASA 5505 with Backup ISP

    I am working with a client that currently has an ASA 5505 with two ISPs for failover using a tracked interface.  I would like to configure logging so that the ASA will email us when the Primary ISP goes down and fails over to the backup.  Here is wha

  • What must I do to move my iTunes library to a Firewire-connected HD?

    I have added an external hard drive (WD 2TB) using the existing FireWire connection to my Mac PowerBook 17" Titanium. The internal hard drive is quite small (120GB) so I want to move my existing iTunes library (and all associated files) to this new e

  • How do I get my iPhone4s back to iOS 5

    I updates my iPhobe4s to iOS6. Now my iPhone does not work correctly with my handsfree telephone in my ca (Mercedes-Benz W212). How ca i get back my old firmware (iOS) on my phone? Thanks fpr held!

  • VB4 OO40 2.2 to Oracle 8i

    We are in a process of transitioning our applications across to Oracle 8i (8.1.6) and part of this involves an older app using VB4.0 16 bit running through OO4O 2.2 and connecting to Oracle 7.3.4. Whilst the application connects and runs fine for the

  • Help with forEach loop

    I have a JSTL forEach loop similar to below: <c:forEach var="product" items="${sessionScope.products}">      <tr><td>${product.description}</td></tr> </c:forEach>I would like to use a static class to format the description. Something like below, but