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 Issues

Former Member
0 Likes
1,014

My requirement is:

i have a report which displays sales order, material no and rejection code in a row.

Now if i select a row and click on the user button (which i created it) the rejection should be empty ( get modified as blank in the database tables ) that is the material for that sales order should get unrejected.

Could anyone pls help me how to achieve the same thru this BAPI.

the internal table from which i display this report is itab.

thanks

John

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
901

Hi,

Since you have a user button, set a function code to that which will act as the user-command for that button.

In that PAI event you can capture that line details (for eg: in a at line-selection event) and modify the database table.

You dont require any BAPI FM for this.

Regards

Subramanian

8 REPLIES 8
Read only

Former Member
0 Likes
903

Hi,

Since you have a user button, set a function code to that which will act as the user-command for that button.

In that PAI event you can capture that line details (for eg: in a at line-selection event) and modify the database table.

You dont require any BAPI FM for this.

Regards

Subramanian

Read only

Former Member
0 Likes
901

No i need to use the BAPI

Read only

Former Member
0 Likes
901

You can use BAPI BAPI_SALESORDER_CHANGE for modifying sales order. But, first, you have to try out this BAPI with appropriate parameters and check whether it is updating as per your requirement. Then you have to use it in your report program to update it based on selection and then use interactive report technique to update list.

Read only

Former Member
0 Likes
901

It is for sure that i need to use this BAPI

and i have devloped an interactive report

now my issues is i need to make amandments using this bapi in database tables

which i mentioned my first thread

Read only

0 Likes
901

That's what i said that you pass relevant details to this BAPI by filling all tables/parameters etc based on your line selection. Best thing is to try out this BAPI in SE37 and check required parameters.

Read only

Former Member
0 Likes
901

Hi,

I did the below coding but still after doing that it is not getting updated into database tables. Pls tell me if any error

LOOP AT it_final INTO wa_final.

i_header-updateflag = 'U'.

i_item-itm_number = wa_final-vbeln.

i_item-reason_rej = '02'.

APPEND i_item.

clear i_item.

i_item_x-itm_number = wa_final-vbeln.

i_item_x-updateflag = 'U'.

i_item_x-reason_rej = 'X'.

APPEND i_item_x.

clear i_item_x.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = wa_final-vbeln

order_header_inx = i_header

TABLES

return = i_return

order_item_in = i_item

order_item_inx = i_item_x.

endloop.

Read only

0 Likes
901

I hope you are passing Item number in i_item-itm_number and not wa_final-vbeln which you have written. Also, check for mandatory parameters.

Once, SO is updated you need to refresh your list with new information.

Read only

0 Likes
901

Hi john,

This BAPi does not perform database Commit. So, You need to use the

BAPI_TRANSACTION_COMMIT function module to make the changes in the database.

Hope this should solve your purpose.

Regards,

Durga.