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

doubt in coding to get idoc no

Former Member
0 Likes
315

Hi ,

i want to get corresponding idoc no s for delivery nos

I understood the logic of how to get the idoc no for particular delivery no.but unable to code it exactly.

Message type is desadv

Idoc type is delvry03.

Segment name is E1EDL20

can u write me the code exactly

Here is sample code.

tables:edid4,edidc,likp.

types:begin of ty_likp,

vbeln type vbeln_vl, "delivery no

end of ty_likp.

data:it_likp type table of ty_likp,

wa_likp type ty_likp.

types:begin of ty_edidc,

DOCNUM type EDI_DOCNUM,

MESTYP type EDI_MESTYP,

IDOCTP type EDI_IDOCTP,

end of ty_edidc.

data:it_edidc type table of ty_edidc,

wa_edidc type ty_edidc.

types:begin of ty_edid4,

DOCNUM type EDI_DOCNUM,

sdata type EDI_SDATA,

segnam type edi_segnam,

end of ty_edid4.

data:it_edid4 type table of ty_edid4,

wa_edid4 type ty_edid4.

select DOCNUM

mestyp

idoctp

from

edidc into table it_edidc

where mestyp = 'DESADV'

AND IDOCTP = 'DELVRY03'.

(here I get idoc no after this how to code to get corresponding idoc nos for delivery nos)

after this can u code how to get the idoc no for particular delivery no like

how to link sdata and delivery no

how to get tht offset values

Hi ,

i want to get corresponding idoc no s for delivery nos

I understood the logic of how to get the idoc no for particular delivery no.but unable to code it exactly.

Message type is desadv

Idoc type is delvry03.

Segment name is E1EDL20

can u write me the code exactly

Here is sample code.

tables:edid4,edidc,likp.

types:begin of ty_likp,

vbeln type vbeln_vl, "delivery no

end of ty_likp.

data:it_likp type table of ty_likp,

wa_likp type ty_likp.

types:begin of ty_edidc,

DOCNUM type EDI_DOCNUM,

MESTYP type EDI_MESTYP,

IDOCTP type EDI_IDOCTP,

end of ty_edidc.

data:it_edidc type table of ty_edidc,

wa_edidc type ty_edidc.

types:begin of ty_edid4,

DOCNUM type EDI_DOCNUM,

sdata type EDI_SDATA,

segnam type edi_segnam,

end of ty_edid4.

data:it_edid4 type table of ty_edid4,

wa_edid4 type ty_edid4.

select DOCNUM

mestyp

idoctp

from

edidc into table it_edidc

where mestyp = 'DESADV'

AND IDOCTP = 'DELVRY03'.

(here I get idoc no after this how to code to get corresponding idoc nos for delivery nos)

after this can u code how to get the idoc no for particular delivery no like

how to link sdata and delivery no

how to get tht offset values

1 REPLY 1
Read only

former_member404244
Active Contributor
0 Likes
295

Hi,

after this...try like this

if not it_edidc[] is initial.

select segnam sdata from edid4 into table it_edid4

for all entries in it_edidc

where docnum = it_edidc-docnum.

endif.

now u need to loop ur delivery numbers table and also the internal table it_edid4 and check the segment where ur getting the delivery number.

Loop at it_delivery

Loop at it_edid4.

if it_edid4-segnam = <give the segment name where delivery number exists>.

move : it_edid4-sdata to wa_edid4-sdata.

now check the delivery number with it_delivery-deliveryno.

endf.

endloop.

endloop.

Regards,

nagaraj