2012 May 28 10:12 AM
Hi SAPians,
I am creating a module pool program, from which i need to call a independent ALV report, can i do this.
What i did as a soultion is created a TCode for that particular Report and i called it through " Call Transaction' statement.
But noe the situation is when i give the particular Sales No. as input instead of executing it , it comes back.
Can anybody give me a solution for this.
Do we have any Function module to do this.
thank you
2012 May 28 10:22 AM
If this is a report, wshy don't you use a SUBMIT report_name WITH parameter_name = parameter_value AND RETURN ?
But noe the situation is when i give the particular Sales No. as input instead of executing it , it comes back.
This part, i did not understand ?
Regards,
Raymond
2012 May 28 10:35 AM
Hi Mr Giuseppi,
i did try even that (Submit report_name ). But when we execute the SUBMIT statement
Ex: i had given like this
Sumbit report_name with parameter_name = Parameter_value.
parameter_name = what i had defined as parameter
but in parameter_value = tablename-field_name i had given like this
as i cannot give vlue directly.
And also i didn't use RETURN.
-----------------------------------------------------------------------------------------------------------------------------
and the other query that coming back instead of executing is. I am in a screen ,when i click a button say report it goes to input screen after entering the input value and press execute,
instead of executing it goes back to the screen where i pressed the Report Button.
2012 May 28 10:55 AM
That is standar behavior if you don't put the AND RETURN option, you left the current transaction/program. (Ref SUBMIT AND RETURN or press F1 on Abap editor)
Regards,
Raymond
2012 May 28 11:14 AM
hmm nope.....its showing a message .saying that " Enter proper Input Value". msg which i gave in
my message class.
and when i click Enter. it shows an Empty list
2012 May 28 11:22 AM
Hi Rohan,
Is the value getting passed properly ? What is the value on the selection screen of the program which you are submitting ? Is it the correct value... Pls check. Looks like the value is not passed properly.
Thanks,
Best regards,
Prashant
2012 May 28 11:31 AM
Hi Prashant,
If i Execute the Report independently ,i gets executed properly.
i have created a Tcode for that Report, "so firstly forget SUBMIT (looking for options)."
so ,if i call the same report through module pool program, the input screen comes ,where in enter
my input value say 12345. when i click Execute button. Instead of Executing it goes back to same screen from where i called the report.
-------------------------------------------------------------------------------------------------------------------------------------
Now come to the second option i.e., SUBMIT , when i use submit i also gave the parameter , so now when i execute it or click on report button it asks for proper input.
But i cannot give 12345 directly in the SUBMIT statement right.
what can i do.
2012 May 28 11:43 AM
parameter_name = what i had defined as parameter
Is this parameter belongs to your ALV report? Please check.
Regards,
Jake
2012 May 28 11:56 AM
2012 May 28 12:35 PM
Mr Giuseppi,
can you say what should be in Parameter_value . does it has to be any prewritten value (ex:12345)
or table/structure-field.
2012 May 28 1:01 PM
It can be any variable of the calling program or any subfield of a structure or a constant.
you must specify a data object whose data type can be converted to the data type of the selection screen component sel.
(ref WITH expr_syntax1)
Regards,
Raymond
2012 May 28 12:12 PM
Please anybody have a solution.
lets make it very simple.:
i have an Independent ALV report, i like to call it in my module pool program with a click of a button.
can i do this. after all the experiment i done.
2012 May 28 1:02 PM
Hi Rohan,
As per standard behavior If you omit the AND RETURN addition, all data and list levels of the calling program (the entire internal session) are deleted. After the called executable program has finished, control returns to the level from which you started the calling program.
In your scenario, I think its problem with passing parameters. Try to use conversion exit before you pass the parameters. Please see the below peace of code.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lv_start
MPORTING
output = lv_start.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lv_end
IMPORTING
output = lv_end.
SUBMIT zprogram WITH p_start EQ lv_start
WITH p_end EQ lv_end.
Hope its solves your problem.
Regards,
Rajesh
2012 May 28 1:03 PM
Hi,
Yes you can do it.
At first, when user press button u write SUBMIT program.
e.g SUBMIT report_name
WITH p_param = 'value_of_param'
AND RETURN.
Specify the report name, the parameter name(p_param) and the value to be passed for the parameter.
when the SUBMIT is executed the report output would be displayed, and when user click back then control should go to the module pool program.
2012 May 28 1:16 PM
Hi Md.Anas Khan,
I did as you have posted, but the resulting list doesn't show value when it does have value.
When it is executed for the same Sales No. it shows the List.
in 'value_of_param' if i give value Ex: 12345 it shows the result list.
but when i give it as vbap-vbeln it does not show the selection-screen.
nor does it show any list only field names are shown.
regards.
2012 May 28 1:32 PM
Hi Rajesh,
I have done it as you have posted, but what should i define lv_start and lv_end.
data : lv_start type c,
lv_end type c.
data: p_start like lv_start,
p_end like lv_end.
2012 May 28 1:40 PM
Hi Rohan,
By your reply it seems that the report is working fine when u pass hardcoded value but it doesnt work when u pass value using a variable.
Is my uinderstanding correct. please correct me if I m wrong.
Please debug it, and find the reason for not getting the values in the ALV.
Put the breakpoint at the select and check the where clause variable.
It might be a problem with the data type.
2012 May 28 1:59 PM
Hi,
your exactly right, in ALV report i used a Subroutine to retrieve the Data,
so when i debugged the report it shows that it is not fetching data.
what can i do.
2012 May 28 2:23 PM
Hi Rohan,
Please check the WHERE clause variable(the submit report parameter), is it of the same type as the database table field.
IF yes, then pass the same value in SE16 n check whether there is an entry for that value.
Most probably, its an issue with the data type OR the data doesnot exist in the table.
2012 May 28 12:50 PM
Dear Rohan,
If your report has a selection screen to fill, please use SUBMIT AND RETURN statement. Another way is to have a button placed on the application toolbar and write the SUBMIT/CALL TRANSACTION statement on PAI event.
If you don't have a selection screen, then please call your ALV screen from the PAI of the module pool program.
2012 May 28 2:02 PM
Hi Abhijith,
i do have a Selection-screen in my ALV report,
and also i tried both SUBMIT/CALL TRANSACTION statement on PAI Event,
nothing is working properly.
please give some suggestions.
2012 May 28 1:22 PM
Dear Rohan ,
Kindly check the below code, this may help you........
Note: In ALV Report selection screen parameter field must have a parameter id....
Regards,
Srinivasan R.
2012 May 28 1:35 PM
Hi Srinivasan,
the code snippet you posted and the code i have written are similar for call transaction case,
but the result remains the same, i.e., When i give input in selection-screen and press execute
it comes back to the screen through which i have called the ALV report.