Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IDOC Number

Former Member
0 Likes
828

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

6 REPLIES 6
Read only

Former Member
0 Likes
802

This FM should return you the IDOC number. Can you paste your code?

Regards,

Atish

Read only

0 Likes
802

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.

Read only

0 Likes
802

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

Read only

0 Likes
802

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

Read only

0 Likes
802

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>

Read only

0 Likes
802

PE_IDOC_NUMBER =

u have commented this, pls uncomment that and give a variable there which contains the idoc number