‎2025 Apr 06 2:22 PM - edited ‎2025 Apr 06 2:23 PM
Hi Experts,
For one of the requirements, we need to generate a IDOC in SAP ECC system from SAP BTP CAP application. Can you please give any idea how we can achieve it?
Request clarification before answering.
I would recommend using Cloud Integration to generate IDocs. You can send a request from your CAP application to Cloud Integration and delegate the IDoc generation to Cloud Integration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please call this 'MASTER_IDOC_DISTRIBUTE' from BTP:-
DATA: control TYPE edidc,
data TYPE STANDARD TABLE OF edidd.
control-mestyp = 'ORDERS'.
control-rcvprn = 'RECEIVER'.
control-sndprn = 'SENDER'.
APPEND VALUE #( segnam = 'E1EDK01' sdata = '...' ) TO data.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = control
TABLES
communication_idoc_control = control
idoc_data_records = data.Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Assuming Cloud connector is in place , at ECC use function module MASTER_IDOC_DISTRIBUTE
FUNCTION Z_TRIGGER_IDOC.
*"----------------------------------------------------------------------
*" Importing VALUE(I_MATNR) TYPE MATNR
*"----------------------------------------------------------------------
DATA: ls_edidc TYPE edidc,
lt_edidd TYPE TABLE OF edidd,
lv_idoc_number TYPE edi_docnum.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = ls_edidc
TABLES
communication_idoc_control = lt_edidd
EXCEPTIONS
OTHERS = 1.
ENDFUNCTION.and in the CAP application:-
import { executeFunction, rfcDestination } from '@sap-cloud-sdk/rfc';
const destination = await rfcDestination({ destinationName: 'ECC_RFC' });
const response = await executeFunction(destination, {
functionName: 'Z_TRIGGER_IDOC',
parameters: {
I_MATNR: '123456'
}
});Thanks,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.