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: 

FM for inbound idoc

Former Member
0 Kudos

Hi abap gurus ,

I need to create one function module like INbound_IDOC_delvry to read an inbound idoc for goods receipt ? can anyone give me any idea (like sample code ) on that ?

Thanks in advance .

5 REPLIES 5

Former Member
0 Kudos

there is no standard inbound fm for the GR ...you need to create the custom fm for that..

Former Member
0 Kudos

The custom FM should have the following import, export and table parameters.

IMPORTING

VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD

VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC

EXPORTING

VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK

VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS

VALUE(WORKFLOW_RESULT) LIKE BDWFAP_PAR-RESULT

VALUE(APPLICATION_VARIABLE) LIKE BDWFAP_PAR-APPL_VAR

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

code:

LOOP AT t_idoc_data WHERE docnum = f_idoc_contrl-docnum.
    CASE t_idoc_data-segnam.

      WHEN Header.
Processing logic
      WHEN Item.
Processing logic
      WHEN item1.
Processing logic
      WHEN item2.
   Processing logic
      WHEN custom segments if any.
Processing logic
     WHEN OTHERS.
  Processing logic
    ENDCASE.
* Update the IDOC_STATUS at the end
  CLEAR t_idoc_status.
  t_idoc_status-docnum = docnum.
  t_idoc_status-status = status.
  t_idoc_status-msgty  = msgty.
  t_idoc_status-msgid  = msgid.
  t_idoc_status-msgno  = msgno.
  t_idoc_status-msgv1  = msgv1.
  t_idoc_status-msgv2  = msgv2.
  t_idoc_status-msgv3  = msgv3.
  t_idoc_status-msgv4  = msgv4.
  t_idoc_status-segnum = segnum.
  t_idoc_status-segfld = segfld.
  t_idoc_status-repid  = repid.
  t_idoc_status-routid = routid.
  APPEND t_idoc_status.

Regards

Kannaiah

Former Member
0 Kudos

Hi,

Use

The following modification scenarios are available to you:

You use the standard IDoc but want to define the processing yourself.

You create a user-defined processing module, which you copy from the standard function module for the respective message type and adjust accordingly.

You use the standard IDoc but want to adjust the standard IDoc processing. That is to say, you want to modify error processing or want to interpret the contents of the IDocs to suit your individual needs.

You activate the customer exits in the standard function module:

If you want to influence error processing, you activate the customer exit for Own error status.

If you want to influence IDoc processing, you activate the customer exit for Own updates.

You use a modified IDoc with user-defined segments and want to execute a particular process for the data from these segments.

You define your own IDoc segments in the standard IDoc and use the customer exit for Own update to process the data from the user-defined segments.

You use a modified IDoc with customized segments and want to define IDoc processing yourself.

You define customized IDoc segments in the standard IDoc and create a customized processing function module.

You use a user-defined IDoc with a new message type and have to implement processing of the IDoc on your own.

You define a user-defined IDoc and create a user-defined processing function module. You can use the standard auxiliary function module to create the function module.

Features

Adjusting the Standard Function Module

As soon as the SAP system has received the IDoc and saved it, the system calls a main function module of the application, which takes over the processing of the IDoc.

At this point, you have the first opportunity to intervene in the IDoc processing, by creating a user-defined function module.

You enter this function module in the SAP menu under Tools ® Business Communication ® IDoc-Basis ® Development ® Inbound Processing Settings ® Message/Application Object.

There, you can also enter an additional partner profile for a certain message variant or message function from the external system in order to differentiate processing in the SAP system.

Main function modules for inbound IDoc processing

Message Type

Function module

Use

WMBBIN

L_IDOC_INPUT_WMBBIN

Blocking storage bin

WMCATO

L_IDOC_INPUT_WMCATO

Canceling TO

WMINFO

L_IDOC_INPUT_WMINFO

Information

WMINVE

L_IDOC_INPUT_WMINVE

System inventory records

WMMBXY

L_IDOC_INPUT_WMMBXY

Goods movements

WMSUMO

L_IDOC_INPUT_WMSUMO

Moving a storage unit

WMTOCO

L_IDOC_INPUT_WMTOCO

Confirming TO

WMTORD

L_IDOC_INPUT_WMTORD_MULTIPLE

Transfer orders (TO)

WMTREQ

L_IDOC_INPUT_WMTREQ

Releasing group

Auxiliary function modules for inbound IDoc processing

Function module

Task

L_IDOC_CONTINUE_SAVE

Continuously save application objects for subsequent activities

L_IDOC_CREATED_OBJECTS_SAVE

Continuously save the documents created from an IDoc

L_IDOC_ERROR_SAVE

Continuously save IDocs with errors

L_IDOC_INPUT_REFRESH

Initialization for IDoc processing (table refresh)

L_IDOC_OK_SAVE

Continuously save processed IDocs

L_IDOC_RETURN_CREATE

Determine and construct status record for the IDoc

L_IDOC_ROLLBACK_SAVE

Update IDoc tables after necessary rollback

L_IDOC_STATUS_CREATE

Determine and construct status record for the IDoc

L_IDOC_TIDOC_FETCH

Fetch internal table for the purpose of status update

With thanks & regards,

Srvani yendru.

Former Member
0 Kudos

HI Gaurab,

You can use Basic Idoc type ACC_DOCUMENT01 or ACC_DOCUMENT03 having msg type ACC_DOCUMENT.

For this you can use FM as IDOC_INPUT_ACC_DOCUMENT.

this you can also use for Goods Movement and Invoice Receipt scenarios.

Regards,

Vivek

0 Kudos

good answer.