TCode to fill BAPI
Hi all!
I need to fill tree BAPI's using SE37 Tcode, for a test to PI scenario integration.
BAPI_SALESORDER_CREATEFROMDAT2
BAPI_CUSTOMERCONTRACT_CHANGE
BAPI_SALESORDER_CREATEFROMDAT1.
I have heard once about the way to fill BAPI using a Tcode that fills automaticaly all fields in BAPI. For example: I go to VA01 and fill all fields, than this fields are transported to BAPI_SALESORDER_CREATEFROMDAT2.
Is it true? How i can to do this?
Is there other way to do this? more easy?
Thanks
Fábio Ferri
Sap Consultant PI/ABAP/MDM Netweaver
a
Similar Messages
-
Can you help with Tcode to fill this SETUP table? not working for me.
Hi,
For the datasource 2LIS_11_VASCL (SD Sales: Schedule Line Item), I need to fill the Setup Tables via OLI*BW
I understand the * to be the application number, which in this case it is 11 but I get a message that OLI11BW does not exist.
1. Can you help me with the tcode to fill the setup table for 2LIS_11_VASCL?
2. Since there are several datasources with the same application number 11, how do I fill only 2LIS_11_VASCL without filling the others:
2LIS_11_VAHDR Sales Document Header Data
2LIS_11_VAITM Sales Document Item Data
2LIS_11_VAKON Sales Document Condition
2LIS_11_VASCL Sales Document Schedule Line
2LIS_11_VASTH Sales Document Header Status
2LIS_11_VASTI Sales Document Item Status
2LIS_11_V_ITM Sales-Shipping Allocation Item Data
2LIS_11_V_SCL Sales-Shipping Allocation Schedule Line
2LIS_11_V_SSL Sales Document Order Delivery
ThanksOk,
I tried that and it basically bring you to OLI7BW as suggested above.
1. At this point, how do you know which of these it is actually filling:
2LIS_11_VAHDR Sales Document Header Data
2LIS_11_VAITM Sales Document Item Data
2LIS_11_VAKON Sales Document Condition
2LIS_11_VASCL Sales Document Schedule Line
2LIS_11_VASTH Sales Document Header Status
2LIS_11_VASTI Sales Document Item Status
2LIS_11_V_ITM Sales-Shipping Allocation Item Data
2LIS_11_V_SCL Sales-Shipping Allocation Schedule Line
2LIS_11_V_SSL Sales Document Order Delivery
2. Also, what does it mean when after running OLI7BW wide, with no restriction on my system, still rsa3 shows no records for 2LIS_11_V_SCL?
Any other way to confirm that there may not be any data in 2LIS_11_V_SCL?
Or any way, to make an entry which reflect in 2LIS_11_V_SCL so that I can verify if OLI7BW actually fills the setup table?
Thanks -
Tcode for filling setup tables
Hi experts,
What is the tcode for filling setup tables of 2lis_06_inv ?
Full points will be assigned.
Regards,
Bhadri M.Hi,
Filling up the set up tables depends on the datasource.
there are different T-codes for the respective extract structures
OLIIBW transaction PM data
OLI1BW INVCO Stat. Setup: Material Movemts
OLI2BW INVCO Stat. Setup: Stor. Loc. Stocks
OLI3BW Reorg.PURCHIS BW Extract Structures
OLI4BW Reorg. PPIS Extract Structures
OLI7BW Reorg. of VIS Extr. Struct.: Order
OLI8BW Reorg. VIS Extr. Str.: Delivery
OLI9BW Reorg. VIS Extr. Str.: Invoices
OLIABW Setup: BW agency business
OLIFBW Reorg. Rep. Manuf. Extr. Structs
OLIIBW Reorg. of PM Info System for BW
OLIQBW QM Infosystem Reorganization for BW
OLISBW Reorg. of CS Info System for BW
OLIZBW INVCO Setup: Invoice Verification
OLI7BW is the tcode for Sales Order.
Have a look at these discussions:
set up tables
Set up tables
Set up tables
view of set up tables data in se11??????????
Set Up tables..
lo: delete set up tables: DOUBT
Blogs of Roberto will be useful as well:
/people/sap.user72/blog/2004/12/16/logistic-cockpit-delta-mechanism--episode-one-v3-update-the-145serializer146
LOGISTIC COCKPIT DELTA MECHANISM - Episode two: V3 Update, when some problems can occur...
LOGISTIC COCKPIT DELTA MECHANISM - Episode three: the new update methods
LOGISTIC COCKPIT - WHEN YOU NEED MORE - First option: enhance it !
LOGISTIC COCKPIT: a new deal overshadowed by the old-fashioned LIS ?
Display Setup Table Data:-
Goto SE11 or SE16 -> MC*SETUP -> F4 you will get all the setup tables choose and display the data
To check completion of dta loading
NPRT t-code... Where u can see the entry with ur user and the Run of ur setup..
Regards
Tg -
Hello experts,
I'm ABAPer,
I need to know what are the TCode(s) to fill Table MKPF.
So far i have found:
- MIGO
- MB1A = GI
- MB1B = TP
- MB1C = GR others
- MB01 = GR PO
- VL02N Posting GI
is there any other TCode?
Thanks & rgds,
JackHi,
Apart from wht u have written, u can add MB04,this u can find in the migo transaction fiels too.
i think this is sufficient.
Reward if useful
Aasif -
Tcode to fill setup tables for application 0CS( Customer Service)
Dear Experts,
i have to fill the setup tables for the datasource 2LIS_18_I0TASK.
the datasource comes under the appilcation 0CS( Customer Service).
when i am trying to fill the setup tables through the tcode SBIW i am not able to find the respective appilcation.
Could you please let me know the transaction to fulfill the same.
Regards,
Sunil...Hi SunilKumar Bolle,
For filling setup tables for 0CS Data Sources Use the T-Code- OLISBW, or use the path SBIW->Settings for Application-Specific DataSources (PI)->Logistics->Managing Extract Structures->Initialization->Filling in the Setup Table->Application-Specific Setup of Statistical Data->Service Management - Perform Setup
The only way to say thanks in SDN is to assign Points. -
New Z tcode which calls BAPI - add this to GRC RuleSet
Hi,
There is a development currently underway in house where a z transaction has been created which calls the BAPI:
BAPI_ACC_GL_POSTING_POST
I have been asked to add this transaction to the GRC RuleSet but i don't think there's any point in doing this yet as i don't feel the z transaction is calling an authority check in the right way.
When i trace the test user, or check the transaction in RSABAPSC, i cannot see any posting activity taking place i.e. i cannot see ACTIVITY 01 being called anywhere.
The developer added the FM Z_AUTH_BUKRS_FROM_BUKRS at my request but i think he should go further and add a check with an ACTIVITY 01. Only then will GRC be able to properly analyse this tcode for SOD violations because as-is, it's not calling enough.
I hope i have explained this in enough detail.
Has anyone come across an issue like this in the past? Any advice greatly appreciated.
Regards,
ColinHi Colin
You can still define your function but you do need to clarify what the checks should be. At the moment, your function defintion would be the S_TCODE for the Z transaction.
However, if you just define it like that and there are additional checks then you increase the level of false positives. If there isn't then you are right that the code still needs to be hardened
As you have mentioned a Z authority check none of us can comment on the security. Did you run a security trace on the Z transaction with the BAPI to see what is checked? How has the developer coded the authority check.
I would push back if there is insufficient checks from a security point of view. But if the Z transaction activity forms part of a risk and is available to end users you should capture it and then start the remeidation/mitigation processes.
Regards
Colleen -
Which field denotes result column of Qe01 tcode in below bapi
Bapi Name: BAPI_INSPOPER_RECORDRESULTS
Hi can anyone help me finding out the field which actually denotes the result column (Summarized Results or Single Results )
from QE01 TCODE in BAPI: BAPI_INSPOPER_RECORDRESULTS .Use SINGLE_RESULTS to write the result value
Refer
http://wiki.sdn.sap.com/wiki/display/Snippets/Sample%20Code%20BAPI_INSPOPER_RECORDRESULTS?bc=true
Also
Example in ; BAPI_INSPOPER_RECORDRESULTS, Record Insp Lot Results -
Is there any bapi for LECI tcode
i would like to make data transformation to LECI tcode by usign bapi . i need the bapi name for this work
hii venkat,
you can search on sdn.
BADI_CHECK_IN_01
to put custom fields in LECI transaction
regards,
shweta -
Please find herewith my below code. This program i have created for transferring goods with mvt type '657' to '555' using BAPI 'BAPI_GOODSMVT_CREATE' for TCODE MB1A.
*& Report Z_BAPI_FOR_MB1A
REPORT Z_BAPI_FOR_MB1A.
Tables : mkpf, mseg, WB2_V_MKPF_MSEG2.
DATA:
it_mb1a LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER LINE,
it_return LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
it_ex_headret LIKE BAPI2017_GM_HEAD_RET OCCURS 0 WITH HEADER LINE,
it_im_header LIKE BAPI2017_GM_HEAD_01, " OCCURS 0, " WITH HEADER LINE,
it_im_gmcode LIKE BAPI2017_GM_CODE, " OCCURS 0, "WITH HEADER LINE,
mat_doc type bapi2017_gm_head_ret-mat_doc,
mat_docyear type bapi2017_gm_head_ret-doc_year.
*data : lv_intense(01).
data : it_mseg like WB2_V_MKPF_MSEG2 occurs 0 with header line,
it_cost like csks occurs 0 with header line.
selection-screen begin of block a with frame title text-001.
parameters: p_date type sy-datum default sy-datum.
select-options: so_budat for WB2_V_MKPF_MSEG2-budat,
so_werks for WB2_V_MKPF_MSEG2-werks_i,
so_matnr for WB2_V_MKPF_MSEG2-matnr_i,
so_lgort for WB2_V_MKPF_MSEG2-lgort_i.
selection-screen end of block a.
select * from WB2_V_MKPF_MSEG2 into
table it_mseg where
budat in so_budat and
werks_i in so_werks and
matnr_i in so_matnr and
lgort_i in so_lgort and
bwart_i = '657'.
select * from csks into table it_cost
for all entries in it_mseg where
gsber = it_mseg-werks_i.
*Filling BAPI Header Tables
it_im_header-pstng_date = sy-datum.
it_im_header-doc_date = sy-datum.
it_im_gmcode-gm_code = '03'.
*Filling BAPI Item Tables
loop at it_mseg.
read table it_cost with key gsber = it_mseg-werks_i.
it_mb1a-material = it_mseg-matnr_i.
it_mb1a-plant = it_mseg-werks_i.
it_mb1a-stge_loc = it_mseg-lgort_i.
it_mb1a-batch = it_mseg-charg_i.
it_mb1a-move_type = 555. " '103'.
it_mb1a-entry_qnt = it_mseg-menge_i.
it_mb1a-costcenter = it_cost-KOSTL.
it_mb1a-gl_account = '530089'.
append it_mb1a.
clear it_mb1a.
clear it_cost.
endloop.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = it_im_header
goodsmvt_code = it_im_gmcode
* TESTRUN = ' '
* GOODSMVT_REF_EWM =
IMPORTING
GOODSMVT_HEADRET = it_ex_headret
MATERIALDOCUMENT = mat_doc
MATDOCUMENTYEAR = mat_docyear
tables
goodsmvt_item = it_mseg
* GOODSMVT_SERIALNUMBER =
return = it_return
* GOODSMVT_SERV_PART_DATA =
* EXTENSIONIN =
if sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
endif.
But when i execute the above i am getting the following error.
Runtime Errors CALL_FUNCTION_UC_STRUCT
Except. CX_SY_DYN_CALL_ILLEGAL_TYPE
Date and Time 27.01.2009 14:43:06
Short text
Type conflict during structure parameter transfer at CALL FUNCTION.
What happened?
Error in the ABAP Application Program
The current ABAP program "Z_BAPI_FOR_MB1A" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught and
therefore caused a runtime error.
The reason for the exception is:
In the function "BAPI_GOODSMVT_CREATE", the STRUCTURE parameter "GOODSMVT_ITEM"
is typed in such a way
that only actual parameters are allowed, which are compatible in Unicode
with respect to the fragment view. However, the specified actual
parameter "IT_MSEG" has an incompatible fragment view.
Missing Handling of System Exception
Program Z_BAPI_FOR_MB1A
Trigger Location of Exception
Program Z_BAPI_FOR_MB1A
Include Z_BAPI_FOR_MB1A
Row 72
Module Name START-OF-SELECTION
Source Code Extract
Line SourceCde
42 lgort_i in so_lgort and
43 bwart_i = '657'.
44
45 select * from csks into table it_cost
46 for all entries in it_mseg where
47 gsber = it_mseg-werks_i.
48 *Filling BAPI Header Tables
49 it_im_header-pstng_date = sy-datum.
50 it_im_header-doc_date = sy-datum.
51 it_im_gmcode-gm_code = '03'.
52
53 *Filling BAPI Item Tables
54 loop at it_mseg.
55
56 read table it_cost with key gsber = it_mseg-werks_i.
57
58 it_mb1a-material = it_mseg-matnr_i.
59 it_mb1a-plant = it_mseg-werks_i.
60 it_mb1a-stge_loc = it_mseg-lgort_i.
61 it_mb1a-batch = it_mseg-charg_i.
62 it_mb1a-move_type = 555. " '103'.
64 it_mb1a-costcenter = it_cost-KOSTL.
65 it_mb1a-gl_account = '530089'.
66
67 append it_mb1a.
68 clear it_mb1a.
69 clear it_cost.
70 endloop.
71
72*>>>> CALL FUNCTION 'BAPI_GOODSMVT_CREATE'* 73 EXPORTING
74 goodsmvt_header = it_im_header
75 goodsmvt_code = it_im_gmcode
76 * TESTRUN = ' '
77 * GOODSMVT_REF_EWM =
78 IMPORTING
79 GOODSMVT_HEADRET = it_ex_headret
80 MATERIALDOCUMENT = mat_doc
81 MATDOCUMENTYEAR = mat_docyear
82 tables
83 goodsmvt_item = it_mseg
84 * GOODSMVT_SERIALNUMBER =
85 return = it_return
86 * GOODSMVT_SERV_PART_DATA =
87 * EXTENSIONIN =
88 .
89 if sy-subrc = 0.
90 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
91 EXPORTING
Can u explain why this is coming. Your valuable suggestions are required.
Thanks,
Jitesh M NairHi,
Try this Code.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = WF_HEADER
GOODSMVT_CODE = WF_CODE
TESTRUN = WL_space
IMPORTING
MATERIALDOCUMENT = FS_MATERIAL_DOC
TABLES
GOODSMVT_ITEM = INT_ITEM
GOODSMVT_SERIALNUMBER = INT_SERIALNO
RETURN = INT_RETURN1.
*VARIABLES for goods movement creation bapi
DATA : WF_HEADER TYPE BAPI2017_GM_HEAD_01,
WF_CODE TYPE BAPI2017_GM_CODE.
DATA : FS_MATERIAL_DOC TYPE BAPI2017_GM_HEAD_RET-MAT_DOC,
FS_SERIALNO TYPE BAPI2017_GM_SERIALNUMBER,
FS_ITEM TYPE BAPI2017_GM_ITEM_CREATE,
FS_RETURN1 TYPE BAPIRET2,
data declaration for goods movement creation bapi
DATA : INT_ITEM TYPE TABLE OF BAPI2017_GM_ITEM_CREATE,
INT_SERIALNO TYPE TABLE OF BAPI2017_GM_SERIALNUMBER,
INT_RETURN1 TYPE TABLE OF BAPIRET2.
Hope this will help.
Regards,
Rohan. -
Friends,
I have a Transaction Z, to read a file and created documents in FI, using Call Transactio 'FB01'.
The document is created with the field BKPF-TCODE = 'FB01', Would record the transaction in the field Z ?
Anyone know of any exit or badi for this ?
Thanks,
FabioHi,
When we use the BAPI BAPI_ACC_DOCUMENT_POST, the field BKPF-tcode is filled with the Z-transaction, however, if we run the same program in background this field is not filled. I such a case what is the solution. Is creating an enhancement in the include LACC9F20 , form FILL_ACCHD the only option?
Thanks -
Hi,
I want BAPI for G/L balance upload.
I want to transfer these fields:
STYPE(BBKPF-STYPE)
LDGRP(BKPF-LDGRP)
BSCHL(Posting key)
MWSKZ(Tax Code)
I looked into BAPI's BAPI_ACC_GL_POSTING_POST and BAPI_ACC_DOCUMENT_POST but I didn't find any field like above fields.
Please suggest which BAPI to use so that I can get all the above fields. Better if someone can provide the code.
Thanks
Vinod.Hi,
U can use Bapi "BAPI_ACC_DOCUMENT_POST" to post the G/L balances data.
Before that u need to activate the BADI "BADI_ACC_DOCUMENT".
This badi contains structure called "ACCIT" (Check the structure in SE11) which will fill the remaining fields which are not supported by BAPI.
For this u need to fill BAPI extension parameter. Check the bapi documentation for the procedure to fill the structure. -
Fill data in 2 fields on selection screen from a search help
Hi,
I have defined a custom search help as given below.
Selection Method : ZTSTCT
Search Help Parameters :
TCODE Importing & Exporting
TTEXT Exporting Only
I have two parameters in my report as declared below:
PARAMETERS : tcode TYPE tstct-tcode MATCHCODE OBJECT zm_tstc,
ttext TYPE tstct-ttext.
Now whenever a user selects any TCODE in the help ZM_TSTC, I need both the fields on the selection screen to be filled with appropriate data. When I tested the search help in SE11, both fields are getting filled with appropriate data but in the report only the field TCODE gets filled. Is there any way to get the other field also filled with the appropriate data ?
Points will be awarded for helpful answers.
Thanks & Regards,
MukulHi,
Use the Event.
AT SELECTION-SCREEN AT tcode.
Use the select query from the method ZTSTCT.
select single TTEXT into ttext from ZTSTCT where TCODE = TCODE.
you will get the value of TTEXT .
Regards,
Balakumar.G. -
Exact process flow for Material management (MM) and UI Tcodes.
Hi Gurus,
Could any one tel me Exact process flow for Material management (MM) and UI Tcodes.
ALL BAPIs for MM module.
Thanks in Advance.hi,
Check the threads:
MM flow
MM-Process
For tcodes:
TCODES IN MM
TCODES IN MM
Hope it helps..
Regards
Priyanka.P -
Data migration ALE or idocs and bapis
hi ,
thank you guys for the support.
i am into a data migration project.
i need the initial setup for the idocs and bapis.
i dont know anything about these so can u send me the process for the setup and the data migration process too with idocs and bapis.
i didnt understand when they asked me if we can data migrate with a ALE, is that the same as using idocs and bapis or is it a different approach.
u can send me at any inofrmation connected to my eamil addr.
i would really appreciate that.
thank you.Hi,
Outbound:
Step 1. Application document is created when transaction is saved.
2. Message control is invoked.
3. Messages are processed by system.
4. Messages are Edited (if desired).
5. Output (ALE / EDI) is checked
6. Validate against Message control record from Partner Profile
7. Application Document is saved.
8. Entry NAST table is created for every selected output program
along with Medium & Timing.
9. Check for Process Immediately .
If (yes)
Determine Processing Program from TNAPR Table.
ELSE
Execute RSNASTED Program.
10. Read Partner Profile to determine Process Code.
11. Process Code points to the Function Module & Invoked.
12. IDoc is generated.
13. Check for ALE Request.
if (Yes)
Perform Filters, Conversions, Version Changes etc.
Else.
IDoc is stored in DATABASE.
INBOUND:
Step 1. EDI Subsystem creates an IDoc file from EDI Messages
2. Subsystem calls Functional Module EDI_DATA_INCOMING from startRFC program.
3. Data in Control Record is validate against the Partner Profile.
4. IDoc is generated in Database and syntax check is carried out.
5. IDoc file is deleted once file read.
6. Event PROCESSSTATE REACHED is triggered in Idoc Object Workflow.
7. Check for Process Immediately.
If NO
Execute RBDAPP01 Program
Else
Read Process Code from Partner Profile
Process Code Points to Function Module
Application Document Posted.
further help:
check url
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapgenie.com/ale/configuration.htm
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapdevelopment.co.uk/training
And also u can get lots of inof from the below link.
http://www.sapgenie.com/ale/why_ale.htm
Just follow the procedure
Sending System(Outbound ALE Process)
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Create Model View
Tcode BD82 ? Generate partner Profiles & Create Ports
Tcode BD64 ? Distribute the Model view
Message Type MATMAS
Tcode BD10 ? Send Material Data
Tcode WE05 ? Idoc List for watching any Errors
Receiving System(Inbound ALE )
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 ? Idoc List for inbound status codes
ALE IDOC Steps
Sending System(Outbound ALE Process)
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Create Model View
Tcode BD82 !V Generate partner Profiles & Create Ports
Tcode BD64 !V Distribute the Model view
This is Receiving system Settings
Receiving System(Inbound ALE )
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 !V Idoc List for inbound status codes
Message Type MATMAS
Tcode BD10 !V Send Material Data
Tcode WE05 ( )
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.
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
just refer to the link below
http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g
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.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#
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
Thanks and regards,
Sarada -
hi Experts,
Can any one Help meplz, I'm Venkat,I have doubt in Dictionary .i.e how to create transaction code for database table .when i create Tcode for table in Se93 ,it asks abt progarm name,if i given that name as table name it is giveng run time error.Hi
You can create new Tcode from Tcode SE93
Fill all the attributes
Give your custom txn name 'ZTXN'.
Give the Short text for it .... (This short text will appear if u choose this txn as favourites on SAP Easy access)...
Select the Object type of your program from the 5 radiobuttons that come up..Select 2nd option if its a report program. Press Enter.
When you go to the next screen, Enter name of the Program(ZPROG) you are intending to make the transcation for ...
Save the Transaction.
Now you can type the transaction ... 'ZTXN' in the command bar that will take you to the selection screen of the program ZPROG...
Regards
Maybe you are looking for
-
How can I automatically word wrap a string placed in a (multicolumn) listbox ?
Hello, Using LabView 7.0: I need to automatically wrap text inserted in a multicolumn listbox. The size of the listbox is fixed and I don't know the legth of the string that will be inserted. But the whole string must be visible, because it's Informa
-
Problem using Brush tool with layer mask in Photoshop CC.
Using Photoshop CC, working on a layer mask. Using the Brush tool to paint white to show the effect works like normal. Painting black has no effect. Just started doing this in the last two days.
-
Standard Data Collection Failing with Error ORA-04054: database link does not exist.
Hi Gurus, When I am running Standard Data Collection in ASCP(APS) instance R12.1.3, its failing with error : ORA-04054: database link does not exist. There is no such Database link exits which is showing in above error. Also the database link name i
-
Regarding miro tcode copy to zmiro.
Hi Experts, i got requirement like copy miro tcode to zmiro, i copied all includes and all objects, finaly transaction code is also created. while executing the program i got the dump, how to solve this dump , please give me an idea to solve this i
-
XMLP Rounding issue vs Excel???
Hey all, We're modifying the Sales Order Acknowledgement using XML Publisher for an australian business unit. The standard Sales Order Ack has just the line total, but we need to break out GST tax and show it separately. GST calculation is original p