‎2011 Jun 07 7:55 AM
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.
‎2011 Jun 07 8:33 AM
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
‎2011 Jun 07 9:00 AM
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
‎2011 Jun 07 9:34 AM
Hi Chen,
You are right i was suggesting to use the code in a function module...
Regards,
Nagaraj
‎2011 Jun 07 9:08 AM