Skip to Content
0

Create custom IDoc SAP standard error

Nov 01, 2017 at 09:49 AM

16

avatar image
Former Member

Hi folks,

I have a problem with the create of an custom idoc.

this is my coding:

l_con_partnerart_ls TYPE edi_rcvprt VALUE 'LS',
l_con_outmod TYPE edi_outmod VALUE '4',
* l_con_sndprt TYPE edidc-rcvprt VALUE 'LS',
l_con_rcvprn TYPE edidc-rcvprn VALUE '001XIT',
l_con_mestyp TYPE edidc-mestyp VALUE 'YKLS_ZAHLSTATUS',
l_con_idoctp TYPE edidc-idoctp VALUE 'YKLS_ZAHLSTATUS',
l_con_edidd TYPE edidd-segnam VALUE 'YKLSFVIK'.

*************
* Eigenes logisches System ermitteln
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = l_var_snd_logsys
EXCEPTIONS "#EC FB_RC
own_logical_system_not_defined = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.


* Erzeugen Kontrollsatz
SELECT SINGLE * FROM edp13
INTO CORRESPONDING FIELDS OF l_wa_edp13
WHERE rcvprt = l_con_partnerart_ls
AND mestyp = l_con_mestyp
AND rcvpor <> l_var_snd_logsys.

IF sy-subrc = 0.

* l_wa_rec_control-MANDT = SY-MANDT.
* l_wa_rec_control-direct = 1.
* l_wa_rec_control-docrel = 1.

l_wa_rec_control-idoctp = l_con_idoctp.
l_wa_rec_control-mestyp = l_con_mestyp.
l_wa_rec_control-outmod = l_con_outmod.

l_wa_rec_control-docrel = sy-saprl.
l_wa_rec_control-credat = sy-datum.
l_wa_rec_control-cretim = sy-uzeit.
l_wa_rec_control-serial = sy-datum && sy-uzeit.
l_wa_rec_control-sndpor = 'SAP' && sy-sysid .
l_wa_rec_control-sndprn = sy-mandt && sy-sysid.
l_wa_rec_control-rcvpor = l_wa_edp13-rcvpor.
l_wa_rec_control-rcvprn = l_wa_edp13-rcvpor.
l_wa_rec_control-rcvprt = l_wa_edp13-rcvprt.

MOVE-CORRESPONDING l_wa_edp13 TO l_wa_rec_control.

l_it_kls_pos[] = it_m_kls_debi_doc_positions.

* IDoc aufbauen
l_segnum = 1.

LOOP AT l_it_kls_pos INTO l_wa_kls_pos.
MOVE-CORRESPONDING l_wa_kls_pos TO l_wa_idoc_hdr.

* * restliche Felder bedienen
* ** ID aufbauen
CONCATENATE
l_wa_kls_pos-zuonr
l_wa_kls_pos-kunnr
l_wa_kls_pos-buzei
INTO l_wa_idoc_hdr-id.

l_wa_idoc_hdr-type = l_wa_kls_pos-kls_kennz_blart.
l_wa_idoc_hdr-timestamp = l_wa_kls_pos-cpudt.
l_wa_idoc_hdr-posnr = l_wa_kls_pos-buzei.

CLEAR l_wa_data.
l_wa_data-segnum = l_segnum.
l_wa_data-psgnum = 0.
l_wa_data-segnam = l_con_edidd.
l_wa_data-mandt = sy-mandt.
l_wa_data-DOCNUM = SY-TABIX.
l_wa_data-sdata = l_wa_idoc_hdr.

APPEND l_wa_data TO l_it_data.

ADD 1 TO l_segnum.

ENDLOOP.

wa_m_eddic = l_wa_rec_control.
it_m_eddic = l_it_rec_control.
it_m_eddid = l_it_data.

ENDIF.

The error (MOVE_TO_LIT_NOTALLOWED_NODATA) occurs in this part:

Include LBD11F09

FORM DATA_INITIALIZE
TABLES
IDOC_DATA STRUCTURE EDIDD
CHANGING
EXCEPTION LIKE EDIMESSAGE.

CLEAR EXCEPTION.

LOOP AT IDOC_DATA.
CLEAR: IDOC_DATA-MANDT, IDOC_DATA-DOCNUM,
IDOC_DATA-PSGNUM, IDOC_DATA-HLEVEL-

MODIFY IDOC_DATA. <--- Assignment error: Overwriting of a protected field.Felds.

ENDLOOP.

Can someone help me (asap)?

Greetings,

Tim

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers