BAPI to create PO and GR
Hi,
Can anybody send me some sample code to handle multiple files in application server. My requirement is to create an interface to create PO and GR from the file residing in Application server. Multiple files will be in application server. No selection screens are there. BAPI used are BAPI_PO_CREATE1 and BAPI_GOODSMVT_CREATE. And If anyone has already created this interface, please give me some idea of how to read multiple files and if possible send some sample code.
Any help will be greatly appreciated.
Regards,
Naveen
Hi Naveen,
Go through this link.
BAPI_PO_CREATE1
Re: Proble in Creating Multiple Item PO using BAPI_PO_CREATE1
BAPI_GOODSMVT_CREATE
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
http://www.4ap.de/abap/bapi_goodsmvt_create.php
Reward Points For the Helpful.
Regards,
Harini.S
Similar Messages
-
Hi All,
I would like to use the BAPI to create the IR and GR.
But i don't know which BAPI is use for create the IR and GR . Could you mind give any information about this?
Regards,
LukeHi Luke,
The function module "BAPI_GOODSMVT_CREATE " would perform the task. Please refer to the following link.
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
Regards. -
BAPI to create Delivery and GI
Hello Expert,
I need to create the Delivery and Good Issue ata the same time with the information imported from another system. Do you know if there is a BAPI or RFC to create both documents (Material document and Accounting Document for Delivery) in only one step?
Thanks and Regards,
PabloHi,
Have you tried "BAPI_GOODSMVT_CREATE" (Post goods movements).
If doesn't solve your problem you can create a wrapper BAPI using "BAPI_GOODSMVT_CREATE" and "BAPI_ACC_GOODS_MOVEMENT_POST" (Accounting: Post Goods Movement). Call one after the other.
Regards,
Srilatha. -
Hi all,
I can found a function called in one of my reference program, it's purpose is for creating billing. However, I cannot find any any BAPI/FM which is used for creating the billing document, but here is a function named: "pos_sa_get_document_status".
What's the use of this function?
and also what function/bapi should I use when I creating the billing record?
Please Note there will be no Sales Order.
Regards,
MandyHave you looked at BAPIACCBILLINGPOST (Please search with this string).
Thanks,
Srihari -
BAPI for create VIP and Group_d for BP
Hey
Do you know BAPI for filling fields VIP and Group_d from table BP001 for BP?
Regards
RadekHey, thank you, with this BAPI I found bapi BAPI_BUPA_FS_TREASURY_ADD that suit my needs.
BAPI FS_API_BP001_change is only for changing records, BAPI FS_API_BP001_ADD has some problems (short dump).
Regards
Radek -
BAPI to create Excise Invoice and Commercial Invoice
Hi All,
Can u tell me the BAPI for creating Excise and Commercial Invoice.
Moderator message: please do some research before asking.
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
Edited by: Thomas Zloch on Mar 2, 2011 5:56 PMHi,
You can make the appropriate setting in Customizing for Excise Duty, by choosing Basic Settings -> Maintain Excise Groups, and selecting Create EI (Create Excise Invoice Automatically)
Also maintain the default excise and series group in the configuration.
Logistics general>Tax on Goods Movement>India>Basic Settings>Maintain Excise groups. For your Excise group maintain the check Excise invoice during Billing.
After maintaining the same also maintain the default values in Logistics general>Tax on Goods Movement>India>Business transactions>Outgoing Excise invoices-->Maintain Default Excise groups and Series groups.
Regards, -
Bapi to create a condition record
hi,
is there any standard bapi for creating ,changing and deleting a pricing record using VK11,VK12.
any other function module will solve the problem.Hi Ajith,
You can use <b>IDOC approach</b> also for doing teh same solution. Yo get Create/Change/ Delete Option as per indicator passed:
Refer Code below.
*& Form map_idoc_structure
Map E1KOMG, E1KONH, E1KONP segment fields
FORM map_idoc_structure
USING fp_condition_table TYPE kotabnr
fp_rate TYPE z_cs_cpp_rate
fp_condition_type TYPE kschl
fp_rate_type TYPE z_cs_file_type.
*-- Local Data Declaration
DATA: lw_e1komg TYPE e1komg, "Filter seg. with separated condition key
lw_e1konh TYPE e1konh, "Data from condition header
lw_e1konp TYPE e1konp, "Conditions Items
lv_delete TYPE konp-loevm_ko. " Delete Indicator
*-- IDoc data internal table
DATA: i_idoc_data TYPE TABLE OF edidd
INITIAL SIZE 0
WITH HEADER LINE.
CLEAR: lw_e1komg,
lw_e1konh,
lw_e1konp,
lv_delete,
v_segnum,
w_e1komg,
v_rate_type.
REFRESH i_idoc_data.
v_rate_type = fp_rate_type.
PERFORM conversion_alpha_input
USING w_crp_data-kunnr CHANGING w_crp_data-kunnr.
PERFORM conversion_matn1_input
USING w_crp_data-matnr CHANGING w_crp_data-matnr.
E1KOMG: Filter segment with separated condition key
i_idoc_data-segnam = 'E1KOMG'.
lw_e1komg-kvewe = c_usage_cond_tab.
lw_e1komg-kotabnr = fp_condition_table.
lw_e1komg-kappl = c_cond_type.
lw_e1komg-kschl = fp_condition_type.
CONCATENATE p_vkorg p_vtweg p_spart p_hienr p_matnr
CONCATENATE w_crp_data-vkorg w_crp_data-vtweg
w_crp_data-kunnr w_crp_data-matnr
INTO lw_e1komg-vakey.
lw_e1komg-vakey_long = lw_e1komg-vakey.
lw_e1komg-vkorg = w_crp_data-vkorg.
lw_e1komg-vtweg = w_crp_data-vtweg.
lw_e1komg-spart = w_crp_data-spart.
lw_e1komg-kunnr = w_crp_data-kunnr.
lw_e1komg-matnr = w_crp_data-matnr.
i_idoc_data-sdata = lw_e1komg.
APPEND i_idoc_data TO i_idoc_data.
Segment E1KONH - condition header
i_idoc_data-segnam = 'E1KONH'.
lw_e1konh-datab = w_crp_data-datab.
lw_e1konh-datbi = w_crp_data-datbi.
lw_e1konh-knuma_pi = v_promotion.
lw_e1konh-knuma_ag = v_sales_deal.
i_idoc_data-sdata = lw_e1konh.
APPEND i_idoc_data TO i_idoc_data.
IF fm_process_type EQ c_pt_dep.
lv_delete = c_x. " Deletion Indicator
ENDIF.
Segment E1KONP - condition items
i_idoc_data-segnam = 'E1KONP'.
lw_e1konp-kschl = fp_condition_type.
lw_e1konp-kbetr = fp_rate.
lw_e1konp-konwa = w_crp_data-waers.
lw_e1konp-kpein = v_cond_pric.
lw_e1konp-kmein = v_cond_unit.
lw_e1konp-knuma_pi = v_promotion.
lw_e1konp-knuma_ag = v_sales_deal.
lw_e1konp-loevm_ko = lv_delete.
i_idoc_data-sdata = lw_e1konp.
APPEND i_idoc_data TO i_idoc_data.
*-- Post Idoc for Creating Pricing Condition
PERFORM post_idoc
TABLES i_idoc_data.
ENDFORM. " map_idoc_structure
*& Form post_idoc TABLES i_idoc_data.
Post Idoc for Creating Pricing Condition
FORM post_idoc
TABLES i_idoc_data STRUCTURE edidd.
*-- Local data declaration
DATA: lv_komg LIKE komg, " Condition Structures
lv_subrc LIKE sy-subrc, " Sy-subrc
lw_messages TYPE rsuvm_msg, " Message Description
lw_idoc_status TYPE bdidocstat. " ALE IDoc status
DATA: idoc_contrl " IDoc Control data
LIKE edidc OCCURS 1 WITH HEADER LINE.
*-- Initialize Internal Tables
CLEAR: t_konh,
t_konp,
t_konm,
t_konw,
i_idoc_status,
t_kona.
REFRESH: t_konh,
t_konp,
t_konm,
t_konw,
i_idoc_status,
t_kona,
i_messages.
This code is taken from IDOC_INPUT_COND_A
PERFORM fill_appl_structures(saplvkoi)
TABLES i_idoc_data
t_konh
t_konp
t_konm
t_konw
i_idoc_status
t_kona
USING lv_komg
lv_subrc
idoc_contrl-docnum
idoc_contrl-mestyp.
IF lv_subrc = 0.
This code is taken from IDOC_INPUT_COND_A
PERFORM idoc_in_datenbank(saplvkoi)
TABLES idoc_contrl
t_konh
t_konp
t_konm
t_konw
i_idoc_status
t_kona
USING lv_komg
lv_subrc
idoc_contrl-docnum.
IF lv_subrc = 0.
COMMIT WORK AND WAIT.
Endif.
Reward points if this Helps.
Manish
Message was edited by: Manish Kumar -
We are trying to develop an interface with a third party software and we need to upload recipe from there.
So i am need a BAPI to create recipe and maintain aswell.
also I am trying to use BAPI BAPI_MATERIAL_SAVEDATA to create material and BAPI
BAPI_BOM_UPLOAD_SAVE to create BOM .
I manually entered data into fields but not able to create material and BOm.
Please give me the procedure on how to use them and BAPI for creating Recipe.
Help is appriciated.Hi Mirza
You can use BAPI_MATERIAL_BOM_GROUP_CREATE to create a BOM,
Regards
UK -
A proxy and in that proxy we will call the BAPI for creating Purchase Requi
HI all,
I am explaining a situation please resolve if possible.
I got source data to create purchase requisition . the source data was not cleaned and requires lot of validations and crossmapping with actual sap tables . I did it for testing and used bapi ( bapi_requsition_create) and was able to test the data to create a pr in sap. but now as per the instructions from my onsite co-ordinator , they told thy will use a proxy( in place of idoc) and in that we will call bapi to create purchase requisition in sap. please explain about what kind of proxy it may be and how we call bapi in it . thanx in adv..HI all,
I am explaining a situation please resolve if possible.
I got source data to create purchase requisition . the source data was not cleaned and requires lot of validations and crossmapping with actual sap tables . I did it for testing and used bapi ( bapi_requsition_create) and was able to test the data to create a pr in sap. but now as per the instructions from my onsite co-ordinator , they told thy will use a proxy( in place of idoc) and in that we will call bapi to create purchase requisition in sap. please explain about what kind of proxy it may be and how we call bapi in it . thanx in adv.. -
Using BAPI to create users across all Clients and R/3 Systems
Hi everyone,
I'm currently writing a program where I'm using a BAPI to create multiple new users via central user admin (SU01) and assigning Roles to these users.
My objective is to create these new users in all clients of all R/3 systems using RFC. At the moment, in SM59, our DEV environment is set up as "DEV", QA as "TST" and PRD as "PRD". When I use syntax:
CALL FUNCTION 'BAPI_USER_CREATE1' DESTINATION 'TST' the system presents a logon screen to login to TST system. Can this logon be made automatic i.e. without this screen prompt?
Also, I can't create the users in all clients of 'TST'. Our test system has 5 clients...how do I create the users in all clients of TST automatically?
Your help will be greatly appreciated.
Thanks.
Sougata.Try to see the SAP HELP:
RFC logon to target system (remote logon)
RFC logon within an R/3 system can be successfully undertaken using the same user ID even if the logon is to take place in a different client.
In principle, all necessary logon data for a particular RFC destination (language, user, client, and password) are used when an RFC logs on to the target system.
Typically the password field (for a particular user) must be maintained when an RFC communicates with other clients or user IDs.
If one of the fields language, client or user is not maintained for the designated RFC destination, default values are taken from the system environment (system table).
Tips:
With RFC communication within a single R/3 system with the same client and user the logon fields do not have to be maintained. Password entry is also unnecessary in this special case.
If an RFC logon in online mode is unsuccessful, an RFC logon window is displayed (not during background processing) where you can logon to the target system online at runtime.
The default values for the RFC logon screen fields are as follows:
Client
The standard value of the target system application server is used. This value is read from the target server's "login/system_client" profile parameter.
User
The system inserts the user ID of the current user in this field.
Language
Information from the RFC destination is used to fill the language field. If the language field has not been maintained in the destination, the current language of the calling system is inserted.
The RFC logon window does not appear if the initial function module call of the RFC destination originates from the system-specific function group 'SRFC'. The function modules RFC_PING and RFC_SYSTEM_INFO belong to this group among others.
If you would like to have an RFC logon window displayed regardless, you must end RFC communication to that particular RFC destination after the call using the function module 'RFC_CONNECTION_CLOSE'.
Be aware that no logon screen is usually offered when using trusted/trusting systems.
Documentation to authorization checks in the RFC environment can be found in RFC authorization concept.
Max -
BAPI needed to create invoice and creditmemo
Hi all,
Is there any BAPI available to create invoice and creditmemo when material no is not given.
My requirement is to create credit memo and invoice through FB75 or FB70 transaction. I am able to achieve the same through BDC. Is there any BAPI availabe for the same to create credit memo or invoice to avoid BDC.
Input given to the program is a excel file in which i have the following fields
Transaction -- which separates credit memo or
invoice
Company code, purchase order number, GL account
number, cost center, profit center, amount etc...
Please let me know some pointers.
Regards,
Karthik.GN_INVOICE_CREATE or BAPI_BILLINGDOC_CREATEMULTIPLE
Please find the sample code for Billing document BAPI.
t_billing-salesorg = vbak-vkorg.
t_billing-DISTR_CHAN = vbak-vtweg.
t_billing-DIVISION = vbak-spart.
t_billing-DOC_TYPE = vbak-auart.
t_billing-ref_doc = vbak-vbeln.
t_billing-ref_item = vbap-posnr.
t_billing-doc_number = vbak-vbeln.
t_billing-ITM_NUMBER = vbap-posnr.
t_billing-ordbilltyp = 'BILLING TYPE'.
t_billing-price_date = sy-datum.
t_billing-ref_doc_ca = vbak-vbtyp.
t_billing-sold_to = vbak-kunnr.
t_billing-material = vbap-matnr.
t_billing-plant = vbap-werks.
APPEND t_billing.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
billingdatain = t_billing
return = t_return
success = t_success.
commit work.
Regards -
Performance of BAPI's to create Leads and Activities
Hi,
I'm using the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI to create Leads and Activities.
The scenario is:
1) The input file has 3 types of records coming in
(a) Leads only
(b) Activities only (Prospect Lead activities)
(c) LEad + Activity (rescheduled activities)
2) Depending on the type of record, I'm required to create the relevant order and if required link the lead and activity (scenario - C)(using the FM CRM_DOC_FLOW_MAINTAIN_OW).
3) In addition to this, I'm also required to link campaign elements to both Leads and Activities (done within the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI in the doc_flow structure).
ISSUE:
The issue that I am facing is that it is taking a lot of time to create these. I'm basically running a custom conversion program for LEads and Activities. The rate is almost 6-8 secs for each record, and we have about 500,000 records to be converted.
Also, I'm having to use the following function modules after the creation of Leads and Activities:
1) CRM_MA_ACT_SAVE - to set the status of the activity to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_ACTIVITYCRM_CREATEMULTI seems to always default the status to OPEN.
2) CRM_ORDER_CHANGE_STATUS - to set the status of the LEad to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_LEAD_CREATEMULTI seems to always default the status to OPEN.
3) BAPI_LEAD_ATT_CHANGE - to set the STATUS SINCE field for a Lead. This is being done because I'm unable to set the STATUS_SINCE field using the BAPI BAPI_LEAD_CREATEMULTI.
The logic being used within the code is to process a batch of records (500/1000 records - value is an input selection parameter) from the input file in one go, and then commit all of them after their creation. After this, the next batch of records is again processed and committed.
We've also tried to create LEads and Activities record by record and not in batches... but the performance still remains the same.
I'm not sure what is slowing down the process. If whether it is all the commits, or if it is the additional use of the FM's to change the 'status' and 'Stauts-since' values after having committed the leads and activities.
When we look at the LEads and Activities that are created, everything looks fine. It is only that the performance is really slow.
Thanks for all your patience and suggestions,
- AkarshIn order to improve the performance you could use several processes. Just start you conversion-program with several variants at the same time.
Last time I converted 80.000 contracts it took me 6 hours with 5 processes.
Hopes this helps. -
Performance of BAPI's to create Leads and Activities in CRM
Hi,
I'm using the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI to create Leads and Activities.
The scenario is:
1) The input file has 3 types of records coming in
(a) Leads only
(b) Activities only (Prospect Lead activities)
(c) LEad + Activity (rescheduled activities)
2) Depending on the type of record, I'm required to create the relevant order and if required link the lead and activity (scenario - C)(using the FM CRM_DOC_FLOW_MAINTAIN_OW).
3) In addition to this, I'm also required to link campaign elements to both Leads and Activities (done within the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI in the doc_flow structure).
ISSUE:
The issue that I am facing is that it is taking a lot of time to create these. I'm basically running a custom conversion program for LEads and Activities. The rate is almost 6-8 secs for each record, and we have about 500,000 records to be converted.
Also, I'm having to use the following function modules after the creation of Leads and Activities:
1) CRM_MA_ACT_SAVE - to set the status of the activity to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_ACTIVITYCRM_CREATEMULTI seems to always default the status to OPEN.
2) CRM_ORDER_CHANGE_STATUS - to set the status of the LEad to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_LEAD_CREATEMULTI seems to always default the status to OPEN.
3) BAPI_LEAD_ATT_CHANGE - to set the STATUS SINCE field for a Lead. This is being done because I'm unable to set the STATUS_SINCE field using the BAPI BAPI_LEAD_CREATEMULTI.
The logic being used within the code is to process a batch of records (500/1000 records - value is an input selection parameter) from the input file in one go, and then commit all of them after their creation. After this, the next batch of records is again processed and committed.
We've also tried to create LEads and Activities record by record and not in batches... but the performance still remains the same.
I'm not sure what is slowing down the process. If whether it is all the commits, or if it is the additional use of the FM's to change the 'status' and 'Stauts-since' values after having committed the leads and activities.
When we look at the LEads and Activities that are created, everything looks fine. It is only that the performance is really slow.
Thanks for all your patience and suggestions,
- AkarshIn order to improve the performance you could use several processes. Just start you conversion-program with several variants at the same time.
Last time I converted 80.000 contracts it took me 6 hours with 5 processes.
Hopes this helps. -
BAPIs for Create and Change Classes
Hi experts,
Is there any BAPI to Create or to Change the classes.
Thanks,
kruthik.Hi
Class Creation first u need to check whether the class is alreay created or nor for that use the below BAPI
CALL FUNCTION 'BAPI_CLASS_EXISTENCECHECK'
EXPORTING
CLASSTYPE = CLASSTYPENEW
CLASSNUM = CLASSNUMNEW
TABLES
RETURN = RETURN.
CLEAR RETURN.
READ TABLE RETURN WITH KEY TYPE = 'S'.
IF SY-SUBRC = 0.
MESSAGE RETURN-MESSAGE TYPE 'I'.
ELSE.
CALL FUNCTION 'BAPI_CLASS_CREATE'
EXPORTING
CLASSNUMNEW = CLASSNUMNEW
CLASSTYPENEW = CLASSTYPENEW
CLASSBASICDATA = CLASSBASICDATA
TABLES
RETURN = RETURN
CLASSDESCRIPTIONS = CLASSDESCRIPTIONS1
CLASSCHARACTERISTICS = CLASSCHARACTERISTICS.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
for Changing the class
CALL FUNCTION 'BAPI_CLASS_CHANGE'
EXPORTING
CLASSNUM = CLASSNUM
CLASSTYPE = CLASSTYPE
KEYDATE = SY-DATUM
CLASSBASICDATA = CLASSBASICDATA
CLASSBASICDATANEW = CLASSBASICDATANEW
TABLES
RETURN = RETURN
CLASSDESCRIPTIONS = CLASSDESCRIPTIONS1
CLASSDESCRIPTIONSNEW = CLASSDESCRIPTIONSNEW
CLASSCHARACTERISTICSNEW = CLASSCHARACTERISTICSNEW.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' . -
BAPIs to create and change the BOM
Hi experts,
Is there any BAPI to Create or to Change the BOM
Thanks,
kruthik.Hi ,
For Routing Create 'BAPI_ROUTING_CREATE'.
For char change BAPI_CHARACT_CHANGE.
Edited by: Selva M on Feb 24, 2010 11:38 AM
Maybe you are looking for
-
Can I have multiple/separated secure sites/wikis on one server?
I would like to host several secure wikis on my one iMac running OS X Server (10.8). I've got the hostname for the primary domain and all of the virtual, primary domains good to go. It's serving out a secure wiki on servername.domainname.com, which
-
Officejet pro 8610 connection to Mac Air
I cannot seem to wireless print w/ macair
-
IAS console doesn't work due DCM daemon failure
Hi, I've got a problem with IAS console recently. When I try to open Application or Administration tabs for my OC4J Instance I get an error message: <ias-component id="dcm-daemon"> <process-type id="dcm-daemon"> <process-set id="dcm"> <process id="65
-
SHOW ALL / HIDE ALL BUTTONS produce error in chm but not in "View Selected Item"
My SHOW ALL and HIDE ALL buttons work in the View Selected Item mode. However, the compiled version generates an error tag: Line: 72 Char: 1 Error: Object expected Code: 0 URL: mk:@MSITSTORE:C\Documents%20and%20Settings\glenn_michaels\RoboHelp%206.0\
-
Windows Crashes with JRE 1.4.2 When Moving around JDialog
Hi! I work on a Java Applet/application that was originally written to run on java 1.1 -- only AWT that too. Recently I managed to convince my manager (and his manager and his manager) to migrate from the AWT framework on java 1.1 (Microsoft JVM that