04-05-2006 7:46 PM
i put in include
form xxxx
endform.
and i get error why?
what should i do?
04-05-2006 7:50 PM
hi,
perform xxxx.
..
..
..
....
form xxxx.
endform.
what is the error.
regards
vijay
04-05-2006 7:50 PM
hi,
perform xxxx.
..
..
..
....
form xxxx.
endform.
what is the error.
regards
vijay
04-05-2006 7:56 PM
i use fm alv
i put 'USER_COMMAND'
MAKE
FORM USER_COMMAND
ENDFORM.
GET ERR FORM AMD ENDFORM.
04-05-2006 7:58 PM
hi,
it should be..
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
case r_ucomm.
when 'BACK' or 'CANC' or 'EXIT'.
endcase.
ENDFORM. "USER_COMMAND
regards
vijay
04-05-2006 7:58 PM
04-05-2006 7:59 PM
Hi,
Are you sure its just not a syntax error. I can't see a period of the FORM USER_COMMAND.
It could be a silly mistake.
Regards,
Ravi
04-05-2006 8:05 PM
I'M AT HOME NOW SO I DONT HAVE THE CODE
BUT
I HAVE MAIN PROG
FORM XX
INCLUDE YY.
ENDFORM.
IN THE INCLUDE
I PUT CALL FUNCTION alv_GRID
AND THE FORM USER_COMMAND.
AS VAIJA MENTION.
04-05-2006 8:09 PM
I don't think that you can do that, have an INCLUDE inside of a FORM. Put the INCLUDE statement at the end of your program outside the FORMS, you can include your code by wrapping it in a another FORM which is in the INCLUDE.
FORM XX.
perform call_alv_grid.
ENDFORM.
include YY.
Now in the include source, have a FORM.
**include YY.
form call_alv_Grid.
* Do whatever.
endform.
Also you can call the FORM directly instead of going thru the FORM XX.
Make sense?
Regards,
Rich Heilman
04-05-2006 8:25 PM
It is the same concept that I talked about earlier. Of course I was assuming that you are working with a function module user exit, which turned out to be wrong.
You should remember that an include within a code will be replaced in its entirity during compilation. So if I expand your include it looks something like
FORM XX.
CALL FUNCTION ..ALV GRID...
FORM USER_COMMAND.
ENDFORM. " OF USER_COMMAND
ENDFORM. " OF XX.
So essentially you are writing nested FORMs which is not allowed.
04-05-2006 7:51 PM
Well ideally you should not get a error, can you tell us what is the error message?
Regards,
Ravi
04-05-2006 7:58 PM
Assuming that this include is part of a function module user exit, then it is not allowed as you are putting a FORM... ENDFORM inside of a FUNCTION .. ENDFUNCTION code.
Remember, an include within a function module is just normal code that you would otherwise insert between the FUNCTION... ENDFUNCTION.