I am using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2 to create sales order and it is getting created without long text though i pass the value for ORDER_TEXT table. The issue is that long text are created when i run the FM directly using SM37 and when I call the same function Module in a program I am not able to see the long text in sales order.
data: begin of wa_val,
value(70) type c,
end of wa_val.
data txt_value like table of wa_val with header line.
call function 'RKD_WORD_WRAP'
exporting
textline = 'THis is a String for Long Text'
delimiter = ' '
outputlen = 50
tables
out_lines = txt_value
exceptions
outputlen_too_large = 1
others = 2.
if sy-subrc <> 0.
subrc = 4.
endif.
loop at txt_value.
order_text-itm_number = '000000'.
order_text-text_id = '0001'.
order_text-langu = 'EN'.
order_text-text_line = txt_value-value.
order_text-function = '009'.
order_text-format_col = '*'.
append order_text.
endloop.
call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
order_header_in = order_header_in
order_header_inx = order_header_inx
importing
salesdocument = salesdocument
tables
return = return
order_items_in = order_items_in
order_items_inx = order_items_inx
order_partners = order_partners
order_schedules_in = order_schedules_in
order_schedules_inx = order_schedules_inx
order_cfgs_ref = order_cfgs_ref
order_cfgs_inst = order_cfgs_inst
order_cfgs_refinst = order_cfgs_refinst
order_cfgs_value = order_cfgs_value.
order_text = order_text.
Kindly help me with sample values
thanks in advance
Edited by: Senthil Ram Kumar Palanisamy Ganapathi on Jul 14, 2009 4:50 PM