07-25-2007 10:44 AM
Hi frnds,
I m facing problem while calling bapi BAPI_GOODSMVT_CREATE in my badi , i m passing all the required parameter, and after that perform commit operation,
but it is giving error message as follows,
The function module MB_CREATE_GOODS_MOVEMENT is called up for the
second time. After it was called up the first time, the function
module MB_POST_GOODS_MOVEMENT was called, but a COMMIT WORK was not
carried out in the calling program.
As running the two function modules again would result in the
database being incorrectly updated, processing is terminated.
System Response Procedure Please ensure that a COMMIT WORK is set
after you call up the function module MB_POST_GOODS_MOVEMENT.
Thanks and Regards,
Mahesh.
07-25-2007 10:48 AM
Hi,
iF you are working for IS-OIL Reqirement there is no BAPI will work as per OSS note 607156.
Please go thru
17.02.2007 Page 1 of 4
SAP Note Number 607156
Goods movements in IS OIL: MB_CREATE_GOODS_MOVEMENT
Note Language: English Version: 3 Validity: Valid from 23.01.2006
Summary
Symptom
*******
WARNING: This is an IS-OIL / IS-MINE-specific note. If you DON'T *
have IS-OIL / IS-MINE installed on your system, this note does *
not apply to you. If this note is applied and you do not have *
IS-OIL / IS-MINE installed, you could cause serious damage to *
your system. *
*******
This note provides information on how function module
MB_CREATE_GOODS_MOVEMENT is used in IS-Oil systems in conjunction with
IS-Oil materials (that is, those materials that carry a UoM group in the
oil-specific view in the material master data, MARA-CMETH = 1 or 2).
A ) In general, in the case of goods movements for IS-Oil materials, the
additional quantities for these materials must be posted in parallel for
every goods movement. The additional stock levels must also be updated
using these quantity values.
There are two possible ways to do this:
a) The additional quantities and parameters are passed to
function module MB_CREATE_GOODS_MOVEMENT through the following IS-Oil
specific table parameters:
T_MS1INT STRUCTURE MSEGO1 OPTIONAL
T_MS2INT STRUCTURE MSEGO2 OPTIONAL
b) The additional quantities are CALCULATED and posted through function
module
MB_CREATE_GOODS_MOVEMENT and processed using the default parameters
that are determined for each line item that contains an IS-Oil material.
In general, SAP does NOT support the second way (b) for calling function
module MB_CREATE_GOODS_MOVEMENT. In the past there have been some
exceptions to this to ensure seamless integration of important
business processes used in the oil & gas industry.
With 4.6C Service Pack 2, these exceptions are delivered as entries
in an SAP table:
Table TOIBCALC_INTRN is delivered with 8 entries that enable
posting of IS-Oil material movements through function module
MB_CREATE_GOODS_MOVEMENT, without passing the additional quantities
(and parameters) through the interface of MB_CREATE_GOODS_MOVEMENT.
The entries delivered with table TOIBCALC_INTRN are:
PROG1 EVENT1 PROG2 EVENT2
RM06ELLB POST_GOODS_ISSUE RM06ELLB ATUSER-COMMAND
SAPLCOCI COCI_CONFIRM_MATERIAL_CONS
SAPLCOCI COCI_CONFIRM_MATERIAL_PROD
SAPLCOFW CO_FW_GOODS_MOVEMENTS_BY_AFFW
17.02.2007 Page 2 of 4
SAP Note Number 607156
Goods movements in IS OIL: MB_CREATE_GOODS_MOVEMENT
SAPLCORF CO_RU_GOODS_MOVEMENT
SAPLWPUE POS_SALES_DOCUMENT_PROCESS
SAPLWPUE POS_SALES_TURNOVER_PROCESS
SAPMQEVA BUCHE_BESTAENDE
NOCALC BLTIME_SET
D X
D X
D X
D X
D X
X X
X X
D X
The call stack of a calling program is analyzed (PROG1, EVENT1, PROG2,
EVENT2) and if it is found in the table as a valid entry, the
additional quantities are calculated, either in the background
(NOCALC = X) or whereby the classic dialog box appears on the screen
(NOCALC = D). The posting time is either left unchanged
(BLTIME_SET = INITIAL) or determined based on the logic that can be
found in include OI_LMBWLFOI_HPM (BLTIME_SET = X).
B) SAP core BAPI using function module MB_CREATE_GOODS_MOVEMENT:
SAP has - so far - not enhanced all core BAPIs to enable the processing
of additional industry solution specific (IS-OIL) data fields.
(see SAP Note 365386 for important details).
However, due to the fact that some core BAPIs use function module
MB_CREATE_GOODS_MOVEMENT from different calling applilcations, the
customer may observe that with one BAPI, postings for IS-Oil materials
are possible, yet with another BAPI, the postings are rejected.
Example:
You can execute the BAPI BAPI_PRODORDCONF_CREATE_HDR using an IS-Oil
material but not BAPI BAPI_GOODSMVT_CREATE.
Since BAPI BAPI_PRODORDCONF_CREATE_HDR calls function module
CO_RU_GOODS_MOVEMENT, which is contained in table TOIBCALC_INTRN,
the posting is based on the default data and additional quantities
are calculated. In this case, you have to set the conversion mode to
'Background', otherwise a 'Dynpro not found' error causes a short dump
(because the entry MOCALC is set to 'D' for dialog).
As a result of this, the system has been designed to run as it does. In
general, customers are advised to proceed as outlined in SAP Note 365386.
On a case by case basis, customers can use table TOIBCALC_INTRN
and either remove, change, or add entries to achieve consistent
system behavior.
17.02.2007 Page 3 of 4
SAP Note Number 607156
Goods movements in IS OIL: MB_CREATE_GOODS_MOVEMENT
With note 736980, the announcement of a new BAPI GoodsMovementOil is made, and
new BAPI methods are delivered which enable goods movement postings for IS-OIL
materials.
More Terms
o General keywords: add-on, IS-Oil, industry solution,...
o Problem-specific key words: BAPI, HPM, QCI, additional quantities
Cause and Prerequisites
.
Solution
Although it is possible to post goods movements for IS-Oil materials (as
above), SAP does not currently support any core
BAPIs for posting goods movements with IS-Oil materials.
Calculating additional quantities in the background is not seen as a
a general solution.
On a case by case basis, customers can use table TOIBCALC_INTRN
and either remove, change, or add entries to achieve consistent
system behavior.
Header Data
Release Status: Released for Customer
Released on: 23.01.2006 13:26:07
Priority: Recommendations/additional info
Category: Consulting
Main Component IS-OIL-DS-HPM Hydrocarbon Product Management
Valid Releases
Software Component Release From
Release
To Release and
Subsequent
IS-OIL 46C 46C 46C
IS-OIL 472 472 472
Related Notes
17.02.2007 Page 4 of 4
SAP Note Number 607156
Goods movements in IS OIL: MB_CREATE_GOODS_MOVEMENT
Number Short Text
870106 IS-OIL TDP LI21 postings from WM to MM
736980 Enhancement of BAPI GoodsMovement for IS OIL
546569 FAQ : HPM - Hydrocarbon Product Management
<b>Reward points</b>
Regards
07-25-2007 11:01 AM
Hi Kiran,
Thanks for reply but i m not getting u, i ll clear u my requirement ,
First i ll clear u my requirement, in MIGO transaction when user clik on save button, I want to call T-code MB1B for scrap entry for this, I m using BAdI MB_DOCUMENT_BADI and method MB_DOCUMENT_BEFORE_UPDATE, and calling the bapi BAPI_GOODSMVT_CREATE.
mahesh.
07-25-2007 11:05 AM
Hi mahesh,
Which area your working is this <b>IS-OIL</b>/SD?Consult your <b>BA</b>(Bussiness Analyst) and ask what mateial you are using..
<b>IS-Oil</b> stands for Industruail Solution for Oil and Gas Industry, IS-Oil is the core business solution for Oil and Gas industry provided by SAP.
IS-Oil component enables you to map all business processes required in the petroleum trade. The component comprises the purchase, storage, transportation, and sale of fuels, lubricants, and bottled gas.
The component contains the following functional areas:
● Telephone sales
● Scheduling
● Data collation
● Interfaces
● Liquefied petroleum gas
● Internal stock monitoring
Regards
07-25-2007 12:07 PM
Hi Kiran,
The situation is not like that, when i m calling same bapi from zreport its working fine , but when i m calling in badi it gives said dump.
please reply.
07-26-2007 4:32 AM
Hi Frnds,
I m waiting ........................
please reply.
Regards,
mahesh.
07-26-2007 7:33 AM
Hi Mahesh,
You can't directly call BAPI FM 'BAPI_GOODSMVT_CREATE' inside the BADI 'MB_DOCUMENT_BADI'. Because this function module will again trigger the BADI when it is saving, so it will go in a Loop. And it will cause update termination.
To avoid this in BADI you write a code for creating a job and inside that perform a BAPI FM call. so it will be separated from main transaction.
Create a report with BAPI FM call and schedule a job for that report in BADI by passing the necessary details. so it won't go in a loop.
Thanks
Rajkumar Abbu.