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

BAPI for Order creation

Former Member
0 Likes
894

hi all,

do we have any BAPI's available in SAP to create orders using IW31 transaction.

Rgds,

stock.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
640

Do you absolutely need BAPI function module? If not then there is a funciton modlue :

CALL FUNCTION 'ALM_ME_ORDER_CREATE'

EXPORTING

order_header = g_order_header

IMPORTING

e_order_header = g_order_header

TABLES

order_partner = i_ordpartner

return = lt_return.

all errors will be stored in lt_return.

  • Check for fatal errors

CALL FUNCTION 'ALM_ME_CHECK_RETURN_TABLE'

TABLES

return = lt_return

EXCEPTIONS

error_in_return = 1

OTHERS = 2.

if sy-subrc is zero then, post the order using the funciton module:

  • If no errors then post

CALL FUNCTION 'CO_ZV_ORDER_POST'

EXPORTING

commit_flag = 'X'

ext_flg = 'X'

flg_wait = ' '

trans_typ = 'H'

no_gui_message = 'X'

no_dialog = 'X'

TABLES

caufvd_num_exp = l_caufvdn

EXCEPTIONS

OTHERS = 1.

Please reward points if useful...

3 REPLIES 3
Read only

Former Member
0 Likes
640

Hi,

I believe the BAPI is BAPI_ALM_ORDER_MAINTAIN

Cheers,

Vasanth

Read only

Former Member
0 Likes
641

Do you absolutely need BAPI function module? If not then there is a funciton modlue :

CALL FUNCTION 'ALM_ME_ORDER_CREATE'

EXPORTING

order_header = g_order_header

IMPORTING

e_order_header = g_order_header

TABLES

order_partner = i_ordpartner

return = lt_return.

all errors will be stored in lt_return.

  • Check for fatal errors

CALL FUNCTION 'ALM_ME_CHECK_RETURN_TABLE'

TABLES

return = lt_return

EXCEPTIONS

error_in_return = 1

OTHERS = 2.

if sy-subrc is zero then, post the order using the funciton module:

  • If no errors then post

CALL FUNCTION 'CO_ZV_ORDER_POST'

EXPORTING

commit_flag = 'X'

ext_flg = 'X'

flg_wait = ' '

trans_typ = 'H'

no_gui_message = 'X'

no_dialog = 'X'

TABLES

caufvd_num_exp = l_caufvdn

EXCEPTIONS

OTHERS = 1.

Please reward points if useful...

Read only

Vijay
Active Contributor
0 Likes
640

hi

ALM_ME_ORDER_CREATE

CMOH_ORDER_CREATE

CO2H_PROD_ORDER_CREATE

regards

vijay

reward points if helpful