Application Development 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: 

getting valid idoc number from the sales document

Former Member
0 Kudos

hi,

Iam sending the code for getting the idoc number from sales document.

but iam not getting the result.

please see the code and correct the code so that i will get the idoc number from the sales document.

tables edid4.

data l_docnum like edid4-docnum.

parameters:p_vbeln like vbak-vbeln.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = p_vbeln

IMPORTING

OUTPUT = p_vbeln

.

select single docnum from edid4 into l_docnum where sdata like '&p_vbeln&'.

if sy-subrc = 0.

write edid4-docnum.

else.

write ' the record is not found'.

endif.

it is very urgent..............

thanks in advance......

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

concatenate '%' p_vbeln '%' into v_vbeln.

select single docnum from edid4 into l_docnum where sdata like v_vbeln.

if sy-subrc = 0.

write edid4-docnum.

else.

write ' the record is not found'.

endif.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

concatenate '%' p_vbeln '%' into v_vbeln.

select single docnum from edid4 into l_docnum where sdata like v_vbeln.

if sy-subrc = 0.

write edid4-docnum.

else.

write ' the record is not found'.

endif.

0 Kudos

please send the code once again with some more clarity,because iam not getiting the answer.

it is very u rgent........

thanks in advance.......

0 Kudos

See the below code :

report zxyz.

tables edid4.

data l_docnum like edid4-docnum.

parameters:p_vbeln like vbak-vbeln.

<b>data sdata like edid4-sdata.</b>

start-of-selection.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = p_vbeln

IMPORTING

OUTPUT = p_vbeln

.

<b>concatenate '%' p_vbeln '%' into sdata.</b>

select single docnum from edid4 into l_docnum

where sdata like <b>sdata.</b>

if sy-subrc = 0.

write edid4-docnum.

else.

write ' the record is not found'.

endif.

Thanks

Seshu

Former Member
0 Kudos

Hi Sudarson,

Do not use table EDID4 for what you are trying to do as it will be very slow and EDID4 does not hold the details you want.

Look at tables EDIDC - IDOC control records

EDIDS - IDOC status records - the fields STAPAx hold the parameters, like sales order number, that you need.