2006 Nov 01 10:38 AM
Hi,
For Inbound Idoc
In function module for posting the Idoc what should be given as the return_variable.
2006 Nov 01 11:33 AM
Hi,
it depends on application.i have written some piece of code for my requiremnt.chek it,may be it will help u.
FORM idoc_status_ord_change
TABLES idoc_data STRUCTURE edidd
idoc_status STRUCTURE bdidocstat
r_variables STRUCTURE bdwfretvar
USING idoc_contrl LIKE edidc
value(retn_info) LIKE bapiret2
status LIKE bdidocstat-status
wf_result LIKE bdwf_param-result.
CLEAR idoc_status.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-msgty = retn_info-type.
idoc_status-msgid = retn_info-id.
idoc_status-msgno = retn_info-number.
idoc_status-appl_log = retn_info-log_no.
idoc_status-msgv1 = retn_info-message_v1.
idoc_status-msgv2 = retn_info-message_v2.
idoc_status-msgv3 = retn_info-message_v3.
idoc_status-msgv4 = retn_info-message_v4.
idoc_status-repid = sy-repid.
idoc_status-status = status.
APPEND idoc_status.
IF idoc_status-status = '51'.
wf_result = '99999'.
r_variables-wf_param = 'Error_IDOCs'.
r_variables-doc_number = idoc_contrl-docnum.
READ TABLE r_variables FROM r_variables.
IF sy-subrc <> 0.
APPEND r_variables.
ENDIF.
ELSEIF idoc_status-status = '53'.
CLEAR wf_result.
r_variables-wf_param = 'Processed_IDOCs'.
r_variables-doc_number = idoc_contrl-docnum.
READ TABLE r_variables FROM r_variables.
IF sy-subrc <> 0.
APPEND r_variables.
ENDIF.
ENDIF.
regards,
nagaraj
It would depend on the function module. You would expect all the IDoc related Function Modules to work in the same manner but they do not.
2006 Nov 01 10:49 AM
It would depend on the function module. You would expect all the IDoc related Function Modules to work in the same manner but they do not.
2006 Nov 01 10:50 AM
Hi,
check Fm IDOC_INPUT_RESEND
IDOC_INPUT_CMSEND
IDOC_INPUT_ACC_SENDER_ACTIVITY
return idoc number
Regards
amole
2006 Nov 01 10:58 AM
hi,
below is a piece of code to give u an ideas as to what to do with <b>RETURN_VARIABLES</b>
WORKFLOW_RESULT = C_WF_RESULT_OK.
RETURN_VARIABLES-WF_PARAM = C_WF_PAR_PROCESSED_IDOCS.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
RETURN_VARIABLES-WF_PARAM = C_WF_PAR_APPL_OBJ_TYPE.
RETURN_VARIABLES-DOC_NUMBER = 'LIKP'.
APPEND RETURN_VARIABLES.
RETURN_VARIABLES-WF_PARAM = C_WF_PAR_APPL_OBJECTS.
RETURN_VARIABLES-DOC_NUMBER = S_KOKO-VBELN_VL.
APPEND RETURN_VARIABLES.
hope it helps...
please reward if useful...
2006 Nov 01 11:13 AM
Hi,
it depends on application.
and for sales order change in the FM IDOC_INPUT_ORDCHG
this is the code SAP uses...
return_variables-wf_param = eid.
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.Regards
vijay
2006 Nov 01 11:20 AM
Hi,
In function module to post IDOC ...there is no return variable..
If posting if successful sy-subrc is 0 else <> 0.
2006 Nov 01 11:33 AM
Hi,
it depends on application.i have written some piece of code for my requiremnt.chek it,may be it will help u.
FORM idoc_status_ord_change
TABLES idoc_data STRUCTURE edidd
idoc_status STRUCTURE bdidocstat
r_variables STRUCTURE bdwfretvar
USING idoc_contrl LIKE edidc
value(retn_info) LIKE bapiret2
status LIKE bdidocstat-status
wf_result LIKE bdwf_param-result.
CLEAR idoc_status.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-msgty = retn_info-type.
idoc_status-msgid = retn_info-id.
idoc_status-msgno = retn_info-number.
idoc_status-appl_log = retn_info-log_no.
idoc_status-msgv1 = retn_info-message_v1.
idoc_status-msgv2 = retn_info-message_v2.
idoc_status-msgv3 = retn_info-message_v3.
idoc_status-msgv4 = retn_info-message_v4.
idoc_status-repid = sy-repid.
idoc_status-status = status.
APPEND idoc_status.
IF idoc_status-status = '51'.
wf_result = '99999'.
r_variables-wf_param = 'Error_IDOCs'.
r_variables-doc_number = idoc_contrl-docnum.
READ TABLE r_variables FROM r_variables.
IF sy-subrc <> 0.
APPEND r_variables.
ENDIF.
ELSEIF idoc_status-status = '53'.
CLEAR wf_result.
r_variables-wf_param = 'Processed_IDOCs'.
r_variables-doc_number = idoc_contrl-docnum.
READ TABLE r_variables FROM r_variables.
IF sy-subrc <> 0.
APPEND r_variables.
ENDIF.
ENDIF.
regards,
nagaraj
2006 Nov 01 2:09 PM
Thanks a lot nagaraj,
why do we give '99999' to wf_result and 'error_idoc' to r_variables-wf_param .
What is the reason, Can you please tell me why it is so
2006 Nov 02 4:27 AM
Hi,
why do we give '99999' to wf_result .Actually i was told to use like this ,i also don't know the exact reason.
for ur second query i actually copied it from standard function module IDOC_INPUT_ORDERS..
inside the function module u can find like this.
DATA: eid LIKE bdwfretvar-wf_param VALUE 'Error_IDOCs'.
return_variables-wf_param = eid.
return_variables-doc_number = idoc_contrl-docnum.
So i have applied it in my code ,the sample code which i have given....
Regards,
nagaraj
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |