Skip to Content
author's profile photo Former Member
Former Member

Sales Order Creating using Fucntion Module

HI,

I am working on RFC's. I need to create a sales order from one system to other.

I created a BDC using SHDB transaction and created a function module for it. i able to create a sales order but i should be able to retrieve the sales order number too so that i can make use of it in RFC Program.

Can anyone tell me how to find out the sales order number using a function module??

regards

Ramakanth

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2010 at 05:56 AM

    hi

    In bdc you can get the messages from this

    l_tab_messtab TYPE TABLE OF bdcmsgcoll,

    PERFORM bdc_transaction TABLES lt_messtab USING 'VA01' g_ctu g_mode g_update

    CALL FUNCTION 'CONVERT_BDCMSGCOLL_TO_BAPIRET2'

    TABLES

    imt_bdcmsgcoll = l_tab_messtab

    ext_return = et_message_return.

    BAPI_SALESORDER_GETLIST for get the SO based on the Customer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2010 at 06:14 AM

    Hi,

    You can populate your return messages from BDC using this FM 'MESSAGE_TEXT_BUILD'.

    Here, the parameter MSGV2 will return the sales order number that is created

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2010 at 12:15 PM

    Hi ,

    Use This BAPI To Create Sales Order.Goto se37 and enter this BAPI & check it will work.BAPI is RFC Enabled Function Module.

    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

    EXPORTING

    • SALESDOCUMENTIN =

    ORDER_HEADER_IN = bapi_head

    ORDER_HEADER_INX = bapi_headx

    IMPORTING

    SALESDOCUMENT = SALESDOCUMENT

    TABLES

    RETURN = it_ret1

    ORDER_ITEMS_IN = it_item

    ORDER_ITEMS_INX = it_itemx

    ORDER_PARTNERS = it_parnr

    ORDER_SCHEDULES_IN = it_sched

    ORDER_SCHEDULES_INX = it_schedx

    EXTENSIONIN = it_extensionin

    .

    Regards,

    Manesh.R

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2010 at 12:54 PM

    Hi,

    As suggested; do not use a BDC, use the BAPI instead.

    Regards,

    Ankur Parab

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2010 at 01:16 PM

    Hi ,

    It is better to use th BAPI BAPI_SALESORDER_CREATEFROMDAT2 instead of going for FM.

    Read the documentation before using this.

    Regards,

    Bharani

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2010 at 02:12 PM

    Hi,

    You can use BAPI_SALESORDER_SIMULATE , BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2.

    It will work fine.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.