‎2007 May 09 5:07 PM
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
‎2007 May 09 5:11 PM
Can we let us know the error that you are getting ??
Regards,
Santosh
‎2007 May 09 7:29 PM
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.
‎2007 May 09 5:12 PM
‎2007 May 09 7:31 PM
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.
‎2007 May 09 7:33 PM
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.
‎2007 May 09 7:38 PM
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
‎2007 May 09 5:13 PM
Activate ur function group in SE80 or use se38 using SAPLXXXX - XXXX is ur function group.
Reward points if it is helpful
Thanks
Seshu
‎2007 May 09 7:32 PM
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
‎2008 Jun 11 10:09 AM
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.