Skip to Content
Author's profile photo Former Member

Material to be Update in J_2IRG1BAL Automatically Development using J1ID Transaction using Enhancement framework.

Material to be Update in J_2IRG1BAL Automatically Development using J1ID Transaction using Enhancement framework.

By Sagar Dev

PURPOSE:

When we declare Material in J1ID Transaction as RG1 Material then we have to update this material in Table J_2IRG1BAL manually.

So we have developed one program when we update material in J1ID transaction as RG1 Material program will automatically update that material in table J_2IRG1BAL in the background.

Step by step Solution: 

Find the enhancement point in the include ‘LJ1I5O02’.

Go to transaction “SE38”.

  

  1. To find the enhancement point, go to Program –>  Enhance (Or)

      Click on the “Enhance” .

  1. Go to Edit –> Enhancement Operations –> Show Implicit Enhancement Options.  

Now, we will observe commas like below. 

  1. Go to Implicit enhancement option at the beginning of the form ‘CHECK_DOCUMENT_TYPE’ and Right click –> Enhancement Implementation –> Create.

Now it will ask for Enhancement Type. 

ZJ1ID_J_2IRG1BAL

Description

And ok

We have to implement the code and it will looks like this. 

ENHANCEMENT ZJ1ID_J_2IRG1BAL.    “active version

  1. ENDENHANCEMENT.

Here you can write the custom code for modifying the functionality. 

ENHANCEMENT ZJ1ID_J_2IRG1BAL.    “active version
DATA: lv_exgrp TYPE j_1iexgrpsj_1iexcgrp,
lv_rgbal
TYPE j_2irg1bal,
wa      
TYPE j_2irg1bal.

CLEAR: wa,lv_exgrp,lv_rgbal.

IF fcode EQ ‘EDIT’ AND view_action = ‘U’ AND view_name EQ ‘J_1IMTCHID’.
“For Exices Group.
SELECT SINGLE j_1iexcgrp FROM j_1iexgrps CLIENT SPECIFIED INTO lv_exgrp
WHERE mandt     EQ symandt
AND j_1iwerks EQ j_1imtchidwerks.
“Here we are cheking that record is present in j_2irg1bal table or not.
SELECT SINGLE * FROM j_2irg1bal CLIENT SPECIFIED INTO lv_rgbal
WHERE mandt EQ symandt
AND exgrp EQ lv_exgrp
AND matnr EQ j_1imtchidmatnr
AND werks EQ j_1imtchidwerks.
CASE j_1imtchidj_1icapind.
WHEN ‘F’.
“if Record is Not presented in j_2irg1bal table then append it into j_2irg1bal table.
IF lv_rgbal IS INITIAL.
“Here we insert that record in j_2irg1bal table.
wa
mandt  = symandt.
wa
exgrp  = lv_exgrp.
wa
datum  = sydatum.
wa
matnr  = j_1imtchidmatnr.
wa
form   = ‘P’.
wa
werks  = j_1imtchidwerks.
INSERT INTO j_2irg1bal VALUES wa.
ENDIF.
WHEN OTHERS.
“If Record is exits in j_2irg1bal table then delete it because it is not releavet for RG1 Register
IF NOT lv_rgbal IS INITIAL.
“Here we Delete that record from j_2irg1bal table.
DELETE j_2irg1bal FROM lv_rgbal.
ENDIF.
ENDCASE.
ENDIF.
ENDENHANCEMENT.

Activate the code and enhancement.

Output:

Check in Go to Transaction ‘J1ID’ .

Select Material and Chapter-ID Combination and Click On .

Click on .

Put on the Material No, Plant, Chapter ID and Select Material Type Only ‘RG1’.

Please Check Table ‘J_2IRG1BAL’.

Thanks & Regards,

Sagar Dev

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Sagar,

      Thank's for your valuable information.

      Regards,

      S.Himavanth.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Himavanth,

      Welcome.....

      Regards,

      Sagar Dev.

      Author's profile photo Former Member
      Former Member

      Thanks for sharing this information!!!

      Author's profile photo Former Member
      Former Member

      Hi Shiv Lyer,

      Welcome.....

      Regards,

      Sagar Dev.

      Author's profile photo Former Member
      Former Member

      Its really a good document.

      Author's profile photo Former Member
      Former Member

      Hi Priyaranjan,

      Thanks....

      Regards,

      Sagar dev.