12-19-2013 11:24 AM
Hello All ,
I need to implement a check while creating MIGO.
While doing MIGO at header level there is a Excise Invoice tab , this TAB appears if we check Item OK check box and also the Material is Excisable.
Now my company's MM consultant want a check to implemented such that whenever user enters a value for Excise Invoice the system should check whether Chapter ID has been maintained for that Material or not.
I had check all MIGO related BADIs like MB_DOCUMENT_BADI , MB_CHECK_LINE_BADI but no use , reason being Excise Updation is carried out separately using FM J_1IEXGM_UPDATE_EXCISE.
So I tried to Implicitly Enhance the FM but it shows DUMP reason being its an UPDATE TASK FM.
Also tried to Implicitly Enhance the Tab Screen Excise Invoice's PAI ( SAPLJ1IEXGM , LJ1IEXGMPAI. ) but can't find any point to write my code.
12-19-2013 12:43 PM
Hi,
Include : LJ1IEXGMPAI
You can implement the implicit enhancement here and validate the code !
observe the validations in the form and do same to idnetify the chapter ID for excise invoice.
Example.
CALL FUNCTION 'ENQUEUE_EJ_1IEX'
EXPORTING
mode_j_1iexchdr = 'E'
mode_j_1iexcdtl = 'E'
mandt = sy-mandt
trntyp = gs_exhead-trntyp
docyr = gs_exhead-docyr
docno = gs_exhead-docno.
12-19-2013 12:03 PM
Have you checked BADI "MB_MIGO_BADI"? Please go through its documentation and see if it helps.
Regards
12-19-2013 12:13 PM
Very Thanks netweaver developer for your prompt reply ,
Sorry for not mentioning that ,
Yeah I had tried that BADI as well.
Problem is that Excise Updation is carried out separately using FM J_1IEXGM_UPDATE_EXCISE , where it updates all the Excise registers and it has nothing to do with MIGO updation , that's the reason we are not able to get Excise details in these MIGO related BADI's.
Got 2-3 points where Data from Excise Invoice tab is transferred to this FM , but was not able to find a point where I can place my code. ( Implicit Enhancement spot )
12-19-2013 12:23 PM
Hi Sijin
Can you please provide us what is the screen number on which this field is there and program name. I would have searched in PAI for some implicit enhacnement
Nabheet
12-19-2013 12:30 PM
Hi Nabheet,
just checking, please find the details below.
Rg, Kiran
12-19-2013 12:36 PM
Very thanks for your reply ,
I have already mentioned that Screen
SAPLJ1IEXGM ,
And the Screen Number is 0211
Inside this there is include code LJ1IEXGMPAI which is for PAI.
Wasted all my day debugging , to find an appropriate place where I can fit my code.
Hoping for a valuable suggestion .
12-19-2013 12:32 PM
Hi,
Please check the following 2 EXIT FM they are with CIN 2.0
J_1I7_MIGO_SAVE
J_1I7_MIGO_DEFAULT
Exception handling is not there, bu try it should work.
Regards
12-19-2013 12:39 PM
12-19-2013 1:17 PM
Hello Yakub ,
At first sight I thought FM J_1I7_MIGO_SAVE would do.
But there is an issue .
In table CT_PART1 we can get Excise Register updation data ( Material Code , Movement type etc )
But Plant is not there.
And in CT_EXCDTL table I am getting the Excise Invoice entered.
So only the Plant is the main concern here , and its the main thing.
Actually what I need to check is that whether Chapter ID has been maintained for the material or not .
Chapter ID is maintained using MATNR - WERKS combination using J1ID tcode.
Your answer was almost close
12-19-2013 1:19 PM
NO ,
Its there in CT_EXCDTL !!
Is it advisable to write a error message in this FM ?
12-19-2013 1:38 PM
Am getting the same DUMP which I got when I enhanced J_1IEXGM_UPDATE_EXCISE for doing this purpose .
12-19-2013 2:24 PM
Hello Yakub ,
In FM J_1I7_MIGO_DEFAULT ,
there is an internal table CT_EXITEM where I am getting all data except the Excise Number which I am providing as input.
But while debugging I found that while doing MIGO for Excisable goods only this FM triggers which was my concern ( my code should not interrupt MIGO for non excisable goods ) and for the same only I was checking the condition Excise Invoice IS NOT INITIAL .
Test case is giving me positive results will discuss the same with Function Guy tomm and reply.
Very thanks for this suggestion Yakub
12-20-2013 5:08 AM
Hello Yakub ,
J_1I7_MIGO_DEFAULT is not providing me with the Excise Number provided by User and its also not showing Excise Action .
MM Guy wants the check to be restricted based on this value also
12-20-2013 5:44 AM
Hi Sijin
Can you please put a break point in J_1IEXGM_BADI_STATUSANDHEADER function module and check whether you have all values available here..? If yes you can implement your logic here i believe.
Jus an addtional info the function module is getting called via BADI MB_MIGO_BADI implementation CIN_PLUG_IN_TO_MIGO
Nabheet
12-19-2013 12:43 PM
Hi,
Include : LJ1IEXGMPAI
You can implement the implicit enhancement here and validate the code !
observe the validations in the form and do same to idnetify the chapter ID for excise invoice.
Example.
CALL FUNCTION 'ENQUEUE_EJ_1IEX'
EXPORTING
mode_j_1iexchdr = 'E'
mode_j_1iexcdtl = 'E'
mandt = sy-mandt
trntyp = gs_exhead-trntyp
docyr = gs_exhead-docyr
docno = gs_exhead-docno.
12-19-2013 1:00 PM
Yeah kiran ,
From this point I can get Excise Num from structure GS_EXHEAD , but I can't access MIGO line item details here .
For this I need to use EXPORT IMPORT MEM id technique.
EXPORT it to MEM ID .
and later write my code in any of the MIGO Badi .
I was looking for a point where I can get both Excise num and Material Doc line items at the same point.
Anyways will try to workout and reply you.
12-19-2013 1:07 PM
I believe you will have to use import export only and then proceed since i donot find any gloabl data here.
Nabheet
12-19-2013 1:45 PM
Yeah nabheet ,
Things are making me conclude the same ,
But still I believe that there may be a point somewhat like that Yakub suggested and J_1IEXGM_UPDATE_EXCISE where we can evaluate Excise Register Entries before they are posted into registers like RGPart 1.
Enhancement in this FM are giving dumps while execution.
12-20-2013 6:41 AM
AT LAST .
I am sticking with the IMPORT EXPORT technique.
Am EXPORTING Excise number from INCLUDE LJ1IEXGMPAI .
And Later IMPORTING it to MB_CHECK_LINE_BADI's method CHECK_LINE.
And placed my code there.
Very thanks for all of yours contributions and time.
Your support really helped me to think from different angles .
12-20-2013 6:50 AM
Good to know that, I also stop the checking right place for validation
Rg, Kiran
12-20-2013 7:26 AM
Actually ,
As I have mentioned in my question itself , I started exploring with PAI include pgm LJ1IEXGMPAI ( must say a very big code for such a small sub screen ) itself.
But I gave up with the first two Implicit Enhancement Option Points , you pointed out the 4th one which worked.