BAPI IN HR-ABAP
SOME WAY OF DOING BAPI IN HR ..PLEASE IF POSSIBLE ONE EXAMPLE
Hi Raghunandan,
Look into the following program which might be useful.
HR_INFOTYPE_OPERATION is used to insert,modify,change etc using particular infotype.
data : v_file type string.
PARAMETERS : p_file like rlgrap-filename.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
start-of-selection.
**get pernr.
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = i_0008
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*RP50G-PERNR = '54025'.
*RP50G-CHOIC = '0008'.
*P0008-BEGDA = '20030101'.
*P0008-ENDDA = '99991231'.
*P0008-PREAS = 'w1'.
*P0008-TRFGR = 'L03'.
*Q0008-ANSAL = '50000'.
*P0008-ANCUR = 'EUR'.
*q0008-LGART = 'M100'.
**Q0008-BETRG = '500'.
**Q0008-BETRG = '500'.
**Q0008-WAERS = 'INR'.
loop at i_0008.
***move i0008 to i_0008.
move-corresponding i_0008 to p0008.
append p0008.
*move-corresponding i_0008 to q0008.
*append q0008.
*loop at p0008.
***move i_0008 to p0008.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0008-pernr "RP50G-PERNR
IMPORTING
RETURN = RETURNE.
**IF RETURN EQ 0.
**loop at p0008.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0008'
NUMBER = p0008-PERNR
SUBTYPE = p0008-SUBTY
OBJECTID = p0008-OBJPS
LOCKINDICATOR = p0008-SPRPS
VALIDITYEND = p0008-ENDDA
VALIDITYBEGIN = p0008-BEGDA
RECORDNUMBER = p0008-SEQNR
RECORD = p0008
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '2'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = RETURN
KEY = KEY
if return is not initial.
write: / 'ERROR OCCURED'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = p0008-pernr "RP50G-PERNR
IMPORTING
RETURN = RETURNE.
endloop.
If you want more clarification on this see the documentation for HR_INFOTYPE _OPERATION.
Hope this helps you understand the usage of BAPI HR_INFOTYPE _OPERATION
*Reward points if found useful
Regards,
Naresh
Similar Messages
-
Hi bapi Guru's,
I am asked to use bapi's(Instead of BDC's) for data upload .I am not getting good documentation on 'USING BAPI's IN ABAP',Like Defining structures, and what are the FM's to be called like bapi_commit.
Any Info is Appriciated.
Regards
satishSorry Satish,
Maybe this is going off topic a little, bit perhaps also its relevant as you have been asked to move from BDC's to BAPIs.
Juan,
When I talk about debugging, there are two levels to this:
<b>1. Debugging by the programmer</b>
In this case, how can it be easier to debug an error from a BAPI than from the screen? For a sales order, for example, when you enter a delivery date of 01.01.2000 for an item, via BDC you will get an error message as the item is entered (something along the lines of delivery date is in the past), and you will see exactly the date you have entered, and if you don't understand the error, you can click on F1 and it will give you the long description of the error. Via a BAPI, you would get the error message, and you MIGHT get the item number and the date in question. But if you don't understand the error what do you do then? Debug the BAPI itself? You could, but isn't this a rather lengthy way to get to the root of the problem? In general, any errors you get calling BAPIs/BDCs are errors with your master data, or breaking business rules, you shouldn't have to debug standard code to tell you whats going wrong, the application can tell you.
<b>2. Debugging by the end user</b>
When you implement a BAPI/BDC this will be related to an interface/automated transaction etc. When its in production you will occassionally get errors (due to bad master data, not fully capturing all the business logic in your custom coding [it happens], technical issues etc.) What do you do then? In the case of BDC you can do nothing. The error is recorded, and you can get end users to process the errors by stepping through the screens (which they already know how to use) and make corrections as required. In the case of BAPIs, you have to record the error in a table or a file, then develop some kind of interface to display the errors, then develop some kind of process for re-processing the errors. If the data used to call the BAPI is not correct then you also need to provide a facility for changing the data before reprocessing. Normally you do none of this because its too much work and you end up having all errors coming back to the SAP team who have to debug and change table entries etc. to get it all to work. I would not say that this makes BAPIs easier to debug.
Oops, just realised my pasta is burning!!!
Anyway, think I got my point across. Not personal but feel quite strongly about this topic. To me BDC's are still a relevant tool despite the push for Idocs/BAPIs.
Cheers,
Brad -
How to call BAPI in a ABAP prog
Hi All
I have a concern regarding the usuage of BAPI in the ABAP program.
i have successfully created a BAPI and i have implemented a method as well using ADD API Method button.
Now after doin all the things in SWO1.
I wanted to know how to call this BAPI method in se38.
CAn anyone throw some light on this ?
Regards
GauravHi,
try this
*& Report ZKAR_MATMAS_BAPI
*& This program demonstrates how easy it is to create Material master
*& data using BAPI_MATERIAL_SAVEDATA
*& The program also generates a report post-execution displaying errors
*& as well as successful uploads
REPORT ZKAR_MATMAS_BAPI.
* TABLES
* FLAGS *
DATA: F_STOP. " Flag used to stop processing
* DATA DECLARATIONS *
DATA : V_EMPTY TYPE I, " No. of empty records
V_TOTAL TYPE I. " Total no. of records.
* STRUCTURES & INTERNAL TABLES
*BAPI structures
DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
BAPI_MAKT LIKE BAPI_MAKT, " Material Description
BAPI_MARA1 LIKE BAPI_MARA, " Client Data
BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2. " Return Parameter
*--- Internal table to hold excel file data
DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*--- Internal table to hold Matetrial descriptions
DATA: BEGIN OF IT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- Internal to hold the records in the text file
DATA : BEGIN OF IT_DATA OCCURS 100,
WERKS(4), " Plant
MTART(4), " Material type
MATNR(18), " Material number
MATKL(9) , " Material group
MBRSH(1), " Industry sector
MEINS(3), " Base unit of measure
GEWEI(3), " Weight Unit
SPART(2), " Division
EKGRP(3), " Purchasing group
VPRSV(1), " Price control indicator
STPRS(12), " Standard price
PEINH(3), " Price unit
SPRAS(2), " Language key
MAKTX(40), " Material description
END OF IT_DATA.
* SELECTION SCREEN. *
SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
'C:\Material_master.XLS'.
PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK SCR1.
* AT SELECTION-SCREEN *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*--- Validating file
PERFORM VALIDATE_FILE USING P_FILE.
* START-OF-SELECTION
START-OF-SELECTION.
*--- Perform to convert the Excel data into an internal table
PERFORM CONVERT_XLS_ITAB.
IF NOT IT_DATA[] IS INITIAL.
*--- Perform to delete Header lines
PERFORM DELETE_HEADER_EMPTY_RECS.
ENDIF.
* END OF SELECTION. *
END-OF-SELECTION.
*--- Perform to upload Material Master data
PERFORM UPLOAD_MATMAS.
* Form : validate_input_file
* Description : To provide F4 help for file if read from PC
FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
FILE_NAME = F_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
ENDIF.
ENDFORM. " validate_input_file
*& Form CONVER_XLS_ITAB
* text
FORM CONVERT_XLS_ITAB.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--- Perform to move the data into an internal data
PERFORM MOVE_DATA.
ENDFORM. " CONVERT_XLS_ITAB
*& Form MOVE_DATA
* text
FORM MOVE_DATA.
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS <FS>.
*--- Sorting the internal table
SORT IT_INTERN BY ROW COL.
CLEAR IT_INTERN.
LOOP AT IT_INTERN.
MOVE IT_INTERN-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS>.
*--- Asigning the field value to a field symbol
MOVE IT_INTERN-VALUE TO <FS>.
AT END OF ROW.
APPEND IT_DATA.
CLEAR IT_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
*& Form DELETE_HEADER_EMPTY_RECS
* To delete the Header and empty records
FORM DELETE_HEADER_EMPTY_RECS.
DATA: LV_TABIX LIKE SY-TABIX.
IF NOT P_HEADER IS INITIAL.
LOOP AT IT_DATA.
IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
DELETE IT_DATA FROM 1 TO P_HEADER.
* P_HEADER = 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR IT_DATA.
*--- To delete the empty lines from internal table
LOOP AT IT_DATA.
LV_TABIX = SY-TABIX.
IF IT_DATA IS INITIAL.
V_EMPTY = V_EMPTY + 1.
DELETE IT_DATA INDEX LV_TABIX..
ENDIF.
ENDLOOP.
CLEAR IT_DATA.
*--- Total no of recs in file
DESCRIBE TABLE IT_DATA LINES V_TOTAL.
IF V_TOTAL = 0.
MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
F_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " DELETE_HEADER_EMPTY_RECS
*& Form UPLOAD_MATMAS
* to upload Material Master data
FORM UPLOAD_MATMAS .
LOOP AT IT_DATA.
* Header
UNPACK IT_DATA-MATNR TO IT_DATA-MATNR.
BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
* Material Description
REFRESH IT_MAKT.
IT_MAKT-LANGU = IT_DATA-SPRAS.
IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
APPEND IT_MAKT.
* Client Data - Basic
BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
BAPI_MARA1-DIVISION = IT_DATA-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
* Plant - Purchasing
BAPI_MARC1-PLANT = IT_DATA-WERKS.
BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
BAPI_MARCX-PLANT = IT_DATA-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
* Accounting
BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
*--- BAPI to create material
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA = BAPI_MBEW1
* VALUATIONDATAX = BAPI_MBEWX
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA = BAPI_MVKE1
* SALESDATAX = BAPI_MVKEX
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-MATNR.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,IT_DATA-MATNR.
ENDIF.
ENDLOOP.
ENDFORM. " UPLOAD_MATMAS
Regards,
V.Balaji
Reward if Usefull... -
Listing of BAPI's or ABAP support for Solution Manager
Hi,
Does anyone know of any BAPI's or ABAP RFCs/API associated with the Solution Manager?
Thank You,
Philhttp://service.sap.com/patches
--> Entry by Application Group
--> SAP Technology Components
--> SAP SOLUTION MANAGER
--> SAP SOLUTION MANAGER 7.0
--> Support Package Stacks
Give your source and destination support package and download them.
Markus -
Calling a Bapi on XI ABAP stack
Hi to all,
I have to call a Bapi defined on XI ABAP stack. I want to use a synchronous scenario in which my sender channel uses a File Adapter. The Bapi that I have to call is defined on the same SAP XI, then I don't know if my receiver channel has to use a RFC Adapter or an XI Adapter. If I use a RFC Adapter, I don't see any message in Message Monitoring. Instead, if I use the XI Adapter as Receiver, I get this error:
HTTP response contains status code 401 with the description Unauthorized Error when sending by HTTP (error code: 401, error text: Unauthorized)
Thanks to all!<i>I don't know if my receiver channel has to use a RFC Adapter or an XI Adapter</i>
No XI Adapter configuration required. Use RFC adapter
<i>
I want to use a synchronous scenario</i>
Synchronous scenario using file adapter can be achieved using BPM. A workaround would be
File - RFC - File without a BPM - Possible from SP 19.
Regards,
Prateek -
Bapi call in abap proxy reaching dialog timeout in async scenario
Hi all,
We have an XI interface to create sales orders. Legacy app sends a soap message async to XI with a group of orders. XI sends this group of orders to an Abap proxy async on ECC side. Into this Abap proxy we have a loop to process each order received in the group with BAPI_SALESORDER_CREATEFROMDAT2. Ending the loop, abap proxy start another async process to send the response to XI with an outbound abap proxy, and the response is redirected by XI to Legacy app.
The problem is, this group of orders can have two or two thousand orders... so, the async process guarantee that no timeout limit will be reached. This is working for the whole process. But when this BAPI is creating an order, the time out of BAPIs execution seems to be the same as the timeout of dialog processes (now set to 10 minutes). This is our problem. Some orders spend more than 10 minutes to process (orders with five hundreds items, for example)... when this occurs, BAPI throws a time out reached error and the async process stops on the inbound queue with status sysfail.
We are now trying to understand why this timeout is been triggered by the BAPI. As it is running into an Async process, it should execute without any kind of timeout limits...
If anybody has any idea, please, help us.
Thank you.
regards.
robertiMay be I was not so clear... the total spent time in the process can be many many hours, days, etc... no timeout is reached. I can post 10.000 orders, no timeout is reached. The problem is that if the processing of only one order with BAPI_SALESORDER_CREATEFROMDAT2 takes longer than 10 minutes, then the timeout is reached. This is the strange part. The processing of the bapi seems to get the same timeout of dialog processes, we already tested increasing the dialog process timeout and the timeout of bapi execution was the same...
We already monitor on SE66 to see if it opens a dialog process to execute the bapi call function, but it does not.
If anyone has any tip, please, provide us.
Thanks!
roberti -
Hi....Can u please send me any Basic Study material of BAPI 's and OOP's ABAP
to my email id [email protected] ...
thanks in advance......Hi,
Check these links:
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
list of all bapis
http://www.planetsap.com/LIST_ALL_BAPIs.htm
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
ooops abap:
Have a look at below link and go to page 1291. It will give you good info abt OO ABAP.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
Also have a look at below links:
http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
Please do check transaction ABAPDOCU to learn more about ABAP OO. There are lots of examples and explanations there. Also, do check sapgenie.com for more examples(under their ABAP OO link).
A very good option would be "ABAP Objects" written by Horst Keller.
Regards -
Is there any BAPI calling only ABAP command SET UPDATE TASK LOCAL
Hi abapers
we have a requirement to run SET UPDATE TASK LOCAL befor calling BAPI_ENTRYSHEET_CREATE command by JAVA through JCO.
is there any BAPI that contains SET UPDATE TASK LOCAL command or simillar functionality.
Thanks & Regards,
RameshYou could write a wrapper RFC function module which calls your BAPI and also the SET UPDATE TASK LOCAL.
Regards,
Rich Heilman -
Hello Friends,
I am basically a J2ee developer and very new to ABAP Programming language, and need to do some BAPI call through ABAP. I am having a following problem, and I am very thankful to some one who can help me out !
The problem is:
For example
DATA : MY_NUMBER LIKE BAPIRET2- NUMBER,
MY_TEXTFORMAT LIKE BAPITGA-TEXTFORMAT,
correct me if I am wronge, BAPIRET2- is an internal-table or structure and - NUMBER, is its attribute, ? if its true then,
1) Do we alwayas need for each BAPI to define its parameter and initilize with LIKE to the attribute of the internal database table ?
2) how do I come to know that, for which bapi which internal database table I have to use from SAP SYSTEM ?
I have already looked in many articals of BAPI, but did not help me much,
Thanks in advance
Haider Syed.Hi Syed,
Do you want to call these BAPIs from ABAP or from JAVA?
From ABAP - it is pretty simple. You just can do something like that:
REPORT z_mi_test .
DATA: l_debtorid TYPE bapi1007-customer.
DATA: ls_debitor_general_detail TYPE bapi1007_4.
l_debtorid = '0000000001'.
CALL FUNCTION 'BAPI_DEBTOR_GETDETAIL'
EXPORTING
debtorid = l_debtorid
COMPANYCODE =
IMPORTING
debitor_general_detail = ls_debitor_general_detail
DEBITOR_COMPANY_DETAIL =
RETURN =
TABLES
DEBITOR_BANK_DETAIL =
This function module 'BAPI_DEBTOR_GETDETAIL' corresponds to the method 'GetDetail' of Buisness Object 'Debtor'.
The types of IMPORT/EXPORT/TABLES parameters of the function module you can just see in SE37. Just start this transaction enter the name of the Function Module, like 'BAPI_DEBTOR_GETDETAIL. Or you just can navigate to this transaction when making double click on the Function Module name in BAPI explorer.
Anyway, you can find the types of the parameters on the corresponded tab strips Import, Export and Tables. -
Need simple ABAP OO reports, BAPI's and BDC upload using flat file.
Hello experts,
I am currently practicing ABAP and I would like to request some example codes for ABAP Objects, BAPIs, BDC's, etc.
Thanks!hi viray,
check these...
BAPI'S..
http://help.sap.com/saphelp_47x200/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/3e/ecf226942511d2ad4b080009b0fb56/frameset.htm
http://www.sapgenie.com/abap/bapi/index.htm
Abap Objects
http://www.sapgenie.com/abap/OO/index.htm
http://sap.ittoolbox.com/documents/industry-articles/introducing-abap-objects-982
http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
bdc's...
http://www.sappoint.com/abap/bdcconcept.pdf
http://wiki.ittoolbox.com/index.php/Topic:ABAP_-_BDC
http://www.sap-img.com/bdc.htm
hope these help,
do reward if it helps,
priya.
Message was edited by: Priya -
LSMW for uploading assets using BAPI
Hi.
I am trying to upload assets from a flat file into the standard table using LSMW with BAPI.
I could upload the assets by calling the BAPI from an ABAP report. But when I use the same BAPI in LSMW it gives an error while maintaining structure relationships.
I created different source structures for header segment, general data and for depreciation areas on same level. While assigning these structures to target structures it asked for maintaining hierarchy between them. After I created that hierarchy I could maintain the relationships properly. But the read program was not generated.
Please help me in this.
Thank you.Hi Savitha.
Thanks for the reply.
The identification field need to be defined in case of data maintained for several source structures in one file. I am maintaining the data for each source structure in a separate file.
Still it is giving me the same problem that is not generating the read program.
If I dont maintain the hierarchy in source structures then it is generating the read program but then gives error while converting the data.
Don't know how to proceed. -
How to put the message in sxi_monitor when call a bapi
hi experts,
I call a bapi in my abap program, and I want to put some information of this program into the xml messages,then I can monitor in future, but I don't know how to do this.
Thanks.I'm still waiting for the answer. anyone will help me?
thanks. -
BAPI is missing. How to get a BAPI in BOR?
Hi,
in my SAP BW 3.1 exits a BAPI names MDDataSetBW. I want to use this BAPI in a ABAP-Programm, which is exists on a R/3 Enterprise. Using CALL FUNCTION ' BAPI_<..>_<..> don´t work. Wenn im browsing through the BAPI-Explorer (TSC: BAPI) at R/3, i can´t found the BAPI. Browsing at SAP BW, BAPI exists.
RFC connection through both systems is established, sm59 gives okay. Extracting Data from R/3 through DataSources and store them at the Data Warehouse also work. The systems know each other.
Testing on SAP NetWeaver 7.0 AS the BAPI-Explorer and the BAPI exists, not not in R/3 Enterprise. Patchlevel is up to date. ALE ist enabled.
Im running out of ideas. Anybody a idea, how kann i get access to the BAPI? whats wrong?
Thanks for every answers.
Renétry using this syntax.
call function 'bapi....' destination 'destination name'.
this destination name is which u have in SM59. RFC destination.
ur BW server must be opened.
Message was edited by:
Kalpanashri Rajendran -
Problem while testing a BAPI Web Servicei face this problem in web service
i face this problem in web service bapi when i am carrying out the submit test... so can anyone help me???
HTTP/1.1 500 Internal Server Error
Set-Cookie: <value is hidden>
content-type: text/xml; charset=utf-8
content-length: 803
sap-srt_id: 20080610/144609/v1.00_final_6.40/DD36B8E7DE44B5F19BA900145E6770F3
server: SAP Web Application Server (1.0;700)
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body><soap-env:Fault><faultcode>soap-env:Client</faultcode><faultstring xml:lang="en">Deserialisation failed</faultstring><detail><n0:SimpleTransformationFault xmlns:n0="http://www.sap.com/transformation-templates"><MainName>/1BCDWB/WSS0080610064309718000</MainName><ProgName>/1BCDWB/WSS0080610064309718000</ProgName><Line>128 </Line><Valid>X</Valid><ReferenceFault><DescriptionText>Error accessing the ref. node 'EMPLOYEENUMBER'</DescriptionText><RefName>EMPLOYEENUMBER</RefName></ReferenceFault><Caller><Class>CL_SRG_RFC_PROXY_CONTEXT</Class><Method>IF_SXML_PART~DECODE</Method><Positions>1 </Positions></Caller></n0:SimpleTransformationFault></detail></soap-env:Fault></soap-env:Body></soap-env:Envelope>Hi,
since I did not find that BAPI in my system: what is the exact name?
Did you test the BAPI directly in ABAP, i.e. function builder SE37, successfully?
Currently it looks to me as if you did not provide sufficient business data.
Did you specify the employee number before executing the call? -
How to Debug a BAPI from a Web Dynpro application
I have a Web Dynpro application calling a BAPI, and I would very much like to see what data the Web Dynpro application is passing into the BAPI, and then debug the BAPI.
Is there a way to do this? I'm wondering if it is possible to somehow set up the ABAP stack so that on receipt of the BAPI call, it appears on the tRFC queue waiting for execution.
However it is done, I need a way to step through the BAPI on the ABAP stack.
BR,
Tony.Hi Anthony,
The ABAP runtime environment contains various tools that you can use for analysis purposes, such as for debugging source code. All source code written for Web Dynpro applications in ABAP can normally be tested using the debugger.
To allow it to test other Web Dynpro-specific program entities too, the debugger has been equipped with a special enhancement. In the phase model in the active application, you can typically see the following information at various points in time:
-The structure of the content of the current controller,
-The properties of the UI elements in the layout of the current view
-The currently instantiated component usages
Starting the Debugger
The functions for debugging Web Dynpro entities are embedded in the new debugger. You therefore need to have selected the new debugger in your Workbench settings.
Selecting the New Debugger
1. In the menu, choose Utilities -> Settings.
2. A dialog box now appears that contains two nested tab page areas. Choose the parent tab page ABAP Editor.
3. The settings for ABAP Editor always open with the content of the child tab page Editor. Here, select Front End Editor (New).
4. Now switch to the Debugging tab page in the ABAP Editor settings and select New Debugger.
5. Save your changes and close the dialog.
Starting the Debugging Process
To run an application in debugging mode, you first need to set an external breakpoint in display mode in one of the methods in the component.
Now start a test run of the application from ABAP Workbench as usual.
The method in which you set the breakpoint depends on the purpose of the test run. To debug a view, for example, it is best to set the breakpoint in method WDDOMODIFYVIEW. Provided that the context of the view controller is not filled using a supply method, the view is fully instantiated in the phase model at this point in time.
Selecting the Web Dynpro Tool in the New Debugger
When you start the application, another session opens automatically for the debugger. If you have not yet saved any personal settings with regard to the layout of the debugger, the Editor tool will now appear on the left, with the Display Variables tool on the right.
1. Select one of the three desktops in order to reconfigure it for debugging the Web Dynpro application (see Designing Work Areas).
2. The right-hand edge of the debugger window has a bar of function icons. Choose the Replace Tools icon:
3. In the next dialog box (New Tool) open the lowest node (Special Tools) and choose Web Dynpro.
4. Confirm the dialog box.
On the right of the debugger desktop, you will see that the previous tool has now been replaced by the Web Dynpro debugger. You can save this setting for future debugging activities. To do this, choose Save Layout In the debuggers general toolbar.
Thankyou,
Ramganesh.
Maybe you are looking for
-
How to hide duplicate photos that origins from the photo stream and imported photos?
Hi, I are using my camera both with an IPad (through SD-card reader) and directly to my iMac. I want to keep the full photo archive on the iMac. Now the problem, that I encounter, is that if I use the iPad to look at the photos, those photos will be
-
HT4061 CAN I GET A REFUND ON MY IPAD 3 AS IM NOT HAPPY WITH 4G?
has n e body been refunded?????
-
Forms tutorial....
Hi , I often bump to questions like...."Do you know of any forms tutorials...???" Ok... there are some: http://www.youtube.com/watch?v=4kLDDsDL_M8&feature=related http://www.youtube.com/watch?v=Fum3MJm5yKU&feature=related http://www.youtube.com/watch
-
Linking Illustrator file to InDesign
If I link an Illustrator file into InDesign (to add some artwork to a book), then export the InDesign file to PDF to upload to a printing website, will it cause problems for the printing because of the linked Illustrator file?
-
Where's the new interface???
I installed 4.2.1 and I still get the same interface as before. I got the Game Center and the Mute button is there and iTunes says that 4.2.1. is the operating system but no bar, no folders. Is there a switch I have to throw?