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

How to call Z-Function module from BAPI_IDOC_INPUT1.

Former Member
0 Likes
4,963

Hi All,

Process code is :BAPI and standard function module is BAPI_IDOC_INPUT1.

I am coding all the logic for the INBOUND IDOC in the Z-Function module ZIDOC_INPUT_ZGOODSMOVEMENTOIL.

My requirement is:

Process code fires the inbound function module BAPI_IDOC_INPUT1, this in turn call the function module ZIDOC_INPUT_ZGOODSMOVEMENTOIL.

How can i call ZIDOC_INPUT_ZGOODSMOVEMENTOIL from BAPI_IDOC_INPUT1 to process the idoc.

Thanks in Advance.

Regards,

Umesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,829

You cannot directly call the Z-function module from Standading processing FM "BAPI_IDOC_INPUT1" (See lines 30 to 36). For that you have to create a Custom BAPI object & Method, and link the Z-function module to the BAPI method. Read SAP Documentation on [Maintaining BAPI-ALE Interfaces |http://help.sap.com/saphelp_nw70ehp2/helpdata/en/78/21740f51ce11d189570000e829fbbd/frameset.htm] for more details.

10 REPLIES 10
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
2,829

Hi

Why can't u go for Custom Process code and attach ur custom ZIDOC_INPUT_ZGOODSMOVEMENTOIL.

to the custom process code as you are not want to fire the standard FM.

Regards,

Sreeram

Read only

Former Member
0 Likes
2,829

Hi,

aht happens, if you give your fm "ZIDOC_INPUT_ZGOODSMOVEMENTOIL" as parameter INPUT_METHOD on call of BAPI_IDOC_INPUT1?

Regards,

Klaus

Read only

Former Member
0 Likes
2,830

You cannot directly call the Z-function module from Standading processing FM "BAPI_IDOC_INPUT1" (See lines 30 to 36). For that you have to create a Custom BAPI object & Method, and link the Z-function module to the BAPI method. Read SAP Documentation on [Maintaining BAPI-ALE Interfaces |http://help.sap.com/saphelp_nw70ehp2/helpdata/en/78/21740f51ce11d189570000e829fbbd/frameset.htm] for more details.

Read only

0 Likes
2,829

Hi,

Thanks everyone for your reply.

I developed Z-Function module and generated ALE-BAPI interface making BOR object through BDBG transcation.

So, How it will trigger inbound function module do i have to do any cofiguration to link Process code,Message type and idoc type also how it gets linked to BAPI_IDOC_INPUT1.

regards,

umesh

Read only

0 Likes
2,829

Hi Umesh,

Just you need to add your custom Message Type in Partner Profile WE20 and set the process code as BAPI.

Since you have generated BAPI ALE Interface via BDBG,The system will fetch the Inbound function module which was generated by BDBG based on Message type from Table TBDBE or TBDBA.

No need to set custom process code.

Hope I have answered your question.

Thanks,

Krush

Read only

0 Likes
2,829

Hi Krush,

Thanks for your reply,

Now i can trigger the idoc.

I have one more problem that if i want to add another z-segment to the attached idoc type its not allowing me its saying that it is already generated and cannot be changed.

if i am generating the BDBG transaction its not asking for specific segment and it automatically takes the segment and generates the function module.

How i can add an additinal z-segment to the idoc type and it generate through BDBG transaction to include in inbound function module?

Thanks in Advance.

Regards,

Umesh

Read only

0 Likes
2,829

Hi Umesh,

We can not change the Idoc type using WE30 which is generated by BDBG.if you want to add new z segment to your existing Idoc type.Then you have to add the fields/structure in the BAPI/BOR first and regenerate idoc type using BDBG.The new segments will be added to the existing idoc type.

hope I have answered your question.

Thanks,

Krush

Read only

0 Likes
2,829

Hi Krush and Everyone,

I got the solution.

Regards,

Umesh

Read only

0 Likes
2,829

Hi,

Can we just use custom message type with the standard idoc MBGMCR03?

Read only

Former Member
0 Likes
2,829

HI Umesh,

You can try with the implicit enhancement available at the beginning of the BAPI, if you are on an older version and do not have the enhancement framework the only option left is go to with a custom process code.

Regards,

Chen