Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Chapter ID check while doing MIGO

Sijin_Chandran
Active Contributor
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

20 REPLIES 20

former_member188827
Active Contributor
0 Kudos

Have you checked BADI "MB_MIGO_BADI"? Please go through its documentation and see if it helps.

Regards

0 Kudos

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 )

0 Kudos

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

0 Kudos

Hi Nabheet,

just checking, please find the details below.

Rg, Kiran

0 Kudos

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 .



Former Member
0 Kudos

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

0 Kudos

These seems something different.

Will try and let you know ASAP.

0 Kudos

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

0 Kudos

NO ,

Its there in CT_EXCDTL !!

Is it advisable to write a error message in this FM ?

0 Kudos

Am getting the same DUMP which I got when I enhanced J_1IEXGM_UPDATE_EXCISE for doing this purpose .

0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

I believe you will have to use import export only and then proceed since i donot find any gloabl data here.

Nabheet

0 Kudos

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.

0 Kudos

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 .

0 Kudos

Good to know that, I also stop the checking right place for validation

Rg, Kiran

0 Kudos

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.