05-19-2009 12:54 PM
Hi,
I have to create a dialog program which can be called using the BAPI.As we have in the case of PO , it can be created using the transaction code ME21n and calling the BAPI(BAPI_PO_CREATE).Please suggest how to create the BAPI for the custom program.
05-19-2009 1:00 PM
Hi
You aim is to create a Module pool program and that module program you have to call it in your custom bapi
and also you want to display all the screens while executing this bapi right!!!!!!!!!!
is this is your requirement ???
05-19-2009 2:03 PM
Yes , you have understood it correct. Please suggest the solution.
05-19-2009 1:07 PM
Well, in a nutshell, the BAPI will have to hold all the data (fields) that are available in the module program. Also, all the validations you are doing in your module pool will have to be part of the BAPI as well. So, more or less, beside the screens of course, the coding for the BAPI and for the module pool will look very much a like. This is something you will have to take into account when creating module pool routines. Put this logic into CLASSES and METHODS, which can be called from module pool and BAPI.
BTW: Do you really want to go for the BAPI concept, making use of the business object builder (transaction SWO1) or do you just need an RFC?
05-19-2009 1:09 PM
Hi,
BAPI is nothing but a RFC enabled Function Module.
If you need to call a BAPI in a R/3 system only then you can go for RFC FM itself.
To create BAPI, you need to release the FM in the following way:
1)Goto SE37
2)Give the FM name
3)Select the Menu Function Module >> Release >> Release
Create the object from transaction SWO1.
05-19-2009 2:11 PM
Hi,
Call Bapi just like a function module.
Below code will help you,
CALL FUNCTION 'BAPI_PO_CREATE'
EXPORTING
po_header = WA_POHD
PO_HEADER_ADD_DATA =
HEADER_ADD_DATA_RELEVANT =
PO_ADDRESS =
SKIP_ITEMS_WITH_ERROR = 'X'
ITEM_ADD_DATA_RELEVANT =
HEADER_TECH_FIELDS =
IMPORTING
PURCHASEORDER = g_prchord
tables
po_items = I_PO_ITM
PO_ITEM_ADD_DATA =
po_item_schedules = I_PO_SCH
PO_ITEM_ACCOUNT_ASSIGNMENT =
PO_ITEM_TEXT =
RETURN = i_return
PO_LIMITS =
PO_CONTRACT_LIMITS =
PO_SERVICES =
PO_SRV_ACCASS_VALUES =
PO_SERVICES_TEXT =
PO_BUSINESS_PARTNER =
EXTENSIONIN =
POADDRDELIVERY =
.
you can use the above bapi in your dialog program.
Rahul