PR creation using BAPI_REQUISITION_CREATE, Service lines query

Hi,
I am trying to create the PR for service agreements and i'm able to create the same.
My first query is how to populate the data in LIMIT tab(Overall Limit & Expected value) for each line item of PR. I am using BAPI_REQUISITION_CREATE but its not populating the values in LIMIT tab.
2nd Query: BAPI_REQUISITION_CREATE is not checking the validity of the Requisitioner ID and even if the ID is not valis it is creating the PR. Does this BAPI_REQUISITION_CREATE restrict this? I guess it does not. I have created so many PR with invalid ID's while testing and it seems this bapi doesn't care about requisitioner id at all. Please advice some workaround.
Appreciate your help.
Thanks
Randhir

Solved.

Similar Messages

  • PR Creation Using BAPI_REQUISITION_CREATE

    Hi,
    Iam using the RFC "BAPI_REQUISITION_CREATE" to create the Service PR . Iam entering the Service details in REQUISITION_SERVICES.
    PR is getting created but the Service line items are not filled.
    Please let me know which tables to be entered.
    Note: Iam using "BAPI_TRANSACTION_COMMIT"
    Thanks in Advance

    Dear,
    It is a generic problem while creating service PR using BAPI_REQUISITION_CREATE. For creating service PR using above function module follow  SAP note 420331
    Thanks and Regards,
    Chandra

  • Is there a way to use REST service to query data from a forms collection?

    I want to query and retrieve data from a SharePoint forms collection. I have a forms library that has multiple documents all being created using the same template.
    I need to query and retrieve data from it using oData/ReST API.
    I could see the /_vti_bin/listdata.svc and it seems I cannot get the forms data using this.
    What will be the best approach?
    Does that helps?
    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.
    Thanks,
    Kangkan Goswami |Technical Architect| Blog: http://www.geekays.net/
    http://in.linkedin.com/in/kangkan

    Hi,
    Rest service is not available to retrieve the data in forms.
    For this issue, the common workaround I know is to first populate the form fields as columns in form library, then retrieve the columns value instead. You can also use rest service in this way.
    If it is not convenience this way, please provide more information about the scenario to get the data.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • IDOC - PO Creation using a service without master record

    I can not find the field to populate the cost center when i create a PO using a service without master data (buy using Material Group) via transaction WE19.
    The accounting information is present on "E1BPMEPOACCOUNT" segment, but the cost center and G/L Account in this segment were not recognized by IDOC because this segment is used to populate Account Assignment tab on Item Detail Level and my problem appear one step before when after I populate the service tab at Item Detail Level and press .
    In few words I didn´t find the correct field to populate the cost center on Basic type "PORDCR101".
    I tried populate the field COSTCENTER on the segment "E1BPMEPOACCOUNT" but didn´t work.
    Maybe is there another basic type to use in this specific case?
    Thanks a lot.
    Kind Regards,

    Hi,
    In the inbound side create a new entry in WE57 tcode.. with the functio mdoule as "IDOC_INPUT_ORDERS", basic type "ORDERS05", extn< specify the extn u created at outbound side>, message type "ORDERS". Now see if it is working.
    Regards,
    Nagaraj

  • SUP 2.1.3 MBO creation using ODATA service

    Hi All,
    I am using SUP 2.1.3 and trying to consume OData service created using SEGW transaction on gateway. following an older document i moved ahead by creating XSD files from the XML file.
    But,after uploading the XSD file , i chose the root element as 'feed' .
    After this , one XSLT file is generated automatically.
    But , when I click the XSLT file to edit , it shows error saying  'java.lang.NullPointerException' .
    I have to follow the methodology of creating MBO's using OData service and then deploying it on server.
    Please help me to move ahead with ODATA service in SUP 2.1.3 version. 
    Appreciate your quick help and assistance on this.
    Regards
    Rahul

    Hi
    If i ignore the Null exception error and move ahead with the XSLT format and preview the data source i receive the below error:
    Execution failed: HTTP status code is [401], expected [200]; response body is [<html><head><title>Logon Error Message</title><META http-equiv="Content-Type" content="text/html;charset=UTF-8"><style type="text/css">body { font-family:tahoma,helvetica,sans-serif;color:#333333;background-color:#FFFFFF; }td { font-family:tahoma,helvetica,sans-serif;font-size:70%;color:#333333; }h1 { font-family:tahoma,helvetica,sans-serif;font-size:160%;font-weight:bold;margin-top:15px;margin-bottom:3px;color:#003366; }h2 { font-family:verdana,helvetica,sans-serif;font-size:120%;font-style:italic;font-weight:bold;margin-top:6px;margin-bottom:6px;color:#999900; }p { font-family:tahoma,helvetica,sans-serif;color:#333333;margin-top:4px;margin-bottom:4px; }ul { font-family:tahoma,helvetica,sans-serif;color:#333333;list-style-type:square;margin-top:8px;margin-bottom:8px; }li { font-family:tahoma,helvetica,sans-serif;color:#33333;margin-top:4px; }.emphasize { color:#333333;background-color:#C8E3FF;padding:5px;}.note { color:#CC6600; }a { font-family:tahoma,helvetica,sans-serif;text-decoration:underline;color:#336699; }a:visited { color:#001166; }a:hover { text-decoration:none; }</style></head><body><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><h1>Anmeldung fehlgeschlagen</h1><br><h2>Was ist passiert ?</h2><p>Der Aufruf der URL http://10.5.1.150:8000/sap/opu/odata/sap/ZCM_TEST_V5_SRV/PayrqSet/ wurde aufgrund fehlerhafter Anmeldedaten abgebrochen.</p></td></tr><tr><td> </td></tr><tr><td class="emphasize"><strong>Hinweis</strong><br>Die Anmeldung wurde im System GWD ausgeführt. Hierbei wurden keine Anmeldedaten bereitgestellt.</td></tr><tr><td> </td></tr><tr><td><p>  </p><h2>Was können Sie tun ?</h2><ul><li> Falls Sie noch über keine Benutzerkennung verfügen, so wenden Sie sich an Ihren Systemadministrator. </li></ul></br><p class="note">Fehlercode: ICF-LE-http-c:001-l:-T:-C:6-U:-P:-L:6-X:CBC8A013038D1EE486AE76E3D8B54E1D_CBC8A013038D1EE486AE76E3D3D34E1D_1-x:B77319E4C51EF1AFAE1DCBC8A013038D</p></br><p> HTTP 401 - Unauthorized</br><p> Ihr SAP Internet Communication Framework Team</p></td></tr></table></body></html>
    Please let me know if anyone has worked on ODATA+MBO+SUP2.1.3. I know this is not the recommended approach but i have to follow this scenario and i know it can be achieved through this approach. JUst need your assistance experts.
    Thanks & Regards
    Rahul

  • MBO creation using Web Service in SMP3.0

    Hello  Experts,
    When I am trying to create an MBO using web service in SMP3.0, I am getting the following error.
    Please check the screenshot.
    But It is working fine in SMP2.3 .
    Thanks
    Tags edited by: Jitendra Kansal (Moderator)

    Av nas
    Can you check if you are accessing web service URL in browser via some proxy server?
    If yes, then you have to set the proxy settings in SMP3 Mobile workspace.
    Steps:
    Go to Window>Preferences in Mobile Workspace
    Preferences box prompt out, choose "Network Connections"
    Select "Manual" from Action Provider in the drop-down
    Select "HTTP" >Click on "Edit"
    Provide required proxy details with port number.
    Check my blog How to bypass proxy settings in SMP workspace for connecting any public Web Service within corporate Network
    Regards,
    JK

  • Issue with service entry sheet creation using synchronous service

    Hi,
      I am using a synchronous service inside that i am calling bapi bapi_entrysheet_create with testrun
    set,so that commit doesnot happen inside the bapi,then outside i am explicitly calling commit work.
    Still database table is not updated,commit is not working.

    Hi Venu,
       But I cannot set test run as initial because if testrun is set to initial bapi_entrysheet_create logic
    is written in such a way that it calls commit work inside the bapi....and so we cannot rollback later
    in the synchronous service.
    Regards,
    Tess

  • Query relating to the creation of Managed Service Accounts

    Hi Folks
    I am studying for my 70-411 exam and have a query relating to the creation of Managed Service Accounts.
    I have successfully created an MSA account named 'MSATest' on a DC  using:
     new-adserviceaccount -name msatest –dnshostname home-dc-01 -passthru
    and
     add-AdcomputerServiceAccount -identity home-ap-01 -serviceaccount msatest -passthru
    However the guide that I am using now says that I now need to run:  Install-ADServiceAccount on the host computer in the domain to install the MSA in order to make available it available for use by services.
    So on my member server (home-ap-01) I have installed the Active Directory Module for powershell and ran:
    PS C:\Users\administrator.PCECORP> Install-ADServiceAccount -Identity msatest
    Install-ADServiceAccount : Cannot install service account. Error Message: 'An
    unspecified error has occurred'.
    At line:1 char:1
    + Install-ADServiceAccount -Identity msatest
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : WriteError: (msatest:String) [Install-ADServiceA
       ccount], ADException
        + FullyQualifiedErrorId : InstallADServiceAccount:PerformOperation:Install
       ServiceAcccountFailure,Microsoft.ActiveDirectory.Management.Commands.Insta
      llADServiceAccount
    PS C:\Users\administrator.PCECORP>
    However this errors, Have I misunderstood the purpose of the Install-ADServiceAccount ?  or am I doing something wrong?
    Thanks in advance for you help.

    Try using  -RestrictToSingleComputer parameter when creating service account with New-ADServiceAccount.
    Gleb.
    Hi Gleb
    Thank you for your help, it is appreciated.  That did the trick.
    All the best.

  • BAPI_REQUISITION_CREATE: Err-No account assignment exists for service line

    Hi Frnds,
    I am using bapi BAPI_REQUISITION_CREATE to create PR with mutiple Service line.
    I am getting an error message SE518 - No account assignment exists for service line 0000000000.
    Can anyone of you help me out to solve this issue?
    Thanks in advance
    Suganya

    HI
    I need to create pucharse-requisition for services with account assignment K.
    execute BAPI_REQUISITION_CREATE with an item with a service and work well.
    When I prove with two items each one with its service gives east error me
    "E518, No account assignment exists for service line 0000000010"
    my source is:
    REPORT Z_WGS_BAPI_REQUISIT_CREATE_002
                                      NO STANDARD PAGE HEADING LINE-SIZE 180
                          START-OF-SLECTION                              *
    DATA:
    W_NUMBER             LIKE  BAPIEBANC-PREQ_NO,
    W_REQUISITION_ITEMS LIKE BAPIEBANC           OCCURS 0 WITH HEADER LINE,
    W_REQUISITION_ACCOUNT LIKE BAPIEBKN          OCCURS 0 WITH HEADER LINE,
    W_REQUISITION_SERVICES LIKE BAPIESLLC        OCCURS 0 WITH HEADER LINE,
    W_REQUISITION_SRV_VALUES LIKE BAPIESKLC      OCCURS 0 WITH HEADER LINE,
    W_RETURN             LIKE BAPIRETURN         OCCURS 0 WITH HEADER LINE,
    W_RETURN1            LIKE  BAPIRET2          OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    perform item_10.
    perform item_20.
    perform bapi.
    form item_10.
    **Item 10
    W_REQUISITION_ITEMS-DOC_TYPE = 'NB'.
    W_REQUISITION_ITEMS-PREQ_ITEM = '00010'.
    W_REQUISITION_ITEMS-ACCTASSCAT = 'K'.
    W_REQUISITION_ITEMS-ITEM_CAT = '9'.
    W_REQUISITION_ITEMS-PUR_GROUP = 306.
    W_REQUISITION_ITEMS-PURCH_ORG = '9000'.
    W_REQUISITION_ITEMS-PLANT    = 'CO95'.
    W_REQUISITION_ITEMS-PREQ_NAME = 'EORTIZ'.
    W_REQUISITION_ITEMS-DELIV_DATE = SY-DATUM.
    W_REQUISITION_ITEMS-SHORT_TEXT = 'Servicio 1'.
    W_REQUISITION_ITEMS-MAT_GRP = 'SER-0005'.
    W_REQUISITION_ITEMS-QUANTITY = '1.000'.
    W_REQUISITION_ITEMS-PCKG_NO = '0000000001'.
    W_REQUISITION_ITEMS-GR_IND = 'X'.
    W_REQUISITION_ITEMS-IR_IND = 'X'.
    W_REQUISITION_ITEMS-FIXED_VEND = space.
    W_REQUISITION_ITEMS-INFO_REC = space.
    APPEND W_REQUISITION_ITEMS. CLEAR W_REQUISITION_ITEMS.
    W_REQUISITION_ACCOUNT-PREQ_ITEM = '00010'.
    W_REQUISITION_ACCOUNT-SERIAL_NO = '01'.
    W_REQUISITION_ACCOUNT-COST_CTR = '0001010106'.
    W_REQUISITION_ACCOUNT-G_L_ACCT = '0063010001'.
    APPEND W_REQUISITION_ACCOUNT. CLEAR W_REQUISITION_ACCOUNT.
    W_REQUISITION_SERVICES-PCKG_NO     =  '0000000001'.
    W_REQUISITION_SERVICES-LINE_NO     =  '0000000001'.
    W_REQUISITION_SERVICES-EXT_LINE    =  '0000000000'.
    W_REQUISITION_SERVICES-SUBPCKG_NO  =  '0000000002'.
    W_REQUISITION_SERVICES-FROM_LINE   =  '1'.
    W_REQUISITION_SERVICES-PLN_LINE   =  '0000000001'.
    APPEND W_REQUISITION_SERVICES. CLEAR W_REQUISITION_SERVICES.
    W_REQUISITION_SERVICES-PCKG_NO     =  '0000000002'.
    W_REQUISITION_SERVICES-LINE_NO     =  '0000000002'.
    W_REQUISITION_SERVICES-EXT_LINE    =  '0000000010'.
    W_REQUISITION_SERVICES-SUBPCKG_NO  =  '0000000000'.
    W_REQUISITION_SERVICES-SERVICE    =  '000000000003000001'.
    W_REQUISITION_SERVICES-QUANTITY   =  '5.000'.
    W_REQUISITION_SERVICES-BASE_UOM   =  'UN'.
    W_REQUISITION_SERVICES-GR_PRICE   =  '150.0000'.
    APPEND W_REQUISITION_SERVICES. CLEAR W_REQUISITION_SERVICES.
    W_REQUISITION_SRV_VALUES-PCKG_NO    =  '0000000002'.
    W_REQUISITION_SRV_VALUES-LINE_NO    =  '0000000002'.
    W_REQUISITION_SRV_VALUES-SERNO_LINE = '01'.
    W_REQUISITION_SRV_VALUES-SERIAL_NO  =  '01'.
    W_REQUISITION_SRV_VALUES-PERCENTAGE  = '100.0'.
    APPEND W_REQUISITION_SRV_VALUES. CLEAR W_REQUISITION_SRV_VALUES.
    endform.
    form item_20.
    item 20
    W_REQUISITION_ITEMS-DOC_TYPE =   'NB'.
    W_REQUISITION_ITEMS-PREQ_ITEM = '00020'.
    W_REQUISITION_ITEMS-ACCTASSCAT = 'K'.
    W_REQUISITION_ITEMS-ITEM_CAT = '9'.
    W_REQUISITION_ITEMS-PUR_GROUP = '306'.
    W_REQUISITION_ITEMS-PURCH_ORG = '9000'.
    W_REQUISITION_ITEMS-PLANT    = 'CO95'.
    W_REQUISITION_ITEMS-PREQ_NAME = 'EORTIZ'.
    W_REQUISITION_ITEMS-DELIV_DATE = SY-DATUM.
    W_REQUISITION_ITEMS-SHORT_TEXT = 'Servicio 2'.
    W_REQUISITION_ITEMS-MAT_GRP = 'SER-0005'.
    W_REQUISITION_ITEMS-QUANTITY = '1.000'.
    W_REQUISITION_ITEMS-PCKG_NO = '0000000003'.
    W_REQUISITION_ITEMS-GR_IND = 'X'.
    W_REQUISITION_ITEMS-IR_IND = 'X'.
    W_REQUISITION_ITEMS-FIXED_VEND = space.
    W_REQUISITION_ITEMS-INFO_REC = space.
    APPEND W_REQUISITION_ITEMS. CLEAR W_REQUISITION_ITEMS.
    W_REQUISITION_ACCOUNT-PREQ_ITEM = '00020'.
    W_REQUISITION_ACCOUNT-SERIAL_NO = '01'.
    W_REQUISITION_ACCOUNT-COST_CTR = '0001010106'.
    W_REQUISITION_ACCOUNT-G_L_ACCT = '0063010001'.
    APPEND W_REQUISITION_ACCOUNT. CLEAR W_REQUISITION_ACCOUNT.
    W_REQUISITION_SERVICES-PCKG_NO     =  '0000000003'.
    W_REQUISITION_SERVICES-LINE_NO     =  '0000000003'.
    W_REQUISITION_SERVICES-EXT_LINE    =  '0000000000'.
    W_REQUISITION_SERVICES-SUBPCKG_NO  =  '0000000004'.
    W_REQUISITION_SERVICES-FROM_LINE   =  '1'.
    APPEND W_REQUISITION_SERVICES. CLEAR W_REQUISITION_SERVICES.
    W_REQUISITION_SERVICES-PCKG_NO     =  '0000000004'.
    W_REQUISITION_SERVICES-LINE_NO     =  '0000000004'.
    W_REQUISITION_SERVICES-EXT_LINE    =  '0000000010'.
    W_REQUISITION_SERVICES-SUBPCKG_NO  =  '0000000000'.
    W_REQUISITION_SERVICES-SERVICE    =  '000000000003000002'.
    W_REQUISITION_SERVICES-QUANTITY   =  '10.000'.
    W_REQUISITION_SERVICES-BASE_UOM   =  'UN'.
    W_REQUISITION_SERVICES-GR_PRICE   =  '90.0000'.
    APPEND W_REQUISITION_SERVICES. CLEAR W_REQUISITION_SERVICES.
    W_REQUISITION_SRV_VALUES-PCKG_NO    =  '0000000004'.
    W_REQUISITION_SRV_VALUES-LINE_NO    =  '0000000004'.
    W_REQUISITION_SRV_VALUES-SERNO_LINE = '01'.
    W_REQUISITION_SRV_VALUES-SERIAL_NO  =  '01'.
    W_REQUISITION_SRV_VALUES-PERCENTAGE  = '100.0'.
    APPEND W_REQUISITION_SRV_VALUES. CLEAR W_REQUISITION_SRV_VALUES.
    endform.
    form bapi.
    BAPI
      CALL FUNCTION 'BAPI_REQUISITION_CREATE'
      EXPORTING
        SKIP_ITEMS_WITH_ERROR          =
       AUTOMATIC_SOURCE                = 'X'
        IMPORTING
          NUMBER                         = W_NUMBER
        TABLES
          REQUISITION_ITEMS              = W_REQUISITION_ITEMS
          REQUISITION_ACCOUNT_ASSIGNMENT = W_REQUISITION_ACCOUNT
        REQUISITION_ITEM_TEXT          =
        REQUISITION_LIMITS             =
        REQUISITION_CONTRACT_LIMITS    =
          REQUISITION_SERVICES           = W_REQUISITION_SERVICES
          REQUISITION_SRV_ACCASS_VALUES  = W_REQUISITION_SRV_VALUES
          RETURN                         = W_RETURN.
        REQUISITION_SERVICES_TEXT      =
        REQUISITION_ADDRDELIVERY       =
        EXTENSIONIN                    =
    ejecuta commit
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT   = 'X'
        IMPORTING
          RETURN = W_RETURN1.
      LOOP AT  W_RETURN.          .
        WRITE: / SY-TABIX,
        / 'W_RETURN-TYPE:', W_RETURN-TYPE,
        / 'W_RETURN-CODE:', W_RETURN-CODE,
        / 'W_RETURN-MESSAGE:', W_RETURN-MESSAGE,
        / 'W_RETURN-LOG_NO:', W_RETURN-LOG_NO,
        / 'W_RETURN-LOG_MSG_NO:', W_RETURN-LOG_MSG_NO,
        / 'W_RETURN-MESSAGE_V1:', W_RETURN-MESSAGE_V1,
        / 'W_RETURN-MESSAGE_V2:', W_RETURN-MESSAGE_V2,
        / 'W_RETURN-MESSAGE_V3:', W_RETURN-MESSAGE_V3,
        / 'W_RETURN-MESSAGE_V4:', W_RETURN-MESSAGE_V4.
        ULINE.
      ENDLOOP.
    endform.

  • How to Check Creation/Change data for PO Service Line item

    Hi, I was wondering what field(s) from what table(s) I would have to check if I wanted a report to look for the creation or chnaged date of a specific service item in a PO?
    Currently it is using the EKPO-AEDAT field to check if a PO line item has been changed, but I would like to narrow it down to just some service line items instead of capturing all the service lines in a recently changed PO line item.
    Thank you very much in advance for the advice!

    Hi Rashid, thanks for the advice, but it doesn't really solve my problem.
    What I want to know is if there is a field where the date of a service item was created in a PO line item is stored, so that an ABAP report can be written to retrieve newly created service items from POs.

  • Unable to create PR with Service Line & also no entry in ESLH table using

    Hi Experts,
    I am using BAPI => BAPI_REQUISITION_CREATE to create PR and it is successful to create PR but when I try to create PO is become fail (proably missing entry in ESLH table).
    Now my requirement is to create PR with Service Line and an entry in ESLH table (should be filled by SAP automatically). I have been passing the service related/account assigment tables into BAPI but still not working.
    Will you please give a solution to create PR with Service Line and also need an entry in ESLH table (its important to my req)?
    Also provide some input on Service Line, if possible(How to check Service Line for PR + Account Assignment to Service Line + etc.)?
    Note that: If I create PR manually then there have entry in ESLH and hence I can create PO.
    Definately the quick solution help me lot...
    Thanks
    AKG

    Hi Experts,
    I am using BAPI => BAPI_REQUISITION_CREATE to create PR and it is successful to create PR but when I try to create PO is become fail (proably missing entry in ESLH table).
    Now my requirement is to create PR with Service Line and an entry in ESLH table (should be filled by SAP automatically). I have been passing the service related/account assigment tables into BAPI but still not working.
    Will you please give a solution to create PR with Service Line and also need an entry in ESLH table (its important to my req)?
    Also provide some input on Service Line, if possible(How to check Service Line for PR + Account Assignment to Service Line + etc.)?
    Note that: If I create PR manually then there have entry in ESLH and hence I can create PO.
    Definately the quick solution help me lot...
    Thanks
    AKG

  • Service order creation using bapi with repair order number

    Hi experts,
    Pls suggest me a BAPI to create a service order for those repair orders where a PGR has been done(for return delivery type : LR).
    The plant should be 0260 with storage location wh01 and item category ZRRE
    Creation of a service order with repair order type SM03 is not allowed in iw31.
    thanks and regards,
    Vijayb.

    Hi prakash,
    Thank u for the BAPI
    But an error is being displayed saying that the REFURBISHMENT ORDERS CANNOT BE PROCESSED USING BAPI.
    ERROR DURING PROCESSING OF BAPI METHODS.
    This is while u pass the order type as either ZM03 or SM01or SM02 or SM03.
    pls help me on that.
    thanks and regards,
    Vijayb.

  • How to create 'Planned service line' using BAPI_ENTRYSHEET_CREATE? Pl. help

    I need to create service entry sheet ( SES ) using input data from text file through BAPI_ENTRYSHEET_CREATE.
    If the input contains service line items, which are not present in PO, it should be treated as an unplanned service and correspondingly 'unplanned' indicator is to be set on ML81N ( Service netry sheet ) display.
    I want to make an entry unplanned if the input field external no. ( Field: BAPIESLLC-EXT_LINE ) is not matching with external no. field of corresponding purchase order to which the SES refers.
    The BAPI works fine for all cases except one. If the unplanned service line contains field SERVICE_NO value which is matching with a SERVICE_NO in PO, it is invariable treated by BAPI as  'PLANNED'. ie. BAPI decides whenther a service line is planned or unplanned based on SERVICE_NO only.
    For eg. Let a PO contains one service line with SERVICE_NO value 1008505.
                If SES input file contains 2 service entries with SERVICE_NO value 1008505.
                While creating SES, the BAPI should treat first entry as 'planned' and second line as 'unplanned'.
                But while running the program, both lines are created as 'Planned'  only, since SERVICE_NO value 1008505 exists in the PO.
    I need to set the service line planned/unplanned through my prgram, overriding the automatic setting up of BAPI_ENTRYSHEET_CREATE.
    Hope this clarifies my requirement.
    Grateful if somebody cam provide a solution.
    Thanks & Regards,
    Manju

    Do NOT USE BAPI_SALESORDER_CREATEFROMDATA, that FM is obsolete!
    Use BAPI_SALESORDER_CREATEFROMDAT1 .
    To build a reference to your contract you have to supply ORDER_HEADER_IN.
    Here´s a sample:
    MOVE:
    gs_vbak-vbeln TO ls_bapisdhd1-refobjkey,
    gs_vbak-vbeln TO ls_bapisdhd1-ref_doc,
    gs_vbak-vbtyp TO ls_bapisdhd1-refdoc_cat,
    gs_vbak-auart TO ls_bapisdhd1-refdoctype.
    also gothrouh the links
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2b-%2bsimple%2bprogram%2bto%2bcreate%2bsales%2border%2busing%2bbapi

  • Excel Function to query BW using Web Services API

    Hello,
    I need to write an Excel function as an .XLA that will do the following:
    It will be invoked like any other Excel function. E.g. =GetCost(param p1, param p2)
    This function queries an InfoCube and must return a single numerical value for the Cell in Excel that the function is used in.
    I have never done anything like this before. I have done a decent amount of reading to discover the best way to attack this. It seems like the best way to create this functionality is to:
    1. create a web service in a BW function group with a function module that is RFC enabled.
    2. I'm thinking the function module will use native SQL to query the InfoCube and pull the value and then somehow pass this value to a web service.
    3. The value in the web service will be accessed through it's API in Excel/VBA.
    I am not sure if this is best way to do this, or if it is even possible to do it this way. I was wondering if anyone could tell me if I am heading down the right path and possibly direct me to a tutorial or other information that would aid in accomplishing this. I have yet to find some type of proof of concept from beginning to end on how to do something like this. Any help would be greatly appreciated.
    These are the documents I have found insightful so far:
    How to build an XLA: http://www.fontstuff.com/vba/vbatut03.htm
    If you can read a table and dump it into Excel then you can query an InfoCube? https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c043d836-166c-2910-b99e-ae3633dec547
    How to view a webservice homepage: http://help.sap.com/saphelp_nw04/helpdata/en/1c/472e22c45cc94599ab3725bc9558d2/content.htm
    How to create a webservice:
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm
    What I am missing is how to pass data from the function module to the webservice, and from the webservice to the Excel/VBA code.
    Thanks!
    -Gary

    /bump

  • Error whil creating Service Line item in ME51N using BAPI_PR_CREATE

    Hi Experts,
                Am able to create PR number using BAPI_PR_CREATE, but when am trying to create Service line item am getting acc assignment error please check my code and solve my issue. ..its very adj  please help me .
    DATA : t_bapimereqitemimp TYPE TABLE OF bapimereqitemimp ,
          t_bapimereqaccount TYPE TABLE OF bapimereqaccount,
          t_bapimereqaccountx TYPE TABLE OF bapimereqaccountx,
          t_pritemx    TYPE TABLE OF bapimereqitemx,
          wa_bapimereqitemimp        TYPE bapimereqitemimp,
          pr_number  TYPE bapimereqheader-preq_no,
          wa_prheader  TYPE   bapimereqheader,
          wa_prheaderx TYPE  bapimereqheaderx,
          wa_pritemx   TYPE  bapimereqitemx,
          wa_bapimereqaccountx TYPE bapimereqaccountx,
          wa_bapimereqaccount TYPE bapimereqaccount,
          t_return     TYPE TABLE OF bapiret2,
          wa_return    TYPE bapiret2.
    DATA : t_bapi_srv_limit_data TYPE TABLE OF bapi_srv_limit_data,
            wa_bapi_srv_limit_data TYPE bapi_srv_limit_data.
    DATA servicelimitx  TYPE TABLE OF bapi_srv_limit_datax.
    DATA w_servicelimitx  TYPE bapi_srv_limit_datax.
    DATA : t_servicelines TYPE TABLE OF bapi_srv_service_line,
            w_servicelines TYPE bapi_srv_service_line,
            t_servicelinesx TYPE TABLE OF bapi_srv_service_linex,
            w_servicelinesx TYPE bapi_srv_service_linex,
            t_bapi_srv_acc_data TYPE TABLE OF bapi_srv_acc_data,
            w_bapi_srv_acc_data TYPE bapi_srv_acc_data,
            t_bapi_srv_acc_datax TYPE TABLE OF bapi_srv_acc_datax,
            w_bapi_srv_acc_datax TYPE bapi_srv_acc_datax.
    DATA : t_bapimereqitem TYPE TABLE OF bapimereqitem,
            w_bapimereqitem TYPE bapimereqitem.
    DATA :  t_bapimereqitemx TYPE TABLE OF bapimereqitemx,
            w_bapimereqitemx TYPE bapimereqitemx.
    wa_prheader-pr_type  = 'RV'."lv_doc_type.
    wa_prheaderx-pr_type = 'X'.
    wa_bapimereqitemimp-preq_item  = '1'."wa_eban-item.
    wa_bapimereqitemimp-pur_group  = '100'."wa_eban-ekgrp.
    wa_bapimereqitemimp-preq_name  = 'E.R. TITTO'."wa_eban-afnam.
    wa_bapimereqitemimp-short_text = 'AC Fitting'."wa_eban-txz01.
    wa_bapimereqitemimp-material   = ' '."wa_eban-matnr.
    wa_bapimereqitemimp-plant      = '1000'."wa_eban-werks.
    wa_bapimereqitemimp-store_loc  = 'ST00'."wa_eban-lgort.
    wa_bapimereqitemimp-matl_group = 'Z13'."wa_eban-matkl.
    wa_bapimereqitemimp-quantity   = '1'."wa_eban-menge.
    wa_bapimereqitemimp-unit       = 'AU'."wa_eban-meins.
    wa_bapimereqitemimp-deliv_date =  '20140604'."wa_eban-lfdat.
    wa_bapimereqitemimp-preq_price = '100'."wa_eban-preis.
    wa_bapimereqitemimp-item_cat   = 'D'."wa_eban-pstyp.
    wa_bapimereqitemimp-acctasscat =  'K'."wa_eban-knttp.
    wa_bapimereqitemimp-fixed_vend = ' '."wa_eban-flief.
    wa_bapimereqitemimp-purch_org  = '1000'."wa_eban-ekorg.
    wa_bapimereqitemimp-currency   = 'INR'."wa_eban-waers.
    wa_bapimereqitemimp-pckg_no = '00000001'.
    wa_bapimereqaccount-preq_item  = '1'."wa_eban-item.
    *wa_bapimereqaccount-serial_no  = '01'.
    wa_bapimereqaccount-gl_account = '0000002244'."wa_eban-sakto.
    wa_bapimereqaccount-costcenter = 'OPSD'."wa_eban-kostl.
    APPEND wa_bapimereqitemimp TO t_bapimereqitemimp.
    APPEND wa_bapimereqaccount TO t_bapimereqaccount.
    wa_pritemx-preq_item  = '1'."wa_eban-item.
    wa_pritemx-pur_group  = 'X'.
    wa_pritemx-preq_name  = 'X'.
    wa_pritemx-short_text = 'X'.
    wa_pritemx-material   = 'X'.
    wa_pritemx-plant      = 'X'.
    wa_pritemx-store_loc  = 'X'.
    wa_pritemx-matl_group = 'X'.
    wa_pritemx-quantity   = 'X'.
    wa_pritemx-unit       = 'X'.
    wa_pritemx-deliv_date = 'X'.
    wa_pritemx-preq_price = 'X'.
    wa_pritemx-item_cat   = 'X'.
    wa_pritemx-acctasscat = 'X'.
    wa_pritemx-fixed_vend = 'X'.
    wa_pritemx-purch_org  = 'X'.
    wa_pritemx-currency   = 'X'.
    wa_pritemx-pckg_no   = 'X'.
    wa_bapimereqaccountx-preq_item  = '1'."wa_eban-item.
    *wa_bapimereqaccountx-serial_no  = '01'.
    wa_bapimereqaccountx-preq_itemx = 'X'.
    wa_bapimereqaccountx-serial_nox = 'X'.
    wa_bapimereqaccountx-gl_account = 'X'.
    wa_bapimereqaccountx-costcenter = 'X'.
    APPEND wa_pritemx TO t_pritemx.
    APPEND wa_bapimereqaccountx TO t_bapimereqaccountx.
    **Service item limit
    *wa_bapi_srv_limit_data-doc_item = '10'.
    wa_bapi_srv_limit_data-overall_limit = '1000'.
    wa_bapi_srv_limit_data-exp_value = '800'.
    APPEND wa_bapi_srv_limit_data TO  t_bapi_srv_limit_data.
    *w_servicelimitx-doc_item = '10'.
    w_servicelimitx-overall_limit = 'X'.
    w_servicelimitx-exp_value = 'X'.
    APPEND w_servicelimitx TO servicelimitx.
    w_bapimereqitem-preq_item = '10'.
    ***w_bapimereqitem-preq_name = 'E.R. TITTO'.
    ***w_bapimereqitem-plant = '1000'.
    ***w_bapimereqitem-store_loc = 'ST00'.
    ***w_bapimereqitem-matl_group = 'Z03'.
    ***w_bapimereqitem-quantity = '1'.
    ***w_bapimereqitem-unit = 'AU'.
    w_bapimereqitem-item_cat = 'D'.
    w_bapimereqitem-deliv_time = '20140604'.
    w_bapimereqitem-acctasscat = 'K'.
    **w_bapimereqitem-consumpt = 'U'.
    APPEND w_bapimereqitem TO t_bapimereqitem.
    **w_bapi_srv_acc_data-doc_item = '1'.
    **w_bapi_srv_acc_data-outline = '0000000001'.
    *w_bapi_srv_acc_data-srv_line = '20'.
    w_bapi_srv_acc_data-serial_no = '10'.
    w_bapi_srv_acc_data-serial_no_item = 'D'.
    *w_bapi_srv_acc_data-quantity = '1'.
    *APPEND w_bapi_srv_acc_data TO t_bapi_srv_acc_data.
    **w_bapi_srv_acc_datax-doc_item = '1'.
    **w_bapi_srv_acc_datax-outline = '0000000001'.
    *w_bapi_srv_acc_datax-srv_line = '20'.
    **w_bapi_srv_acc_datax-serial_no = '01'.
    **w_bapi_srv_acc_datax-serial_no_item = '01'.
    *w_bapi_srv_acc_datax-quantity = '1'.
    *APPEND w_bapi_srv_acc_datax TO t_bapi_srv_acc_datax.
    w_servicelines-service = '00000001'.
    APPEND w_servicelines TO t_servicelines.
    w_servicelinesx-service = 'X'.
    APPEND w_servicelinesx TO t_servicelinesx.
    CALL FUNCTION 'BAPI_PR_CREATE'
       EXPORTING
         prheader        = wa_prheader
         prheaderx       = wa_prheaderx
       IMPORTING
         number          = pr_number
       TABLES
         return          = t_return
         pritem          = t_bapimereqitemimp
         pritemx         = t_pritemx
         pritemexp       = t_bapimereqitem
         praccount       = t_bapimereqaccount
         praccountx      = t_bapimereqaccountx
         servicelimit    = t_bapi_srv_limit_data
         servicelimitx   = servicelimitx
         servicelines    = t_servicelines
         servicelinesx   = t_servicelinesx
         serviceaccount  = t_bapi_srv_acc_data
         serviceaccountx = t_bapi_srv_acc_datax.

    Hi,
    Check this Thread , Thread1 . It might help you to resolve the issue.
    Thanks
    KH

Maybe you are looking for

  • US Xperia Support RMA Warranty Nightmare

    I am planning to send this in letter form to Sony Mobile but want to share it with the readers on this forum: Today marks 5 weeks since I opened an RMA with US Xperia support to facilitate the repair of my Xperia Z2. The device had a small crack on t

  • Will not show web page on windows high contrast

    Hi, Am running Windows 7 64bit my problem is as follows. I normally run Windows in high contrast mode and would prefer all web sites to be on the dark side. Occasionally I need to be able to see a web page as its designers intended it to be. So I wan

  • Safari & Java security

    Iv read most of the information that's come out recently on the security loop hole with Java on most browsers including Safari. However, my job work site requires Java to do "anything" in the company web pages. If I disable Java or do any of the sugg

  • Does the iPad 2 have a hard drive?

    Does the iPad 2 have a hard drive?

  • Solaris 10, 6/06 documentation

    Found a what's new at: http://docs.sun.com/app/docs/doc/817-0547 but nothing else. Does anyone know if Sun is going to post new PDF's for the new version or are we stuck with the "beta" PDF's from FCS? thanks, alan All computer problems occur between