Regarding Bapi "'BAPI_BILLINGDOC_CREATEMULTIPLE'"
Hi,
When i execute this below code, Billing document is not created in the table t_success,instead in table t_returns i am getting the message "Delivery type LR cannot be invoiced with billing type F8".
code is
TABLES: vbak,vbap,likp, lips.
DATA: t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE.
DATA: t_conditions TYPE STANDARD TABLE OF bapikomv WITH HEADER LINE.
DATA: t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE.
DATA: t_ccard TYPE STANDARD TABLE OF bapiccard_vf WITH HEADER LINE.
DATA: t_errors TYPE STANDARD TABLE OF bapivbrkerrors WITH HEADER LINE.
DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE
PARAMETERS: p_vbeln TYPE vbeln.
select single * from likp
where vbeln = p_vbeln.
SELECT SINGLE * from lips where
vbeln = likp-vbeln.
t_billing-salesorg = likp-vkorg.
t_billing-ref_doc = likp-vbeln.
t_billing-ref_item = lips-posnr.
t_billing-doc_number = p_vbeln.
t_billing-itm_number = lips-posnr.
t_billing-ordbilltyp = 'F8'.
t_billing-price_date = sy-datum.
t_billing-ref_doc_ca = likp-vbtyp.
t_billing-material = lips-matnr.
t_billing-plant = lips-werks.
APPEND t_billing.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
billingdatain = t_billing
return = t_return
success = t_success
Regards,
Shasiraj.C
Hi,
DATA: it_atg_billing LIKE bapivbrk OCCURS 1 WITH HEADER LINE,
it_atg_return LIKE bapiret1 OCCURS 1 WITH HEADER LINE,
it_atg_success LIKE bapivbrksuccess OCCURS 1 WITH HEADER LINE,
git_likp type table of likp with header line.
LOOP AT git_likp.
it_atg_billing-ref_doc = git_likp-vbeln.
it_atg_billing-ref_doc_ca = 'J'.
APPEND it_atg_billing.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
billingdatain = it_atg_billing
return = it_atg_return
success = it_atg_success.
IF sy-subrc = 0.
CLEAR: it_atg_billing, it_atg_billing[].
ENDIF.
ENDLOOP.
The above code creates the invoice number for respective delivery number.
If this was helpful rewards points
Regards
Pratap.M
Similar Messages
-
Dear Experts,
My scenario is:
We have batch split scenario, where the parent line item of billing document has 0 quantity and its subsequent item (item with batch number) holds actual quantity data.
When we create billing document using VF01 against delivery document, system creates billing document along with excise invoice document (J1IIN Document). And in excise document contain same number of line items that of billing document. Please see the below attachment:
Biiling document screen shot:
While creating billing document, the J1IIN Document created automatically. Below is the screen-shot for the same.
Now the issue is:
When we create billing document using BAPI: BAPI_BILLINGDOC_CREATEMULTIPLE system creating only billing document and not creating excise invoice document.
When we create excise document manually using J1IIN the zero quantity line items are excluded in excise invoice document.
Please see the below screen-shot for the same; The z quantity line items are missing.
We want excise document to be created while creating billing document using BAPI BAPI_BILLINGDOC_CREATEMULTIPLE. Or is there any other BAPI for the same purpose.
Customization is also maintained for creating excise invoice document automatically.
Regards,
Rajesh Sadula.HI
Pricing will be carried basing on the pricing
procedure.
Case1: Prices will be carried out automatically if
necessary condition records are maintained for the
condition type.
For this you can go to Sales Order-> Item Conditions
In the screen you can click on command button Analysis,
which gives you the list of condition types associated
to the pricing procedure. By clicking on the condition
type you can know the action that has taken place.
Case2: Manually forcing prices for Items.
To do this, you have to populate ORDER_CONDITIONS_IN &
ORDER_CONDITIONS_INX. Also note to identify the item
numbers, you manually pass the item number for each item
in the sales order, use the same item number for
populating conditions.
Parameters required:
ORDER_CONDITIONS_IN:
ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
ORDER_CONDITIONS_INX:
ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
Hope the above info helps you. Do revert back if you
need more info.
Kind Regards
Eswar -
HOW TO USE BAPI BAPI_BILLINGDOC_CREATEMULTIPLE
HI ALL:
I want to create billing num. in t-code 'VF01'. It is just to input a delivery num.
then press zhe 'save' button.
How to use the bapi BAPI_BILLINGDOC_CREATEMULTIPLE, I mean which
variable should be given. Is there any examples.
THANKS FIRST.Hi,
Following is the documentation provided by SAP in the BAPI transaction:
Functionality
This method can be used to create billing documents.
As input parameters, you are expected to enter information on the items to be processed in the table BILLING_DATA_IN. This data is processed and produces a batch of billing documents. You also have the option of transferring information for entry in the input structure CREATOR_DATA_IN. If this information is already determined, this is transferred into each billing document header. You can also enter optional conditions for the individual items to be processed in the input table CONDITION_DATA_IN, as well as means of payment information in the table CCARD_DATA_IN.
This method can be used in the simulation run (TESTRUN = 'X') and also in the update run including the update (TESTRUN = ' '). Both execution variants deliver errors that may have occurred back to the output table RETURN. Information on successful processing is sent back in the output table SUCCESS. This output table delivers the document numbers of the billing documents created in particular.
Notes
Required entries :
BILLING_DATA_IN-SALESORG
BILLING_DATA_IN-DISTR_CHAN
BILLING_DATA_IN-DIVISION
BILLING_DATA_IN-DOC_TYPE
BILLING_DATA_IN-ORDBILLTYP
BILLING_DATA_IN-SOLD_TO
BILLING_DATA_IN-ITEM_CATEG
BILLING_DATA_IN-REQ_QTY
BILLING_DATA_IN-SALES_UNIT
BILLING_DATA_IN-CURRENCY
If a material is billed for which a material master needs to be
determined (BILLING_DATA_IN-NO_MATMAST = ' '), you must make the
following entries :
BILLING_DATA_IN-PLANT
BILLING_DATA_IN-MATERIAL
If, on the other hand, a material is billed for which no material
master is to be determined (BILLING_DATA_IN_NO_MATMAST = 'X'), you
must make the following entries :
BILLING_DATA_IN-COUNTRY
BILLING_DATA_IN-MATERIAL
BILLING_DATA_IN-TAXCL_1MAT
COMMIT control :
In the update run (TESTRUN = ' ') the update is carried out by COMMIT
WORK as part of the method available.
I guess using this, you will be able to populate the required things to create the billing documents.
Thanks
Vijay -
Hi,
I want to learn BAPI,can anyone send me the documentation regarding BAPI.
Like what is BAPI?
use of BAPI?
When the BAPI will be used..........
Thanx in advance.Hi,
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
list of all bapis
http://www.planetsap.com/LIST_ALL_BAPIs.htm
for BAPI's
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf
http://service.sap.com/ale
http://service.sap.com/bapi
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
http://www.planetsap.com/Bapi_main_page.htm
http://www.topxml.com/sap/sap_idoc_xml.asp
http://www.sapdevelopment.co.uk/
http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
Also refer to the following links..
www.sappoint.com/abap/bapiintro.pdf
www.sap-img.com/bapi.htm
www.sap-img.com/abap/bapi-conventions.htm
www.planetsap.com/Bapi_main_page.htm
www.sapgenie.com/abap/bapi/index.htm
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
http://www.sap-img.com/bapi.htm
http://www.sap-img.com/abap/bapi-conventions.htm
http://www.sappoint.com/abap/bapiintro.pdf
BAPI
http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://www.sapgenie.com/abap/bapi/example.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
u can check the below the material also
what is BAPI?
BAPI stands for Business API(Application Program Interface).
I have answered this question before..
A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
The following standardized BAPIs are provided:
Reading instances of SAP business objects
GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
The BAPI GetList() is a class method.
GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
Create( ) and CreateFromData! ( )
The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
Change( )
The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
Example Code
U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
U can find these parameters for a particular condition type in table KONV.
*& Form saveTransactionJOCR
text
--> p1 text
<-- p2 text
FORM saveTransactionJOCR .
data: salesdocument like BAPIVBELN-VBELN,
order_header_inx like bapisdh1x,
order_header_in like bapisdh1,
return type standard table of bapiret2 with header line,
conditions_in type standard table of bapicond with header line,
conditions_inx type standard table of bapicondx with header line,
logic_switch like BAPISDLS,
step_nr like conditions_in-cond_st_no,
item_nr like conditions_in-itm_number,
cond_count like conditions_in-cond_count,
cond_type like conditions_in-cond_type.
salesdocument = wa_order_information-VBELN.
LOGIC_SWITCH-COND_HANDL = 'X'.
order_header_inx-updateflag = 'U'.
conditions
clear conditions_in[].
clear conditions_inx[].
clear: step_nr,
item_nr,
cond_count,
cond_type.
step_nr = '710'.
item_nr = '000000'.
cond_count = '01'.
cond_type = 'ZCP2'.
CONDITIONS_IN-ITM_NUMBER = item_nr.
conditions_in-cond_st_no = step_nr.
CONDITIONS_IN-COND_COUNT = cond_count.
CONDITIONS_IN-COND_TYPE = cond_type.
CONDITIONS_IN-COND_VALUE = 666.
CONDITIONS_IN-CURRENCY = 'EUR'.
append conditions_in.
CONDITIONS_INX-ITM_NUMBER = item_nr.
conditions_inx-cond_st_no = step_nr.
CONDITIONS_INX-COND_COUNT = cond_count.
CONDITIONS_INX-COND_TYPE = cond_type.
CONDITIONS_INX-UPDATEFLAG = 'U'.
CONDITIONS_INX-COND_VALUE = 'X'.
CONDITIONS_INX-CURRENCY = 'X'.
append conditions_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = salesdocument
ORDER_HEADER_IN = order_header_in
ORDER_HEADER_INX = order_header_inx
LOGIC_SWITCH = logic_switch
TABLES
RETURN = return
CONDITIONS_IN = conditions_in
CONDITIONS_INX = conditions_inx
if return-type ne 'E'.
commit work and wait.
endif.
ENDFORM. " saveTransactionJOCR
Bdc to Bapi
The steps to be followed are :
1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
[for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
2. Create a Z program and call the BAPi (same as a Funtion module call).
2. Now, if you see this BAPi, it has
-> Importing structures.
eg: SALESDOCUMENT: this will take the Sales order header data as input.
-> Tables parameters:
eg: ORDER_ITEM_IN: this will take the line item data as input.
Note :
Only specify fields that should be changed
Select these fields by entering an X in the checkboxes
Enter a U in the UPDATEFLAG field
Always specify key fields when changing the data, including in the checkboxes
The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
Maintain quantities and dates in the schedule line data
Possible UPDATEFLAGS:
U = change
D = delete
I = add
Example
1. Delete the whole order
2. Delete order items
3. Change the order
4. Change the configuration
Notes
1. Minimum entry:
You must enter the order number in the SALESDOCUMENT structure.
You must always enter key fields for changes.
You must always specify the update indicator in the ORDER_HEADER_INX.
2. Commit control:
The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
For further details... refer to the Function Module documentation for the BAPi.
Bapi to VB(Visual Basic)
Long back I had used the following flow structure to acheive the same.
Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
You need to have com4abap.exe
If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
else refer OSS note 419822 for installation of com4abap
after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
for setting up com4abap and rfc destination please refer to the documentation for com4abap.
Invoke NEW DCOM session
call function 'BEGIN_COM_SESSION'
exporting
service_dest = service_dest "(this will be a RFC destination created in SM59)
importing
worker_dest = worker_dest
exceptions
connect_to_dcom_service_failed = 1
connect_to_dcom_worker_failed = 2
others = 3.
call function 'create_com_instance' destination worker_dest
exporting
clsid = g_c_clsid
typelib = g_c_typelib
importing
instid = g_f_oid
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
call function 'com_invoke' destination worker_dest
exporting
%instid = g_f_oid
%method = 'UpdatePDF'
sntemp = g_v_const_filent
snsysid = sy-sysid
snflag = 'N'
tables
rssaptable = g_t_pdfdetail1
%return = g_t_pdfdetail1 "t_test
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
then close the com session , using
FM delete_com_instance
FM END_COM_SESSION
Regards,
Priyanka. -
Regarding BAPI HRXSS_CAT_WD_RECORD
Hi Experts,
This is regarding BAPI HRXSS_CAT_WD_RECORD.for this BAPI , I am providing inputs like this
IV_PERNR = 90030.
IV_ACTION = COPY_FROM_PREVIOUS_PERIOD.
IV_BEGDA = 09/20/2008 .
IV_ENDDA = 09/26/2008 .
So this BAPI has to copy the previous period(week) data to current week what I provided in the input area.But it is not returing (it is not copying previous week data).means COPY_FROM_PREVIOUS_PERIOD action is not working in BAPI.
Is there any BAPI for meeting this requirement. I want copy the previous weeks time sheet data to week dates provided in input. This functionality is available in Tcode in cat22.
Regards,
VinodYou may use the following BAPI (actual BAPI these one) to fulfil your requirement:
- [BAPI_CATIMESHEETRECORD_GETLIST|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_catimesheetrecord_getlist&adv=false&sortby=cm_rnd_rankvalue]
- [BAPI_CATIMESHEETMGR_INSERT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_catimesheetmgr_insert&adv=false&sortby=cm_rnd_rankvalue]
Regards -
Dear guys,
I have CSV file having records, which is read from local PC and has to be uploaded in R/3 screen.
Concretely speaking, Now Records from CSV files will be displayed in Sales order screen. customer will correct the data changes in screen(if necessary for each record) and save the record to sales table.
1-Here i want to know should i have to use BAPI or not for saving datas in sales order table.
(Its purely ABAP programming module)
2-if Bapi is required could you pls tell what BAPI is required to save in sales table.
Thanks in advance.
ambichan.Hi Ambichan,
first of all: don't make changes (/ use exits / BADI) for this task. Only if you need different functionality for sales document creation itself, you might do some enhancements.
Copy of this transaction doesn't make much sense: to much to delete. Maybe you use screen definition, but the rest you should do on your own.
Do you need feedback from system?
Yes: use BAPI_SALESORDER_SIMULATE to get feedback (like delivery days, availability...) and display results in own transaction.
No: just display the values like an editor (but in corresponding fields and places of VA01).
If you create only one order at a time, then it's also possible to use a batch input (VA01), started in error mode, to fill all fields. Then your last action is pressing enter (instead of save). Transaction will pop up, because it's not finished -> user is in correct transaction, feedback from system is available, all additional functions (like display customer / article / whatever else data) are at hand...
Regards,
Christian -
Problem regarding BAPI call from a webdynpro applications
Hi,
We are trying to call a BAPI in R/3 system from a webdynpro application through the standard method. But we are getting some problems in JCO settings. We already wasted so much time in solving those problems. Is there anyway where i can access BAPI from Webdynpro application.
Rgrds,
AnnaHello Anna,
You can do it by using SAP Java Connector API's in the implementation of the Webdynpro application. You can refer to the sample programs for JCO at http://service.sap.com/connectors and download the latest version of SAP JCo in that install those files as per the installation document in the downloaded zip. The downloaded zip contains information about JCo APIs and sample programs.
Hope this will solve your problem.
Best Regards,
Srinivas. -
Regarding BAPI "BAPI_FUNCLOC_CHANGE" error
Hi All,
I have a requirement to update IFLOT table with new 3 custom fields which i have appened in the include CI_IFLOT.
I have copied standard BAPI "BAPI_FUNCLOC_CHANGE" and created custom Function Module "Y_BAPI_FUNCLOC_CHANGE".
Now when I activated the same, i got one error like "Type "ILOX_T_IFLOS" is unknown". I am not getting exactly why this error comes out, please tell me how to remove this error who have already worked on this.
Thanks,
Jay.hello,
when you copied BAPI it did not copy global objects. Open BAPI via se37 choose attribute tab strip and double click on Program name SAPL( your BAPI's Function group name) you will find it on the right bottom corner and compare include in this program with the standard BAPI's program. Include missing data and you've got the solution.
P.s. required structure is in top include-> type pool ILOX.
best regards,
dez_ -
Hi All,
Can anybody Tell me Available Bapi for F-32( Clear Customer).
Thanks in Advance,
JanaHi,
Welcome To SDN!!.
Please try one the below bapi.
BAPI_ACC_PYMNTBLK_UPDATE_POST
BAPI_ACC_BILLING_POST
check this links:
1) Re: BAPI for FB05
2) Re: F-32 : Clearing Open Items
Regards
Kiran Sure -
Hi experts,
i have one doubt about BAPI's. Here iam using SAP PLM system. I have to search the suitable BAPI to display the list of materials form SAP PLM system.Here the requirement is i have to give this BAPI to the XI people. There they wil use this BAPI to get the structure of the BAPI .
Here my doubt is for SAP PLM system is there any separate BAPI's or we can use the normal BAPI existed in the sap system.Please let me know which BAPI i can use for this requirement.
thanks & regards
babuHi Naga,
you can try BAPI_MATERIAL_GETLIST this is standard bapi if it is excess to your requirement you need to create customized bapi like Z_BAPI_MATERIAL_INFO .
if you give me your exact requirement i can provide fruitfull answer. Thank you
Thanks & Regards
Ramana -
When i create the structure for particular field it will display the message "Field name VBELN does not agree with proposed name SD_DOC for BAPI table".
Kindly help me.
Regards,
Abhishek K.Hello Raymond,
I had problem of creating structure for BAPI Now it is Solved .
And Yes i have created RFC Function Module.
But i get some problem during Activation.
Could you help me on this?
Code:->
FUNCTION ZBAPI_DEMO_SD.
*"*"Local Interface:
*" IMPORTING
*" VALUE(FM_VBELN) TYPE VBAP-VBELN
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRETURN
*" TABLES
*" ZITEMDATA STRUCTURE ZBAPI_TABLE OPTIONAL
SELECT POSNR
MATNR
MATKL
PSTYV
MEINS FROM VBAP INTO TABLE ZITEMDATA
WHERE VBELN = FM_VBELN.
ENDFUNCTION.
Error: ->"Report/Program statement Missing or Program type is I (Include)".
Regards,
Abhishek K. -
UR: Regarding BAPI Wrapper
Hi SDN.
there is a standard bapi BAPI_PO_GETITEMSREL.
I created an RFC ZBAPI_PO_GETITEMSREL.... But i want 2 know whether the RFC i created is said to be a BAPI Wrapper or not ???
because actually i'm in need of BAPI Wrapper.
here is the code ....
FUNCTION ZBAPI_PO_GETITEMREL.
""Local Interface:
*" IMPORTING
*" VALUE(I_REL_GROUP) LIKE BAPIMMPARA-REL_GROUP OPTIONAL
*" VALUE(I_REL_CODE) LIKE BAPIMMPARA-REL_CODE OPTIONAL
*" VALUE(I_ITEMS_FOR_RELEASE) LIKE BAPIMMPARA-SELECTION DEFAULT
*" 'X'
*" TABLES
*" ET_PO_HEADERS STRUCTURE BAPIEKKOL
*" ET_PO_ITEMS STRUCTURE BAPIEKPOC
*" RETURN STRUCTURE BAPIRETURN OPTIONAL
if I_ITEMS_FOR_RELEASE is initial.
CALL FUNCTION 'BAPI_PO_GETITEMSREL'
EXPORTING
REL_GROUP = I_REL_GROUP
REL_CODE = I_REL_CODE
ITEMS_FOR_RELEASE = ' '
TABLES
po_headers = ET_PO_HEADERS
po_items = ET_PO_ITEMS
RETURN = RETURN .
else.
CALL FUNCTION 'BAPI_PO_GETITEMSREL'
EXPORTING
REL_GROUP = I_REL_GROUP
REL_CODE = I_REL_CODE
ITEMS_FOR_RELEASE = 'X'
TABLES
po_headers = ET_PO_HEADERS
po_items = ET_PO_ITEMS
RETURN = RETURN .
ENDIF.
ENDFUNCTION.Hi,
to use it with MI you need to have:
GETLIST
and
GETDETAIL
warpper. Check the documentation in MDK to have a better understanding of the complete process. There is a good example for this and you can take the code from there and change it to your needs.
The single code you send will not help you any further cause it is missing the clear structure between GETLIST and GETDETAIL - that is standard MI behaviour and necessary for correct results. Without this you even can not create any SyncBO in MEREP_SBUILDER.
Hope this helps to bring you any further.
Regards,
Oliver -
Dear all,
I am working in a project where we archive SAP data (outbound documents) and connect some of the documents for SAP R/3 applications from any other resource other than SAP(in bound documents).
Ours is basically a third party tool which supports SAP R/3 documents as well as BW`s documents, certified by SAP.we maintain our own repository for that purpose.The meta data related to the documents is stored in SAP.our requirement now is to have that metadata available in our repository.we need to extract that meta data available in SAP.
can any one know here in which table those data is available? all i know is we need to apply BAPI calls to extract that metadata from SAP to our repository.
is there any method existing other than BAPI to extract that data?if yes what are those and how to go about that type?if not, how to call the BAPI`S from our repository?
Thanks in advance
RaviHello,
You can find out the metadata for tables in table DD03L. I don't know about the BAPI to read these data.
But, you can make one program which downloads the data into flat file. Later you can upload that file into your third party software.
Regards,
Naimesh -
Regarding Bapi (BAPI_ACC_document_post)
Hi,
While executing the Bapi
The return message is showing that invoice document is successfully posted ,but I have checked in the database tables like bseg,bkpf is not updated.
could please tell me what is the problem .
Regards,
Venu.Hai,
Use Function Module BAPI_TRANSACTION_COMMIT by exporting parameter WAIT = 'X' after
calling the BAPI.
After that, you can call function module DEQUEUE_ALL to release the locks. -
Hi @ ,
I have a bapi which i am using in my interface .Now i need to know the tables associated with it and if there are any return parameters .I have chk se37 there is no export parameter present .So the problem ?
Also i have to chk some test cases created previously by another user for that bapi,how to search for those test cases and verify the table entries
thx in advanceHi
Go through the doc of BAPI, it will be helpful to solve your issue
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
list of all bapis
http://www.planetsap.com/LIST_ALL_BAPIs.htm
for BAPI's
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf
http://service.sap.com/ale
http://service.sap.com/bapi
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
http://www.planetsap.com/Bapi_main_page.htm
http://www.topxml.com/sap/sap_idoc_xml.asp
http://www.sapdevelopment.co.uk/
http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
Also refer to the following links..
www.sappoint.com/abap/bapiintro.pdf
www.sap-img.com/bapi.htm
www.sap-img.com/abap/bapi-conventions.htm
www.planetsap.com/Bapi_main_page.htm
www.sapgenie.com/abap/bapi/index.htm
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
http://www.sap-img.com/bapi.htm
http://www.sap-img.com/abap/bapi-conventions.htm
http://www.sappoint.com/abap/bapiintro.pdf
u can check the below the material also
what is BAPI?
BAPI stands for Business API(Application Program Interface).
I have answered this question before..
A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
The following standardized BAPIs are provided:
Reading instances of SAP business objects
GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
The BAPI GetList() is a class method.
GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
Create( ) and CreateFromData! ( )
The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
Change( )
The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
Example Code
U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
U can find these parameters for a particular condition type in table KONV.
*& Form saveTransactionJOCR
text
--> p1 text
<-- p2 text
FORM saveTransactionJOCR .
data: salesdocument like BAPIVBELN-VBELN,
order_header_inx like bapisdh1x,
order_header_in like bapisdh1,
return type standard table of bapiret2 with header line,
conditions_in type standard table of bapicond with header line,
conditions_inx type standard table of bapicondx with header line,
logic_switch like BAPISDLS,
step_nr like conditions_in-cond_st_no,
item_nr like conditions_in-itm_number,
cond_count like conditions_in-cond_count,
cond_type like conditions_in-cond_type.
salesdocument = wa_order_information-VBELN.
LOGIC_SWITCH-COND_HANDL = 'X'.
order_header_inx-updateflag = 'U'.
conditions
clear conditions_in[].
clear conditions_inx[].
clear: step_nr,
item_nr,
cond_count,
cond_type.
step_nr = '710'.
item_nr = '000000'.
cond_count = '01'.
cond_type = 'ZCP2'.
CONDITIONS_IN-ITM_NUMBER = item_nr.
conditions_in-cond_st_no = step_nr.
CONDITIONS_IN-COND_COUNT = cond_count.
CONDITIONS_IN-COND_TYPE = cond_type.
CONDITIONS_IN-COND_VALUE = 666.
CONDITIONS_IN-CURRENCY = 'EUR'.
append conditions_in.
CONDITIONS_INX-ITM_NUMBER = item_nr.
conditions_inx-cond_st_no = step_nr.
CONDITIONS_INX-COND_COUNT = cond_count.
CONDITIONS_INX-COND_TYPE = cond_type.
CONDITIONS_INX-UPDATEFLAG = 'U'.
CONDITIONS_INX-COND_VALUE = 'X'.
CONDITIONS_INX-CURRENCY = 'X'.
append conditions_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = salesdocument
ORDER_HEADER_IN = order_header_in
ORDER_HEADER_INX = order_header_inx
LOGIC_SWITCH = logic_switch
TABLES
RETURN = return
CONDITIONS_IN = conditions_in
CONDITIONS_INX = conditions_inx
if return-type ne 'E'.
commit work and wait.
endif.
ENDFORM. " saveTransactionJOCR
Bdc to Bapi
The steps to be followed are :
1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
[for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
2. Create a Z program and call the BAPi (same as a Funtion module call).
2. Now, if you see this BAPi, it has
-> Importing structures.
eg: SALESDOCUMENT: this will take the Sales order header data as input.
-> Tables parameters:
eg: ORDER_ITEM_IN: this will take the line item data as input.
Note :
Only specify fields that should be changed
Select these fields by entering an X in the checkboxes
Enter a U in the UPDATEFLAG field
Always specify key fields when changing the data, including in the checkboxes
The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
Maintain quantities and dates in the schedule line data
Possible UPDATEFLAGS:
U = change
D = delete
I = add
Example
1. Delete the whole order
2. Delete order items
3. Change the order
4. Change the configuration
Notes
1. Minimum entry:
You must enter the order number in the SALESDOCUMENT structure.
You must always enter key fields for changes.
You must always specify the update indicator in the ORDER_HEADER_INX.
2. Commit control:
The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
For further details... refer to the Function Module documentation for the BAPi.
Bapi to VB(Visual Basic)
Long back I had used the following flow structure to acheive the same.
Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
You need to have com4abap.exe
If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
else refer OSS note 419822 for installation of com4abap
after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
for setting up com4abap and rfc destination please refer to the documentation for com4abap.
Invoke NEW DCOM session
call function 'BEGIN_COM_SESSION'
exporting
service_dest = service_dest "(this will be a RFC destination created in SM59)
importing
worker_dest = worker_dest
exceptions
connect_to_dcom_service_failed = 1
connect_to_dcom_worker_failed = 2
others = 3.
call function 'create_com_instance' destination worker_dest
exporting
clsid = g_c_clsid
typelib = g_c_typelib
importing
instid = g_f_oid
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
call function 'com_invoke' destination worker_dest
exporting
%instid = g_f_oid
%method = 'UpdatePDF'
sntemp = g_v_const_filent
snsysid = sy-sysid
snflag = 'N'
tables
rssaptable = g_t_pdfdetail1
%return = g_t_pdfdetail1 "t_test
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
then close the com session , using
FM delete_com_instance
FM END_COM_SESSION
reward if sueful
regards,
Anji
Maybe you are looking for
-
Can you save a GUI configuration??
Hi everyone, I am learning java and have a question. I have a jdesktop pane and it has multiple internal frames in it. Now I open a bunch of frames and place it the way I want. Now can I do something like save this configuration in any file say for e
-
IWeb 3.04 with OS 10.8.2 on new iMac. Issues with saving.
Sometimes changes save, sometimes they don't. Using Domain Cracker to open desired domain.sites2 files saved in the documents folder. Could that script be the source of the problem? Back story is that we have a fairly large site developed on iWeb 1.
-
I have an iPhone and iPad. I would like to get my husband an iPhone. Are we able to sync all devices and share info with both iPhones and the iPad, using a single email address?
-
Please help I can't send or receive messages on messages or use face time it sometimes work of I turn off my wifi setting and logout of my apple Id
-
Data Execution Prevention has closed Adobe Reader
I cannot launch Adobe Reader, got the following message When I close program, a message says "Data Execution Prevention has closed Adobe Reader." I have searched the Microsoft Community for fixes, but those suggestions don't work. I'm running Window