‎2009 Aug 21 12:45 PM
Hi all,
I have implemented one user-exit...in that i m calling BDC transaction...i have written all perform statemensts and then call transaction...
NOTE : I M CALLING PERFORMING BDC STATMENTS IN USER-EXIT..AS THE USER-EXIT IS FUNCTION MODULE..THATS WHY IT IS SHOWING ERROR..PLS HELP
-
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
CALL TRANSACTION 'FK01' USING bdcdata
MODE 'N'
UPDATE 'S'
MESSAGES INTO it_messtab.
----
Start new screen *
----
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
----
Insert field *
----
FORM bdc_field USING fnam fval.
IF fval <> ' '.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
i m getting error as " incorrect nesting : before the statment "FORM",the structure introduced by "FUNCTION" must be concluded with "ENDFUNCTION".
‎2009 Aug 21 12:48 PM
HI
Write the FORM ENDFORM after the ENDFUNCTION.
Message itself is clear that Fucntion module is not closed....
surya
‎2009 Aug 21 12:48 PM
HI
Write the FORM ENDFORM after the ENDFUNCTION.
Message itself is clear that Fucntion module is not closed....
surya
‎2009 Aug 21 12:51 PM
as i said...it is user-exit..i wrote this code in one include which is present in FM...
FUNCTION EXIT_SAPFP50M_002.
*"----
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(TCLAS) LIKE PSPAR-TCLAS
*" VALUE(INNNN) LIKE PRELP STRUCTURE PRELP
*" VALUE(PSAVE) LIKE PRELP STRUCTURE PRELP
*" VALUE(IPSYST) LIKE PSYST STRUCTURE PSYST
*" VALUE(I001P) LIKE T001P STRUCTURE T001P
*" VALUE(I503) LIKE T503 STRUCTURE T503
*" EXPORTING
*" VALUE(INNNN) LIKE PRELP STRUCTURE PRELP
*" VALUE(SHOW_DATA_AGAIN)
*" CHANGING
*" VALUE(IPREF) LIKE PREF STRUCTURE PREF
*" EXCEPTIONS
*" ERROR_OCCURED
*"----
INCLUDE ZXPADU02.
ENDFUNCTION.
In above include i have written my BDC code
‎2009 Aug 21 12:54 PM
Hi
As forms are not allowed in the FM, what you can do is have the perform statement in the include and write the form..endform in another program,as subroutines are global,it will work fine.
Vishwa.
‎2009 Aug 21 1:01 PM
can i use BADIs for this...are form....end forms are allowed in BADIs??
‎2009 Aug 21 12:51 PM
HI,
Within function module, forms are not allowed.
Regards,
Mansi.
‎2009 Aug 21 12:53 PM
Write ur subroutine in some other program (subroutine pool) and call this subroutine as follows
Perform xyz using abc in program ztest.
or write ur subroutine isnide a include and use this include in the FM and simply call the subroutine from FM as u are calling.
Hope this will help u.