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

scenerio for BAPI

Former Member
0 Likes
732

hai

with detail explaination, give me the real time scenerio for BAPI.

and also for userexit.

urgent .

thx in advance.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
680

A BAPI is used to do some business function. For example, changing a sales order. Just last week, I had a requirement to create a program which can be used to mass change sales orders, changing the requested delivery date and the plant. So in this case I used the BAP BAPI_SALESORDER_CHANGE.

Regards,

Rich Heilman

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
681

A BAPI is used to do some business function. For example, changing a sales order. Just last week, I had a requirement to create a program which can be used to mass change sales orders, changing the requested delivery date and the plant. So in this case I used the BAP BAPI_SALESORDER_CHANGE.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
680

Bapi are really powerful and are really simple to use. It can be used as a substuite for BDC. Its basically a Remote enabled FM.

Recently I have used BAIPI for creating planned orders which is done using MD11 transaction and below is the code for it.

Shreekant.

FORM change_plannedorder .

  • Change the Quantity and make it Firmed

LOOP AT t_output.

t_output-auffx = 'X'.

CLEAR l_headerdatachange.

l_headerdatachange-total_plord_qty = t_output-zcastqty.

l_headerdatachange-FIRMING_IND = t_output-auffx.

l_headerdatachangex-total_plord_qty = 'X'.

l_headerdatachangex-firming_ind = 'X'.

CALL FUNCTION 'BAPI_PLANNEDORDER_CHANGE'

EXPORTING

plannedorder = t_output-plnum

headerdata = l_headerdatachange

headerdatax = l_headerdatachangex

IMPORTING

return = l_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

APPEND l_return.

CLEAR l_return.

ENDLOOP.

ENDFORM. " change_plannedorder

Read only

Former Member
0 Likes
680

Bapi to create Planned order.

LOOP AT t_plafcreate_pe.

CLEAR l_headerdatacreate.

l_headerdatacreate-pldord_profile = t_plafcreate_pe-paart.

l_headerdatacreate-material = t_plafcreate_pe-matnr.

l_headerdatacreate-plan_plant = t_plafcreate_pe-plwrk.

l_headerdatacreate-total_plord_qty = t_plafcreate_pe-gsmng.

l_headerdatacreate-order_start_date = t_plafcreate_pe-psttr.

l_headerdatacreate-firming_ind = t_plafcreate_pe-auffx.

l_headerdatacreate-version = t_plafcreate_pe-verid.

  • PERFORM data_conversions.

CALL FUNCTION 'BAPI_PLANNEDORDER_CREATE'

EXPORTING

headerdata = l_headerdatacreate

IMPORTING

return = l_return

plannedorder = l_plannedorder

createdheaderdata = l_createdheaderdata

capacityheaderdata1 = l_capacityheaderdata1

TABLES

componentsdata = i_componentsdata

createdcomponentsdata = i_createdcomponentsdata

capacitydata1 = i_capacitydata1.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

  • IMPORTING

  • RETURN =

.

APPEND l_return.

CLEAR l_return.

Shreekant

Read only

0 Likes
680

hai Shreekant,

the thing u send is very nice, if u have done some scenerio in user exit means

send me that to.

thx in advance