a month ago
Hi Peers,
I have a requirement to trigger an outbound Idoc whenever a PR (Purchase Requisition) is created.
Idoc types : Create : PREQCR104, Change : PREQCHANGE04.
I have found out that this can be achieved through a FM ALE_PR_CREATE. But, I am not sure how to achieve this. Any pseudo code or other possible ways is greatly appreciated.
Thanks and Regards
Request clarification before answering.
You can call this FM and generate an IDOC thru a BAdI such as ME_PROCESS_REQ_CUST or (better) ME_REQ_POSTED but not thru NACE (AFAIK only PO not PR - A Purchase Requistion is an internal document that is not meant to be sent externally)
You could also consider using FM MASTER_IDOC_DISTRIBUTE and not ALE_PR_CREATE or CHANGE (more threads available)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the suggestion, The Idoc has to triggered in two cases here
1. Create : trigger an Idoc when PR is Created
2. Change : Create an Idoc when PR is Changes
The Idea is to use FM : MASTER_IDOC_DISTRIBUTE in IF_EX_ME_REQ_POSTED~POSTED of BADI ME_REQ_POSTED.
I will try to trigger an Idoc as per your suggestion and let you know the results
Regards,
Hi Raymond, can you please give a brief idea on what data these function module might be expecting. Because, I have tried passing different values, but, still this FM is failing with an Exception.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = idoc_control
TABLES
communication_idoc_control = t_comm_control
master_idoc_data = lt_idoc_data
EXCEPTIONS
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
OTHERS = 5.
Regards.
There are samples in online documentation
Hi Raymond, everythings done, all the connections has been established from my end (partner functions, logical system etc., ), now the Idoc is getting triggered whenever a PR is created in the System.
the only thing that is pending now is filling the Idoc_Data.
I am currently using the Idoc type PREQCR104, I successfully passed the data into the first segment which is 'E1PREQCR1' which is test_run as 'X' as below :
wa_idoc_data-segnam = 'E1PREQCR1'.
ls_header-testrun = 'X'.
wa_idoc_data-sdata = ls_header.
APPEND wa_idoc_data TO lt_idoc_data.
CLEAR : wa_idoc_data.
But, I am not getting how to pass the data into the below segments of the Idoc (lets say 'e1bpmereqheader'). If I pass the data as above, it is creating the Segment as Root but not as its child. How can I achieve this ?
I tried to go through the link you provided, but that was not helpful. Can you please help in filling these data records ?
Regards,
User | Count |
---|---|
91 | |
39 | |
7 | |
5 | |
5 | |
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.