2009 Jun 17 6:23 AM
Hi,
I am using FM SD_SALESDOCUMENT_CREATE for creating a sales order. There are few custom field which i am passing in BAPE_VBAP structure but its not getting reflected in created sales order.
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
sales_header_in = wa_bapihead1
sales_header_inx = wa_bapisdhd1x1
logic_switch = wa_bapisdls1
IMPORTING
salesdocument_ex = l_vbeln1
TABLES
return = t_return
sales_items_in = t_bapiitem1
sales_partners = t_bapipart1
sales_text = t_bapitext
extensionin = t_bapiparex.
I have filled table t_bapiparex using below code
FORM fill_bapi_add_data .
DATA:wl_bapiparex TYPE bapiparex,
wl_zvbap TYPE bape_vbap.
LOOP AT t_item INTO wl_item.
wl_zvbap-posnr = wl_item-posnr.
wl_zvbap-field1 = wl_item-field1.
wl_zvbap-field2 = wl_item-field2.
CLEAR wl_bapiparex.
MOVE wl_zvbap TO l_strng.
MOVE 'BAPE_VBAP' TO wl_bapiparex-structure.
MOVE: l_strng(240) TO wl_bapiparex-valuepart1,
l_strng+240(240) TO wl_bapiparex-valuepart2,
l_strng+480(240) TO wl_bapiparex-valuepart3,
l_strng+720(240) TO wl_bapiparex-valuepart4.
APPEND wl_bapiparex TO t_bapiparex.
endloop.
endform.
Can anyone guide me why its not taking custom fields or any other way of populatingthese custom fields.
regards
Rajneesh
2009 Jun 17 10:34 AM
Hi,
You may need to use a BAPI Extension to update the field which is not there in the BAPI structure you use.
Also see:
http://help.sap.com/saphelp_46c/helpdata/en/c3/4099a68b8911d396b70004ac96334b/content.htm
Edited by: Renjith Michael on Jun 17, 2009 3:05 PM
Edited by: Renjith Michael on Jun 17, 2009 3:06 PM
2009 Jun 17 10:34 AM
Hi,
You may need to use a BAPI Extension to update the field which is not there in the BAPI structure you use.
Also see:
http://help.sap.com/saphelp_46c/helpdata/en/c3/4099a68b8911d396b70004ac96334b/content.htm
Edited by: Renjith Michael on Jun 17, 2009 3:05 PM
Edited by: Renjith Michael on Jun 17, 2009 3:06 PM
2009 Jun 17 10:44 AM
Hi,
Can you elaborate on this more.Actually when I am debugging th FM , subroutine ms_move_extensionin is passing the correct values from extension table to e_vbakkom . But still the fields are not reflected.