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

Function module with process code

Former Member
0 Likes
2,631

Hi,

I have an inbound interface with IDOCs. I have created a SE38 program for its processing as the requirement wont work in a Function module.

I have to create a process code for this interface.

I want to know that if I leave the "Identification" field blank while creating the process code in transaction WE42, i.e., I dont give any FM name then will the interface still work?

What will happen if I dont give any FM while creating the process code?

Thanks,

Abhishek

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,540

Hi,

If you want to go via normal idoc posting mechanism you cannot use report program as posting procedure for Idocs. You have to convert it to Function module/task. Easiest is function module. then you will should be able to attach it in Process code provided you have done other configuration(Like BD51) properly.

The import export parameters you can copy from any standard idoc inbound function module

*" IMPORTING

*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD

*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC

*" 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

The Inbound FM has to have this structure.

The second option is to call IDOC_INBOUND_ASYNCHRONOUS from your report program populating IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40 properly.

5 REPLIES 5
Read only

Pawan_Kesari
Active Contributor
0 Likes
1,540

Are you using message control for this idoc processing?.. If not, then I don't think it will matter (with my best knowledge) .

Read only

Former Member
0 Likes
1,541

Hi,

If you want to go via normal idoc posting mechanism you cannot use report program as posting procedure for Idocs. You have to convert it to Function module/task. Easiest is function module. then you will should be able to attach it in Process code provided you have done other configuration(Like BD51) properly.

The import export parameters you can copy from any standard idoc inbound function module

*" IMPORTING

*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD

*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC

*" 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

The Inbound FM has to have this structure.

The second option is to call IDOC_INBOUND_ASYNCHRONOUS from your report program populating IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40 properly.

Read only

0 Likes
1,540

Actually the function module is triggered whenever an IDOC comes to SAP. However in my case the middleware will create some 2000 IDOCs and I have to start the processing only when all the 2000 IDOCs have come to SAP. I need to perform some aggregation using the records in different IDOCs.

So I have to use a custom program and the function module will be of no use.

So please suggest me how should I proceed...

Thanks,

Abhishek

Read only

0 Likes
1,540

Would you use the data available more than one idoc or you just want to start the idoc processing after 2000 idocs.

Incase you will use data inside idoc as you said correctly you have to use Custom program.

Make sure your partner profile is set as "Collect Idoc" mode otherwise they will be processed immediately.

Control record is stored in EDIDC table where you can check the status get the idoc using message type and staus ( = 64)

The table for idoc data is EDID4. you have to query on this table and field SDATA contains the actual data. So if use segment e.g E1EDK01 declare one workarea type E1EDK01 and then pass EDID4-SDATA to that work area.

After you have used the idocs do not forget to chgange the status of the idocs to "68" ( you can copy the logic to chgange status from program RC1_SET_IDOC_STATUS) so that these do not get processed again.

Another way would be creating a custom table based on your desired format and populate it in the idoc inbound function module . Write standalone program which will then read the data from that custom table and do the processing.

I would suggest the second option as it is more safer to do so.

Hope it helps.

Regds,

Rudra

Read only

Former Member
0 Likes
1,540

You cannot use anything else besides Funtion module.

regards,

Advait