Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SD_SALESDOCUMENT_CREATE

Former Member
0 Kudos

Hi All,

I am using the FM ‘SD_SALESDOCUMENT_CREATE’ to create a Sales Order. Everything is fine apart from two issues that I am struggling with..

1. I wish to assign a condition type ‘ZNET’ with a Amount Value of 0 and a condition value that is populated with a variable. I can do it manually no problem but when I crate it with the program it only creates the condition type but doesn’t assign the values I want.

2. I would like to add text to the item note. Does anyone know where I should put my text?

Many thanks for any help you can give, it is much appreciated,

Points Awarded,

Colm

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You may need to use the function SAVE_TEXT to create the text object.

4 REPLIES 4

Former Member
0 Kudos

You may need to use the function SAVE_TEXT to create the text object.

0 Kudos

That would be a great work around but I'd be very suprised if it wasn't handled in the SD_SALESDOCUMENT_CREATE FM?

Thanks for the help though

Former Member
0 Kudos

I figured out how to do the item text. If you pass through the sales_text table this will populate the item text. See code below to see how to populate the table. I still need a solution for the ZNET issue.

sales_texts TYPE TABLE OF bapisdtext WITH HEADER LINE,

  • Fill Header Text data

sales_texts-itm_number = '000010'.

sales_texts-text_id = '0002'.

sales_texts-langu = sy-langu.

sales_texts-format_col = '*'.

sales_texts-text_line = t_citab-ittxt.

APPEND sales_texts.

CLEAR sales_texts.

CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'

EXPORTING

  • SALESDOCUMENT =

sales_header_in = sales_header_in

  • SALES_HEADER_INX =

  • SENDER =

  • BINARY_RELATIONSHIPTYPE = ' '

  • INT_NUMBER_ASSIGNMENT = ' '

  • BEHAVE_WHEN_ERROR = ' '

  • LOGIC_SWITCH = ' '

  • business_object = 'BUS2094' "cred. mem. req.

  • TESTRUN =

  • CONVERT_PARVW_AUART = ' '

status_buffer_refresh = 'X'

IMPORTING

salesdocument_ex = salesdocument_ex

  • SALES_HEADER_OUT =

  • SALES_HEADER_STATUS =

TABLES

return = returns

sales_items_in = sales_items_in

  • SALES_ITEMS_INX =

sales_partners = sales_partners

  • SALES_SCHEDULES_IN =

  • SALES_SCHEDULES_INX =

sales_conditions_in = sales_conditions_in

  • SALES_CONDITIONS_INX =

  • SALES_CFGS_REF =

  • SALES_CFGS_INST =

  • SALES_CFGS_PART_OF =

  • SALES_CFGS_VALUE =

  • SALES_CFGS_BLOB =

  • SALES_CFGS_VK =

  • SALES_CFGS_REFINST =

  • SALES_CCARD =

sales_text = sales_texts

  • SALES_KEYS =

  • SALES_CONTRACT_IN =

  • SALES_CONTRACT_INX =

  • EXTENSIONIN =

  • PARTNERADDRESSES =

  • SALES_SCHED_CONF_IN =

  • ITEMS_EX =

  • SCHEDULE_EX =

  • BUSINESS_EX =

incomplete_log = incomplete_logs

  • EXTENSIONEX =

  • CONDITIONS_EX =

  • PARTNERS_EX =

  • TEXTHEADERS_EX =

  • TEXTLINES_EX =

  • BATCH_CHARC =

.

Former Member
0 Kudos

To populate the ZNET pricing condtions's condition value you must specify the currency_2 field. Easy as that.