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

Inbound Idoc Function Module

Former Member
0 Likes
1,054

Hi Gurus,

I am new to Idocs. My requiemnet is update the Ztables by using Inbound Idocs.

For this There is a ZIDOC type ,Z Message Type and Z segments are there. By using those I have to create one Custom Z Function Module, This Function Module needs to update the Z database Table.

Please can any one give me the guide lines and step by step procedure to do this.

Points will be rewarded.....

Thanks in Advance.

Thanks and Regards

Abinavasiri...

5 REPLIES 5
Read only

Former Member
0 Likes
766

Please can any one help me. Its very Urgent..

Thanks and Regards

AbinavaSiri..

Read only

0 Likes
766

Is there any Answers for my query..

Thanks and Regards

Abinava Siri...

Read only

0 Likes
766

Hi,

please refer to [ALE Programming Guide|http://help.sap.com/saphelp_nw70/helpdata/EN/78/2173cf51ce11d189570000e829fbbd/frameset.htm], especially [Implementing Inbound Processing|http://help.sap.com/saphelp_nw70/helpdata/EN/78/2174b051ce11d189570000e829fbbd/frameset.htm] might be interesting to you.

Regards Rudi

Read only

Former Member
0 Likes
766

Hi,

plz check the function module which i had used.

function z_idoc_input_dhanu .
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
*"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
*"     VALUE(NO_APPLICATION_LOG) LIKE  SY-DATAR OPTIONAL
*"     VALUE(MASSSAVEINFOS) LIKE  MASSSAVINF STRUCTURE  MASSSAVINF
*"       OPTIONAL
*"  EXPORTING
*"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT
*"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-APPL_VAR
*"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
*"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
*"  TABLES
*"      IDOC_CONTRL STRUCTURE  EDIDC
*"      IDOC_DATA STRUCTURE  EDIDD
*"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
*"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
*"      SERIALIZATION_INFO STRUCTURE  BDI_SER
*"  EXCEPTIONS
*"      WRONG_FUNCTION_CALLED
*"----------------------------------------------------------------------
  include mbdconwf.
  data : it_emp_data like zdhanu occurs 0 with header line.
  data : gen_data like zdhanu .
  workflow_result = c_wf_result_ok.
data : counter type int4.
select count( * ) from zdhanu into counter.
counter = counter + 1.
  loop at idoc_contrl.
    if idoc_contrl-mestyp ne 'ZDHAN'.
      raise wrong_function_called.
    endif.
    clear gen_data.
    refresh it_emp_data.
    loop at idoc_data where docnum eq idoc_contrl-docnum.
      if idoc_data-segnam = 'ZDHAN'.
        gen_data = idoc_data-sdata.
          it_emp_data-mandt = counter.
          it_emp_data-lname = gen_data-lname.
          it_emp_data-fname = gen_data-fname.
          counter = counter + 1.
        append it_emp_data.
      else.
        message 'ERROR' type 'I'.
      endif.
    endloop.
  endloop.
insert zdhanu from table it_emp_data.
*****
call function 'EDI_DOCUMENT_OPEN_FOR_EDIT'
  exporting
    document_number               = idoc_data-docnum
  importing
    idoc_control                  = idoc_contrl
  tables
    idoc_data                     = idoc_data
  exceptions
    document_foreign_lock         = 1
    document_not_exist            = 2
    document_not_open             = 3
    status_is_unable_for_changing = 4
    others                        = 5.
call function 'EDI_CHANGE_DATA_SEGMENTS'
  tables
    idoc_changed_data_range = idoc_data
  exceptions
    idoc_not_open           = 1
    data_record_not_exist   = 2
    others                  = 3.
data t_itab_edids40 like edi_ds40 occurs 0 with header line.
clear t_itab_edids40.
t_itab_edids40-docnum      = idoc_data-docnum.
t_itab_edids40-status      = '51'.
t_itab_edids40-repid       = sy-repid.
t_itab_edids40-tabnam      = 'EDI_DS'.
t_itab_edids40-mandt       = sy-mandt.
t_itab_edids40-stamqu      = 'SAP'.
t_itab_edids40-stamid      = 'B1'.
t_itab_edids40-stamno      = '999'.
t_itab_edids40-stapa1      = 'Sold to changed to '.
*t_itab_edids40-stapa2      = t_new_kunnr.
t_itab_edids40-logdat      = sy-datum.
t_itab_edids40-logtim      = sy-uzeit.
append t_itab_edids40.
call function 'EDI_DOCUMENT_CLOSE_EDIT'
  exporting
    document_number  = idoc_data-docnum
    do_commit        = 'X'
    do_update        = 'X'
    write_all_status = 'X'
  tables
    status_records   = t_itab_edids40
  exceptions
    idoc_not_open    = 1
    db_error         = 2
    others           = 3.
endfunction.

Even check this link its very very helpful for ur case.

[step - by- step method to develop custom IDOC|http://www.saptechnical.com/Tutorials/ALE/DataDistributeCustomIDOC/page1.htm]

This will surely help you.

plz reward if useful.

thanks,

dhanashri.

Edited by: Dhanashri Pawar on Jul 22, 2008 7:34 AM

Read only

Former Member
0 Likes
766

Check following link for step by step procedure ...........

http://www.riyaz.net/?p=18