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

bdc HELP

Former Member
0 Likes
700

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
670

HI

Write the FORM ENDFORM after the ENDFUNCTION.

Message itself is clear that Fucntion module is not closed....

surya

6 REPLIES 6
Read only

Former Member
0 Likes
671

HI

Write the FORM ENDFORM after the ENDFUNCTION.

Message itself is clear that Fucntion module is not closed....

surya

Read only

0 Likes
670

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

Read only

0 Likes
670

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.

Read only

0 Likes
670

can i use BADIs for this...are form....end forms are allowed in BADIs??

Read only

Former Member
0 Likes
670

HI,

Within function module, forms are not allowed.

Regards,

Mansi.

Read only

Former Member
0 Likes
670

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.