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 BDC within user exit

Former Member
0 Likes
1,009

Hi All,

I am trying to generate a BDC recording within a function exit. I have declared the BDCRECX1 include within the TOP include of the function group. But the include BDCRECX1 which actually contains all the FORMs also contains a selection-screen defined in it. I am not able to activate it because it gives me the following error "SELECTION-SCREEN statements can only be used between SELECTION-SCREEN BEGIN and END OF SCREEN (program type is not "1")" Is it because we are not allowed to define a selection screen between Function-Endfunction which defines a function exit?

Please let me know why this error is generated and the step to rectify it.

4 REPLIES 4
Read only

former_member404244
Active Contributor
0 Likes
866

Hi,

You can create a custom function module in the customer function exit with the BDC .

Import parametres like this in the fm.Just a snippet of code for your reference



VALUE(CTU) LIKE  APQI-PUTACTIVE OPTIONAL
*"     VALUE(MODE) LIKE  APQI-PUTACTIVE OPTIONAL
*"     VALUE(UPDATE) LIKE  APQI-PUTACTIVE OPTIONAL
*"     VALUE(GROUP) LIKE  APQI-GROUPID OPTIONAL
*"     VALUE(USER) LIKE  APQI-USERID OPTIONAL
*"     VALUE(KEEP) LIKE  APQI-QERASE OPTIONAL
*"     VALUE(HOLDDATE) LIKE  APQI-STARTDATE OPTIONAL
*"     VALUE(NODATA) LIKE  APQI-PUTACTIVE DEFAULT '/'
also specify the fields you are doing in the BDC

PERFORM bdc_nodata      USING nodata.

    PERFORM open_group      USING group user keep holddate ctu.

Regards,

Nagaraj

Read only

0 Likes
866

Hi Nagaraj,

What Smitha is trying to accomplish here is reuse the subroutines that are available within the INCLUDE bdcrecx1.

Smitha - You cannot re-use the INCLUDE bdcrecx1 as it is, you will have to create a copy of it and take out all the code that relates to selection screen and reference to these selection parameters within the subroutines, as selection screen can be in programs type "1" - that is executable/report programs.

I guess you will need only the subroutines FORM BDC_DYNPRO USING PROGRAM DYNPRO. and FORM BDC_FIELD USING FNAM FVAL. just copy these routines into a new include. And you can use declare BDCDATA in the global data of the Function group.

If you ask me, i guess you could just write these 10-15 lines of code within the same include of the function exit and proceed rather than taking all this trouble.

Regards,

Chen

Read only

0 Likes
866

Hi Chen,

You are right i was suggesting to use the code in a function module...

Regards,

Nagaraj

Read only

RaymondGiuseppi
Active Contributor
866

Don't include BDCRECX1 but include BDCRECXY in the TOP part of the function group.

Regards,

Raymond