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

Former Member
0 Likes
634

Hi!!

My problem is I must add fields to a segment of idoc zinvoic01, but it does not add them.

The rank does not respect it, send me another value each that I execute idoc.

the code that I have is:

zrange = 'C1'.

zobject = 'ZFOLIOS'.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = zrange

object = zobject

quantity = '1'

IMPORTING

number = znumber

EXCEPTIONS

interval_not_found = 1

number_range_not_intern = 2

object_not_found = 3

quantity_is_0 = 4

quantity_is_not_1 = 5

interval_overflow = 6

buffer_overflow = 7

OTHERS = 8.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

select single serie aprobacion fecha

from zedi_fol_factura

into (zserie, zaprobacion, zfecha)

where folsap = zbelnr.

znumber1 = znumber.

CLEAR ze1edk01.

READ TABLE int_edidd WITH KEY segnam = 'E1EDK01'.

ztabix = sy-tabix.

MOVE int_edidd-sdata TO ze1edk01.

ze1edk01-action = znumber1. "Rank

ze1edk01-abrvw_bez = zserie. "Serie

ze1edk01-LIFSK_BEZ = zaprobacion."NumAprob

ze1edk01-BSTZD = zfecha. "YearAprob

MOVE ze1edk01 TO int_edidd-sdata.

MODIFY int_edidd INDEX ztabix.

CLEAR int_edidd.

Thanks.

3 REPLIES 3
Read only

messier31
Active Contributor
0 Likes
559

Hi Beatriz,

Just try making small change in modify statement..

<b>MODIFY int_edidd from ze1edk01.</b>

let me know if it works or not..

Enjoy SAP.

Pankaj Singh.

Read only

Former Member
0 Likes
559

I would just add :

MODIFY int_edidd INDEX ztabix <b>TRANSPORTING SDATA</b>.

and it's good to check sy-subrc after read :

READ TABLE int_edidd WITH KEY segnam = 'E1EDK01'.

<b>IF sy-subrc = 0.</b>

ztabix = sy-tabix.

....

<b>endif.</b>

Read only

Former Member
0 Likes
559

Hi,

I dont see any problem with your code. Just debug and check if the values znumber1, zserie, zaprobacion, zfecha are being populated or not.

More over, what is the enhancement that you are using to change the segment data? check if it is being triggered initially so that you can still change the data or is being triggered only after all the IDoc data is read.

I guess it is an inbound EDI invoice processing. If so, why do you change the IDoc data? just change the values when IDoc is populating values from E1EDK01 segment.

Hope this helps

Vamsi