Problem in creating a sales document

Hi,,
I am creating a sales document programatically by the FM BAPI_SALESDOCU_CREATEFROMDATA1 for tht i have desigend ny selection screen in tht my requirement is i will not give item category for tht i have to quiery for given material and for given plant i have to fetch itcat plz help me in writing this quiery
vbap table is not coreect as it will store data after complettion of sales document
but here i want quiery to create a sales document it self
i have seen in transaction VA01 ity is getting data from t184 for itcat plz help me in writing this quiery
for good answer i will reward points

You can use the t.code SHD0, choose your transaction variant here, further choose your screen variant.
Next select your screen variant and in the Menu bar select Variant> change with processing>Make repairs in foreign namespaces only if they are urgent> Continue(Enter)>again 'enter'>Object can only be created in SAP package>continue(enter)> Exit and save >This variant contains other screens, adopt these as well?>enter>enter> scroll down to the entry make the necessary changes and save.
The system will prompt to assign a package and request enter the necessary values.
Your issue is sorted!!
And further to your query for minimum price PMIN refer to my answer, you will not have to maintain any condition record or the price entered here does not reflect in any other document.
Regards,
PATHIK

Similar Messages

  • Creating a sales document using BAPI in web dynpro by uploading a file

    Hi ALL,
    Can some one help me how to create a sales document using  BAPI by uploading a file as input...Can someone  provide me a sample program....
    Thanks n Regards,
    Praveenn.
    Edited by: praveenn on Aug 23, 2011 12:42 PM

    Hi Sri,
    Thx for the response...
    Here is the code that i followed for creating a BAPI_SALESORDER_CREATE1 by uploading a text file as input.
    Just create a Attribute  in the VIEW CONTEXT of type String.
    method ONACTIONCREATE_SO .
    types : Begin of ty_data,
             sales_org  type vkorg,
             doc_type   type AUART,
             DISTR_CHAN type VTWEG,
             DIVISION   type spart,
             material   type matnr,
             partn_role type PARVW,
             PARTN_NUMB type kunnr,
           end of ty_data.
      DATA  :it_table TYPE  TABLE OF ty_data,
             i_data   TYPE  TABLE OF string,
             l_string TYPE string,
             wa_table TYPE ty_Data,
             l_xstring TYPE xstring,
             fields TYPE string_table,
             lv_field TYPE string.
    DATA: wa_order_header_in TYPE BAPISDHD1,
          it_order_items_in  TYPE TABLE OF BAPISDITM,
          wa_order_items_in  TYPE BAPISDITM,
          it_order_partners  TYPE TABLE OF BAPIPARNR,
          wa_order_partners  TYPE BAPIPARNR,
          it_return TYPE TABLE OF BAPIRET2,
          wa_return TYPE BAPIRET2.
    DATA : sales_doc type bapivbeln-vbeln.
    DATA:
       node_zfinal_node  TYPE REF TO if_wd_context_node,
       elem_zfinal_node  TYPE REF TO if_wd_context_element,
       stru_zfinal_node  TYPE if_main_view=>element_zfinal_node .
    get single attribute
      wd_context->get_attribute(
      EXPORTING
      name =  'DATASOURCE'
      IMPORTING
      value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string.
    SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
      LOOP AT i_data INTO l_string.
       SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
        READ TABLE fields INTO lv_field INDEX 1.
        wa_table-sales_org = lv_field.
        READ TABLE fields INTO lv_field INDEX 2.
        wa_table-doc_type = lv_field.
        READ TABLE fields INTO lv_field INDEX 3.
        wa_table-DISTR_CHAN = lv_field.
        READ TABLE fields INTO lv_field INDEX 4.
        wa_table-DIVISION = lv_field.
        READ TABLE fields INTO lv_field INDEX 5.
        wa_table-material  = lv_field.
        READ TABLE fields INTO lv_field INDEX 6.
        wa_table-partn_role  = lv_field.
        READ TABLE fields INTO lv_field INDEX 7.
        wa_table-partn_numb  = lv_field.
    APPEND wa_table TO it_table.
      ENDLOOP.
    loop at it_table into wa_table.
    clear : wa_order_header_in.
    wa_order_header_in-sales_org   = wa_table-sales_org.
    wa_order_header_in-doc_type    = wa_table-doc_type.
    wa_order_header_in-distr_chan  = wa_table-distr_chan.
    wa_order_header_in-division    = wa_table-division.
    clear : wa_order_items_in.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = wa_table-material
    IMPORTING
       OUTPUT        = wa_order_items_in-material.
    *wa_order_items_in-req_qty  = wa_table-req_qty.
    append wa_order_items_in to it_order_items_in.
    clear : wa_order_partners.
    wa_order_partners-partn_role = wa_table-partn_role.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = wa_table-partn_numb
    IMPORTING
       OUTPUT        = wa_order_partners-partn_numb
    *wa_order_partners-partn_numb = wa_table-partn_numb.
    append wa_order_partners to it_order_partners.
    endloop.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        order_header_in               = wa_order_header_in
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                 = sales_doc
      tables
       RETURN                        = it_return
       ORDER_ITEMS_IN                = it_order_items_in
      ORDER_ITEMS_INX               =
        order_partners                = it_order_partners.
      ORDER_SCHEDULES_IN            =
    get message manager
    DATA: l_current_controller TYPE REF TO if_wd_controller,
           l_message_manager    TYPE REF TO if_wd_message_manager.
           l_current_controller ?= wd_this->wd_get_api( ).
    DATA:  v_message_text TYPE string.
    When Sales Order is created commit the data
    IF NOT sales_doc IS INITIAL.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING wait = 'X'.
      CONCATENATE 'Sales Document' sales_doc 'has been created.' INTO v_message_text SEPARATED BY space.
    Report Success message
      CALL METHOD l_message_manager->report_success
      EXPORTING
      message_text = v_message_text.
      ELSE.
      v_message_text = 'Error Creating Sales Order'.
    Report Error message
    CALL METHOD l_message_manager->report_error_message
    EXPORTING
    message_text = v_message_text.
    ENDIF.
    endmethod.
    Edited by: praveenn on Aug 30, 2011 2:41 PM

  • Problem when creating a sales order with reference by BAPI

    I am facing one problem when creating Sales Order.
    <b>The scenario is like this while creating SO With reference to an Order type, a new SO will be automatically created with a diff order Type</b>.
    I am using "BAPI_SALESORDER_CREATEFROMDAT2".
    I am calling this BAPI in USEREXIT_REFRESH_DOCUMENT.
    Am I using the right exit to call this Bapi ?
    <b>Problems are like :
    1. Ref Sales Order creating without Sales Unit .
    2. "Object Status does not exist" error msg is coming for Header and Item level(when clicking the status tab and then object status pushbutton).</b> But if testing the bapi from SE37 in test sequence....no such problem persists.
    As for example in case of sales unit,in the debugging mode i have seen that BAPI uses a perform to fill the values in the VBAP structure.But after that when it come back to the main program VBAP remains blank.This ocuurs when the BAPI is called from the exit whereas  if tested from SE37, VBAP retains the value.
    Can u suggest in this ? This is very very urgent............
    Thx in Adv.........................

    Thanks........
    Your suggestion was a great help to me.I have used a custom FM and called it in <b>starting new task</b>.
    Since i am a university fresher working in SAP for nearly 1 year.....can you please explain me the difference between <b>in update task</b> and <b>starting new task</b>.Why the problem was occuring for which you have suggested to call a custom function module.
    what is V1 update and V2 update?Is it attached with asynchronous ans synchronous update.It would be a great help to me if you kindly clear my confusions....
    thanks in advance.

  • Problem while creating a Sales Order from RFC

    Dear All,
    I get an error ( Errror ID "TD" Number "600" ) "Text XXXXXXXXXX000001 ID X106 language EN not found" whenever I try to create a Sales Order for a particular Customer and Material.
    But when I create Manually using VA01 for the same details, a Sales Order is created Successfully.
    The error is coming from the Standard Function Module "SD_SALES_ITEM_MAINTAIN".
    Please let me know if any of you have come accross similar problem and if yes, please provide me a solution.
    Thanks and Regards,
    Dinakaran.R

    Hi Dinakaran,
    How ru passing the values in the RFC????
    pass the item details through the tables option of FM...else it will give the error...
    Regards,
    Vamshi

  • After creating a sales document type in tvak

    after creating a new sales document type in tvak what next to link it to BP number.

    Hi
    it should be done via configuration, not using the tcode
    goto SPRO
    press F5
    search for SALES DOCUMENT TYPES
    <b>in sales & distribution
    sales
    sales documents
    sales document header
    define sales document types</b>
    there you have to add extra new entries
    Regards
    Anji

  • Problem in creating an account document using BAPI_ACC_DOCUMENT_POST

    Hi Experts,
    I have a porblem while creating an account document from BAPI_ACC_DOCUMENT_POST.
    The problem is acc document is geeting posted and I am getting an document number for that bapi, but its not getting saved to data base and I am getting the following error message
    "Document 1900004327 3000 does not exist in fiscal year 2005
    Message no. F5A397
    System Response
    The required document either does not exist in the fiscal year or is still being posted.
    When the document is read, archived documents are also considered."
    Please sugggest...
    We are using ECC 6.0
    Thanks,
    Suma.

    Hi,
    this means that the posting is not open...
    try with 2008...
    or else ask ur financial consultatto check, whether the 2005 is open or not.
    u also try posting manually using FB01 with same entries u r using for this BAPI...so that u can track the error.
    Also use BAPI_TRAACTION_COMMIT after bapi post.
    check ur subsystem which u r passing for the BAPI..
    wa_general-assetsubno = '0000'. Is it 3000 or 0000
    Try using 0...
    Edited by: Sumi Vasu on May 14, 2008 8:13 AM

  • Unable to create a sales document

    Hi frns,
    while creating sales document (order) an error poping up saying No customer master record exists for Sold to Party.. Pls advise how to solve da above
    regards,
    kk

    There is a possibility that a Customer Master record is not created, or if it is created, it may not be created in the required Sales Area. Please create Customer Master Data in XD01 & after that create Sales Order. It certainly shoule create Sales order. Also check your configuration for SD:
    SD Configuration:
    Enterprise Structure:
    1. Maintaining Sales Organization
    Sales Organization is an organizational unit responsible for the sale of certain products or services.
    IMG -> Enterprise Structure -> Definition -> Sales and Distribution -> Define, copy, delete, check Sales organization
    2. Assigning Sales Organization to Company Code
    This assignment ensures all the sales made through this Sales Organization are accounted for in the assigned Company Code (Company Code is created by FI Consultant).
    IMG -> Enterprise Structure -> Assignment -> Sales and Distribution -> Assign Sales Organziation to Company Code
    3. Maintaining Distribution Channel
    Distribution Channel is the way, in which Products or Services reach Customers.
    IMG -> Enterprise Structure -> Definition -> Sales and Distribution -> Define, copy, delete, check distribution channel
    4. Assigning Distribution Channel to Sales Organization
    This assignment ensures, a Sales Organization can supply Materials to Customers through this Distribution Channel.
    IMG -> Enterprise Structure -> Assignment -> Sales and Distribution > Assign distribution channel to sales organization
    5. Maintaining Division
    Division is a way of grouping materials, products, or services.
    IMG -> Enterprise Structure -> Definition -> Logistics - General -> Define, copy, delete, check division
    6. Assigning Division to Sales Organization
    IMG -> Enterprise Structure -> Assignment -> Sales and Distribution -> Assign division to sales organization
    7. Setting up Sales Area
    All the sales are made from a particular sales Area. For creating a Sales Order Sales Area is compulsory.
    IMG ->Enterprise Structure -> Assignment -> Sales and Distribution -> Set up sales area
    8. Assigning Sales Organization- Distribution Channel- Plant
    Plant is created ny MM Consultant.
    IMG -> Enterprise Structure -> Assignment -> Sales and Distribution -> Assign sales organization - distribution channel - plant
    9. Define Shipping Points
    Shipping Point is the Organizational element, which is responsible for shipping the Materials to the Customers.
    IMG -> Enterprise Structure -> Definition -> Logistics Execution -> Define, copy, delete, check shipping point
    10 Assigning Shipping Point to Plant
    This assignment ensures that goods from different Plant can be dispatched from different Shipping Points.
    IMG -> Enterprise Structure -> Assignment -> Logistics Execution -> Assign shipping point to plant
    Note: Ensure to do the undermentioned configuration also though it is not in Customizing node of Enterprise Structure.
    11. Defining Common Distribution Channels for Master Data
    Use
    The purpose of this activity is to define distribution channels which have common master data..
    Procedure
    Access the activity using one of the following navigation options:
    IMG Menu -> Sales and Distribution -> Master Data -> Define Common Distribution Channels
    Transaction Code: VOR1
    12. Defining Common Divisions for Master DataUse
    The purpose of this activity is to define distribution channels which have common master data..
    Procedure
    Access the activity using one of the following navigation options:
    IMG Menu -> Sales and Distribution -> Master Data -> Define Common Division
    Transaction Code: VOR2
    Pricing Procedure
    In SD, Pricing Procedure is determined based on Sales Area (Sales Organization + Distribution Centre + Division) + Customer Pricing Procedure + Document Pricing Procedure. Sales Area is determined in Sales Order Header Level. Customer Pricing Procedure is determined from Customer Master. Document Pricing Procedure is determined from Sales Document Type / Billing Type (if configured). Once the pricing procedure is determined, Condition records are fetched. If appropriate condition records are found, the price is determined. If Mandatory pricing condition is missing, system will through an error message.
    In SD, the steps to configure Pricing procedure are as under:
    Step 1:
    Condition table: If existing condition table meets the requirement, we need not create a new condition table. Considering the requirement for new condition table, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Condition Table (select the required fields combination, which will store condition record).
    Step 2:
    Access Sequence: If existing access sequence meets the requirement, we need not create a new access sequence. Considering the requirement for new sequence, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Access Sequence (Access sequence is made up of Accesses (Tables) & the order of priority in which it is to be accessed. Here we assign the condition table to access sequence.
    Step 3:
    Condition Type: If existing condition type meets the requirement, we need not create a new condition type. Considering the requirement for new condition type, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Condition Type. It is always recommended to copy an existing similar condition type & make the neccessary changes. Here we assign Access sequence to Condition type.
    Step 4:
    a. Pricing Procedure: It is recommended to copy a similar pricing procedure & make the neccesary changes in new pricing procedure. Pricing Procedure is a set of condition type & arranged in the sequence in which it has to perform the calculation. Considering the requirement for new Pricing Procedure, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Pricing Procedure --> Maintain Pricing Procedure.
    b. Pricing Procedure: After maintaining the pricing procedure the next step will be determination of pricing procedure. Configuration for determining pricing procedure in SPRO is as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Pricing Procedure --> Determine Pricing Procedure.
    5. Condition record: Condition record is a master data, which is required to be maintained by Core team / person responsible from the client. During new implementation, the condition records can be uploaded using tools like SCAT, LSMW, etc.
    Normal Sales Order Cycle:-
    Step 1: Sales Document Type
    IMG > Sales and Distribution > Sales > Sales Documents >
    Sales Document Header:
    1. Sales Document Type:The sales document types represent the different business transactions, such as Inquiry, Quotation, Sales Order, etc. To create new sales order type, always copy as with reference to similar sales order. If possible use standard sales order.
    2. Define Number Ranges For Sales Documents: Maintain number range with discussion with core team.
    3. Assign Sales Area To Sales Document Types:
    A. Combine sales organizations / Combine distribution channels / Combine divisions: Ensure to maintain these, else Sales Order creation will give error.
    B. Assign sales order types permitted for sales areas: Assign only required Sales Order Types to required Sales Area. This will minimize selection of Sales Order Type as per sales area.
    Sales Document Item:
    1. Define Item Categories: If possible use Standard Item Category. Incase if required to create new, copy as from standard & maintain New.
    2. Assign Item Categories: If possible, use standard. Formula for deriving item category: Sales Document Type + Item Category Group + Usage + Higher Level Item Category = Item Category
    Schedule Line:
    1. Define Schedule Line Categories: If possible use Standard Schedule Lines. Incase if required to create new, copy as from standard & maintain New.
    2. Assign Schedule Line Categories: If possible, use standard. Formula for deriving Schedule Line: Item Category + MRP Type / No MRP Type.
    Step 2:
    IMG > Logistic Execution > Shipping > Deliveries >
    1. Define Delivery Types: If possible use Standard Delivery Type. Incase if required to create new, copy as from standard & maintain New.
    2. Define Item Categories for Deliveries: If possible use Standard Item Categories for Delivery Type. Incase if required to create new, copy as from standard & maintain New.
    3. Define Number Ranges for Deliveries: Ensure to maintain number range.
    Step 3:
    IMG > Sales and Distribution > Billing >
    1. Define Billing Types: If possible use Standard Billing Type. Incase if required to create new, copy as from standard & maintain New.
    2. Define Number Range For Billing Documents: Ensure to maintain number range.
    3. Maintain Copying Control For Billing Documents: Maintain relevant copy controls such as Sales Order to Billing, Deliver to Billing, etc.
    The configuration differs from scenario to scenario & requirement of the client.
    Regards,
    Rajesh Banka
    Reward point if useful.

  • Quantity problem while creating the sales order

    Dear Experts,
    Need your inputs for the following case,
    the sales order has to accept only quantity 1, if more than 1 qty it has to show error message.
    how to control this,as i know not through incompletion log.
    Please let us know your valuable suggestions urgently.
    Thanks
    Raju

    Hi
    J Raju
    Go to SPRO
    Sales and Distribution- --- Sales Documents --  Sales Document Item - -- - Sales Document Item--Select yr sales doc item category view the same there u will find -- general control -- put tick on order qty=1
    Hope this will help you.
    Thx

  • How to create a sales document using  BAPI_SALESORDER_CREATEFROMDAT2

    Hai i was un able to create a sales order using the BAPI can you help me out

    Sample Code:
              clear:   l_order_header,
                       l_salesdocument,
                       l_order_partners,
                       l_order_items,
                       l_order_schdl.
              refresh: it_order_items,
                       it_order_partners,
                       it_order_schdl,
                       it_return.
    ???????? get from material ...
            Order header
              l_order_header-doc_type          = 'ZQBV'.
              l_order_header-distr_chan        = '10'.
              l_order_header-division          = '00'.
              if g_qals-werk eq '1100'.
                l_order_header-sales_org         = '1000'.
              else.
                if g_qals-werk eq '3100'.
                  l_order_header-sales_org         = '3000'.
                else.
                  message i001(00) with text-005.
                endif.
              endif.
              l_order_header-purch_no_c        = g_qals-prueflos.  " <= lot
            Partner data
              l_order_partners-partn_role      = 'AG'.
              l_order_partners-partn_numb      = g_qals-kunnr.
              append l_order_partners to it_order_partners.
            Order items => only one
              l_order_items-itm_number         = 10.
              l_order_items-material           = g_qals-matnr.
              l_order_items-target_qty         = 1.
              append l_order_items to it_order_items.
            Schedules for quantity
              l_order_schdl-itm_number         = 10.
              l_order_schdl-req_qty            = 1.        " <=  only 1 !
              append l_order_schdl to it_order_schdl.
            Conditions for value
              l_order_conditions-itm_number    = 10.
              l_order_conditions-cond_type     = 'PR00'.
              l_order_conditions-cond_value    = g_effort_sum.
              l_order_conditions-currency      = g_effort_unit.
              append l_order_conditions to it_order_conditions.
            BAPI to create sales order
              CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
                EXPORTING
               SALESDOCUMENTIN               =
                  ORDER_HEADER_IN               = l_order_header
               ORDER_HEADER_INX              =
               SENDER                        =
               BINARY_RELATIONSHIPTYPE       =
               INT_NUMBER_ASSIGNMENT         =
               BEHAVE_WHEN_ERROR             =
               LOGIC_SWITCH                  =
               TESTRUN                       =
               CONVERT                       = ' '
                IMPORTING
                  SALESDOCUMENT                 = l_salesdocument
                TABLES
                  RETURN                        = it_return
                  ORDER_ITEMS_IN                = it_order_items
               ORDER_ITEMS_INX               =
                  ORDER_PARTNERS                = it_order_partners
                  ORDER_SCHEDULES_IN            = it_order_schdl
               ORDER_SCHEDULES_INX           =
                  ORDER_CONDITIONS_IN           = it_order_conditions
               ORDER_CONDITIONS_INX          =
               ORDER_CFGS_REF                =
               ORDER_CFGS_INST               =
               ORDER_CFGS_PART_OF            =
               ORDER_CFGS_VALUE              =
               ORDER_CFGS_BLOB               =
               ORDER_CFGS_VK                 =
               ORDER_CFGS_REFINST            =
               ORDER_CCARD                   =
               ORDER_TEXT                    =
               ORDER_KEYS                    =
               EXTENSIONIN                   =
               PARTNERADDRESSES              =
              if not l_salesdocument is initial.
              order successfully created
                message i001(00) with text-001 l_salesdocument.
    call function 'BAPI_TRANSACTION_COMMIT'.
              endif.
    Regards,
    Ravi

  • Problem in creating follow-on document (RFQ) for a bid invitation.

    Hi Experts,
    We have an issue while creating follow-on document(RFQ) for a bid invitation.
    Process is as follows :
    We have a bid invitation and sent it to two vendors. After this, created two responses one is accepted and another one is rejected.
    Now the accepted bid is ready to "Create follow-on Document(RFQ)". But when we do this, the bid with rejected vendor also including in the follow-on document. This should not be the case.
    The follow-on document should include only the accepted bid, but not the rejected bid.
    Could anyone tell me how to achieve this ?
    Thank you very much in advance.

    As far as I understand, what you described is the standard behavior. ALL undeleted vendors are copied over to the follow-on RFQ regardless if their bids have been rejected or not. What you can do is to implement BBP_DOC_CHANGE_BADI for BUS2200 and explicitly remove the vendors which created rejected bids. Make use of the header field "copy_of_guid" to identify the originated RFQ.

  • Problem when creating a sales order using BAPI_SALESORDER_CREATEFROMDAT2

    Hello All,
    I am working on a requirement where i  need to create a new sales order from old sales order (Not all the items of the old sales order are to be copied) i am doing this by getting the data using BAPISDORDER_GETDETAILEDLIST to get the old sales order details and send them to BAPI_SALESORDER_CREATEFROMDAT2.
    My problem is that i when i send the condition also the system in addition to the conditions sent to the BAPI is also automatically proposing the condition types . So the final result is that the sales order ends up having the condition types twice .
    For example VPRS AZWR are visible twice in the sales order.
    Any inputs to solve the problem will be definitely rewarded.
    Thanks in advance.
    Regards,
    Sowmya.

    Hello All,
    I am working on a requirement where i  need to create a new sales order from old sales order (Not all the items of the old sales order are to be copied) i am doing this by getting the data using BAPISDORDER_GETDETAILEDLIST to get the old sales order details and send them to BAPI_SALESORDER_CREATEFROMDAT2.
    My problem is that i when i send the condition also the system in addition to the conditions sent to the BAPI is also automatically proposing the condition types . So the final result is that the sales order ends up having the condition types twice .
    For example VPRS AZWR are visible twice in the sales order.
    Any inputs to solve the problem will be definitely rewarded.
    Thanks in advance.
    Regards,
    Sowmya.

  • Problem while creating a sale order against a purchase order

    functional description
    1 Create a module-pool program for material management and do following:-
    a)     Create a screen to display all purchase Order
    2 same screen should have a tree for all the available PO -done till this part
    4 Select a PO from tree and click on a button to create SO against the selected PO
    in this part created the screen took the screen fields from the get from dictionary now not able to understand how to proceed i ned to click on save and then sales order created should be displayed
    please tell me the flow logic
    thanks
    Moderator message: "spec dumping", please work yourself on your requirement.
    Edited by: Thomas Zloch on Jan 31, 2012

    in this question i missed a thing as i need to display the sales order in an output enabled field

  • Problem while creating a custom document using JAVA API in the current Folder

    I am trying to create an instance of a custome type from the API. I have created a custom type via XML. I have associated a JSP with the custom type thru iFS manager. This jsp provides an interface for the user to enter various data. On submit I call some other jsp also loaded into the /ifs/webui/jsps which calls a method in the java class to create an instance of the above mentioned type. This instance needs to be created in the current directory and not in the home directory of the user. I have written a java program which when run from JDeveloper connects to the repository and creates the object, but not as a foldered object. If I load this class into custom_classes directory, I get an exception. I am attaching the code also here which does the actual processing.
    package cms;
    import oracle.ifs.agents.common.*;
    import oracle.ifs.agents.manager.*;
    import oracle.ifs.agents.server.*;
    import oracle.ifs.beans.*;
    import oracle.ifs.common.*;
    public class ContentModule extends Object {
    public static final String CLASSNAME = "CONTENT";
    public static final String TOPICID_ATTRIBUTE = "TOPICID";
    public static final String SITEID_ATTRIBUTE = "SITEID";
    LibrarySession m_session;
    public ContentModule() {
    connectToRepository();
    createDocument("AM5","s");
    public void connectToRepository(){
    try{
    LibraryService l_service=new LibraryService();
    CleartextCredential l_credential = new CleartextCredential("system","manager");
    ConnectOptions l_options=new ConnectOptions();
    l_options.setServiceName("IfsDefault");
    l_options.setServicePassword("ifssys");
    m_session=l_service.connect(l_credential,l_options);
    }catch(IfsException ex){
    ex.setVerboseMessage(true);
    ex.printStackTrace();
    public void createDocument(String p_docName,String p_docContent){
    try{
    DocumentDefinition l_doc=new DocumentDefinition(m_session);
    l_doc.setClassname(CLASSNAME);
    long newId1=5;
    long newId2=5;
    FolderPathResolver l_currentPath=new FolderPathResolver(m_session);
    Folder l_currentFolder=l_currentPath.getCurrentDirectory();
    l_doc.setAddToFolderOption(l_currentFolder);
    l_doc.setName(p_docName);
    l_doc.setContent(p_docContent);
    AttributeValue av1 = AttributeValue.newAttributeValue(newId1);
    l_doc.setAttribute(TOPICID_ATTRIBUTE,av1);
    AttributeValue av2 = AttributeValue.newAttributeValue(newId2);
    l_doc.setAttribute(SITEID_ATTRIBUTE,av2);
    Document l_document=(Document) m_session.createPublicObject(l_doc);
    }catch(IfsException ex){
    ex.setVerboseMessage(true);
    ex.printStackTrace();
    public static void main(String[] args) {
    ContentModule contentModule = new ContentModule();
    Any help will be highly appreciated.
    Thanks

    Please print out the Verbose Stack Trace generated when you run this application.
    I suspect that you FolderPathResolver is not pointed at the directory you think it is. You might want to try printing out
    I_CurrentFolder.getAnyFolderPath();
    and I_CurrentFolder.getName();
    null

  • Problem in creating purchase order document

    Hi,
    I created a new business document : Purchase request that once it is validated we can copy it to Puchase order.
    when i save the purchase order doc and then launch the creation of the purchase order the operation succed.
    But when i try to copy an already created purchase request i get the error :
    Object reference not set to an instance of an object
    Does any have a clue?
    Thanks a lot.

    This is my code
    Form = _SboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                                                            Documents _Documents =
                                                                (Documents)
                                                            _SboCompany.GetBusinessObject(BoObjectTypes.oPurchaseOrders);
                                                            // Add PO Header
                                                            _Documents.CardCode =
                                                                ((EditText) _Form.Items.Item("3").Specific).Value.ToString();
                                                            _Documents.CardName =
                                                                ((EditText)_Form.Items.Item("4").Specific).Value.ToString();
                                                            // Add PO Lines
                                                            Matrix matrix = (Matrix)Form.Items.Item("37").Specific;
                                                            if (_matrix.RowCount > 0)
                                                                _Documents.Lines.ItemCode =
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("35").Cells.Item(1).Specific).
                                                                        Value;
                                                                string value =
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("38").Cells.Item(1).Specific).
                                                                        Value.Replace(".", ",");
                                                                double val = Convert.ToDouble(value);
                                                                _Documents.Lines.Quantity =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("38").Cells.Item(1).Specific).
                                                                            Value.Replace(".", ","));
                                                                _Documents.Lines.Price =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("39").Cells.Item(1).Specific).
                                                                            Value.Replace(".", ","));
                                                                _Documents.Lines.DiscountPercent =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("40").Cells.Item(1).Specific).
                                                                            Value.Replace(".", ","));
                                                                _Documents.Lines.VatGroup =
                                                                    ((ComboBox)
                                                                     _matrix.Columns.Item("41").Cells.Item(1).Specific).
                                                                        Selected.Value;
                                                                _Documents.Lines.Price =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("39").Cells.Item(1).Specific).
                                                                            Value.Replace(".", ","));
                                                                _Documents.Lines.DiscountPercent =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("40").Cells.Item(1).Specific).
                                                                            Value.Replace(".", ","));
                                                                                    _Documents.Lines.VatGroup =
                                                                    ((ComboBox)
                                                                     _matrix.Columns.Item("41").Cells.Item(1).Specific).
                                                                        Selected.Value;
                                                                                    for (int i = 2; i < _matrix.RowCount + 1; i++)
                                                                    _Documents.Lines.Add();
                                                                    _Documents.Lines.ItemCode =
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("35").Cells.Item(i).
                                                                             Specific).
                                                                            Value;
                                                                    _Documents.Lines.Quantity =
                                                                        double.Parse(
                                                                            ((EditText)
                                                                             _matrix.Columns.Item("38").Cells.Item(i).
                                                                                 Specific).Value.Replace(".", ","));
                                                                    _Documents.Lines.Price =
                                                                        double.Parse(
                                                                            ((EditText)
                                                                             _matrix.Columns.Item("39").Cells.Item(i).
                                                                                 Specific).Value.Replace(".", ","));
                                                                    _Documents.Lines.DiscountPercent =
                                                                        double.Parse(
                                                                            ((EditText)
                                                                             _matrix.Columns.Item("40").Cells.Item(i).
                                                                                 Specific).Value.Replace(".", ","));
                                                                    string val1 = ((ComboBox)
                                                                                    _matrix.Columns.Item("41").Cells.Item
                                                                                    i).Specific).
                                                                        Selected.Value;
                                                                    _Documents.Lines.VatGroup =
                                                                        ((ComboBox)
                                                                         _matrix.Columns.Item("41").Cells.Item(i).
                                                                             Specific).
                                                                            Selected.Value;
                                                                int err = _Documents.Add();
                                                                GC.Collect();
    thanks for your attention

  • Problem while creating sales order

    Hi
       We are facing a problem while creating a sales order in R/3. The sales order number is getting generated. But we are not able to view the same in the backend meaning it is not there in the database. Any inputs would be of help.
    regs
    Steve

    Hi everybody,
    I've got a problem with this too. I use the BAPI_SALESORDER_CREATEFROMDAT2 with BAPI_TRANSACTION_COMMIT and the webdynpro shows me the document number created in R3 with a Success message. But when I go to R3 and try to display the created sales order, it doesn't exists. So... Maybe I'm doing something wrong with the BAPI_TRANSACTION_COMMIT. ¿Can anybody help me with this?
    The code I use is this:
    When the user pushes the SAVE button in the WebDynpro, this code executes:
        //@@begin onActionSave(ServerEvent)
         wdThis.wdGetSOCreaCustController().executeBapi_Salesorder_Createfromdat2();
         wdThis.wdGetSOCreaCustController().executeBapi_Transaction_Commit();
        //@@end
    In the custom Controller I've got the code for those executions:
      public void executeBapi_Salesorder_Createfromdat2( )
        //@@begin executeBapi_Salesorder_Createfromdat2()
         try {
              wdContext.currentBapi_Salesorder_Createfromdat2Element().modelObject().execute();
         catch (Exception ex) {
              wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
         wdContext.nodeOutput().invalidate();
        //@@end
      public void executeBapi_Transaction_Commit( )
         try {
              wdContext.currentBapi_Transaction_CommitElement().modelObject().execute();
         catch (Exception ex) {
              wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
         wdContext.nodeOutput().invalidate();   
        //@@end
    ¿Is something wrong? ¿Is something missing?

Maybe you are looking for