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: 

any idea of logic for this INBOUND IDOC

0 Kudos

In the source function module ZV_IDOC_INPUT(same FM like IDOC_INPUT_SHPMNT), IDOC data has to be read from the internal table I_IDOC_DATA with key segnam eq ‘ZE1A’ and ‘ZE1B’ and ‘ZE1C’ .

1 REPLY 1

Former Member
0 Kudos

Hi,

<b>populating the segments</b>!! have a look at it.

LOOP AT i_mara INTO w_mara.

PERFORM sub_populate_e1edp19.

PERFORM sub_populate_e1edp32.

ENDLOOP.

FORM sub_populate_e1edp19.

e1edp19-qualf = '001'.

e1edp19-idtnr = w_mara-matnr.

CLEAR w_edidd.

w_edidd-segnam = c_e1edp19.

w_edidd-sdata = e1edp19.

APPEND w_edidd TO i_edidd.

ENDFORM. " sub_populate_e1edp19

&----


*& Form sub_populate_e1edp32

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sub_populate_e1edp32.

READ TABLE i_sum_qty INTO w_sum_qty

WITH KEY matnr = w_mara-matnr

BINARY SEARCH.

IF sy-subrc = 0.

CLEAR: ze1ep32.

ze1ep32-qualf = c_q101.

ze1ep32-quantity = w_sum_qty-tot_qty.

ze1ep32-unit = w_mara-meins.

CLEAR w_edidd.

w_edidd-segnam = c_e1edp32.

w_edidd-sdata = ze1ep32.

APPEND w_edidd TO i_edidd.

ENDIF.

LOOP AT I_QTY_USED INTO W_QTY_USED.

IF W_QTY_USED-MATNR = W_MARA-MATNR.

CLEAR: ze1ep32.

ze1ep32-qualf = c_q102.

ze1ep32-quantity = w_qty_used-menge.

ze1ep32-unit = w_qty_used-meins.

ze1ep32-mblnr = w_qty_used-mblnr.

ze1ep32-ktext = w_qty_used-bktxt.

ze1ep32-zeile = w_qty_used-zeile.

ze1ep32-budat = w_qty_used-budat.

CLEAR w_edidd.

w_edidd-segnam = c_e1edp32.

w_edidd-sdata = ze1ep32.

APPEND w_edidd TO i_edidd.

ENDIF.

ENDLOOP.

LOOP AT I_QTY_RECIEVED INTO W_QTY_RECIEVED.

IF W_QTY_RECIEVED-MATNR = W_MARA-MATNR.

CLEAR: ze1ep32.

ze1ep32-qualf = c_q103.

ze1ep32-quantity = w_qty_recieved-menge.

ze1ep32-unit = w_qty_recieved-meins.

ze1ep32-mblnr = w_qty_recieved-mblnr.

ze1ep32-ktext = w_qty_recieved-bktxt.

ze1ep32-zeile = w_qty_recieved-zeile.

ze1ep32-budat = w_qty_recieved-budat.

CLEAR w_edidd.

w_edidd-segnam = c_e1edp32.

w_edidd-sdata = ze1ep32.

APPEND w_edidd TO i_edidd.

ENDIF.

ENDLOOP.

ENDFORM.

MOVE c_mestyp TO w_edidc-mestyp.

MOVE c_doctyp TO w_edidc-idoctp.

MOVE c_rcvpor TO w_edidc-rcvpor.

MOVE c_rcvprt TO w_edidc-rcvprt.

MOVE c_rcvprn TO w_edidc-rcvprn.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'

EXPORTING

master_idoc_control = w_edidc

  • OBJ_TYPE = ''

  • CHNUM = ''

TABLES

communication_idoc_control = i_edidc

master_idoc_data = i_edidd

  • EXCEPTIONS

  • ERROR_IN_IDOC_CONTROL = 1

  • ERROR_WRITING_IDOC_STATUS = 2

  • ERROR_IN_IDOC_DATA = 3

  • SENDING_LOGICAL_SYSTEM_UNKNOWN = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

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

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

ENDIF.

<b>Reward points</b>

Regards