Skip to Content

item text element in BAPI_SALESORDER_CREATEFROMDAT2

Hi all,

I have created a ABAP-Program to create sales-orders with the function module:

BAPI_SALESORDER_CREATEFROMDAT2

I am not able to create text-elements (from the item) with this bapi.

Can anybody help me?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:35 AM

    Hi,

    with the BAPI we can't load the Texts. Use the FMs SAVE_TEXT or CREATE_TEXT to load the texts.

    Thanks,

    Rajinikanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:39 AM

    Are your Customization in place ? Try to create TEXT via VA01.If you are able to then can u copy paste the code. Also you can try SD_SALESDOCUMENT_CREATE.

    Regards

    Saket Sharma

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:41 AM

    Say for example you have all details in an internal table t_sales_text and t_sales_header.

    For doing this you should know the Text ID.

    LOOP AT t_sales_text WHERE ind = t_sales_header-ind.

    IF t_sales_text-itm_number not initial.

    MOVE t_sales_text-itm_number TO wa_bapi_text-itm_number.

    ENDIF.

    IF t_sales_text-text_id not initial.

    MOVE t_sales_text-text_id TO wa_bapi_text-text_id.

    ENDIF.

    MOVE sy-langu TO wa_bapi_text-langu.

    IF t_sales_text-text_line not initial.

    MOVE t_sales_text-text_line TO wa_bapi_text-text_line.

    ENDIF.

    APPEND wa_bapi_text TO t_bapi_text.

    CLEAR wa_bapi_text.

    ENDLOOP.

    after appending the records to t_bapi_text, pass this table to the BAPI.

    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

    EXPORTING

    order_header_in = wa_bapi_header

    order_header_inx = wa_bapi_header_inx

    IMPORTING

    salesdocument = w_vbeln

    TABLES

    return = t_return

    order_items_in = t_bapi_items

    order_items_inx = t_bapi_item_inx

    order_partners = t_bapi_partner

    order_schedules_in = t_bapi_schedule

    order_schedules_inx = t_bapi_schedule_inx

    order_text = t_bapi_text.

    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.