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

call the BAPI from the program..

Former Member
0 Likes
466

Hey guys,

can we call the BAPI from the program..

if yes how can we can show sales orders being loaded..

thanks its urgent

1 ACCEPTED SOLUTION
Read only

Former Member
3 REPLIES 3
Read only

valter_oliveira
Active Contributor
0 Likes
443

Hello.

Yes, you can call a BAPI from a program! To achieve that you have to fill it's input parameters and then call the bapi. For sales orders you have BAPI_SALESORDER_CREATEFROMDAT2. Don't forget to call FM BAPI_TRANSACTION_COMMIT after each order.

To show the sales orders that are created use parameter SALESDOCUMENT that BAPI_SALESORDER_CREATEFROMDAT2 has.

Regards.

Valter Olivera.

Read only

Former Member
0 Likes
443

Nishant,

yes easily you can call bapi from program.

for getting all sales order use:

BAPI_SALESORDER_GETLIST

also am providing a program so that you can see how bapi has to call in program.

CALL FUNCTION 'BAPI_SALESORDER_GETLIST'
             EXPORTING
                  customer_number    = lf_customernumber
                  sales_organization = if_sales_organization
                  document_date      = lf_document_date_from
                  document_date_to   = lf_document_date_to
*              PURCHASE_ORDER     = IF_PURCH_ORDER
                  material           = lf_matno
             IMPORTING
                  return             = ls_return
             TABLES
                  sales_orders       = sales_orders.

Am afraid to say you that above solution you get about bapi it is not for showing the list of SO these are for creating SO.

Edited by: Amit Gujargoud on Jul 3, 2008 3:12 PM

Read only

Former Member