Question:
Hi friends,
I am doing a user exit. In that iam including my code in a Include say 'ZXXX' in that i have 2 includes 'ZXX1' and 'ZXX2' ( one for PBO and one for PAI )..... i ve written my codes inside and when iam activating the include it gives me the following error ???? what iam missing / what ive given extra / what should i do???
Error :
" EACH ABAP PRORAM CAN CONTAIN ONLY ONE "REPORT" OR "PROGRAM" OR "FUNCTION-POOL" STATEMENT" ..................
Expecting ur answers.....(any small idea will surely help me and others too)
Hope my question is clear .....
thanks in advance .............................
_________________
Cheers,
Kripa .,
Upcoming New Abaper......
Answer:
If you double click on the error message or choose the change icon displayed with the error message does it not take you to somewhere in your code where you have a "REPORT" or "PROGRAM" statement or similar?
I'm guessing somewhere you may have defined the top of a program/report which is irrelevant in this scenario as the report/program statement will feed through from the top level calling program.
Does this help?
Answer:
Hi wizbongre,
When i double click on the syntax error, it is going into the PAI module of the program and it is pointing to a place where i ve declared the "class-pool ".... ( if declaring a class-pool is wrong, then is there any other method to create an object for a class?????? without using the class-pool statement in PAI )
the very interesting part is the PAI as such got activated.. the PBO also got activated ... only the main program is not getting acivated...........
I have a Include program say A, and in that i ve two inlcudes of program B and C ( All A,B,C are of the same Type I only ) in that B and C are the PBO and PAI inlcudes of Program A. So as per u ve said, i ve checked the types and everything is of Type I and no other Report / Program name is included in the program.
B and C got activated and A is throwing syntax error ....
So ?????????? now what could i do ????
Thanks & regards,
_________________
Cheers,
Kripa .,
Upcoming New Abaper......
Answer:
It has happend to my programs too. Then I declared the class pools and definitions in the main program. I don't know the reason but it fixed the problem.
Answer:
Hi,
I think its better to tell the whole process which iam doing ( i dont know whether the steps are right as this is the first time iam tryig to implement a user-exit!). So what ever could be the mistake which u encounter in my steps please let me know so that i could correct that!
My requirement is:
1. To add a field in ME51N transaction in the valuation tab, Say a field which captures the text 'AAA' which could be given by the user....
My Understanding and implementation:
1. Got the user exit name to be 'MEREQ001' ( Tcode SMOD )
2 Added a field 'ZZXXX' in the table EBAN and activated the table.
3. From SE80 --> in the function group XM02,created a screen ( of type subscreen '0111' ) and placed a table field text box of name and attributes of
'EBAN-ZZXXX' .....
4. Double clicked the screen '0111' and in that i ve writen some code for its PBO and PAI ......
5. Code in PBO .......MODULE STATUS_0111.
MODULE STATUS_0111 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
TABLES : EBAN.
EBAN-ZZPAYMENT = "TEST PAYMENT".
ENDMODULE. " STATUS_0111 OUTPUT
6. Code in PAI .......... USER_COMMAND_0111 INPUT
*----------------------------------------------------------------------*
***INCLUDE ZXM02I01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0111 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0111 INPUT.
CLASS-POOL
* An object is created for the class IF_PURCHASE_REQUISITION_ITEM
CREATE OBJECT IF_PURCHASE_REQUISITION_ITEM.
* As i want to import the value from the subscreen to a value thruogh
* a function GET_DATA
* Creating a reference variable
DATA : CREF_IF_PR_ITEM TYPE REF TO
IF_PURCHASE_REQUISITION_ITEM.
* Local variable declaration
data : l_mereq_item type mereq_item.
* T_NATR_PAY is the new extended field...
if not CREF_IF_PR_ITEM is initial.
l_mereq_item = CREF_IF_PR_ITEM->get_data( ).
if ( ci_ebandb-ZZPAYMENT ne l_mereq_item-ZZPAYMENT ).
move-corresponding ci_ebandb to l_mereq_item .
call method
CREF_IF_PR_ITEM->set_data( l_mereq_item ).
ex_changed = 'X'.
endif.
*endif.
ENDMODULE. " USER_COMMAND_0111 INPUT
7. Then i activated .... at that time only i got the syntax error.... hope the question is clear now !!
note :
I may be wrong in the way of implememnting the user exit also ..... please correct me if iam wrong and if anyone of u could guide me properly to implement the user exit for the transaction ME51N ... it could be of a great help !!!
Expecting ur answers !! .......
Thanks in Advance !!!!
Revert back if the question is still not clear !!!
_________________
Cheers,
Kripa .,
Upcoming New Abaper......