2007 Oct 03 6:19 AM
Hi,
How to capture the idoc number generated using function module idoc_inbound_single. I am passing internal table to above functional module idoc is generating and every thing is happening fine but that internal is not showing the idoc number it is showing blank. Can you please tell me the reason for this and how to capture the idoc number in my program.
Thanks
Hi,
How to capture the idoc number generated using function module idoc_inbound_single. I am passing internal table to above functional module idoc is generating and every thing is happening fine but that internal is not showing the idoc number it is showing blank. Can you please tell me the reason for this and how to capture the idoc number in my program.
Thanks
2007 Oct 03 6:24 AM
This FM should return you the IDOC number. Can you paste your code?
Regards,
Atish
2007 Oct 03 6:37 AM
Hi,
Thanks for your reply.
CALL FUNCTION 'IDOC_INBOUND_SINGLE'
EXPORTING
pi_idoc_control_rec_40 = lv_idoc_header
pi_do_commit = ' '
IMPORTING
PE_IDOC_NUMBER =
PE_ERROR_PRIOR_TO_APPLICATION =
TABLES
pt_idoc_data_records_40 = it_idoc_data.
EXCEPTIONS
IDOC_NOT_SAVED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
In above I am checking it_idoc_data-docnum . but that is showing empty but idoc was generated.
2007 Oct 03 6:40 AM
Hi,
You will get idoc number in the blow parameter. lv_idoc_number will have idoc number.
CALL FUNCTION 'IDOC_INBOUND_SINGLE'
EXPORTING
pi_idoc_control_rec_40 = lv_idoc_header
pi_do_commit = ' '
<b> IMPORTING
PE_IDOC_NUMBER = lv_idoc_number
</b>
PE_ERROR_PRIOR_TO_APPLICATION =
TABLES
pt_idoc_data_records_40 = it_idoc_data.
EXCEPTIONS
IDOC_NOT_SAVED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Atish
2007 Oct 03 6:41 AM
Try to use as like below :
CALL FUNCTION 'IDOC_INBOUND_SINGLE'
EXPORTING
pi_idoc_control_rec_40 = lv_idoc_header
pi_do_commit = 'X '
IMPORTING
PE_IDOC_NUMBER = <b>pe_idoc_number</b> " Declare variable
PE_ERROR_PRIOR_TO_APPLICATION =
TABLES
pt_idoc_data_records_40 = it_idoc_data.
EXCEPTIONS
IDOC_NOT_SAVED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
comitt work .
Thanks
Seshu
2007 Oct 03 6:42 AM
Hi Babji..
data: idocNo type edidc-docnum.
This is the Return Parameter that give the IDOC no:
<b>
importing
PE_IDOC_NUMBER = idocNo
</b>
**After the Call function
write:/ idocno.
<b>reward if Helpful.</b>
2007 Oct 03 6:47 AM
PE_IDOC_NUMBER =
u have commented this, pls uncomment that and give a variable there which contains the idoc number