Success of a BAPI
Hi all,
Can I check the success of BAPI using sy-subrc ? what does the warning message <b>Referenced object type (STATUS) not allowed</b>mean ? Say when I run the tcode mm02 from where the data will be fetched into the screens ? If it from sap tables , will any changes made directly to the database will be reflecetd on the screen or not ?
Regards,
Varun.
Message was edited by: varun sonu
Hi,
The BAPI I am trying to use is BAPI_ACTIVITYCRM_CHANGEMULTI.
I will forward you the whole code I have written.
REPORT Z_CRMORDERREAD.
data : lt_header_guid type CRMT_OBJECT_GUID_TAB,
wa_header_guid type CRMT_OBJECT_GUID,
wac type CRMT_OBJECT_GUID,
lt_doc_flow type CRMT_DOC_FLOW_WRKT,
wa_doc_flow type CRMT_DOC_FLOW_WRK,
lt_status type CRMT_STATUS_WRKT,
lt_SAVE type table of BAPIBUS20001_GUID_DIS,
wa_save type BAPIBUS20001_GUID_DIS,
h_header type table of BAPIBUS2000110_HEADER_INS,
wah_header type BAPIBUS2000110_HEADER_INS, " work area
hx_header type table of bapibus2000110_header_insx,
wahx_header type bapibus2000110_header_insx, " work area
s_status type table of BAPIBUS20001_STATUS_INS,
was_status type BAPIBUS20001_STATUS_INS, " work area
sx_status type table of BAPIBUS20001_STATUS_INSX,
wasx_status type BAPIBUS20001_STATUS_INSX. " work area
data : return type table of BAPIRET2,
vc_LOG_HANDLE type BALLOGHNDL. " log_handle
wa_header_guid = '442EFEBDF11501C700000000888DE636'.
append wa_header_guid to lt_header_guid.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
IT_HEADER_GUID = lt_header_guid
IT_ITEM_GUID =
IV_MODE =
IV_ONLY_SPEC_ITEMS =
IT_REQUESTED_OBJECTS =
IV_NO_AUTH_CHECK =
IT_ITEM_USAGE_RANGE =
IV_SUBITEM_DEPTH = -1
IT_OBJECT_FILTER =
IV_ONLY_CHANGED_OBJ = FALSE
IMPORTING
ET_ORDERADM_H =
ET_OPPORT_H =
ET_LEAD_H =
ET_ACTIVITY_H =
ET_ORDERADM_I =
ET_ACTIVITY_I =
ET_PRODUCT_I =
ET_FINPROD_I =
ET_BATCH =
ET_CONFIG =
ET_STRUCT_I =
ET_SALES =
ET_PRICING =
ET_PRICING_I =
ET_ORGMAN =
ET_SHIPPING =
ET_CUSTOMER_H =
ET_CUSTOMER_I =
ET_SERVICE_H =
ET_SERVICE_I =
ET_SERVICE_ASSIGN =
ET_QUALIF =
ET_PAYPLAN =
ET_PAYPLAN_D =
ET_APPOINTMENT =
ET_TEXT =
ET_SCHEDLIN =
ET_PARTNER =
ET_SERVICE_OS =
ET_REFOBJ =
ET_SUBJECT =
ET_CUMULAT_H =
ET_STATUS = lt_status
ET_STATUS_H =
ET_SCHEDLIN_I =
ET_CANCEL =
ET_CANCEL_IR =
ET_CANCEL_CR =
ET_BILLPLAN =
ET_BILLING =
ET_ORDPRP_I =
ET_ORDPRP_I_D =
ET_ORDPRP_OBJL_I_D =
ET_CUMULATED_I =
ET_DOC_FLOW = lt_doc_flow
ET_EXCEPTION =
ET_PRIDOC =
ET_PRICE_AGREEMENTS_CRM =
ET_PRICE_AGREEMENTS_BBP =
ET_CONFIG_FILTER =
ET_SERVICEPLAN_I =
ET_SERVICEPLAN_IE =
ET_EXTENSION =
ET_CREDITVALUES =
ET_SURVEY =
ET_AC_ASSIGN =
CHANGING
CV_LOG_HANDLE = vc_LOG_HANDLE
EXCEPTIONS
DOCUMENT_NOT_FOUND = 1
ERROR_OCCURRED = 2
DOCUMENT_LOCKED = 3
NO_CHANGE_AUTHORITY = 4
NO_DISPLAY_AUTHORITY = 5
NO_CHANGE_ALLOWED = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at lt_doc_flow into wa_doc_flow.
*write :/ wa_doc_flow-objkey_b.
wah_header-GUID = wa_doc_flow-objkey_b.
was_status-ref_guid = wa_doc_flow-objkey_b.
wac = wa_doc_flow-objkey_b.
wa_save-guid = wa_doc_flow-objkey_b.
*was_status-ref_guid = wa_header_guid. "wa_doc_flow-objkey_b.
append wah_header to h_header.
endloop.
wahx_header-GUID = 'X'.
append wahx_header to hx_header.
*loop at lt_doc_flow into wa_doc_flow.
*was_status-ref_guid = wa_header_guid. "wa_doc_flow-objkey_b.
was_status-status = 'E0004'.
was_status-REF_HANDLE = vc_LOG_HANDLE.
append was_status to s_status.
*endloop.
wasx_status-ref_guid = 'X'.
wasx_status-status = 'X'.
wasx_status-REF_HANDLE = 'X'.
append wasx_status to sx_status.
CALL FUNCTION 'BAPI_ACTIVITYCRM_CHANGEMULTI'
TABLES
HEADER = h_header
HEADERX = hx_header
PARTNER =
PARTNERX =
ORGANISATION =
ORGANISATIONX =
DATE =
DATEX =
TEXT =
TEXTX =
REASON =
REASONX =
OUTCOME =
OUTCOMEX =
STATUS = s_status
STATUSX = sx_status
LOCATION =
LOCATIONX =
INPUT_FIELDS =
RETURN = return
DOCUMENT_FLOW =
JOURNAL =
JOURNALX =
MATERIAL =
MATERIALX =
EXTENSIONIN =
*append wa_save to lt_save.
**commit work.
CALL FUNCTION 'BAPI_ACTIVITYCRM_SAVE'
EXPORTING
UPDATE_TASK_LOCAL = 1
SAVE_FRAME_LOG = 0
IMPORTING
LOG_HANDLE =
TABLES
OBJECTS_TO_SAVE = lt_SAVE
SAVED_OBJECTS =
RETURN =
call function 'BAPI_TRANSACTION_COMMIT'
exporting wait = 'X'.
*CALL FUNCTION 'CRM_ORDER_REGISTER_SAVEGRP_OW'
EXPORTING
iv_master_guid = wac
iv_slave_guid = wac.
*write sy-subrc.
break-point.
Regrads,
Varun.
Similar Messages
-
Creation of Opportunity using standard BAPI
Hello,
I am using BAPI_OPPORTUNITY_CREATEMULTI for creating opportunity. It is generating GUID and Oject ID. But the data is not storing in data base table except GUID in CRMD_OPPORT_H table. And even it is not displaying all the data which is i am passing through flat file in t-code : 'CRMD_ORDER' .Hello Nizam,
I am also working on the same requirement.
I am able to create the Opportunity successful through the BAPI "BAPI_OPPORTUNITY_CREATEMULTI".
and it is also updating all the required fields.
But issue which i am facing is, I am able to see the opportunity in the GUI but not in the WEB UI.
Could you please help me on this?
Which parameter I need to set in order to Pass the opportunity on the WEB UI.
I would really appriciate if you share the code.
Thanks & Regards
Sachin -
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... -
Is it possible to get document NO. create by bapi BAPI_COPAACTUALS_POSTCOST
Hello experts,
in my ABAP program design, i want to trans data through the bapi:BAPI_COPAACTUALS_POSTCOSTDATA to trans data from a SCV file to the SAP CO-PA, the user want to see the error infor if the BAPI does'nt success, if the BAPI is success, we have to show the document Number created by the BAPI BAPI_COPAACTUALS_POSTCOSTDATA.
and the problem is :is it possible to see the Document Number if the BAPI is success?
I searched thr parameters of the BAPI ,but find no parameter to export the Document number created by the bapi,
how could i realise the requirement ?
do Ihave to realise it through the BDC?
hope to receive your response, and wish you have a good day!
Best regards!
Carl!Hi,
unfortunately, this BAPI does not return CO document number. If you need it then you need to write BDC for KE21.
Cheers -
HI experts In file business req I developed scenario like JDBC--XI--R/3(RFC).
In my scenario data is send to R/3 using BAPI(RFC) from XI using receiver RFC adapter.
So How Can I check whether data is saved or not in R/3 Database.
How we can see the BAPI list in R/3 as like WE05 for IDoc at R/3 system.
ThanksHI,
You could monitor the processing with XI Monitoring tools RWB (Runtime Workbench) & SXMB_MONI.
Here if you get the successful status then you cna check in SM58 if there is any error generated on XI side as well as on R/3 side.
This will give you the confirmation about successful execution of BAPI on R/3 side. If in case you get any message in SM58 it means there was some problem with BAPI while executing.
Even you can use rscrm_bapi > select a query to schedule > monitor for monitoring the BAPIs
Refer
Transaction for RSCRM_BAPI monitor
Thanks
Swarup -
Multiline BAPI return structure and RFC Adapter
Since SP14 RFC Adapter check return structure of RFC function.
But how it works if BAPI returns multiline BAPIRET2?
Will adapter loop all elements and perfom commit only if <b>all</b> alements don't have errors.I'am about this:
<i>As of SP 14 support for commit handling for single BAPI calls was added to the RfcAdapter receiver channel. If activated in the receiver channel setting, the received XI message will be executed as synchronous RFC (sRFC) in the receiving system. This is also true for asynchronous (QoS EO) XI messages to receive and analyze the execution result by the RfcAdapter.
The received response is parsed by the RfcAdapter to get the BAPI return parameter with name "RETURN". This return parameter can be of BAPIRETURN, BAPIRET1 or BAPIRET2 types. The "RETURN" parameter is checked for the response status (field TYPE) which can take following values:
1. 'S' : Success
2. 'I' : Information
3. 'W' : Warning
4. '' : Empty String
5. 'A' : Abort
6. 'E' : Error
If the response contains one amongst the first four response status then it implies that the BAPI was successful. If the response contains one amongst the last two response then the BAPI failed. If the BAPI "RETURN" parameter is of not of type ABAP structure rather of type ABAP table, a empty table is also considered as successful execution result.
In case of a successful execution the BAPI function module "BAPI_TRANSACTION_COMMIT" is called within the same context to trigger the commit of the BAPI. In case of a failure the BAPI function module "BAPI_TRANSACTION_ROLLBACK" is executed by RFC Adapter which rolls back the changes.</i> -
Hello guys,
I am using BAPI 'BAPI_LOAN_CONTRACT_CREATE' to create a loan. After passing all parameters when I execute BAPI, I get a loan number and it says loan created.
But when I use t.code FNV3 or so to view that loan, I get message loan does not exist.
I am able to create loan manually (TCode FNV1) but thru BAPI, loan number is generated but using TCode FNV2/FNV3 I cannot find that loan.
Module FI-CML.
Would be grateful if anyone can help me out.
Thank you,
Cheers,
JGHi Naga,
I will explain how to use the BAPI.
When you expand the function module BAPI_LOAN_CONTRACT_CREATE you will see the following-
CALL FUNCTION 'BAPI_LOAN_CONTRACT_CREATE'
EXPORTING
loan = wa_loan_header
conditionheader = wa_conditionheader
CORRESPONDENCE =
USERFIELDS =
TESTRUN = ' '
REFRESH = ' '
PROCESSEXTENSION = ' '
STEERING =
IMPORTING
loannumber = l_loanno
error =
TABLES
partner = it_partner
conditions = it_conditions
FORMULA =
OBJECTS =
COLLATERALS =
ENCUMBRANCES =
CLERKS =
EXTENSION_IN =
return = it_return .
The above is how I used it. You need to create work areas for loan header, condition header and internal table for partner and conditons.
Check what field are present in these work areas and fill those required by you.
Then you will be able to run the BAPI.
Remember to use CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' to finalize if bapi has run successfully.
When bapi runs properly you will get a loan number , if you do not get it then there is an error in your input parameters.
Hope this helps,
Cheers,
Jack -
Error M7019 BAPI_GOODSMVT_CREATE - Subcontracting process
Hi,
I am developing a subcontracting process and using the BAPI_GOODSMVT_CREATE to return the goods, but when I do the low inputs (mov 543) the BAPI returns the following message.
TYPE E
ID M7
NUMBER 19
MESSAGE Combination of movement type 543 and function selected not possible
LOG_NO
LOG_MSG_NO 0
MESSAGE_V1 543
MESSAGE_V2
MESSAGE_V3
MESSAGE_V4
PARAMETER GOODSMVT_ITEM
I'm using GOODSMVT_CODE = "07" (MB04).
When I run the same procedure via transaction MB04 I can create the document.
Has anyone experienced this? Would have any suggestions?
Thanks
Sandra AvilaHi,
Successfully execute the BAPI using the help of SAP
http://wiki.sdn.sap.com/wiki/display/ERPSCM/HowToGoodsMovementswith+BAPI#HowToGoodsMovementswithBAPI-MoreinformationonLINEIDandPARENTID
Thanks to all
Sandra Avila -
SAML Sender Vouches Assertion in ABAP only environment
All u2013 apologies for a length postu2026
subject: Standard logon - SAML Authentication (logon using SAML).
We are testing if an external app u2013 like Oralce (consumer), can render a web service via SAML assertion into an AS ABAP (provider) environment. Per OSS note 1254821, we have setup a trusted environment, and were able to successfully test a bapi function via Certificate Authentication (logon using a client certificate), one of the standard logons.
This test validates that the SOAP message can be processed through SAP, from the secured transport layer to decrypting and processing the SOAP message.
When we move to test the SAML assertion piece, we are not able to find the logon of u201CSAML Authenticationu201D via the standard logon through trnx SICF.
We nonetheless moved to test with all the available logon options without success:
1 Fields Authentication
2 SSO Authentication
3 Basic Authentication
4 SAP Authentication
5 Certificate Authentication (we deactivated the USEREXTIDu2019s DN user)
6 Service Authentication
While researching, we come across that there should be a u201CSAML Authenticationu201D standard logon option, yet this is not available in our test system.
Our system information is as follow:
SAP ECC 6.0
SAP_BASIS 700 SAPKB70017
SAP_ABA 700 SAPKA70017
We are testing in an ABAP stack environement.
We have crossed reference with note 1254821, and have satisfied all the requirements.
We expect the standard logon to contain the u201CSAML Authenticationu201D through SICF since we have configured the web service through SOAMANAGER using u201CSAML 1.1. Sender Vouches Assertionu201D.
Question:
Is u201CSAML Authenticationu201D standard logon necessary to facilitate the SAML sender vouches solution (we have only AS ABAP)?
If needed, what configuration, or support pack we need to be on.
Better yet, have anyone out there make it work? If so, please share.
Thanks much,
AlexHi Jens,
yes, it's keystore view TicketKeystore. The idea is that a logon ticket trust suffices to get the SAML 1.1 Sender Vouches trust as well.
The next thing you should take care of is to make sure that your SAP Portal system trusts the SAML issuer of your SAML assertion. This is to be configured in NetWeaver Administrator under Configuration Management Security > Trusted Systems. There you add the issuer string of your SAML Assertion into the Trusted Partners section.
Please follow paragraph "Configuring the Trusted Partners (Provider)" on this documentation link for details: http://help.sap.com/saphelp_nw73/helpdata/en/48/b264916b156ff4e10000000a42189b/frameset.htm
Another thing. Please see that for SOAP Web Services SAP (both AS ABAP and AS Java) for Sender-Vouches only SAML 1.1 is supported. Holder-of-key SAML assertions are supported with SAML 1.1 and SAML 2.0.
Regards,
Mathias -
Handling exception thrown by parseEscapedXML function
Hi,
I am using parseEscapedXML function to parse an xml string in the below format .
<parameters><item id="" value=""/><item id="" value=""/></parameters>
The exception thrown when input is in incorrect xml format is not caught using catchAll.
Kindly check if anyone have any idea about this.Hi,
Ideally your BAPI shouldn't raise exceptions - it is much better to use the RETURN table from your BAPI with any relevant messages - have a look at the majority of standard SAP BAPI's in transaction BAPI.
This way, the only exceptions your try... catch block needs to handle are those related to the actual calling of your BAPI, not it's functionality.
Also, if you can successfully run the BAPI in SE37 but it fails when called from your WD application, try using the FBGENDAT functionality to capture what data is being passed to SAP from your Web Dynpro application. All it takes is a simple mistake in setting up your contexts or logic and you won't be calling your BAPI correctly.
Hope this helps,
Gareth. -
RFC-Adapter, order not put in
Hi,
my scenario File -> XI -> R/3-Backend will be precessed successful. The Response Payload have the items and in detail of messages appears succes status
"RFC adapter received an asynchronous message. Attempting to send tRFC for BAPI_PO_CREATE with TID XIfr1OyAQS4Td..."
But in R/3 the order ísn't put on.
Does one of you have an idea why???????
Thanks
HüsniyeTry this code. This works perfectly for us:
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN = SALESDOCUMENTIN
ORDER_HEADER_IN = ORDER_HEADER_IN
ORDER_HEADER_INX = ORDER_HEADER_INX
SENDER = SENDER
BINARY_RELATIONSHIPTYPE = BINARY_RELATIONSHIPTYPE
INT_NUMBER_ASSIGNMENT = INT_NUMBER_ASSIGNMENT
BEHAVE_WHEN_ERROR = BEHAVE_WHEN_ERROR
LOGIC_SWITCH = LOGIC_SWITCH
TESTRUN = TESTRUN
CONVERT = CONVERT
IMPORTING
SALESDOCUMENT = SALESDOCUMENT
TABLES
RETURN = RETURN
ORDER_ITEMS_IN = ORDER_ITEMS_IN
ORDER_ITEMS_INX = ORDER_ITEMS_INX
ORDER_PARTNERS = ORDER_PARTNERS
ORDER_SCHEDULES_IN = ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX = ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN = ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX = ORDER_CONDITIONS_INX
ORDER_CFGS_REF = ORDER_CFGS_REF
ORDER_CFGS_INST = ORDER_CFGS_INST
ORDER_CFGS_PART_OF = ORDER_CFGS_PART_OF
ORDER_CFGS_VALUE = ORDER_CFGS_VALUE
ORDER_CFGS_BLOB = ORDER_CFGS_BLOB
ORDER_CFGS_VK = ORDER_CFGS_VK
ORDER_CFGS_REFINST = ORDER_CFGS_REFINST
ORDER_CCARD = ORDER_CCARD
ORDER_TEXT = ORDER_TEXT
ORDER_KEYS = ORDER_KEYS
EXTENSIONIN = EXTENSIONIN
PARTNERADDRESSES = PARTNERADDRESSES
**checking if the BAPI returned some errors*****
LOOP AT return ASSIGNING <bapiret>.
IF <bapiret>-type = 'E' OR <bapiret>-type = 'A'.
success = space.
EXIT.
ENDIF.
ENDLOOP.
IF success = 'X'.
****in case of success commit the BAPI*********
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = wa_bapiret.
ELSE.
ROLLBACK WORK.
ENDIF.
Also you need to pass on the information for "inx" structures. What I mean is , if you are sending data to field REF_1 in header_in, then ref_1 in header_inx needs to be passed witha value of 'X'.
The update flag in inx structure needs to be 'C' for create.
If have items in your sales order, then you have to pass the values for item_in and item_inx. Additionally you need to pass values for schedule lines also.
Hope this helps.
Thanks,
Bhaskar -
RFC error communication exception
Hi all,
My scenario is Jdbc -- XI -- RFC(Z_BAPISALESORDER with two BAPI's 1.BAPI_SALESORDER_CREATEFROMDAT 2.BAPI_TRANSACTION COMMIT).
I am using RFC reciever adapter.While configuring the RFC adapter I have two options.
1.SAP system 2.External RFC server
If i select SAP system , I did not get any errors.It is showing successful message in SXMB_MONI and also in RWB. But Sales order is not created.
Message in RWB ...
.>RFC adapter received an asynchronous message. Attempting to send tRFC for Z_SALESORDERCREATEFROMDAT_XI with TID XIWVaSqBlY4TccBW0GtFmRhW
.>The message status set to DLVD.
.>The message was successfully delivered to the application using connection AFW.
But If i use External RFC system, I am getting excepion.In RWB it is showing following excetion.
...>Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CPIC-CALL: CMRCV LOCATION CPIC (TCP/IP) on host sapx
...>Delivery of the message to the application using connection AFW failed, due to: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CPIC-CALL: CMRCV LOCATION CPIC (TCP/IP) on host sapx.
which option is used for calling the BAPI to create the sales order?
Could anybody help me out...?
Thanks,
sekhar.Try this code. This works perfectly for us:
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN = SALESDOCUMENTIN
ORDER_HEADER_IN = ORDER_HEADER_IN
ORDER_HEADER_INX = ORDER_HEADER_INX
SENDER = SENDER
BINARY_RELATIONSHIPTYPE = BINARY_RELATIONSHIPTYPE
INT_NUMBER_ASSIGNMENT = INT_NUMBER_ASSIGNMENT
BEHAVE_WHEN_ERROR = BEHAVE_WHEN_ERROR
LOGIC_SWITCH = LOGIC_SWITCH
TESTRUN = TESTRUN
CONVERT = CONVERT
IMPORTING
SALESDOCUMENT = SALESDOCUMENT
TABLES
RETURN = RETURN
ORDER_ITEMS_IN = ORDER_ITEMS_IN
ORDER_ITEMS_INX = ORDER_ITEMS_INX
ORDER_PARTNERS = ORDER_PARTNERS
ORDER_SCHEDULES_IN = ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX = ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN = ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX = ORDER_CONDITIONS_INX
ORDER_CFGS_REF = ORDER_CFGS_REF
ORDER_CFGS_INST = ORDER_CFGS_INST
ORDER_CFGS_PART_OF = ORDER_CFGS_PART_OF
ORDER_CFGS_VALUE = ORDER_CFGS_VALUE
ORDER_CFGS_BLOB = ORDER_CFGS_BLOB
ORDER_CFGS_VK = ORDER_CFGS_VK
ORDER_CFGS_REFINST = ORDER_CFGS_REFINST
ORDER_CCARD = ORDER_CCARD
ORDER_TEXT = ORDER_TEXT
ORDER_KEYS = ORDER_KEYS
EXTENSIONIN = EXTENSIONIN
PARTNERADDRESSES = PARTNERADDRESSES
**checking if the BAPI returned some errors*****
LOOP AT return ASSIGNING <bapiret>.
IF <bapiret>-type = 'E' OR <bapiret>-type = 'A'.
success = space.
EXIT.
ENDIF.
ENDLOOP.
IF success = 'X'.
****in case of success commit the BAPI*********
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = wa_bapiret.
ELSE.
ROLLBACK WORK.
ENDIF.
Also you need to pass on the information for "inx" structures. What I mean is , if you are sending data to field REF_1 in header_in, then ref_1 in header_inx needs to be passed witha value of 'X'.
The update flag in inx structure needs to be 'C' for create.
If have items in your sales order, then you have to pass the values for item_in and item_inx. Additionally you need to pass values for schedule lines also.
Hope this helps.
Thanks,
Bhaskar -
I am using this BAPI to return a list of PM work order operations from SAP using a JRA connector. I have had good success with the BAPI so far, but have noticed a problem with the DURATION_NORMAL_UNIT returned by the BAPI. If the duration unit is set to "DAY" for an operation in SAP, the BAPI returns the text "TAG" instead of "DAY" in its return table. If the duration unit is set to "D" in SAP, the BAPI returns the text "10" instead of "D" in it's return table.
Anyone have thoughts on a potential cause for this behavior?Hi John,
Just a couple of more things.
Are you in the workbench for the testing or in a webpage. In either case, what is the locale (language) for both the NW/MII ID and if in the webpage, what is the language set to? Depending upon your set up, check to see if you have UME Locale selected (it is in Display Templates for sure).
What is the default language of the user ID used to connect to ECC? Can you change it and see if that affects the results? It really looks like you are using English versions as inputs and they are being interpreted (or converted) to Deutsch terms. You may want to look at the equivalent localization tables in ECC.
And what version of MII and NW are you running?
Regards,
Mike
Edited by: Michael Appleby on Mar 2, 2011 3:25 PM -
Bapi_Po_Create1_Input
Hi,
I am having a problem using Bapi_Po_Create1_Input from a Web Dynpro Application. I have the Cardinality of the Context Node set as 0..n and the selection as 0..1 with initialize lead selection as true.
So far I have not been able to successfully use the BAPI to create a Purchase Order. Here is the execute method for example:
public void executeBapi_Po_Create1_Input( )
/@@begin executeBapi_Po_Create1_Input()
try {
wdContext.currentBapi_Po_Create1_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (Exception e) {
msgMgr.reportException(e.getMessage(), false);
No exception is thrown, but the message from the BAPI is that it can not create a Purchase Order. I have tested the SAP Backend ability to create a PO via transaction ME21N and am able to created a Purchase Order. Any input or ideas about what could be wrong? Thanks for your help..I have a similar problem.
I am using BAPI_PO_CREATE1 to create purchase order.
I am getting an error that reads - No instance of object type PurchaseOrder has been created. External referen
I am using the following data to create a PO - do you see any attribute missing that may be causing the error.
//Header
poHeader.setDoc_Type("NB");
poHeader.setPurch_Org("XYZ");
poHeader.setVendor("610100");
poHeader.setComp_Code("PQR");
poHeader.setPur_Group("TN4");
poHeaderX.setDoc_Type(false);
poHeaderX.setPurch_Org(false);
poHeaderX.setVendor(false);
poHeaderX.setComp_Code(false);
poHeaderX.setPur_Group(false);
//Schedules
poItemSchedules.setQuantity(new BigDecimal(100));
poItemSchedules.setPo_Item("00001");
poItemSchedules.setSched_Line("0001");
poItemSchedules.setDelivery_Date("12/29/2007");
poItemSchedules.setDel_Datcat_Ext("1");
poItemScheduleX.setQuantity(false);
poItemScheduleX.setPo_Item("00001");
poItemScheduleX.setPo_Itemx(false);
poItemScheduleX.setSched_Line("0001");
poItemScheduleX.setSched_Linex(false);
poItemScheduleX.setDelivery_Date(false);
poItemScheduleX.setDel_Datcat_Ext(false);
//Line Items:
poItems.setTax_Code("I0");
poItems.setNet_Price(new BigDecimal(100.99));
poItems.setShort_Text("Test Description");
poItems.setMatl_Group("PI08");
poItems.setPlant("TOM");
poItems.setPo_Item("00001");
poItems.setAcctasscat("K");
poItems.setPrice_Unit(new BigDecimal(100));
poItems.setMaterial(String.valueOf(0));
poItems.setOver_Dlv_Tol(new BigDecimal(0));
poItems.setUnder_Dlv_Tol(new BigDecimal(0));
poItems.setGr_Ind(true);
poItems.setIr_Ind(true);
poItems.setGr_Basediv(true);
poItemX.setTax_Code(false);
poItemX.setNet_Price(false);
poItemX.setShort_Text(false);
poItemX.setMatl_Group(false);
poItemX.setPlant(false);
poItemX.setPo_Item("00001");
poItemX.setAcctasscat(false);
poItemX.setPrice_Unit(false);
poItemX.setOver_Dlv_Tol(false);
poItemX.setUnder_Dlv_Tol(false);
poItemX.setGr_Ind(false);
poItemX.setIr_Ind(false);
poItemX.setGr_Basediv(false);
poItemX.setDistrib(false);
poItemX.setStge_Loc(false);
poItemX.setItem_Cat(false);
//Account Assignments
itemAcctAssC.setPo_Item("00001");
itemAcctAssC.setSerial_No("01");
itemAcctAssC.setQuantity(new BigDecimal(2));
itemAcctAssC.setCostcenter("12345");
itemAcctAssC.setGl_Account("678901");
itemAcctAssC.setCo_Area("TRUY");
itemAcctAssCX.setPo_Item("00001");
itemAcctAssCX.setSerial_No("01");
itemAcctAssCX.setQuantity(false);
itemAcctAssCX.setCostcenter(false);
itemAcctAssCX.setGl_Account(false);
itemAcctAssCX.setCo_Area(false);
Thanks -
Reg BAPI_SHIPMENT_CREATE
Hi All!,
I know dat these two need to be filled to create shippment.
TRANS_PLANT_PT
SHIPMENT_TYPE are mandatory to create shipment.But I even need to populate service_agent in STAGEDATA.Can any one help me out in providing required parameters to successfully run this bapi (BAPI_SHIPMENT_CREATE) in such a case?
Thanking u in Advance,
Regards,
ChandanaKick me please.
Maybe you are looking for
-
Re: Search Help for Standard field in a Standard Component
Dear Experts i enhanced a standard screen with one inputfield and mapped a context attribute(The attribute is also standard one which doesnot have search help) my requirement is to assign a search help to the context attribute so that at runtime the
-
Pop up asked me to download latest version, now disabled?
A window popped up asking to download the latest version of firefox. Usually say no, not having time, but this time said yes. Operating system is Mac OS X 10.5.8 with 512 MB, which is recommended. However, got to the drag and drop into Apps part of t
-
Trouble opening downloaded applications
Well the problem that I am having is that whenever I download an application and try to get it to open it doesn't work. I know that it has to do with the fact that the recommended application that it is supposed to open with has been changed to iTune
-
My iPod nano disconnect when I start itune in windows 8.1
When I connect my Ipod to windows it work fine but when I start my Itune it disconnect from windows I don't know why I follow the troubleshooting in apple website but still I have the same problem,this happen just when I update to the latest version
-
can anyone suggest plug-in, or other suggestion for expanded choics of album templates ?