‎2010 Sep 28 12:19 PM
Hello;
I have created a BAPI which doesnt have any data i want to put some data in that BAPI so tried with constants but it is not working..how put hard code data in function module..when i put the data it gives error stating that 'Function-Pool' should not be the first statement..
Thanks and Regards,
Om.
‎2010 Sep 28 12:24 PM
Hello,
Did you try putting the constants in the TOP include of the function group ?
BR,
Suhas
‎2010 Sep 28 12:24 PM
Hello,
Did you try putting the constants in the TOP include of the function group ?
BR,
Suhas
‎2010 Sep 28 12:28 PM
Hi;
No i did not but if i put constants in function module then is it necessory to define it in TOP include...
Thanks,
om.
‎2010 Sep 28 12:30 PM
well local constants are somewhat senseless so yeah declare them in the top include of the function group. they will be known in the whole function group.
‎2010 Sep 28 12:33 PM
ok that means the same declearation i had define in the function module the same thing i hjave to define in the TOP include..OM
‎2010 Sep 28 12:32 PM
Hi..
declare the constant in top include of fucntion group and then activate the function group..
Hope this will help you..
Regards,
Kiran
‎2010 Sep 28 12:38 PM
HI;
Ya I did it but still i am facing the same problem...can u just tel me is this right
DATA: Total TYPE p DECIMALS 3.
CONSTANTS: BEGIN OF sampledata,
CARRID TYPE c LENGTH 5 VALUE 'AA',
SEATSMAX TYPE i value '600',
SEATSOCC TYPE i value '500'.
CONSTANTS end OF sampledata.
Export
CARRID = 'AA'
CURRENCY = 'USD'
SEATSMAX = '600'
SEATSOCC = '500'
Total = 100 * ( seatsocc / seatsmax ).
‎2010 Sep 28 12:33 PM
Hi!
If you are using SE80 for editing your function group, you will see under the includes tab the TOP include.
You can enter the constants here, right after the FUNCTION-POOL command.
For example if your function group is called ZMYFUGR, then the top include will be LZMYFUGRTOP.
Regards
Tamá
‎2010 Sep 28 12:36 PM
Hi;
Thanks for replying..Yup I am facing the same problem...Is that constant will get reflected in the o/p wehn i activate it.
Thanks and regards;
Om.
‎2010 Sep 28 1:13 PM
HI;
Ya I did it but still i am facing the same problem...can u just tel me is this right
DATA: Total TYPE p DECIMALS 3.
CONSTANTS: BEGIN OF sampledata,
CARRID TYPE c LENGTH 5 VALUE 'AA',
SEATSMAX TYPE i value '600',
SEATSOCC TYPE i value '500'.
CONSTANTS end OF sampledata.
Export
CARRID = 'AA'
CURRENCY = 'USD'
SEATSMAX = '600'
SEATSOCC = '500'
Total = 100 * ( seatsocc / seatsmax ).
‎2010 Sep 28 1:19 PM
Hi
In your program itself you are declarting the structure,
First yoou have check the corresponding Function group in SE80.
Goto SE80 ->Package Name->Function Group->Includes->
CONSTANTS: BEGIN OF sampledata,
CARRID TYPE c LENGTH 5 VALUE 'AA',
SEATSMAX TYPE i value '600',
SEATSOCC TYPE i value '500'.
CONSTANTS end OF sampledata.
ActivateFunction group
In Your report just call the variable/structure
Total = 100 * ( seatsocc / seatsmax ).
‎2010 Sep 28 1:40 PM
Hello;
I did it but what result i want that i m not getting..can u able to send me simple code which can calculate the area of circle with the help of RFC BAPI Function module..hope u must have understand..Thanks...OM
‎2010 Sep 28 1:40 PM
Hello;
I did it but what result i want that i m not getting..can u able to send me simple code which can calculate the area of circle with the help of RFC BAPI Function module..hope u must have understand..
‎2010 Sep 28 1:41 PM
If they are import parameters then you can specify default values in the function module interface.
‎2010 Sep 28 1:45 PM
i did it,,but m facing error it says 'FUNCTION-POOL' should not be the first statement...Om
‎2010 Sep 28 2:04 PM
Goto SE37 for your function module then use "Goto -> Main Program". Go into the first Include you see at the top of the main program (usually the top include). The first statement in the Include should be similar to FUNCTION-POOL <your function module name>.
If it is then go back to the main program Include, double click into each Include and activate each include separately. Do this until all Includes are active. Let me know what happens.
‎2010 Sep 28 2:17 PM
‎2010 Sep 28 2:53 PM
Hi;
Now i can enter the data but the inter table has 0 entries when i fetch the data..It will not return the RETURN value but it wont give any error..also..Om
‎2010 Sep 28 3:01 PM
Post the code you have between the FUNCTION and END FUNCTION statements including the function module interface parameters. Also post the code from your TOP include.
‎2010 Sep 28 3:07 PM
Moderator message - Sorry - this forum is not a training forum Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again. Thread locked. Rob