Calling BAPI in sequence
Greetings,
I m calling FIVE FM namely,
BAPI_ALM_ORDER_MAINTAIN
BAPI_TRANSACTION_COMMIT,
BAPI_ALM_NOTIF_DATA_ADD,
BAPI_ALM_NOTIF_SAVE,
BAPI_TRANSACTION_COMMIT
in the sequence written above.But i am not able to add data
to a created notification (created through BAPI_ALM_ORDER_MAINTAIN ),IF i process it in the above sequence.If i do the notification addition separetly,its working.
Do anyone have an idea to do this in a single function module.?
Helpful answers will be rewarded.
Regards,
Try to open the order (IW32 or the like) after the commit wait, there may be a delay as i wrote. So try something like:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = bapiret2.
IF bapiret2-type EQ 'E'.
" help
ENDIF.
DO.
SELECT COUNT(*) FROM aufk BYPASSING BUFFER
WHERE aufnr = returned_order.
IF sy-subrc EQ 0.
EXIT.
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.
Regards
Similar Messages
-
Sample ABAP code for userexits, and calling bapi's
Hi,
Can someone please send me sample ABAP code
1) to do extractor enhancement using user exit.
2) ABAP program to call BAPI to read live cache order series data in SNP and write to Idocs through some ports.
3) ABAP routine to generate file name (based on date/country)in the infopackage to upload flatfiles.
Thank you very much in advance and appreciate any help.
Regards
Prasadhai ,
check this code...
*& Tables
tables : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
*& Selection Screen Parameters
selection-screen begin of block a01 with frame title text-001.
selection-screen skip.
parameters : p_tcode like tstc-tcode obligatory.
selection-screen skip.
selection-screen end of block a01.
*& Start of main program
start-of-selection.
Validate Transaction Code
select single * from tstc
where tcode eq p_tcode.
Find Repository Objects for transaction code
if sy-subrc eq 0.
select single * from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
move : tadir-devclass to v_devclass.
if sy-subrc ne 0.
select single * from trdir
where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir
where pname = tstc-pgmna.
select single * from enlfdir
where funcname = tfdir-funcname.
select single * from tadir
where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name = enlfdir-area.
move : tadir-devclass to v_devclass.
endif.
endif.
Find SAP Modifactions
select * from tadir
into table jtab
where pgmid = 'R3TR'
and object = 'SMOD'
and devclass = v_devclass.
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
write:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of Exits:' , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) 'No User Exit exists'.
endif.
else.
format color col_negative intensified on.
write:/(95) 'Transaction Code Does Not Exist'.
endif.
Take the user to SMOD for the Exit that was selected.
at line-selection.
get cursor field field1.
check field1(4) eq 'JTAB'.
set parameter id 'MON' field sy-lisel+1(10).
call transaction 'SMOD' and skip first screen. -
hi
i developed one report and one bapi (to create sale order with ref to contract) every thing working fine.
now my client asked he want to call bapi program from report because my report output is input to bapi for this i maintained check box for every row in report and in application tool bar i maintained one key , suppose he selected one record and press on that key it should move to bapi up to this working fine .for this my logic is
SET PF-STATUS 'ZCON'.
At USER-COMMAND.
CASE SY-UCOMM.
WHEN 'BAPI'. "this is key
CALL TRANSACTION 'ZBC'. "zbc = my bapi tcode
endcase.
now i have to pass selected record values to bapi input automatically so what i have to write .
please share information
thanks in advance
Moderator message : Duplicate post locked. Continue with the original thread.
Edited by: Vinod Kumar on Sep 7, 2011 10:32 AMHello Bhavin,
you have marked your question an self solved. Would be fine if you post your solution.
Regards
Gregor -
How to add error message to return structure of calling BAPI from a BADI
i have a bapi where a badi is triggered.this badi method has just importing and changing parameters.is there any way with which i can add error message to the return structure of calling bapi.please reply at the earliest.High points can be expected.
thanks got it
-
HTTP to RFC (Calling BAPI)
Hi,
I am working on creating a Purchase Order in SAP system by calling BAPI's from XI using RFC adapter.
I defined the following in IR:
1. Created data types for mapping with BAPI request and response.
2. Created messsage types and assigned corresponding data types to the message types.
3. Created one Message Interface (Outbound/Synchronous), Output message - request message type, Input message - response message type.
4. Create request and response message mapping and one Inteface mapping (with request tab and response tab) properly assigned.
Defined the following in ID:
1. Created HTTP business system (no communication channel)
2. Created communication channel for receiving system (SAP).
3. Created receiving determination and interface determination, receiver agreement, no sender agreement.
I sent XML message (required data to create purchase order) from HTTP client but I am getting the response as <b>Unable to determine name of mapping program</b>, my Interface Determination has proper Inbound Interface (ZBAPI_PO_CREATE) and Mapping program (PO_I_MAP). But Why am I getting the reposnse as I said above in my HTTP client?
Appreciate your help,
Thanks and Regards,
Jagadish.Hi Jagadish,
The error lies in Message Mapping .So please check it once again .You have mentioned your steps it seem there is problem in Message mapping..
Please look at the following Steps..
IR:
1.Import Corresponding RFC(BAPI). No need to create Interface Objects( Data type, Message type,Message Interface ) for SAP( RFC ) system..
2.Create Interface Objects For HTTP System.As you told it is synchronous.
3.Perform Two Message Mappings
(A).HTTP Request <--> RFC Req
(B).RFC Response<-->HTTP Res
4.Perform one Interface Mapping which includes Request and Response Mappings ..
5.Activate all objects..
ID : what you have done is ok..
URL: http://<hostname:port>/<path>?<query-string> Make sure your URL is correct or not for( sender HTTP )..
I think it will hepl you , if it is solved please assign points . If you have any doubt you can call me...
Thanks
N.Prasad Babu
iGATE Global Solutions Hyderabad : 98490 65377 -
How to call BAPI from ABAP Inbound Proxy
Hi All
Can some one provide/giude a sample code on how to call a BAPI from generated Method (Inbound Proxy) and how are the table parameters passed from Proxy to BAPI.
Thanks
Ravi/Hello Ravi,
In the proxy before calling the BAPI, construct the table, fill it with the appropiate values by lopping over the proxy request object. Now use this table for calling BAPI
Cheers,
Naveen -
How to Call BAPI From the Custom Controller
Hi
I developed frist WD Application Using RFC Adapter.
i did the following steps
1. created the project
2. created the model.
3. created the customer controller and mapped the model of the controller to the model.
4. mapped controller context to the views
5. created one action in the start view
6. created one method in the customer controller.
so please let me know the lines of code to call BAPI using RFC.
and how to pass input valus to the bapi and how to execute the BAPI
plese send the reply ASAP
regards
mmukeshHi
i did like this
In Start View OnActionSearch () method code
public void onActionsearch (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
wdThis.wdGetTestCustControllerController().executeGetlistBapi();
in CustomController Init method
public void wdDoInit()
Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
wdContext.nodeBapi_FlightGetlist_Input().bind(input);
input.setDestination_From(new Bapisfldst());
input.setDestination_To(new Bapisfldst());
In CUSTOMECONTROLLER executeGetlistBapi();
METHOD
public void executeGetlistBapi( )
//@@begin executeGetlistBapi()
try{
wdContext.currentBapi_FlightGetlist_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}catch(Exception ex){
ex.printStackTrace();
Then let me know what is wrong in this
i did as per pdf
please correct if there is any worng in this code.
this is flight example .
regards
mmukesh -
I want to call a BAPI using web Dynpro.
In my case, the BAPI without input parameter, it only give out a out table after execute.
So that I include this Bapi in the model and directly call it in wdDoInit like this :
wdContext.nodeZbapi_Outvendor_Input().currentZbapi_Outvendor_InputElement().modelObject().execute();
wdContext.nodeZbapi_Outvendor_Input().invalidate();
However, no any result can see. Anybody could tell me what is the correct way to call BAPI in WD?
Thanks!Hi,
Don't invalidate the zbapi node...
If your output can be recieved from the node say.., output from the bapi side and you mapped it to controller to node say OutVend...
Then use this code
wdContext.nodeOutVend().bind(wdContext.nodeZbapi_Outvendor_Input().currentZbapi_Outvendor_InputElement().modelObject().getOutput());
Any queries revert back.
If this is not working post your context structure in your reply and tell where you are expect the output
Best Wishes,
Idhaya R -
ABAP program to call bapi of catsdb in sap
ABAP program to call bapi of catsdb in sap
coding please,
Thank you,
points will be rewarded,
Regards,
Jagrut BharatKumar Shuklaif the transactions are custom one, then you can do some work around.
But i dont know how you will do it for standard ones.
Aa far as i know this requiorement has a least possibility. -
Creating webservice using webdynpro java calling bapi from r/3
hi all,
as i am new to this area can anyone provide me a guide to create a simple webservice using webdynpro java to call bapi's from r/3?
i want to consume the created webservice on a .net client.
Thanks in advance,
RaghunandanYou can use the SAP .NET Connector to do it.
Download from [http://service.sap.com/connectors|http://service.sap.com/connectors]. -
Calling Bapi through BADI gives data statement error
Dear Experts,
I am trying to call BAPI through BADI ME_PROCESS_REQ_CUST --> process_item.
I get an error stating that "The addition OCCURS no longer supported in OO objects"
If, I remove OCCURS statement I get an error stating that "Tables with headers are no longer supported in OO context" for the following data statement.
Appreciate, if you could provide possible solution to overcome the problem.
Regards
Kumar
BAPI code is as follows.
DATA: LV_TABIX LIKE SY-TABIX,
LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
LV_TABIX = SY-TABIX.
CLEAR: LT_WMDVSX, LT_WMDVEX.
REFRESH: LT_WMDVSX, LT_WMDVEX.
Fill communication table
LT_WMDVSX-REQ_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
LT_WMDVSX-REQ_QTY = ET_PROCUREMENT_ITEM-QUANTITY.
APPEND LT_WMDVSX.
Availability check with check rule '03'
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT = ET_PROCUREMENT_ITEM-PLANT
MATERIAL = ET_PROCUREMENT_ITEM-MATERIAL
UNIT = ET_PROCUREMENT_ITEM-UNIT
CHECK_RULE = '03'
TABLES
WMDVSX = LT_WMDVSX
WMDVEX = LT_WMDVEX
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC EQ 0.
READ TABLE LT_WMDVEX WITH KEY
COM_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
IF SY-SUBRC EQ 0.
ET_PROCUREMENT_ITEM-AVAIL_QTY = LT_WMDVEX-COM_QTY.
ENDIF.
ENDIF.Hi,
Occurs is no more supported by SAP ( is an obsolete statement )
<b>Instead of following code</b>
DATA: LV_TABIX LIKE SY-TABIX,
LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
you can use
data: LT_WMDVSX type standard table of BAPIWMDVS,
LT_WMDVEX type standrad table of BAPIWMDVE,
LS_WMDVSX like line of LT_WMDVSX , "( work area )
LS_WMDVEX like line of LT_WMDVEX. "(work area)
use workarea to get the data and then append the records from workarea to Internal tables
Reward points if usefull
Regards,
Mohan -
Hi
How to call BAPI FM's from RFC ??
thanks
kumarHi Palnati,
Use statement :
Call FUNCTION 'Bapi................'
DESTINATION Dest(RFC destination in TCODE SM59)
EXPORTING f1 =
f2 =
IMPORTING f3 =
TABLES T1 =
EXCEPTIONS .
Reward points if helpful.
Regards,
Hemant -
How to create an Accounting Document by calling BAPI
Hai friends ,
please tell me how to call this BAPI and fulfill all the parameters .. Please help me , I dont know the head and tail of it ...
create an Accounting Document by calling BAPI BAPI_ACC_DOCUMENT_POST
Below is the step to fill the parameters for BAPI:
Enter company code, invoice no, invoice date, document type, header text into DOCUMENTHEADER
Enter customer, item text, company code, payment term into ACCOUNTRECEIVABLE
Enter offset account, company code, document type, item text into ACCOUNTGL
Enter currency type u201800u2019, currency, exchange rate, amount into CURRENCYAMOUNT. Please note there will be two rows in this table, one positive amount and one negative amount
Call the BAPI to create the AR document. If p_check is checked, call the BAPI only without COMMIT and then do the message processing
If p_check is initial, COMMIT the data to the database tables.
Check the RETURN table after each BAPI, if no u2018Eu2019 message type found, output the document no. Otherwise, output the error messge to the screen with the message type u2018Eu2019.
thanks in advance ...Hi,
Check the link
http://www.sapbrainsonline.com/sapinfo/tutorial.php?artid=617
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bapi_acc_document_post-error-1973720
http://delaynomore.spaces.live.com/blog/cns!D2BFFB84EDFE4189!528.entry
http://sap4.com/wiki/index.php?title=BAPI_ACC_DOCUMENT_POST
http://www.sapfans.com
Anurodh -
How to call BAPI from R/3 system
hi,
i am doing small application by using Model. that is calling BAPI from R/3 system. but i am not able to get data from the back end system. please suggest me regarding this problem
thanx
tanvisteps:
1) create Model
2) bind Model to component controller ( you can use data modeler.) 2.1) open data modeler; if your model is not there, you can add by clicking add existing model;
2.2) create data link between model and controller, it will open map dialog.
2.3) click and drag BAPI_xxx_Input to context of controller and select all nodes inside
- if there is any duplicate nodes, just rename it.
3) map context to view controller
3.1) map input parameters separately ( which takes value for IMPORT to BAPI. select only that fields
3.2) do map for output (exact node which contains BAPI output)
coding:
1) in component controller you need to instantiate model and bind to context
BAPI_xxx_Input my_input = new BAPI_xxx_input();
wdContext.nodeBAPI_xxx_Input my_input().bind( my_input);
2) create a method in the component controller so that we can execute it from any of views used.
try{
wdContext.currentBAPI_xxx_Input my_input().modelObject().execute();
}catch(WDRFCException e) {
e.printStackTrace();
wdContext.node<ExactOutput>().invalidate();
// this stmt will reflect new values
3) Go to view and bind values to UI Elements
in wdDoInit()
IPrivate<Comp_Name>View.I<ExactOutput>Element input = wdContext.create<BAPI_xxx_Input>Element();
// see if this may demand model instance as parameter
wdContext.node<BAPI_xxx_Input>().addElement( input);
4) In OnAction you just executes the component controller method
wdThis.wdGet<Com_Name>Controller().executeMyBapi();
// executeMyBapi() is the method contains the mentioned try..catch code
nikhiL -
Calling BAPI in the Classes and also in Methods
hi ,
is it possible to call the BAPI function module in the classes, i am creating BSP for creating the material, i think BDC will not work properly in this case, so i want to use BAPI for creating material , so please suggest me which way is suitable for this, and let me know is it possible to use BAPI's in classes which is created throw SE24 tcode.
srujan.pHi,
yes, it is possible to call BAPI from method. It is just normal function module call. Generally I am trying to avoid BDC. It almost always brings some problems. There is BAPI BAPI_MATERIAL_SAVEDATA for maintaining material master data.
Cheers
Maybe you are looking for
-
Anyone know how to create something like this?
I've been asked to make something like this except for newsletters instead of business cards. If anyone has seen any tutorials covering anything like this I would love to hear about them, or if you have some ideas of how to start. I tried using image
-
I've seen that others have experienced this. I've tried the suggested settings & adjustments as described. Still not very good. I was quite happy to ditch media Player, but may have to reconsider. I like iTunes (apart from this issue). Is there a def
-
Can't use Siri to call "Shanise" it always recogniz "shanice"
after update to ios7.0.4 sori can't not like recognize the word "Shanise"
-
how do you put album art on the ipod video? i put songs on it from my cds but i don't know how to add the album art to it
-
Clicking on a file in bridge opens it in preview. I want it to open in photoshop cc.