2009 May 21 8:41 AM
Hi all,
Can any one please provide the sample custom inbound program if it is possible stepls also.
2009 May 21 8:47 AM
The following is a short list of key reports that process inbound IDocs. They are sometimes usefull to have run in a batch mode.
1) RBDMANIN - Start Error Handling for Non-Posted IDocs
Description: This report attempts to post the inbound IDocs with status '51' (Application document not posted)
2) RBDAGAIN - Process Outbound IDocs with Errors Again
Description: This report reprocesses outbound IDocs which contain errors. IDocs containing errors have one of the following statuses:
02: Error transmitting data to port
04: Error in EDI subsystem control information
05: Error in conversion
25: Continue processing despite syntax error (outbound)
29: Error in ALE service
3) RBDAGAIE - Reprocessing of Edited IDocs
Description: This report reprocesses an edited IDoc in inbound or outbound processing. The edited IDoc has one of the following statuses:
32: IDoc edited (outbound)
69: IDoc edited (inbound)
4) RBDAGAI2 - Re-processing of IDocs after ALE Input Error
Description: You use this report to reprocess inbound IDocs containing errors. IDocs containing errors have one of the following statuses:
56: IDoc containing errors added
61: Continue processing despite syntax error (inbox)
63: Error passing IDoc to the application
65: Error in ALE service
5) RBDAPP01 - Inbound Processing of IDocs Ready for Transfer
Description: Report for processing inbound IDocs not passed to the application immediately. This report forwards all IDocs with:
Status 64 "ready to be passed to application"
Status 66 "IDoc is waiting for predecessor IDoc (serialization)
Hi all,
Can any one please provide the sample custom inbound program if it is possible stepls also.
2009 May 21 8:47 AM
The following is a short list of key reports that process inbound IDocs. They are sometimes usefull to have run in a batch mode.
1) RBDMANIN - Start Error Handling for Non-Posted IDocs
Description: This report attempts to post the inbound IDocs with status '51' (Application document not posted)
2) RBDAGAIN - Process Outbound IDocs with Errors Again
Description: This report reprocesses outbound IDocs which contain errors. IDocs containing errors have one of the following statuses:
02: Error transmitting data to port
04: Error in EDI subsystem control information
05: Error in conversion
25: Continue processing despite syntax error (outbound)
29: Error in ALE service
3) RBDAGAIE - Reprocessing of Edited IDocs
Description: This report reprocesses an edited IDoc in inbound or outbound processing. The edited IDoc has one of the following statuses:
32: IDoc edited (outbound)
69: IDoc edited (inbound)
4) RBDAGAI2 - Re-processing of IDocs after ALE Input Error
Description: You use this report to reprocess inbound IDocs containing errors. IDocs containing errors have one of the following statuses:
56: IDoc containing errors added
61: Continue processing despite syntax error (inbox)
63: Error passing IDoc to the application
65: Error in ALE service
5) RBDAPP01 - Inbound Processing of IDocs Ready for Transfer
Description: Report for processing inbound IDocs not passed to the application immediately. This report forwards all IDocs with:
Status 64 "ready to be passed to application"
Status 66 "IDoc is waiting for predecessor IDoc (serialization)
2009 May 21 8:53 AM
WE42-Creating process code
BD51-Characteristics of inbound fn, module (input type, dialog allowed)
WE57-Assigning fn, module to message type and idoc type
BD87-Status monitor for ALE messages
Consider the following code:
FUNCTION Z_IDOC_INPUT_ZRZSO_MT.
*"----
""Local interface:
*" IMPORTING
*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR
*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
*"----
Include File containing ALE constants
INCLUDE MBDCONWF.
TABLES : ZCUSTOMERS, "Cutomer Header
ZSOHEADERS, "Sales Header
ZSOITEMS. "Sales Items
***Data
DATA : W_ZRZSEG1 LIKE ZRZSEG1,
W_ZRZSEG2 LIKE ZRZSEG2,
W_ZRZSEG3 LIKE ZRZSEG3.
DATA : T_ZCUSTOMERS LIKE ZCUSTOMERS OCCURS 0 WITH HEADER LINE.
DATA : T_ZSOHEADERS LIKE ZSOHEADERS OCCURS 0 WITH HEADER LINE.
DATA : T_ZSOITEMS LIKE ZSOITEMS OCCURS 0 WITH HEADER LINE.
***********************************************************************
WORKFLOW_RESULT = C_WF_RESULT_OK.
LOOP AT IDOC_CONTRL.
IF IDOC_CONTRL-MESTYP NE 'ZRZSO_MT'.
RAISE WRONG_FUNCTION_CALLED.
ENDIF.
Before reading a new entry, clear application buffer
LOOP AT IDOC_DATA WHERE DOCNUM EQ IDOC_CONTRL-DOCNUM.
CASE IDOC_DATA-SEGNAM.
WHEN 'ZRZSEG1'.
W_ZRZSEG1 = IDOC_DATA-SDATA.
MOVE-CORRESPONDING W_ZRZSEG1 TO T_ZCUSTOMERS.
INSERT INTO ZCUSTOMERS VALUES T_ZCUSTOMERS.
WHEN 'ZRZSEG2'.
W_ZRZSEG2 = IDOC_DATA-SDATA.
MOVE-CORRESPONDING W_ZRZSEG2 TO T_ZSOHEADERS.
INSERT INTO ZSOHEADERS VALUES T_ZSOHEADERS.
WHEN 'ZRZSEG3'.
W_ZRZSEG3 = IDOC_DATA-SDATA.
MOVE-CORRESPONDING W_ZRZSEG3 TO T_ZSOITEMS.
INSERT INTO ZSOITEMS VALUES T_ZSOITEMS.
ENDCASE.
ENDLOOP.
************************************************************************
CUSTOMER HEADER *
************************************************************************
SELECT *
FROM zcustomers.
ENDSELECT.
IF sy-subrc NE 0.
INSERT INTO zcustomers VALUES t_zcustomers.
ELSE.
UPDATE ZCUSTHEAD FROM T_ZCUSTOMERS.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = T_ZCUSTOMERS-KUNNR.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = T_ZCUSTOMERS-KUNNR.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
************************************************************************
SALES HEADER *
************************************************************************
SELECT *
FROM zsoheaders.
ENDSELECT.
IF sy-subrc NE 0.
INSERT INTO zsoheaders VALUES t_zsoheaders.
ELSE.
UPDATE ZSOHEADERS FROM T_ZSOHEADERS.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = T_ZSOHEADERS-VBELN.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = T_ZSOHEADERS-VBELN.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
************************************************************************
SALES ITEM *
************************************************************************
SELECT *
FROM zsoitems.
ENDSELECT.
IF sy-subrc NE 0.
INSERT INTO zsoitems VALUES t_zsoitems.
ELSE.
UPDATE ZSOITEMS FROM T_ZSOITEMS.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = T_ZSOITEMS-VBELN.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = T_ZSOITEMS-VBELN.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
************************************************************************
ENDLOOP.
ENDFUNCTION.
Don't change the parameter name under the import, export and tables.
You can find more under http://www.riyaz.net/blog/beginners-guide-to-ale-and-idocs-a-step-by-step-approach/
Edited by: Ramesh Sundaram on May 21, 2009 9:55 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |