‎2009 Sep 01 10:11 PM
Hi all,
I am making use of BAPI_SALESORDERCREATE_FROMDAT2 for creating a sales order.
for some orders i need to pass even the material text.
I am not able to find the field in the BAPI structures to pass the material text.
PLease help me solving this issue.
Thanks in advance.
Regards,
Sunny.
‎2009 Sep 01 10:14 PM
Hi,
Maybe you can try SHORT_TEXT field in BAPISDITM structure.
Regards,
Subramanian
‎2009 Sep 01 10:45 PM
Hi Subrmanian,
I tried using SHORT_TEXT but its not fruitful.
please tell me if you have used it earlier...and if it had worked.
‎2009 Sep 01 11:18 PM
Hi Termi,
just found this 5-year+ old snippet, might help:
form prepare_item_text
using pv_text1 type xxxxxxxxxxxx_order_item-text1
pv_text2 type xxxxxxxxxxorder_item-text2
pv_kschl type kschl
pv_material type matnr
pv_itm_number type posnr
ps_bapisdhd1 type bapisdhd1
changing pt_order_text type ty_t_bapisdtext.
data:
lv_langu type sylangu,
ls_bapisdtext type line of ty_t_bapisdtext.
perform get_order_text_language
changing lv_langu.
perform get_1st_item_text_id_4_item
using ps_bapisdhd1 pv_material
changing ls_bapisdtext-text_id.
check not ls_bapisdtext-text_id is initial.
ls_bapisdtext-langu = lv_langu.
ls_bapisdtext-format_col = '*'.
ls_bapisdtext-itm_number = pv_itm_number.
*** Top: Material short text
** PERFORM get_maktx
** USING pv_material lv_langu
** CHANGING ls_bapisdtext-text_line.
** APPEND ls_bapisdtext TO pt_order_text.
*** Space line
** CLEAR: ls_bapisdtext-text_line.
** APPEND ls_bapisdtext TO pt_order_text.
if not pv_kschl is initial.
* In case of 'misc surcharge' item: Add condition text
perform get_vtext_4_kschl using pv_kschl lv_langu
changing ls_bapisdtext-text_line.
append ls_bapisdtext to pt_order_text.
else.
* In case of normal item: Add IDOC item text
ls_bapisdtext-text_line = pv_text1.
if not pv_text1 is initial.
append ls_bapisdtext to pt_order_text.
ls_bapisdtext-format_col = '='.
endif." not pv_text1 is initial.
ls_bapisdtext-text_line = pv_text2.
if not pv_text2 is initial.
append ls_bapisdtext to pt_order_text.
endif." not pv_text2 is initial.
endif.
endform. " prepare_item_textxxxx had customer-related information...
Regards,
Clemens
‎2009 Sep 02 8:41 AM
Hi,
Thanks for your replies.
PRoblem solved using SHORT_TEXT itself, there was some problem before in data.
Regards,
Sunny.