Skip to Content
Author's profile photo Former Member

Post GR with IDOC with CIN

Background :Standard SAP does not offer a solution for posting GR with CIN through EDI message.

Message type MBGMCR is used to Post GR. However SAP provides CIN Plugin BADI if you can call it at right spot in IDOC FM then you can achive the business requirement. Which of course needs lot of analysis to identify the right method and to put it at right SPOT.

We have not used CIN Plugins for our solution due to time and cost constraint.

IDOC structure needs to be enhanced to have excise date and excise number fields well thats the easy part of this solution 🙂

Business  Scenario

A) Import Purchase : Purchase order will be created for foreign vendor then custom Invoice will be created against PO for paying duty to customs department

Good receipt will come from legacy system SAP or Non SAP system through Interface.

B) Domestic Purchase: Schedule agreement or Purchase order will be created for local purchase with correct tax code so that duties will flow in PO from TAXINN


Domestic Flow:

A) Post Good receipt with MBGMCR

B) Capture excise IV

C) Update RG23A Part 1

D) Post Excise Invoice.

Idoc structure is enhanced to have Excise Invoice number and Excise Invoice date field also E Sugam number field is added in the Idoc.

Message type MBGMCR is used to received GR data.

We will post good receipt using MBGMCR message type aligned to Z process code which points to our Z function module but standard function module can be used here with slight code change to handle E Sugam number.

Capture Excise IV

SAP provides an option of capturing excise IV with reference to GRN document number in tcode J1IEX. But this works only for the Domestic flow and not for Import flow.

We need to create a Z program which will call LSMW recording in background wherein we are going to pass the excise Invoice number and excise Invoice date along with the GRN number. Background Job can be scheduled to run this program in backend.

This program is going to read the Idoc for which GRN is posted in the system and for those GRN you do not find any excise IV created in system( also not cancelled)

So here you need to use IDOC table the status record can hold the GRN number along with excise IV and Date in the parameter field.

Basically we are fetching the GRN , excise IV and date from IDOC itself and then we are checking the status of the excise IV is it cancelled , is it created or is it posted etc.

Update RG23APART 1

SAP provides standard tcode J1I5 for this activity you can schedule the job for that tcode in batch mode.

Post Excise Invoice

Again a LSMW recording needs to be done for posting of excise Invoice on the tcode J1IEX.

the program we used for creating the excise IV has to hold this functionality also.

You can schedule a background job for this.

Needed Error Messages  :

SInce the GR will come in background so before posting it you need to put all the checks whcih happens in MIGO


1) Material and chapter id not maintained
2) Vendor excise details are not maintained

3) Tax record in FV11 are not maintained

4) Duplicate excise Invoice


You need to create a report which list out the GR idoc with there status , excise number,date and status if its posted or not.


Solution: we have a different solution in place for Import flow as compared to domestic flow due to the fact that we can capture excise IV after GRN is posted and if you try to do that then the duty amounts appears to be zero.

In this solution since we are going to use PO to capture excise IV which makes it important to read the quantity from GR IDOC and then call BAPI for PO change to amend the quantity in PO to have actual quantity in it.

A) Capture excise Invoice

B) Post GRN

C) update RG23PART1

D) Post excise IV.

Capture Excise IV: We have done recording to J1IEX tcode by using PO to capture excise IV. This recording will be called in background to capture excise IV with reference to PO.

Suppose you have created the excise IV but GR Idoc failed in next step then you need to skip the capture excise IV BDC when you re process the IDOC.

POST GRN: We will pass the excise IV and date from IDOC to MB01 tcode recording and PO number which will post GRN

Update RG23A part 1: Already mentioned above

Post excise IV: Already mentioned above.

Error Message:

1: check if customs Invoice exist in PO history or not

2: Check if custom IV is cancelled or not

3: Material chapter id exist or not

If you have query /question /objection then please write back to me.



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Dibyendu Patra
      Dibyendu Patra

      Nice Document...

      Very helpful..

      Author's profile photo Former Member
      Former Member

      Hi Rahul,

      Good Document Impressed with the idea of Excise Capture for Domestic and Calling BAPI for PO Admend in Import.

      I have some queries regarding

      1.Domestic in Case Dealer how to Map it.

      2.For Import in case of Customs duties IR Number should be referred at the time of Excise Capture how u recorded it.

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

      For dealer purchase you can search forum many threads are available.

      However the trick is with the MRP indicator in the GR screen in the excise tab.

      For 2nd question

      Bill of entry document number is mentioned in the excise IV number and since in our case the data comes from non sap system they will enter it there but the bottom line is you need to capture it in excise IV number field

      Author's profile photo Former Member
      Former Member

      Thanks for rly,

      In your case how to capture dealer scenario, 1st ur doing GR and then doing Excise IV. where u ll put MRP tick.

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

      Are you using IDOC to post GR  ?

      well to answer your question I need to do analysis which at this point of time is not possible for me but just to give it a shot...MRP indicator modifies the excise values which should be available in J1IEX tcode also where in we capture the xcise invoice

      Author's profile photo Former Member
      Former Member

      Hi Rahul,

              Please can you help me. I have an urgent requirement to update excise details after GR using a Zprogram and no IDOC is used. In the program, FM 'BAPI_GOODSMVT_CREATE' is being used to update the GR Details. I tried to use FM 'BAPI_EXCINV_CREATE_FROMDATA' but it was updating the excise details related to sales whereas I needed to update the excise details related to purchase. While debugging MIGO, I saw FM 'J_1IEXGM_UPDATE_EXCISE' is used to update excise details. But when I use this FM in the program its not working because there are many parameters passed from MIGO screen and they are not updated while using the FM in the program. Please can you tell me how I can update the excise details.

      Thanks & Regards,