Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FM SD_SALESDOCUMENT_CREATE

Hi experts,

I'm using SD_SALESDOCUMENT_CREATE function module and I need to also create the header text of the created sales order, however it is not working.

Here the code:

  • wa_textheaders-sd_doc = wa_alv_output_dummy-vbeln.

  • wa_textheaders-itm_number = space.

  • wa_textheaders-applobject = c_vbbk.

  • wa_textheaders-text_id = 'ZNFO'.

  • wa_textheaders-text_name = wa_line.

  • wa_textheaders-langu = sy-langu.

  • APPEND wa_textheaders TO i_textheaders.

  • Function module to create new sales order

CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'

EXPORTING

sales_header_in = wa_hdr_in

sales_header_inx = wa_hdr_inx

IMPORTING

salesdocument_ex = v_sales_order

TABLES

return = i_return

sales_items_in = i_items

sales_items_inx = i_itemsx

sales_partners = i_partners

sales_conditions_in = i_cond

sales_conditions_inx = i_condx

textheaders_ex = i_textheaders. " I - SIR 115839

Tags:
Former Member
Former Member replied

Hi,

Populate data as in my early example and pass to parameter table: SALES_TEXT of FM: SD_SALESDOCUMENT_CREATE.

call function 'SD_SALESDOCUMENT_CREATE'
    exporting
*      SALESDOCUMENT                 =
      sales_header_in               = ibapisdhd1
      sales_header_inx              = ibapisdhd1x
*      BUSINESS_OBJECT               = ' '
   importing
      salesdocument_ex              = ibapivbeln
   tables
      return                        = ibapiret2
      sales_items_in                = ibapisditm
      sales_items_inx               = ibapisditmx
      sales_partners                = ibapiparnr
      sales_schedules_in            = ibapischdl
      sales_schedules_inx           = ibapischdlx
      sales_conditions_in           = ibapicond
      sales_conditions_inx          = ibapicondx
      sales_text                    = ibapisdtext
      partneraddresses              = ibapiparadr.

Regards

Eswar

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question