Application Development and Automation 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: 
Read only

Passing custom fields in FM SD_SALESDOCUMENT_CREATE

Former Member
0 Likes
2,355

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,403

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

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

2 REPLIES 2
Read only

Former Member
0 Likes
1,404

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

Read only

Former Member
0 Likes
1,403

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.