SALES DOC NO IS NOT CREATED

I RUN THE SALESORDER_CREATEFROMDAT2
i wrote the code as giveb below
please check the code and tell me if any modification.
String DocType = "TA";
String xUploadFlag = "I";
String xDocType = "X";
String xSalesOrg = "X";
String xDisChan = "X";
String xDivision = "X";
String xPurchNo = "X";
String PartnerRole = "AG";
try {
jcoclient =
JCO.createClient(
strSapClient,
strSapUser,
strSapPassWord,
strSapLang,
strSapHost,
strSapSysNo);
jcoclient.connect();
catch (RuntimeException e1) {
errorCode = "J222";
objClsSuper.setErrorCode(errorCode);
return objClsSuper;
catch (Exception e1) {
errorCode = "J112";
objClsSuper.setErrorCode(errorCode);
return objClsSuper;
Bapi_Salesorder_Createfromdat2_Output output = null;
MySalesOrder_PortType mysalesorder = new MySalesOrder_PortType();
Bapi_Salesorder_Createfromdat2_Input input=null;
MyCommit_PortType mycommit = new MyCommit_PortType();
try{
input =
new Bapi_Salesorder_Createfromdat2_Input();
Bapisdhd1Type headerin = new Bapisdhd1Type();
headerin.setDoc_Date(CrtDate);
headerin.setReq_Date_H(ReqDate);
headerin.setDoc_Type(DocType);
headerin.setSales_Org(SalesOrg);
headerin.setDistr_Chan(DisChan);
headerin.setDivision(Division);
headerin.setPurch_No_C(PurchNo);
input.setOrder_Header_In(headerin);
Bapisdhd1XType headerinx = new Bapisdhd1XType();
headerinx.setUpdateflag(xUploadFlag);
headerinx.setDoc_Type(xDocType);
headerinx.setSales_Org(xSalesOrg);
headerinx.setDistr_Chan(xDisChan);
headerinx.setDivision(xDivision);
headerinx.setPurch_No_C(xPurchNo);
input.setOrder_Header_Inx(headerinx);
BapisditmType_List itemsinlist = new BapisditmType_List();
BapisditmxType_List iteminxlist = new BapisditmxType_List();
for (int i = 0; i < objSalesOrderVO.length; i++) {
String itemno = objSalesOrderVO.getStrItemNo();
String Material = objSalesOrderVO.getStrMaterial();
BigDecimal TargetQty = objSalesOrderVO.getTargetQty();
BapisditmType itemsin = new BapisditmType();
BapisditmxType iteminx = new BapisditmxType();
itemsin.setItm_Number(itemno);
itemsin.setMaterial(Material);
itemsin.setTarget_Qty(TargetQty);
//BapisditmType_List itemsinlist = new BapisditmType_List();
itemsinlist.addBapisditmType(itemsin);
iteminx.setItm_Number(itemno);
//iteminx.setMaterial(itemData[1]);
iteminx.setMaterial("X");
//iteminx.setTarget_Qty(itemData[2]);
iteminx.setTarget_Qty("X");
iteminx.setUpdateflag("X");
//BapisditmxType_List iteminxlist = new BapisditmxType_List();
iteminxlist.addBapisditmxType(iteminx);
input.setOrder_Items_In(itemsinlist);
input.setOrder_Items_Inx(iteminxlist);
BapiparnrType partner = new BapiparnrType();
partner.setPartn_Role(PartnerRole);
partner.setPartn_Numb(PartnerNo);
BapiparnrType_List partnrlist = new BapiparnrType_List();
partnrlist.addBapiparnrType(partner);
input.setOrder_Partners(partnrlist);
mysalesorder = new MySalesOrder_PortType();
mysalesorder.messageSpecifier.setJcoClient(jcoclient);
mycommit = new MyCommit_PortType();
mycommit.messageSpecifier.setJcoClient(jcoclient);
//Bapi_Salesorder_Createfromdat2_Output output = null;
}catch(Exception e){
objClsSuper.setErrorCode(e.toString());
return objClsSuper;
try {
output = mysalesorder.bapi_Salesorder_Createfromdat2(input);
} catch (SystemFaultException e) {
// TODO Auto-generated catch block
errorCode += "J113";
objClsSuper.setErrorCode(errorCode);
e.printStackTrace();
return objClsSuper;
} catch (ApplicationFaultException e) {
// TODO Auto-generated catch block
errorCode += "J114";
objClsSuper.setErrorCode(errorCode);
e.printStackTrace();
return objClsSuper;
String docno = output.getSalesdocument();
objClsSuper.setDocNumber(docno);
Bapi_Transaction_Commit_Input commitinput =
new Bapi_Transaction_Commit_Input();
commitinput.setWait(docno);
Bapi_Transaction_Commit_Output outcommit = null;
try {
outcommit = mycommit.bapi_Transaction_Commit(commitinput);
} catch (SystemFaultException e1) {
// TODO Auto-generated catch block
errorCode += "J113";
objClsSuper.setErrorCode(errorCode);
e1.printStackTrace();
return objClsSuper;
} catch (ApplicationFaultException e1) {
// TODO Auto-generated catch block
errorCode += "J114";
objClsSuper.setErrorCode(errorCode);
e1.printStackTrace();
return objClsSuper;
jcoclient.disconnect();
errorCode = "J000";
objClsSuper.setErrorCode(errorCode);
return objClsSuper;
i am wating for ur response
Thanqqqqqqqqqqqq
Guru
Replies: 4   Pages: 1

Hi Guru ,
the two main things i noted here are,
1) are you getting any exceptions like data type cast or something like that while execting this?.
    then just check, whether the field where u entered values are proper data types or not.(for fields containing DATE.. just check). i think have to type cast it to proper data types before executing the function module.
2). at the time of Import Adaptive RFC model how u created the model .i mean the BAPI for Sales creation and BAPI for commit . are they in the same LUW.
       i had faced this type of problem , when i try to create one "create BAPI" and "Commit BAPI "  as seperate models .
and i could solve this problem , by creating one model including the create bapi and commit work bapi in one Adaptive RFC model and dont have any change in the code.
       Regards
         Kishor Gopinathan

Similar Messages

  • Need to create a sales order that does not create demand

    Hi,
    We need to create a no cost sales order - that does not create demand
    In our current set-up when we try to create a no cost sales order with a material ( It Cat = Norm) we see demand being created in MD04
    What configuration settings will allow us a deliverable order - that does not create demand (no MRP run?)
    Thanks,
    SM

    Hello,
    For this set of requirement i think the best option would be to configure a New Sales Order Type and a new Schedule Line Category. In VOV6, While you are defining a new Schedule line category in the transaction flow make sure to switch off the three check box.
    Transfer of requirements / Begin assembly order from SD
    Availability check for sales
    Product allocation active
    Then when we are assigning this newly defined Schedule line Category to Item category, make sure to leave the field of MRP Type as blank in VOV5.
    Regards,
    Sarthak

  • Cancel billing doc (S1) is not creating Accounting document

    Hi,
    I have cancelled F2 billing document with cancel billing type S1. But for that cancel billign doc S1 is still in open status only and it is not creating accounting document..
    I tried to release to accounting but it is showing error like " Document type is not defined"..
    Please any guess on this..
    regards
    sankar

    Hi sankar
    I am sure you might be aware of this but just to reiterate
    When you cancel documents in Logistics Invoice Verification, the document line items are not automatically cleared in Financial Accounting. We recommend that you periodically clear such items (using daily background jobs, for example).
    Kalpesh

  • Sales doc copy control not working with price condition

    Here's the situation.
    For OR sales document I have  Procedure ZSALES and price conditions Z001
    For a QT Sales document I have Procedure ZQUOTE which does not have a Z001 condition in that procedure.
    If I create an OR (with the proper customer / matieral) the Z001 populates, based on it's defined record.
    If I then create another OR with reference to the original OR, the Z001 populates with no problem.
    Up to now everything's fine, now here's the probem......
    If I create an OR with reference to a QT, the Z001 does not populate in the OR order.I know there is no Z001 in the QT for it to copy from, but if I do [New Pricing] in the order it still does not come in.(I've tried [new Pricing] with Pricing type A..G)
    I have found OSS Note 413066, but this is in reference to 46c systems. we are on ECC 6.0
    any ideas ?

    Hi Bill,
    If PP assigned for both are different it's not going to populate field even if you are redertermining price, since it would be following the PP of Quotation (ZQUOTE), not Sales Order (ZSALES) because it's gonna copy the elements of that PP in order. Are your PP assigned are same or different?
    Hope this will answer your query
    Regards
    SD

  • Sales Doc Overall status not updating in DSO

    Hi All,
    In ECC status of the Sales Document has changed from B to C. However in the DSO status still shows as C. Delta has pushed through successfully. Please see the screenshot below. Why is the status not changing in DSO?
    How to handle this issue?
    Regards,
    DTD

    Dear Dhanuka
    If the sale order item is the key field and the status is in the data field in the DSO you will not have an issue in the cube.
    Please find the example below
    1. DSO - Sales order X1 / 10  overall status B   keyfigure 100
    2. Cube - Sales order X1 / 10  overall status B   keyfigure 100
    After the Full DTP - Overall status will be overwritten in DSO
    3. DSO - Sales order X1 / 10  overall status C   keyfigure 100
    4. Cube - Sales order X1 / 10  overall status B   keyfigure 100
    5. Cube - Sales order X1 / 10  overall status B   keyfigure  -100
    6. Cube - Sales order X1 / 10  overall status C   keyfigure   100
    Regards
    Gajesh

  • Cross Company Sales Automatic Vendor Invoice Not Created

    Hi,
    I have an issue in Cross company Sales Scenario (Inter company Sales),
    During the Intercompany Invoice we can trigger output RD04 to create Automatic Vendor Invoice in the Ordering Company.
    I have done the necessary configuration for creating Idoc (RD04), FI & MM.
    I could able to create an Idoc successfully and the status of the Idoc is 53.
    However when I check the Vendor Invoice in the Ordering Company T.Code FBL1N, system gives me message that no items found for the Vendor.
    I request please let me know me what configuration I have to do to create Cross Company Sales Automatic Vendor Invoice
    Regards,
    Murali
    Edited by: Murali Mikkili on Jul 27, 2008 9:05 AM
    Edited by: Murali Mikkili on Jul 28, 2008 11:49 AM

    Hi Daniel,
    Both the company codes should be assigned to the same company.
    Clearing accounts must be defined in every company code before a cross-company code transaction may be carried out. The clearing accounts may be G/L accounts, customer, or vendor accounts.
    In the configuration you must assign clearing accounts to every possible combination of two company codes to allow cross-company code postings between these combinations
    To reduce the number of clearing accounts, you can use just one company code as the clearing company code. In this case, you only have to assign clearing accounts to every combination of the clearing company code
    In T-code OBYA
    For ex: company code 1000 clearing account 12345 is same for Debit and credit
    Company code 2000 Clearing account 67890 is same for debit and credit
    Posting keys must be assigned to the clearing accounts to identify their account
    types.
    Hope this helps you to solve your probelm.
    Regards,
    Mir

  • Idoc not created for a particular sales order

    Hi,
        For a particular sales order , idoc is not created .
    The idoc has to be generated when we create a sales order ,
    but for a particular sales order , the idoc is not generated when the sales order is created. The program is assigned in
    nace for output type zd00.  
    RSNASTED is the program which triggers the idoc and FM: IDOC_OUTPUT_ORDRSP.
    How to debug and see why the idoc is not generated,
    i had kept break point in idoc_output_ordrsp function module
    and program rsnasted, but my control does not
    reaches this point.
    can anyone help me in this issue.
    Thanks and regards,
    A. thirumaran.
    Edited by: thirumaran a on Jul 22, 2008 1:35 PM

    Hi,
    Could you please check if the output is processed or not, whether in the output type what all conditions you have maintained e.g send immediately.
    Reward me point if you find this helpful.
    regds.......
    Sumit

  • Incorrect requirements type in sales doc.

    HI,
    Due to incorrect requirements types of material the costs and sales volume are posted directly to sales doc instead of posting
    to WBS element.
    How can this be fixed (after cancellation of posting)?
    How can we identify already created u201Cincorrectu201D sales docs?
    Regards,
    Anup
    Edited by: anup12 on Jun 3, 2011 7:29 AM

    Hi !
    regarding your query, there may be various sales documents type which might be created during configuration.
    Some of these might not be required by end users and need to be blocked so that wrong document types are not chosen. so an indicator 'X' is placed againt these document types and these can not be used.
    There may be some documents wherein manual creation might not be allowed, and auto creation is desired. so againt these doc types-'A' is placed by which these doc types can not be created manually,
    Other sales doc types might not be blocked so that they can be used or created manually, hence kept blank against the indicator field.
    Plz reward point if useful.

  • In SD, assign programmatically an external sales doc nbr

    Hello, we have a sales document type that will be need to be externally assigned a sales document number in txn VA01.  Right now it is configured to be mandatory.
    The requirement is to go to txn VA01, enter the sales doc type, hit enter, and then have a userexit/badi to find what the externally assigned number would be in a custom table (some complicated formatting of numbers and chars - hence why it cannot be internally assigned number), and have it populate in the sales doc field.
    Because it is a mandatory field, the check for mandatory fields seems to fire before anything we can find.  We are also looking at making the field not be required for this sales doc type but not sure that can be done.
    Is there a userexit or BADI that we could use to populate that number that people have come across.
    We are trying, if at all possible, to avoid creating a custom txn that calls VA01 or a custom program that loads the sales order via a BAPI(these would be last resorts).
    We are on ECC5.0 webAS 6.40.
    Any help would be appreciated.
    Thanks, David

    Yes, the sales doc number field.  The do not want to use a custom field or place it into the PO field.  It is just an externally assigned number range, but it is to be stored in VBAK-VBELN.
    The numbers may not be able to be calculated as a sequential sequence which is why they did not create an internal assigned number range, but they want to automate the calculation of that externally assigned number through a lookup to a custom table, etc.
    So, they key we are looking for is if there is a userexit, badi, project that we could use to do this since right after we enter the VA01 txn, that field is required to be populated and there does not seem to be a userexit that fires before that check for the required field.
    Another option we are thinking is declaring the field as internally assigned but then using the userexit USEREXIT_NUMBER_RANGE in MV45AFZZ but not sure that would even work as well without some sort of coremod which we want to avoid.

  • CO08 can not create Production Order!!!

    Dear Experts
    We are running an MTO(make to order) scenario!
    First we create an contract in the system!Then we create sales order
    with reference to this contract!
    And when the sales order is sent to the planning department! They use
    TCODE:CO08 create production order with reference to the sales order!
    But we get an error message as follows:
    Account assignment cannot be carried out because of different origin no.
    Message no. V1134
    Diagnosis
    The sales document to which you want to refer is based on sales document 41033737 and item 000010.
    Therefore, the settlement and possibly inventory management are carried out using the number of the
    preceding document.
    ut when I entered the the contract in Co08 and then I am able to create
    the production order.
    And when I back to see the detail in the sales order ,I find there is no
    value in the account assignment to the profitability segment!!
    Why the sales order have no profitability segment??*
    Why we can not create production order with reference to sales order??
    It seems there are one problem!
    Thanks for any reply!!

    Fei Liu,
    The current situation that you have described is pretty standard functionality for most MTO requirements classes.  Account assignment is normally to the reference doc, not the 'Release' Sales doc.  This includes quotations as well as contracts.
    If your business requirement is to instead use the Sales Doc number, and not the Contract number, you can change this by setting OVZG "Account Assignment Consumption" to 'blank'.
    http://service.sap.com/sap/support/notes/459734
    http://service.sap.com/sap/support/notes/729381
    Rgds,
    DB49

  • Acrobat XI will not create PDF from word for Mac

    I'm on a late 2013 macbook air, running Mountain lion, office for mac 20011 and acrobat XI pro.  In acrobat, when I go to file, create pdf and navigate to a word doc, acrobat will not creat the pdf.  I get an error message that reads someting like "acrobat could not open test.docx because it is not a supported file type."  Create pdf works with other file types. I can create PDF by using the Save As in Word, but that is besides the point. I bought Acrobat in order to process many word and excel files into on PDF-file easily and currently that is not possible. Anyone?

    This is possible on Windows.

  • SD Billing doc was not created

    Hi,
    we have a sales document and the status of  order is completed.But the invoice hasn't created.It shows  Account determination error.It is not creating the Acc doc.
    what could be the possibilities??
    Krish.

    1.One more reason could be the posting period is closed. In that case you need to go to the header details of the billing and change the billing date to the current month's date if the earlier date is not of the current month.
    2.There might be a posting blocknin the billing documents type.
    3.try to release it in accounting via change mode through flag.
    4.Check the exchange rate table and the country settings to see if the country you are processing is assigned to 'M'.
    5. try transaction code VFX3 and see the details if is FICO related.

  • Editing sales doc in R/3 that was created in CRM

    Hi all CRM Gurus
    I am in the process of cofiguring the CRM system to enable the creation of sales documents.
    All is working fine, I can create the sales doc is CRM, this them replicates through to R/3 without any errors, but I cant edit the sales doc in R/3 at all to change delivery or print order outputs
    My question is this:
    Can you edit a sales doc in R/3 that has been created in CRM??
    CRM Version 4.0
    kind regards
    Barry Dixon

    Hi Barry,
        You need to activate Scenario 'A' to change the documents in ECC, which replicated from CRM.
         For this you need to make below entries in ECC  & CRM table.
                    In ECC CRMPAROLTP table
                              PARNAME     CRM_SCENARIO
                              PARNAME2    INT_CHANGE_ORDER
                              PARNAME3    <SalesOrderType>
                              PARVAL1     A
                    In CRM SMOFPARSFA table
                               PARSFAKEY     R3A_SALES
                               PARNAME       INT_CHANGE_ORDER
                               PARNAME2      <SalesOrderType>
                               PARVAL1       A
        You need to activate Cross System Lock according to the note 888665. CSL activation is must, if you won't activate CSL order can be edited in both the systems at the same time. CSL ensures order can be opened in change mode in only one system at the same time.
    //Bhanu

  • How to create an invoice from multiple sales doc.

    Hi,
    how to create an invoice from multiple sales doc.
    thanx,
    sourav

    hello, friend.
    assuming that your settings in VTFA and VTFL allow, you can create 1 invoice for many sales orders or deliveries by using VF04.  choose all documents that apply and click "collective billing document". 
    you can also click on "simulation" if you want to test if the combination is possible and the system will give you a split analysis if this is not possible.
    regards.

  • T code to find sales orders/Deliveries for which batch job could not create

    Hi
    Once a PGI has been created for a sales order, the invoice should be created in nightly batch. Once is a while, something is wrong and SAP cannot create the invoice. I know there is a transaction that will list the orders / deliveries where SAP could not create the invoice. Can you tell me what that t-code is? Thanks

    Lakshmipathy
    I think you did not get my point corectly , I know , billing docs due list , what I  need was after batch job running , for some deliveries , due to some reason , billing docs might not have created .
    Business needs to know only thsese delivery docs in a T code or table but not all the due document . I did not find answer for this question in SDN .
    I got the answer now  for this question , it is V.21 .
    Thanks for your time .

Maybe you are looking for