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

error in the function group

Former Member
0 Likes
936

Hello..

I created a function group and that contains a function module which had a include program.Iam getting a error with that even i could not keep a break point with that error.If i execute this functionmodule containing this include program i am geting the error.

In functionmodule these are the import,export and tables that are used.

:

*" IMPORTING

*" VALUE(MESSAGE_TYPE) LIKE TBDME-MESTYP

*" VALUE(IDOC_TYPE) LIKE EDIDC-IDOCTP

*" VALUE(SEGMENT_NAME) LIKE EDIDD-SEGNAM

*" EXPORTING

*" VALUE(IDOC_CIMTYPE) LIKE EDIDC-CIMTYP

*" TABLES

*" IDOC_DATA STRUCTURE EDIDD

INCLUDE Z123.

In the above include z123 program i wrote the below code.

perform debmas_exit tables idoc_data using message_type segment_name .

*----


***INCLUDE ZXVSVF01 .

*----


&----


*& Form debmas_exit

&----


  • text.

----


  • -->P_IDOC_DATAtext

  • -->P_MESSAGE_Ttext

  • -->P_SEGMENT_Ntext

----


form debmas_exit tables p_idoc_data structure edidd

using p_message_type

p_segment_name.

*angemys Bankdata

data: te1knbkm like e1knbkm,

l_iban like tiban-iban.

if p_message_type eq 'ZDEBMASBK' or

p_message_type eq 'ZDEBMASBKI' . "Validating message type

if p_segment_name eq 'E1KNBKM'. "Validating segment name

loop at p_idoc_data where segnam = p_segment_name.

move p_idoc_data-sdata to te1knbkm.

select single iban

from tiban

into l_iban

where banks eq te1knbkm-banks

and bankl eq te1knbkm-bankl

and bankn eq te1knbkm-bankn.

if sy-subrc eq 0.

move l_iban to te1knbkm-stras.

move te1knbkm to p_idoc_data-sdata.

modify p_idoc_data transporting sdata.

endif.

endloop.

endif. "Segment Name

endif. "Message Type

endform. " debmas_exit

9 REPLIES 9
Read only

Former Member
0 Likes
890

Can we let us know the error that you are getting ??

Regards,

Santosh

Read only

0 Likes
890

Hello ..

I got the error like

"incorrect nesting:Before the statement "FORM",the structure introduced by function must be concluded by endfunction."

But in my program of function module after the include statement i kept endfunction.Plz do this practically and see the error.

Read only

Former Member
0 Likes
890

Hi,

what is the error you are getting??

Thanks,

Naren

Read only

0 Likes
890

Hello ..

I got the error like

"incorrect nesting:Before the statement "FORM",the structure introduced by function must be concluded by endfunction."

But in my program of function module after the include statement i kept endfunction.Plz do this practically and see the error.

Thanks.

Read only

0 Likes
890

Just use your FORM-ENDFORM in an include of the function group instead of the body of the Function module.

You dont require to use the INCLUDE statement just write PERFORM in the body of the FM.

This error will be rectified.

Regards.

Amit

reward all helpful replies.

Read only

0 Likes
890

Not sure if it will allow you to do so or not, but try to put the INCLUDE after the ENDFUNCTION.

*" IMPORTING
*" VALUE(MESSAGE_TYPE) LIKE TBDME-MESTYP
*" VALUE(IDOC_TYPE) LIKE EDIDC-IDOCTP
*" VALUE(SEGMENT_NAME) LIKE EDIDD-SEGNAM
*" EXPORTING
*" VALUE(IDOC_CIMTYPE) LIKE EDIDC-CIMTYP
*" TABLES
*" IDOC_DATA STRUCTURE EDIDD


PERFORM ........


ENDFUNCTION.


INCLUDE Z123.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
890

Activate ur function group in SE80 or use se38 using SAPLXXXX - XXXX is ur function group.

Reward points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
890

Hi,

Make sure you have this..Marked in bold..

*" IMPORTING

*" VALUE(MESSAGE_TYPE) LIKE TBDME-MESTYP

*" VALUE(IDOC_TYPE) LIKE EDIDC-IDOCTP

*" VALUE(SEGMENT_NAME) LIKE EDIDD-SEGNAM

*" EXPORTING

*" VALUE(IDOC_CIMTYPE) LIKE EDIDC-CIMTYP

*" TABLES

*" IDOC_DATA STRUCTURE EDIDD

INCLUDE Z123.

<b>ENDFUNCTION.

FORM ...

ENDFORM.</b>

Thanks,

Naren

Read only

Former Member
0 Likes
890

Hi,

Do not keep any FORM....ENDFORM inside the function module. Instead go to include program (Click on FM Menu GOTO-->Main Program) and choose a Include program or create one more. Then keep this FORM....ENDFORM inside this include program and then use the PERFORM statement in your function module.