Doubts with BAPI
Hi,
1) Can we use both Tables and Changing parameters while creating Function modules and BAPI? Please tell the difference b/w Tables and Changing?
2) Is it mandatory that we should pass internal tables with out header line through FM and BAPI?
3) Is it mandatory that Parameters that we pass should be "pass by value"?
Thanks in advance...
HI..,
1)We can use TABLES but we should not use CHANGING ...
Changing is in a way BY REFERENCE onli...
2)We can pass internal tables With header line also to the BAPI function module..
3)Yes it is mandatory that we need to pass the parameters only by Value ... Because RFC enabled function modules doesnot support "By Reference".
reward if it helps u...
sai ramesh
Similar Messages
-
Hi All I have a doubt in BAPI.
I have created a function module which is remote enabled module. I didnu2019t create any BAPI using Tcode SWO1 or BAPI. Am using this function module in my VB code to get the data from SAP, Its working fine am getting all data from SAP database.
My Question is since we can use sap Function module (which is remote enabled module) with out creating BAPI. Then what is the use of creating BAPI.?
If we click on radio button Remote enabled module is that function module act as BAPI?
Please help me.
Regards
Prajwal K.Hi Prajwal,
Please check this link
RFC and BAPI Interfaces to SAP Systems
http://help.sap.com/saphelp_45b/helpdata/en/cf/8ccab761ea11d2804a00c04fada2a1/content.htm
BAPI's are the remote enabled Function modules which are defined in the Business Object Repository (BOR) as the methods of the business objects.I can say BAPI is the subset of RFC. RFC connects to the other system via BAPI and vice versa.
BAPI methods 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.BAPI is having all Key fields, methods, interfaces etc.
Best regards,
raam -
Performance issues with Bapi BAPI_MATERIAL_AVAILABILITY...
Hello,
I have a Z program to check ATP which is working with Bapi BAPI_MATERIAL_AVAILABILITY....
As I am in the retail system we have performance issues with this bapi due the huge amount of articles in the system we need to calculate the ATP.
any way to improve the performance?
Thanks and best regards
LThe BAPI appears to execute for only one plant/material, etc., at a time, so I would have to concentrate on making data retrieval and post-bapi processing as efficient as possible. In your trace output, how much of your overall time is consumed by the BAPI? How much by the other code? You might find improvements there...
-
Reg: Mandatory fields updation with BAPI
Hi..
We are working on BDC using BAPI. In this if flat files contians only 4 fields and the mandatory fields in the application are seven then system needs to through error message. But with BAPI the program is updating the database without throwing error eventhough all mandatory fileds are not filled up with data.. Where exactly we need to do modifications to get error message when mandatory fields are not filled up with input.
RegardsHi Verendra
Sometimes the function modules/BAPI's used by SAP do a direct update on the database tables. In such scnearios the entries are created in the system even though if the mandatory entries are not filled.
If the number of mandatory fields are small, then before the BAPI call, check if all the mandatory fields are filled or not;throw error in case of empty fields & bypass the BAPI call.
In case the mandatory fields are too high, then in that case, please use BDC recording to update the data.
Regards
Chetan
PS:Reward points if you find this helpful. -
Problem in lock Sales order create with BAPI BAPI_SALESORDER_CREATEFROMDAT2
Hi All,
i have the z program to create the sales order with reff quotation in SD With BAPI BAPI_SALESORDER_CREATEFROMDAT2.
this program will excute every 30 mins .
Problem: Some times if i excute the program in background it is taking morethan 30mins so second batch excution also gets starting to create the sales order for same quotation then it is creating 2 sales orders at atime with 1 quotation.
here i am getting duplicate sales orders so i want to lock the creation of duplicate sales order.Some solutions
- Just lock (ENQUEUE) any object at the start of the job(*), if not locked, you can exit or wait in a loop, will be released at end of job (use a _SCOPE '3' so commit work wont release the lock)
-> This will insure the job runs only once at a time
- Lock the quotation before calling the BAPI, will be released by the COMMIT_WORK (from where do you fetch the quotation, if it is a customer Z_table, you can use the lock object that you have surely created ?) (use a _scope '2')
-> This will insure that at most one job will convert a quotation (i suppose you set a "done" flag or status in the quotation record)
Read [SAP Locks |http://help.sap.com/abapdocu_70/en/ABENSAP_LOCK.htm] if you are not familiar with the concept of lock in SAP.
Regards,
Raymond
(*) E_TABLEE for table, E_TRDIR for program, anything not required by another process -
Doubt with creation of Model in the application Webdynpro Java
Good Morning,
I have the following doubts with the fields when i am creating a models in WebDynpro Java
Model Package
Source Fólder
Default logical system name for model instances
Default logical system name for RFC metadata
Logical Dictionary
Dictionary Type Package.
Can Help me?
Kind RegardsHi,
Please check this link:
[https://wiki.sdn.sap.com/wiki/display/WDJava/FAQ%20-%20Models%20-%20Adaptive%20Web%20Service]
Thanks and Regards -
Hi All,
I have to create a file upload program to create service PO's with BAPI_PO_CREATE1. Please if anyone can give me a example of it it would be great.
Thanks.
MalindaHi ,
Check out this program .
use this program for creating service po's using bapi.
*& Report ZMM_PO_CREATE1 *
REPORT ZMM_PO_CREATE1 .
data : POHEADER like BAPIMEPOHEADER occurs 0 with header line,
POHEADERX like BAPIMEPOHEADERX occurs 0 with header line,
POITEM like BAPIMEPOITEM occurs 0 with header line,
POITEMX like BAPIMEPOITEMX occurs 0 with header line,
POESLLC like BAPIESLLC occurs 0 with header line,
POACCOUNT like BAPIMEPOACCOUNT occurs 0 with header line,
POACCOUNTX like BAPIMEPOACCOUNTX occurs 0 with header line,
POCONDHEADER like BAPIMEPOCONDHEADER occurs 0 with header line,
POCONDHEADERX like BAPIMEPOCONDHEADERX occurs 0 with header line,
POCOND like BAPIMEPOCOND occurs 0 with header line,
RETURN like BAPIRET2 occurs 0 with header line.
data : po_no(10).
data : begin of it_head occurs 0,
ref(10),
bsart like ekko-bsart,
lifnr like ekko-lifnr,
ekorg like ekko-ekorg,
ekgrp like ekko-ekgrp,
bukrs like ekko-bukrs,
verkf like ekko-verkf,
telf1 like ekko-telf1,
ihrez like ekko-ihrez,
unsez like ekko-unsez,
kdatb(10),
kdate(10),
end of it_head.
data : begin of it_det occurs 0,
ref(10),
knttp like ekpo-knttp,
pstyp like ekpo-pstyp,
txz01 like ekpo-txz01,
matkl like ekpo-matkl,
werks like ekpo-werks,
afnam like ekpo-afnam,
ktext1 like esll-ktext1,
srvpos like esll-srvpos,
frmval1 like esll-frmval1,
frmval2 like esll-frmval2,
menge like esll-menge,
kostl like eskn-kostl,
sakto like eskn-sakto,
zzcode like eskn-zzcode,
kbetr like konv-kbetr,
end of it_det.
data : c_col1 TYPE i VALUE '0001',
c_col2 TYPE i VALUE '0002',
c_col3 TYPE i VALUE '0003',
c_col4 TYPE i VALUE '0004',
c_col5 TYPE i VALUE '0005',
c_col6 TYPE i VALUE '0006',
c_col7 TYPE i VALUE '0007',
c_col8 TYPE i VALUE '0008',
c_col9 TYPE i VALUE '0009',
c_col10 TYPE i VALUE '0010',
c_col11 TYPE i VALUE '0011',
c_col12 TYPE i VALUE '0012',
c_col13 TYPE i VALUE '0013',
c_col14 TYPE i VALUE '0014',
c_col15 TYPE i VALUE '0015',
c_col16 TYPE i VALUE '0016'.
data : v_currentrow type i,
v_currentrow1 type i.
data : itab_head like ALSMEX_TABLINE occurs 0 with header line,
itab_det like ALSMEX_TABLINE occurs 0 with header line.
data : file_head type RLGRAP-FILENAME,
file_item type RLGRAP-FILENAME.
file_head = 'C:Documents and SettingsDesktophead.xls'.
file_item = 'C:Documents and SettingsDesktopitem.xls'.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = file_head
i_begin_col = 1
i_begin_row = 1
i_end_col = 12
i_end_row = 50
tables
intern = itab_head
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = file_item
i_begin_col = 1
i_begin_row = 1
i_end_col = 16
i_end_row = 50
tables
intern = itab_det
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF itab_head[] IS INITIAL.
WRITE:/ 'No Header Data Exists '.
STOP.
ELSE.
sort itab_head by row col.
read table itab_head index 1.
v_currentrow = itab_head-row.
loop at itab_head.
if itab_head-row ne v_currentrow.
APPEND it_head.
v_currentrow = itab_head-row.
ENDIF.
CASE itab_head-col.
WHEN c_col1.
it_head-ref = itab_head-value.
WHEN c_col2.
it_head-bsart = itab_head-value.
WHEN c_col3.
it_head-lifnr = itab_head-value.
WHEN c_col4.
it_head-ekorg = itab_head-value.
WHEN c_col5.
it_head-ekgrp = itab_head-value.
WHEN c_col6.
it_head-bukrs = itab_head-value.
WHEN c_col7.
it_head-verkf = itab_head-value.
WHEN c_col8.
it_head-telf1 = itab_head-value.
WHEN c_col9.
it_head-ihrez = itab_head-value.
WHEN c_col10.
it_head-unsez = itab_head-value.
WHEN c_col11.
it_head-kdatb = itab_head-value.
WHEN c_col12.
it_head-kdate = itab_head-value.
ENDCASE.
ENDLOOP.
APPEND it_head.
CLEAR it_head.
ENDIF.
IF itab_det[] IS INITIAL.
WRITE:/ 'No Item Data Exists '.
STOP.
ELSE.
sort itab_det by row col.
read table itab_det index 1.
v_currentrow1 = itab_det-row.
loop at itab_det.
if itab_det-row ne v_currentrow1.
APPEND it_det.
v_currentrow1 = itab_det-row.
ENDIF.
CASE itab_det-col.
WHEN c_col1.
it_det-ref = itab_det-value.
WHEN c_col2.
it_det-knttp = itab_det-value.
WHEN c_col3.
it_det-pstyp = itab_det-value.
WHEN c_col4.
it_det-txz01 = itab_det-value.
WHEN c_col5.
it_det-matkl = itab_det-value.
WHEN c_col6.
it_det-werks = itab_det-value.
WHEN c_col7.
it_det-afnam = itab_det-value.
WHEN c_col8.
it_det-srvpos = itab_det-value.
WHEN c_col9.
it_det-ktext1 = itab_det-value.
WHEN c_col10.
it_det-frmval1 = itab_det-value.
WHEN c_col11.
it_det-frmval2 = itab_det-value.
WHEN c_col12.
it_det-menge = itab_det-value.
WHEN c_col13.
it_det-kostl = itab_det-value.
WHEN c_col14.
it_det-sakto = itab_det-value.
WHEN c_col15.
it_det-zzcode = itab_det-value.
WHEN c_col16.
it_det-kbetr = itab_det-value.
ENDCASE.
ENDLOOP.
APPEND it_det.
CLEAR it_det.
ENDIF.
loop at it_head.
poheader-doc_type = it_head-bsart.
poheader-vendor = it_head-lifnr.
poheader-purch_org = it_head-ekorg.
poheader-pur_group = it_head-ekgrp.
poheader-comp_code = it_head-bukrs.
poheader-sales_pers = it_head-verkf.
poheader-telephone = it_head-telf1.
poheader-REF_1 = it_head-ihrez.
poheader-OUR_REF = it_head-unsez.
poheader-VPER_START = it_head-kdatb.
poheader-VPER_END = it_head-kdate.
loop at it_det where ref = it_head-ref.
poitem-acctasscat = it_det-knttp.
poitem-item_cat = it_det-pstyp.
poitem-short_text = it_det-txz01.
poitem-matl_group = it_det-matkl.
poitem-plant = it_det-werks.
poitem-PREQ_NAME = it_det-afnam.
POESLLC-SERVICE = it_det-srvpos.
POESLLC-SHORT_TEXT = it_det-ktext1.
POESLLC-FORM_VAL1 = it_det-frmval1.
POESLLC-FORM_VAL2 = it_det-frmval2.
POESLLC-QUANTITY = it_det-menge.
POACCOUNT-COSTCENTER = it_det-kostl.
POACCOUNT-GL_ACCOUNT = it_det-sakto.
POCONDHEADER-COND_TYPE = 'R000'.
POCONDHEADER-COND_VALUE = it_det-kbetr.
endloop.
endloop.
poheaderx-doc_type = 'X'.
poheaderx-vendor = 'X'.
poheaderx-purch_org = 'X'.
poheaderx-pur_group = 'X'.
poheaderx-comp_code = 'X'.
poheaderx-sales_pers = 'X'.
poheaderx-telephone = 'X'.
poheaderx-REF_1 = 'X'.
poheaderx-OUR_REF = 'X'.
poheaderx-VPER_START = 'X'.
poheaderx-VPER_END = 'X'.
poitemx-acctasscat = 'X'.
poitemx-item_cat = 'X'.
poitemx-short_text = 'X'.
poitemx-matl_group = 'X'.
poitemx-plant = 'X'.
poitemx-PREQ_NAME = 'X'.
*POESLLCx-SHORT_TEXT = 'X'.
POACCOUNTx-COSTCENTER = 'X'.
POACCOUNTx-GL_ACCOUNT = 'X'.
POCONDHEADER-cond_type = 'X'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = poheader
POHEADERX = poheaderx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
EXPPURCHASEORDER = po_no
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
RETURN = return
POITEM = poitem
POITEMX = poitemx
POADDRDELIVERY =
POSCHEDULE =
POSCHEDULEX =
POACCOUNT = poaccount
POACCOUNTPROFITSEGMENT =
POACCOUNTX = poaccountx
POCONDHEADER = pocondheader
POCONDHEADERX = pocondheaderx
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES = poesllc
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
if sy-subrc = 0.
loop at return.
write return-MESSAGE_V1.
write po_no.
endloop.
endif.
Also check this link
[Service Order through BAPI|Service PO creation with BAPI; -
How to create SynBO with BAPIs from R/3 server?
Hi,
Can I get any documents or links regarding Syncbo creation with BAPIs from another R/3 server. I think I have to create RFC destination for this. The steps for creating RFC destination in Netweaver 2004s is also helpful for me.
Also I need the required configurations also.
Regards
ShemimHi Shemin,
Refer the following link for Mobile Development Kit
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/21eba3a7-0601-0010-b982-92f1fca3258a
This will provide you with rules of creating BAPI wrappers and sample BAPI wrappers.
For creating RFC destination, contact your BASIS team member. You may not rights to do it by yourself. They will also tell the exact prodecure. It start with transaction SM59.
Regards,
Rahul -
Problem with bapi to create purchase requisition
I got a requirement that to upload details of procurement into Z table with a temporary PR. Could u please suggest the procedure or bapi to upload datainto Z table.
RegardsHi all
For above requirement i am suppose to develop a FM which upload the data from front end to DB. Forthat I am taking following steps is it ok or not suggest me.
1.call function module bapi_pr_create
2.fill local structure with bapi structure if PR number is created.
3.update data into Z table
Regards -
Hi experts,
as we will try to built the Travel management in SAP CE, we want to trigger the whole travel management flow with BAPIs.
The following already works:
- Creation of trip BAPI_TRIP_CREATE_FROM_DATA
- Approval of trip via BAPI_TRIP_APPROVE
But now I don't know how to proceed.
As I've seen in PR05, the status has then be changed to settled.
Afterwards it can be sent to FI via transaction PRFI.
And then the posting in FI can be done in PRRW.
Is that flow correct?
What are the BAPIs to use for that?
Is it BAPI_ACC_TRAVEL_POST?
DoI also need BAPI_PAYROLLTRAVELEXPNSESPOST?
Could please somebody of you give me an example for calling those functions?
Unfortunately you have to specify a lot of parameters and I don't find much about it on SDN.
Is there a way to retrieve this data first using only personnel number and trip number?
Thanks in advance!Hi Eddie,
For settling and posting the travel cost into the system, you can use t-code - PREC, PRFI and PRRW.
Best Regards,
Raj -
Problem with BAPI BAPI_REQUISITION_CREATE
Hello,
I have problems with BAPI BAPI_REQUISITION_CREATE. I need to create Purchase requisition for services. If I use BAPI BAPI_REQUISITION_CREATE, Purchasing requisition is created, but field NETWR in table EBNK is 0. If I create purchasing requisition manualy using transaction ME51N, field NETWR in table EBNK is filled with correct price.
Can you pls. help me, what do I wrong in calling BAPI_REQUISITION_CREATE?
Thanks®ards,
JirkaNot sure if you got your answer or went to OSS for a resolution. But, as I was searching OSS for my issue, I came across the following note:
Note 1498435 - BAPI_REQUISITION_CREATE: EBKN-NETWR is not updated -
Hi Everyone,
I need some information about posting an application using inbound IDOC with BAPI. I need to write a FM for
Inbound IDOC with BAPI to post it. Can some one give me direction as where to start as I am new to BAPI.
Thanks in advance.
Regards,
vickyHi Vicky,
Please take a look at this link which will show step by step on how to setup inbound proscessing.
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
Also check this links for sample codes.
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
Hope this will help.
Regards,
Ferry Lianto
Message was edited by: Ferry Lianto -
Doubt with a Insert query!
hi friends i have a doubt with a query in sql here is the following code.
INSERT INTO
(SELECT employee_id, last_name,
email, hire_date, job_id, salary,
department_id
FROM employees
WHERE department_id = 50)
VALUES (99999, 'Taylor', 'DTAYLOR',
TO_DATE('07-JUN-99', 'DD-MON-RR'),
'ST_CLERK', 5000, 50);The same insert statement can be achieved with
INSERT INTO EMPLOYEES (employee_id, last_name,
email, hire_date, job_id, salary,
department_id)
VALUES (99999, 'Taylor', 'DTAYLOR',
TO_DATE('07-JUN-99', 'DD-MON-RR'),
'ST_CLERK', 5000, 50);What advantage does the first query have over the second one.
Thanks in advance to everyone.
Regards,
ManojThose two statements are identical.
However this one would be different:
INSERT INTO
(SELECT employee_id, last_name,
email, hire_date, job_id, salary,
department_id
FROM employees
WHERE department_id = 50
with check option )
VALUES (99999, 'Taylor', 'DTAYLOR', TO_DATE('07-JUN-99', 'DD-MON-RR'), 'ST_CLERK', 5000, 50);The "WITH CHECK OPTION" would guarantee that only employees for department 50 are inserted.
see also:
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_10002.htm#i2066598
Edited by: Sven W. on Mar 17, 2011 7:22 PM - typo correction -
Rewrite process and remove the call to f-54 and replace with bapi proces
Hi Gurus,
Please help me to find the soultion.
The root cause of this continual problem is the design and use of BDC session for F-54. Is there a redesign possible with ECC6.0?
I wanted to rewrite the process and remove the call to f-54 and replace with bapi process.
if this is now possible in ECC 6.0
The benefit would be to better control what PO was used in the DP recoupment.
Thanking you,
Raju Singhireddy.Hi Balaji,
Check this BAPI
BAPI_QUOTATION_CREATEFROMDATA
BAPI_QUOTATION_CREATEFROMDATA2
BAPI_CUSTOMERQUOTATION_CHANGE
Regards
Arun -
LSMW with bapi BAPI_REQUISITION_CREATE
Hi
I'm creating an LSMW for create purchase requisition with Bapi (BAPI_REQUISITION_CREATE)
I'm trying to upload 2 items for a PR but the LSMW is creating 2 PR with each item.
How can I tell to the LSMW that I have to item for the same PR?
Remember this bapi doesn't has header.Hi,
you need to define hierarchy in your in put file to merge required lines into one BAPI call. You can find some examples how to create order with multiple items (for example [this one|http://www.scribd.com/doc/6646673/Lsmw-With-Bapi]). So you can easily adapt it to your BAPI.
Cheers
Maybe you are looking for
-
Problems downloading Iphone software 2.0.2
I have tried 8 time to download the Iphone software upgrade 2.0.2 and after waiting for 2 hours that is when it does not get a computer crush, I get a stop err=-3259 There has been a problem with the down load. Some type of out of time waiting for th
-
PC to Mac convert: help with Pages
I recently moved my father from a PC to a Mac. He's liking it so far but stumped by one problem. He was very fond of using Outlook and Word as his email editor. This alowed him to format to a much higher degree since Word essential writes the email
-
Disable Close Tab Button on all Tabs Broken in v5 (31.0)
Firefox 5 (v31.0) has broken browser.tabs.closebuttons = 2 That setting is 2 in my about:config, also I have Tab Control 5.5 with Close Buttons = None. Either way the latest Firefox is ignoring both settings and now displaying an X on my active tab.
-
Issue with testing web service via SICF
Hi, I am trying to test service via SICF. This service is for a FM based Web Service. When I test the service from SICF it passes the authorization checks but then error page, "Page not Found" is shown with error "HTTP 500 - Internal server error Int
-
Cannot update table data based on values of numeric fields
I have a button on a form with two numeric fields: P11_numeric1 and P11_numeric2. I want to be able to either run a stored procedure or execute the update logic. We're on apex 4.0. I tried the follow syntax in a process run by a button: begin schema.