Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 
Former Member

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 :smile:

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.