LSMW me51n, how to create one PR document for all the records in the  file

HI all,
I need to create LSMW for t-code me51n -Create Purchase Requisition. I`m using Bapi BUS2105, method CREATEFROMDATA, idoc message type PREQCR, basic type PREQCR03. The problem is that the LSMW is creating different idoc and different PR document for every record in the source file. My requirement is to create one PR document for one source file (Every source file is different Purchase Requisition) . I`m trying to do this with writing some code(global functions ) in the 'Mapping and conversion rules'  events - BEGINOF_TRANSACTION_, ENDOF_TRANSACTION__..., but i`m not very sure what exactly i`m doing .
Please help me resolve this problem, any help will be appreciated .
Best regards, Emil Milchev.

Thank you for you answer.
But I have found faster way of doing it - two source structures, one HEADER and ONE ITEM.
HEADER: one empty text field and identificator for it.
ITEM: everything else.
Then everything was just fine, i`ve mapped the different IDOC segments by PREQ_ITEM fields (equal values in the source file : 10-10-10..., 20-20-20,.... etc.) and put all required fields for my LSMW
SOURCE FIELDS:
Z_ME51N_V2 - MASS_UPLOAD - CREATE create
Source Fields
UPFILE                    upload file
            IDENT                          C(010)    ident
                                           Identifing Field Content: header
            TEXT                           C(001)
            UPFILE2                   123
                IDENT                          C(010)    ident
                                               Identifing Field Content: item
                BSART                          C(004)    Document type
                BANFN                          C(010)    Purchase requisition number
                BNFPO_FOR_MAP                  N(005)    Item number of purchase req. for MAPPING acc.
                BNFPO                          N(005)    Item number of purchase requisition
                KNTTP                          C(001)    Account assignment category
                PSTYP                          C(001)    Item category in purchasing document
                MATNR                          C(018)    Material Number
                WERKS                          C(004)    Plant
                LGORT                          C(004)    Storage Location
                MENGE                          N(013)    Purchase requisition quantity
                EKGRP                          C(003)    Purchasing group
                KONNR                          C(010)    Number of principal purchase agreement
                KTPNR                          N(005)    Item number of principal purchase agreement
                LIFNR                          C(010)    Desired Vendor
                FLIEF                          C(010)    Fixed Vendor
                AFNAM                          C(012)    Name of requisitioner/requester
                PREIS                          AMT4(011) Price in purchase requisition
                ABLAD                          C(025)    Unloading Point
                WEMPF                          C(012)    Goods Recipient
                PS_POSID                       C(024)    Work Breakdown Structure Element (WBS Element)
                KOSTL                          C(011)    COST_CTR v bapito ?
                NAME1                          C(040)    Name1 - Name of an address
                NAME2                          C(040)    Name2 - Name of an address 2
                STREET                         C(060)    Street
                DELIVERY_DATE                  C(008)    Date on which the goods are to be delivered
                TEXT                           C(132)    item text
STRUCTURE RELATIONS :
Structure Relations
E1PREQCR              Header segment                                               <<<< UPFILE  upload file
           E1BPEBANC             Transfer Structure: Create Requisition Item                  <<<< UPFILE2 123
           E1BPEBKN              Transfer Structure: Create/Display Requisition Acct Assgt    <<<< UPFILE2 123
           E1BPEBANTX            BAPI Purchase Requisition: Item Text                         <<<< UPFILE2 123
           E1BPESUHC             Communication Structure: Limits                              <<<< UPFILE2 123
           E1BPESUCC             Communication Structure: Contract Limits                     <<<< UPFILE2 123
           E1BPESLLC             Communication Structure: Create Service Line                 <<<< UPFILE2 123
           E1BPESKLC             Create Comm. Structure: Acct Assgt Distr. for Service Line   <<<< UPFILE2 123
           E1BPESLLTX            BAPI Services Long Text                                      <<<< UPFILE  upload file
           E1BPMERQADDRDELIVERY  PO Item: Address Structure BAPIADDR1 for Inbound Delivery    <<<< UPFILE2 123
               E1BPMERQADDRDELIVERY1 PO Item: Address Structure BAPIADDR1 for Inbound Delivery    <<<< UPFILE2 123
           E1BPPAREX             Ref. Structure for BAPI Parameter EXTENSIONIN/EXTENSIONOUT   <<<< UPFILE2 123
MAINTAIN FIELD MAPPING AND... :
the MAPPING between two IDOC`s segments:
In first segment:
E1BPEBANC                      Transfer Structure: Create Requisition Item
         Fields
             PREQ_NO                      Purchase requisition number
                                 Source:  UPFILE2-BANFN (Purchase requisition number)
                                 Rule :   Transfer (MOVE)
                                 Code:    E1BPEBANC-PREQ_NO = UPFILE2-BANFN.
             PREQ_ITEM                    Item number of purchase requisition
                                 Source:  UPFILE2-BNFPO (Item number of purchase requisition)
                                 Rule :   Transfer (MOVE)
                                 Code:    E1BPEBANC-PREQ_ITEM = UPFILE2-BNFPO.
In second segment :
E1BPEBKN                       Transfer Structure: Create/Display Requisition Acct Assgt
           Fields
               PREQ_NO                      Purchase requisition number
               PREQ_ITEM                    Item number of purchase requisition
                                   Source:  UPFILE2-BNFPO_FOR_MAP (Item number of purchase req. for MAPPING
                                   Rule :   Transfer (MOVE)
                                   Code:    E1BPEBKN-PREQ_ITEM = UPFILE2-BNFPO_FOR_MAP.
After that everything was OK .

Similar Messages

  • How to create one GR document for mutiple Purchase orders

    Can you please explain me in SAP - How to create one Goods Receipt document for reference of Multiple purchase orders.

    Dear Tanuj,
    Both Rama & Stephen are correct.
    You can take Single GR for Multiple PO either in MIGO or MB01 as long as that POs belongs to same vendor.
    In MIGO, after putting the PO press,enter,  again give the next PO of that vendor .
    If this solve your problem, close the issue.
    With Regars,
    Krishna Reddy

  • How to Create a Billing Document For SalesOrder

    Hi Guys,
    Any one please Explain me how to create a Billing Document for salesOrder. give me step by step procedure so i can easily understand the terms.Thanks in advance.
    Thanks
    Kiran.B

    Hi Kiran,
    Normally a billing doc is created after a sales order-->delivery.
    U can create a sales order w.r.t a Contract or another sales order.
    In your case, its possible only for sales Returns.
    pass billing doc number to ORDER_HEADER_IN-REF_DOC in BAPI_SALESORDER_CREATEFROMDAT2.
    Reward points if helpful
    Regards,
    Hemant

  • How to create an inspection lot for each line item of the Purchase order?

    Hi,
    How to create an inspection lot for each line item of the Purchase order ?
    In detail if possible.

    Hi
       please check this
    [thread|Create Inspection Lot;

  • How to create one inbound delivery for multiple purchase order?

    Hi Experts,
    Please let me know how can I create one inbound delivery for multiple purchasing documents(PO or SA)? 
    Is there a configuration needed for this?  If yes, please let me know the configuration to make this happen.
    Appreciate your help on this.  Right answers will be rewarded.
    Thank you.
    with regards,
    Muthu Ganapathy.

    Hi,
    my situation is:
    - a WM managed warehouse, society A;
    - a HU managed warehouse (without WM), society B;
    - a purchasing process of HU from society A towards society B.
    Society B have a scheduling agreement; when a delivery schedule appears, in society A born a sales order and a delivery. After the registration of the delivery good issue, an idoc transfer information for inbound delivery creation.
    This process is ok without WM, but with a WM managed warehouse the idoc has the following problem:
    "V51VP - item was not found - process cancelled".
    Can you help me to transfer these HU?

  • Tcode to create single delivery document for all line items in PO

    Hi all,
    Sorry if it is a simple question, But I am from SD module. What is Tcode to create a single delivery documents for all line items in PO. I have 3 line items with Different materials having diffent quantities and there are different delivery dates and different delivery schedule dates. I need to create single delivery. Could you please tell me how to do it? What is the Tcode?
    Thanks
    Anil

    Hi,
    Inbound delivery T.code VL31N.
    Regards,
    JS

  • How to get One Selection Screen for all queries?

    Hi Experts,
    I have three queries having selection screens. All the selection screen have the same variables, but the reports are different.
    I have created a workbook having these three queries. Each time when the workbook opens, the three selection screen pops up one after the another. Same values are entered in all the selection screens.
    Now the user wants only one selection screen for all the three reports. Is it possible? I tried but I do not see any way.
    I think there should be some way of getting it done.
    Waiting for your inputs,
    With kind regards,
    Shreeem

    Hi
    If a workbook contains multiple queries that use the same variable, you are prompted to enter the variable values again for each query. To avoid this, set the Display Duplicate Variables Only Once flag.
    Goto Workbook Settings>Under Variables Tab>select Display Duplicate Variables only Once
    http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/54/a493f7256b43698191a2623e5a0532/frameset.htm
    Hope this helps,
    Aparna Duvvuri

  • Best way to create a background image for all resolutions without drastically increasing file size.

    I see a lot of great background images with complex designs that resize with different screen resolutions. I can create the designs, but I don't know how to create a complex image for large screen resolutions without making it a large file, or it loosing quality with it stretches to the larger size. Is there a code that resizes images when stretched, or do I just have to live with a slower load speed with complex background images?

    The background doesn't resize, it shrinks:
    http://johnpatrickgiven.com/jquery/background-resize/
    Basically make a 1920x1080 or higher resolution file and use that script.  There will always be a maximum but based on your response that is not your monitor.  Photoshop and other tools do a pretty good job compressing jpeg files and most internet connections are fast enough to make it seamless.

  • How to create multiple accouting documents for one invoice for diff curr

    Hi experts/gurus,
    I have a requirement where we need to create two two different accounting documents for one invoice. The scenario is this:
    1) We are exporting goods to oversea customer, as such the currency is bill in USD
    2) We also have transportation charges using another condition type, we need to capture this charges/accrual in local currency which is MYR.
    Currently, the system will automatically convert the transporation charges to USD when we create the invoice and the accounting document will be generated in USD for both sales and transport charges.
    is there a way to fullfil the above requirement, any setting in condition type or any user exists we can used to create hte accounting documents.
    Any ideas/input is highly appreciated, points will be awarded

    Hi Wan,
       The following user exits are available in report SAPLV60B for transfer to accounting (function group V60B): So please go through these.
    ·EXIT_SAPLV60B_001: Change the header data in the structure acchd
    You can use this exit to influence the header information of the accounting document. For example, you can change the business transaction, "created on" date and time, the name of the person who created it or the transaction with which the document was created.
    ·EXIT_SAPLV60B_002: Change the customer line ACCIT
    You can use this exit to change the customer line in the accounting document. This exit is processed once the ACCIT structure is filled in with data from document header VBRK.
    ·EXIT_SAPLV60B_003: Change the customer line in costing
    The customer line is filled in differently for costing. You can use exit 003 to influence the ACCIT structure.
    ·EXIT_SAPLV60B_004: Change a GL account item ACCIT You can add information to a GL account item (such as quantity specifications) with this exit.
    ·EXIT_SAPLV60B_005: User exit for accruals
    Once all relevant data for accruals was entered in the GL account item, you can add to this data with this exit.
    ·EXIT_SAPLV60B_006: Change the control line ACCIT
    You can use exit 006 to add information to the control line.
    ·EXIT_SAPLV60B_007: Change the installment plan
    You can use exit 007 to add information to the installment plan
    parameters in the GL account item.
    ·EXIT_SAPLV60B_008: Change the transfer structure ACCCR, ACCIT and ACCHD
    After the accounting document is filled in with data, you can use exit 008 to change the document once again.
    ·EXIT_SAPLV60B_010: Item table for customer lines
    You can use exit 10 to influence the contents of customer lines before they are created.
    ·EXIT_SAPLV60B_0011: Change the parameter for cash account determination or reconciliation account determination
    You can use this exit to change inbound parameters in order to influence account determination.
    I hope any one of these will solve your problem
    Thanks,
    Murali.

  • How to create one primary key for each vendor

    Hi all
    i am doing IDOC to jdbc scenario
    i am triggering idoc from R/3 and the data is going into DB table vendor through XI.
    structures are as follows:
    sender side: ZVendorIdoc (this is a customized IDOC , if i triger IDOC for multiple vendors then it triggers only 1 idoc with multiple segment )
    Receiver side:
    DT_testVendor
        Table
            tblVendor
                action UPDATE_INSERT
                access                     1:unbounded
                    cVendorName         1
                    cVendorCode        1
                    fromdate                1
                    todate                    1
                 Key1
                    cVendorName         1
    if i trigger idoc for multiple vendors ,for example vendor 2005,2006 and 2010 . then i can see that the only key comes from the very first field (2005) and the whole record for vendor 2005,2006 and 2010  goes into the table with this(2005) as a primary key
    now again if i send data for these three vendor 2005, 2006 , 2010, in which record for the vendor 2005 is same and for 2006 and 2010 are different than it takes 2005 as a primary key and it does not update the data in the table.
    my requirement is like this:   for each vendor there should be one unique key assigned.
                                              for above said example there should come three keys one for each vendor .
    could you please help me how to do this???????????

    Hi,
      In Mapping Make the statement is 0-unbounded.For each vendor create a statement.This will solve your problem.
    Regards,
    Prakasu.M

  • How to create one submit form for both input an variable ports ?

    Hello,
    I would like to create an input from for a query I have.
    The problem is that this query has both input an variable ports and each one creates a different input form. I would like to join it into one form or at least have it under one "Submit" button so the user won't need to fill two forms.
    How can I achieve this?

    Hi Mario,
    Thank you for your quick reply.
    >>Even if you could, only port would be effective.
    Can you please elaborate?
    >> You need to change your query and make your input port-fields variables?
    So, if I understand correctly I should select whether I go for only inputs or only variables?
    Thanks,
    Roy

  • Create one invoice document for factory sales and third party sales

    Hi All,
    I want to create one single invoice document for material sold from factory and from third party.
    I have checked the copy controls for order to billing but the system is still spliting the invoice.
    Please share your expertise.

    Hello,
    Can you please provide the details from the "Split Analysis", when you are trying to combine the 2 documents.
    Regards,
    Raghavendra

  • AS3: How to create one base class for classes loaded in multiple swfs?

    Our application have 3 different modules and all use
    fscommand and ExternalInterface alot. Now the problem is we are
    combining all those modules, but they all will reside in different
    swfs. Is there any way that they extend to same base class and its
    static members have only one instance accessible by all
    three?

    Hi,
    You can achieve this via Workshop 9.2 by using the exported Ant script for your project as follows:
    -Ensure that all Jars needed to resolve com.bea.p13n.property.EntityPropertyManager (this particular class is found in weblogic92/common/p13n/lib/p13n_ejb.jar) and all referenced classes are added to the Java build path for your WebLogic EJB project (Properties->Java Build Path->Libraries)
    -Export the "Workshop Ant Script" for your WebLogic EJB project (File->Export->Workshop Ant Script); this will generate a "build.xml" Ant script under your project root directory.
    -Edit this default build script as follows: in the call to the "ejbgen" task within the "build" target, add the attribute: propertyFile="ejbgen.properties"
    -Create a file "ejbgen.properties" under the root of your WebLogic EJB project and add the following entry:
    YourSessionBeanClassName.remote.baseClass=com.bea.p13n.property.EntityPropertyManager
    -Add a "<path refid="java.classpath"/>" within the "<classpath>" for the "java" task element that calls "weblogic.ejbc" (this will ensure that the p13n classes are resolved by EJBC)
    Follow the instructions for executing the Ant build script found here: http://edocs.bea.com/workshop/docs92/ws_platform/ideuserguide/conUseCustomAntBuild.html
    For more information on the EJBGen property file support, see: http://e-docs.bea.com/wls/docs92/ejb/EJBGen_reference.html

  • How to create shortcut desktop icon for all users???

    Hello All,
    I want to know how to create shortcut icon for all users in windows 7. I tried C:\Users\Public but no folder for Desktop.
    Thanks

    C:\users\All users
    JS
    Hi,
    I am just wondering, what is the technically correct location to place say, a shortcut, for all users to access on their desktops on a given machine?
    Is it C:\Users\Public\Desktop ?
    Or is it C:\Users\All Users\Desktop ?
    Would it also be possible to explain the differences as well? Or paste some links to the overview of each one? I am having trouble finding anything from MS.
    Thank you.

  • How to create a Custom Screen for executing a report in the backend ?

    Hello Everyone,
    I have a requirement to develop a Custom Application on the Cloud to capture few fields from user and trigger an execution of a report in the background in CRM. There is no need to display any results after the triggering execution. Just need to show a message that "Background Job was successfully submitted".
    I saw the types of screens available for creation as explained in this link Screen Types, unfortunately none of the screen types works out for me.
    As seen from the requirement, there is no need to store any data send from the UI in backend. So, it doesn't make sense for me to create a Business Object. So I tried creating a Query Object to see if that works out, but query object also requires a BO to execute query on and it also makes result list view mandatory and asks me to pick atleast one field to show in the result list.
    I also tried Mass Data run which doesn't fit the bill.
    So, I'm looking for the best possible UI screen and approach to build a simple custom application with 5-6 fields and an execute button. Please suggest me the best possible option available in the C4C.
    Regards,
    Srikanth

    Hey,
    first of all: if you really need a button, you will need to create your own business object with an action.
    If you just want to trigger the service you could add an extension field of type indicator to any standard Bo and the put logic in the before save of this Xbo. Then you just add the indicator to the UI. But the user would always have to go to this screen I.e. The customer...
    so i guess maybe a custom business object with only one instance, a button, some logic in an action and a generated UI including a workcenters 'backend report execution' is the best way for you!
    cheers
    jens

Maybe you are looking for