Creating  idocs based on invoice number ocurrences

Hi ,
I want  to create idocs based on invoice numbers .
Lets say i have a file coming in from sender system
Invoice1 material customer value
Invoice1 materail1 ..........
imvoice2 material2.....
invoice2 material1.....
invoice1 material3..
Invoice3. material4....
So for Invoice1 only one Idoc should be created  similarly for invoice 2 which is ocurring twice in the file
only 1 idoc  should be created
Let me know how to achieve this ..  by UDF , or by split by value
please help
thnx
Chirdip

Hi,
  Change the IDOC occurance to 0-unbounded.Export the xsd change the occurance and import it to external definition.
Map Like below:
invoice number--removecontext--sort--splitbyvalue(valuechange)--IDOC
other fields you need to map like below.
invoice number--removecontext--sortbykey--SplibyValue(Each)---IDOC fields
source field----removecontext------
Regards,
Prakasu.M

Similar Messages

  • How to split the IDOCS based on document number change whit out BPM

    Hi all,
    Thanks,for giving the responce..
    Scenario:File to IDoc.
    Problum1 : How to Split the IDocs based on document number change in the source file with out BPM.My file contains document numbers like
    20000092
    20000092
    20000092
    50000050
    50000050
    50000065
    I want 3 IDocs in target system.i.e 1 for 20000092,20000092,20000092
                                                       2 for 50000050,50000050
                                                       3 for 5000006
    By using external definations i am getting 6 IDOCs insted of 3.
    Problum 2:Is there any chnges/modifications in Directory when we are using external definations.
    Could u plz provide me the step by step process(Repository/Directory) with using of external definations.
    Thanks in advance.
    Regards,
    KP

    HI,
    for this no need of BPM.
    You can think of Idoc bundling concept to acheive this-just you need to do the external definition to change the idoc occurence
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    to achieve for each document no, one idoc, you can write small user defined function in the mapping with context handling you an achieve this.
    For this e.g
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
    Regards,
    Moorthy

  • Need to create Target substructure if invoice number node has a value.

    I only want to create Target substructure if Source node <Invoice Number> has a value and is not blank. Can not use Exists function because <Invoice Number> node is 1..1 so it will always be there but it may be empty. Thank you.

    Hi Glenn,
    If you are getting the source from idoc and if you dont have invoice number from idoc then you will not at all have the field. So it will not be empty until unless somebody manually sends from we19. So you should not run into those kind of issues.
    Anyways you can check both blank and length. So check lenght greater than zero and equal to blank which is a space. It should work.
    Regards,
    ---Satish

  • Post incoming payments based on Invoice number.

    Hello,
    I would appreciate your help on the following question. POINTS AVAILABLE. <b>Is there a way for us to post an incoming partial payment from a customer based only on the invoice number?</b>
    For example, a customer has several open invoices and want to make a partial payment on 1 of the invoices. <b>I know we can do it using F-28 (Partial Payments tab), however, is there any other way to post a payment to a particular invoice without entering a customer number?</b> Using F-28 brings up all the invoices and pmts for the customer.
    Thanks in advance!

    <b>This is the documentation about the program:</b>
    <b>F.13</b>
    This program clears open items from customer, vendor and G/L accounts (in particular, GR/IR clearing accounts) automatically.
    It selects all accounts specified in the value sets that have debit and credit postings.
    The following items are not cleared:
    Noted items
    Statistical postings and special G/L transactions of the type bill of exchange
    Items with withholding tax postings
    Down payments can only be cleared if down payment clearing for the same amount has been posted
    The remaining open items are grouped according to fixed system criteria:
    Company code
    Account type
    Account number
    Reconciliation account number
    Currency key
    BSID-WAERS for customers
    BSIK-WAERS for vendors
    BSIS-PSWSL for G/L accounts
    Special G/L indicator
    The program also groups items according to a maximum of five user criteria. Note that the trading partner number and the business area are no longer fixed system criteria (in comparison to the former clearing programs SAPF123 and SAPF123W). Therefore, if you want to group by business area or trading partner number, you have to enter these as user criteria.
    Clearing takes place when, for the group of line items selected according to the above criteria, the balance in document currency (for customers and vendors) or in update currency (for G/L accounts) is zero. The date for clearing is the clearing date according to your selection specifications. In an update run, if the clearing transaction is successful, the clearing document number is specified.
    During the program run, all accounts in which clearing can be performed are blocked. They are then unblocked again after the clearing transaction. Accounts that are blocked by other transactions or that are intended for the automatic payment run are not considered in automatic clearing
    <b>OB74</b>
    Prepare Automatic Clearing
    In this activity you enter the criteria for grouping an account's open items for automatic clearing. The clearing program clears the open items that are grouped together if their total balance equals zero in local and foreign currency.
    You must enter the following standard criteria:
    account type
    account number or a number interval
    You can also enter a further five criteria.
    You select these five additional criteria from the fields in table
    BSEG or BKPF. If possible, you should choose fields that are also
    contained in table BSIS (G/L accounts), BSID (customers), or BSIK
    (vendors). You can determine the field names by displaying the tables
    in the Data Dictionary, which you reach by choosing
    Tools -> ABAP Workbench and then Dictionary.

  • BAPI/FM to create idoc based from another(Just like WE19)...

    Hello Experts,
    Are there any BAPI to create a new idoc based on an existing one just like the functionality of WE19?
    Thank you guys!

    But looks like this function module is opening CO07 in SAPGUI...i actually need to call the function module from web application and create the add-on order. Please advise.
    Besides..i can pass the KTEXT value during the function module call itself right? can you pls tell me the reason why i need to force this in the enhancement spot?
    Regards,
    Kumar.
    Edited by: Kumar Kasavaraju on Aug 28, 2009 11:02 PM

  • Create Idocs based on Company Code change & Line Items less than 950

    Dear all,
    I am trying to create the Idocs based on the flat file in the following way.
    1) Create the Idoc per company code
    2) If company code exceeds 950 lines then create another Idoc
    I am trying to follow this BLOG and could not be able to achieve it because in the Blog explained with flat structure and my case is Idoc structure.
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    I changed the Idoc Occurrence and imported to External definition.
    I am able to do the both check individually but not able to put them in combining.
    Please advice..
    Regards

    Company Codes -> sort -> SplitbyVlaue(Valuechange) -> CollapseContexts -> remove contexts
    AND
    Contact(CompanyCodes, Lines) both in header context - removeContexts - SortbyKey(CompanyCodes) -
    formatbyExample(Company Codes -> sort -> SplitbyVlaue(Valuechange)) - count - greater(>950)
    Srikanth Srinivasan

  • CIN-Exicse Invoice created but no internal invoice number generated

    Hi all,
    While saving the Excise Invoice, the Excise Duties get updated and  shows that the MODVAT is updated, but no internal invoice number is generated. Hence I am not able to change/display the saved invoice in J1IIN. It shows " No document generated or the document has been archived". Secondly if I check the number range J_1IINTNUM which is for internal number range, it is updated.
    Kindly suggest what may the error be.
    Karthik

    Hi Gautam,
    Thanks for the answer. As I said I have already maintained the number range. Secondly I am being able to issue the output. But I tried changing the number range as you have given, but the outcome is the same. It says 'Document no does not exist or the document must have been archived'
    Is there any way that I can retrive the archived document?
    Note:
    In the T-Code J1IIN when I select the Due List in the Change mode I am being able to see all documents.
    Kindly suggest whether I am getting things jumbled up.
    Karthik.

  • How to create Idoc based on NAST entries

    Hi Experts,
       I have a requeriement, on successful posting of receipt i  need to send an idoc ORDERS05 using objkey(PO number) of NAST table. How to proceed on this??
    Regards
    Sridevi S
    Edited by: Sridevi Sivanandam on Aug 1, 2010 4:25 PM

    hello,
    please see the segment for ORDERS05 from WE30 and after that you should have an idea what kind of data you need to pass.
    NAST-OBJKEY can contain PO number, article number based on the message / output type fired from GR...
    please have a close look at the data being entered in that field...
    after that you can relevant data from PO document for creating the IDOC.
    Thanks

  • Create IDOC Based on an Event Being Triggered

    I have a BOR object that when changed - triggers event 'Change'
    I would like to code the event linkage such that an IDoc is created everytime the event is raised.
    Has anyone done this before?
    The message type I am using is a standard one and is associated with the same BOR object.
    Which function module should I use in the event linkage for that 'change' event?
    The IDoc doesnt have an outbound function module.
    Please indicate steps or point me to related weblogs/threads
    Thanks

    hi!!!!!!!!!!!!!!
    this is the sample code which may help u,
    *BAsic type ZMARA
    *Extension ZMARA
    *Message type ZMatmas
    REPORT  zi_material_idoc
            NO STANDARD PAGE HEADING
            MESSAGE-ID b1.
    TABLES: z1maram, z1mara_desc, z1marcm.
                        TYPE DECLARATION
    TYPES: BEGIN OF ty_data,
            matnr TYPE matnr,
            ernam TYPE ernam,
            ersda TYPE ersda,
            mtart TYPE mtart,
            mbrsh TYPE mbrsh,
            spras TYPE spras,
            maktx TYPE maktx,
            werks TYPE werks_d,
            lgort TYPE lgort_d,
           END OF ty_data.
    DATA: w_data TYPE ty_data,
          w_edidd TYPE edidd,
          i_edidd TYPE STANDARD TABLE OF edidd,
          w_edidc TYPE edidc,
          i_edidc TYPE STANDARD TABLE OF edidc.
                         SELECTION SCREEN                               *
    PARAMETERS: p_matnr TYPE matnr.
                       AT SELECTION SCREEN
    *Validate Material
    AT SELECTION-SCREEN ON p_matnr.
      PERFORM check_matnr.
                       START-OF-SELECTION
    *Start of selection
    START-OF-SELECTION.
      PERFORM get_data_from_selection.
                        END-OF-SELECTION
    *End of selection
    END-OF-SELECTION.
      IF NOT i_edidd IS INITIAL.
        PERFORM generate_idoc.
      ENDIF.
    *&      Form  check_matnr
          text
    FORM check_matnr .
      DATA l_matnr TYPE matnr.
      IF NOT p_matnr IS INITIAL.
        SELECT SINGLE matnr FROM mara INTO l_matnr
                            WHERE matnr = p_matnr.
        IF sy-subrc NE 0 OR l_matnr IS INITIAL.
          MESSAGE e000 WITH text-004.
        ENDIF.
      ENDIF.
    ENDFORM.                    " check_matnr
    *&      Form  get_data_from_selection
          text
    FORM get_data_from_selection .
      SELECT SINGLE a~matnr
                    a~ernam
                    a~ersda
                    a~mtart
                    a~mbrsh
                    b~spras
                    b~maktx
                    c~werks
                    c~lgort
                    INTO w_data
                    FROM mara AS a
                    INNER JOIN makt AS b
                    ON amatnr = bmatnr
                    INNER JOIN mard AS c
                    ON amatnr = cmatnr
                    WHERE a~matnr = p_matnr AND
                          b~spras = 'EN'.
      IF sy-subrc = 0.
        MOVE: w_data-matnr TO z1maram-matnr,
              w_data-ernam TO z1maram-ernam,
              w_data-ersda TO z1maram-ersda,
              w_data-mtart TO z1maram-mtart,
              w_data-mbrsh TO z1maram-mbrsh,
              w_data-spras TO z1mara_desc-spras,
              w_data-maktx TO z1mara_desc-maktx,
              w_data-werks TO z1marcm-werks,
              w_data-lgort TO z1marcm-lgort.
    Populate Parent Segment
        w_edidd-segnam = 'Z1MARAM'.
        w_edidd-sdata = z1maram.
        APPEND w_edidd TO i_edidd.
        CLEAR w_edidd.
    Populate Extn Segment
        w_edidd-segnam = 'Z1MARCM'.
        w_edidd-sdata = z1marcm.
        APPEND w_edidd TO i_edidd.
        CLEAR w_edidd.
    Populate Child Segment
        w_edidd-segnam = 'Z1MARA_DESC'.
        w_edidd-sdata = z1mara_desc.
        APPEND w_edidd TO i_edidd.
        CLEAR w_edidd.
      ENDIF.
    ENDFORM.                    " get_data_from_selection
    *&      Form  generate_idoc
          text
    FORM generate_idoc .
    Populate Control Record
      w_edidc-direct = '1'.
      w_edidc-rcvpor = 'A000000021'.
      w_edidc-rcvprt = 'LS'.
      w_edidc-rcvprn = 'ZMATMAS'.
      w_edidc-sndprt = 'LS'.
      w_edidc-sndprn = 'LOG950R3'.
      w_edidc-mestyp = 'ZMATMAS'.
      w_edidc-idoctp = 'ZMARA'.
      w_edidc-cimtyp = 'ZMARA'.
    Data Distribution
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
        EXPORTING
          master_idoc_control            = w_edidc
        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.
      IF sy-subrc = 0.
        CLEAR w_edidc.
        READ TABLE i_edidc INTO w_edidc INDEX 1.
        IF sy-subrc = 0.
          WRITE:/ w_edidc-docnum.
        ENDIF.
      ENDIF.
    ENDFORM.                    " generate_idoc
    this link may help u,
    http://help.sap.com/saphelp_nw04/helpdata/en/0b/2a6702507d11d18ee90000e8366fc2/content.htm
    reward if useful.

  • Customer Outstanding based on invoice date

    Hi,
    As you know that we have statndard report for Customer Outstandings which will give us the cusomer outstanding balance with time buckets. in that we calculate the outstanding amoount based on Posting Date.
    Now i want to calculate the same based on invoice date insted of posting date . In the statndard report it was calculated based on posting key date with  SAP Exit. variable.
    Please guide me how to calculate the Custiomer Outstanding amount based on invoice Date.  And guide me how to create buckets  based on invoice date.
    Thanks & Reagards,
    Anand

    Hi,
    Buckets means you need to Substract some Date with invoice date, so you can create Customer Exit Variable with Formula type and do it.
    See the Material age Buckets report and develope your report.
    Calculating the Ageing of the Materials
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/a-c/calculating%20the%20ageing%20of%20the%20materials.pdf
    For all other Customer Exit Variables code pls see.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    Thanks
    REddy

  • Multiple IDOCs based on multiple fields in File to IDOC mapping

    Hello Experts,
         I have a requirement to create multiple IDOCs based on multiple fields.
         Earlier my requirement is to create IDOCs based on ShipID (i.e., for every ShipID new IDOC...I achieved this).
         But now the requirement was to create IDOC based on two more fields like
    Source:
         ShipID1
         FieldA with value1 
         FieldB with value1
    Target :
         1 IDOC to create
    and If
    Source:
         ShipID1
         FiledA with Value2
         FiledB with Value2
         ShipID1
         FiledA with Value1
         FiledB with Value2
    Target:
         2 IDOCs based on FiledA
    Like wise IDOC should create for every change in FiledA and FieldB.
    If FiledA and FiledB has no changes then create IDOC based on ShipID
    please help me in achieving this as this is an urgent requirement.

    Hi Prasad -
    Just concat all the three fields - shipID1, FieldA and FieldB and
    remove contexts
    split by value (value changed)
    collapse contexts
    This way whenever there is a change in any of the above fields you'll have separate IDOC..

  • How to create IDoc once Sales Order Invoice (Billing) has been created

    Hi,
    How to create IDoc once Sales Order Invoice (Billing) has been created   ?
    I.e Once you click on save button of Invoice , IDoc Should genrate Automatically.
    Thanks.

    Hi,
    We need to do custom configuration for this scenario such that an output type will be attached when ever an INVOICE is created.
    Refer to application V3 in NACE. The Output type should contain an entry with transmission medium: Distribution (ALE).
    for example check the customization done for an output type in NACE.
    Goto NACE ---> Select an application V3 ---> Click on processing routines ---> select the output type (Eg: RD00) ---> Click on Details button  (CNTRL + SHFT + F2) which gives the configuration info.
    For example we can generate the IDOC based on the settings in partner profiles for the customer (Sold To)
    With Regards,
    Dwaraka.S
    Edited by: Dwarakanath Sankarayogi on Jan 29, 2009 8:16 AM

  • Create sales order with refrence to invoice number

    Hi,
    I am creating salesorder using FM SD_SALESDOCUMENT_CREATE in my custom report.
    My requirement is to create a sales order with refrence to a invoice number. Kindly let me know which parameters are need to be passed to this FM to create sales order with refrence to a invoice.
    Regards,
    Rajneesh

    Hi,
    Please I have something similar requirement ot create the sales order from the billing document via Idoc.
    Please let me know if any ideas thanks
    Cheers
    Jasmeet

  • DRQ:Credit Note not based on invoice should transfer reference number to JE

    according to SAP business one system behavior, only those credit notes that based on invoices are able to transfer customer/vendor reference no. field value to reference 2 field in journal entry. I would like to propose to enable AP credit note that is not based on invoice to transfer reference number field to JE as well.

    Even if it is possible, you would be better split the amount to individual credit note.  I have no idea why you need to split line in one credit note.
    Thanks,
    Gordon

  • How to create multiple idocs based on complex condition

    HI Users,
    my scenario is jms(xml file) to idoc. for each file have multiple records for each record i need to create multiple idocs.
    source structure:
    <lineitem>
    <student sid="cid">456</student>
    <hreference>
    <reference rtype="number">123</reference>
    </hreference>
    <hreference>
    <reference rtype="number">789</reference>
    </hreference>
    <hreference>
    <reference rtype="char">147</reference>
    </hreference>
    now condition is One input message must create only one output message for each unique  rtype="number" and sid="cid" combination.
    for example
    1. rtype="number" and sid="cid" the value combination means 123456 for this one idoc
    2.  rtype="number" and sid="cid" the value combination means 789456 for this one idoc
    --> the below file shows with out sid="cid"
    <lineitem>
    <student sid="abc">456</student>
    <hreference>
    <reference rtype="number">123</reference>
    </hreference>
    <hreference>
    <reference rtype="number">789</reference>
    </hreference>
    <hreference>
    <reference rtype="number">147</reference>
    </hreference>
    in this case we have to consider only rtype="number" so here we need to create  3 idocs.
    Could anyone help me in this regard.
    Thanks in advance

    Hi Swathip,
    Change the occurence of the IDoc to "unbounded", so that multiple IDocs can get create
    Try with below logic
    If (SID = "CID")
    Then
         If(rtype = "number")
              concat(student,reference ) ---> removeContext ---> Idoc          
    Else
         rtype ---> removeContext ---> Idoc
    If combination of unique  student and reference can occur more than once in the XML, use sort command and splitByValue (Value Change)
    Edited by: chandra shekhar on Jul 3, 2011 12:53 PM

Maybe you are looking for

  • Photos not being sent properly from mail.app

    I wonder if anyone can help with this issue. I cannot send photos via mail.app using the "email" button from iphoto, or by attaching using the "attach" button in mail.app or by dragging the picture from it's folder into a mail message. The picture do

  • Email will Not Sync

    My Yahoo email has stopped syncing to my Droid X. Has worked fine for 8 months until 2 days ago.  

  • Itunes/quicktime crashes when trying to play video podcasts and 3GP files

    Hello all, I've searched these forums and didn't see anything that might help me, so if know of any solutions posted already, please let me know. I have an HP laptop(AMD Turion 64 X2 2.0 GB processor, 2 GB or RAM) running Windows Vista Home Premium.

  • How can I access my IPhoto files on Bridge in Photoshop?

    Hoe can I access my IPhoto files in Bridge in Photoshop?

  • Is Safari The Best Web Browser?

    I Have been dissapointed lately with safari, its always seem to be slow & i have cable. the pages sometimes take forever or get errors, plus alot of video dont play. i was wondering if anyone has tried and can say that there are other browsers that a