2011 Nov 27 8:55 AM
Hi experts,
I am calling the program SAPF124 to one function module using keyword SUBMIT and return.
while calling the program in function module it show the STD report out .. but it shouldn't show the std output , i just want to capture the message and send to the function as output. for that i have created the program in Z as ZSAPF124.
now i want to capture the message and want to pass it to function module i have used the
I have used the importing and exporting also
like
append fehlprot-text to it.
free memory id 'ABC'.
export it_log to memory id 'ABC'.
but i couldn capture the message .it shows the std output screen only
Thanks in advance
ajay
2011 Nov 27 9:05 AM
2011 Nov 27 9:05 AM
2011 Nov 27 9:12 AM
Hi expert,
i just want to capture the error log message alone..
for example if ve executed the program SAPF124
the below message i want to capture in function module and display in the output.
Error Log
No clearing procedures were carried out
Thanks ,
Ajay.
2011 Nov 27 9:17 AM
2011 Nov 27 9:22 AM
Hi deepak,
Hope you would ve wrongly understood my requirement.
Actually if i execute the program means i will get a output. in one screen.
I dont want that output. i just want to pass the value from that report to one function module like zsap_module
and i just want to show only the message not the values or the screen.
kindly advice me how to resolve this .
Regards,
AJay
2011 Nov 27 9:33 AM
Hi ,
Shri What you have to do is , After executing Report using Submit , you need to get data from that report .
using that data you can pass on to other function module .
regards
Deepak.
2011 Nov 27 9:47 AM
Hi ,
This is What you want .
Just Copy this code in your ABAP REPORt and change company code and year will give Result .
DATA :lt_selscreen TYPE TABLE OF rsparams WITH HEADER LINE .
lt_selscreen-SELname = 'BUKRX'. " Company Code
lt_selscreen-sign = 'I'.
lt_selscreen-option = 'EQ'.
lt_selscreen-low = 'BFL'.
append lt_selscreen.
lt_selscreen-SELname = 'GJAHX'. " Year
lt_selscreen-sign = 'I'.
lt_selscreen-option = 'EQ'.
lt_selscreen-low = '2011'.
append lt_selscreen.
data : listtab like abaplist occurs 1 .
data : txtlines(20000) type c occurs 0 with header line.
data : n type int2 .
data : cnt type i value 1 .
data : delimiter(1) value '|'.
submit SAPF124 WITH SELECTION-TABLE lt_selscreen with x_shblf = 'X'
exporting list to memory
and return .
call function 'LIST_FROM_MEMORY'
tables
listobject = listtab
exceptions
not_found = 1
others = 2.
*if sy-subrc <> 0.
*
*endif.
call function 'LIST_TO_ASCI'
tables
listobject = listtab
listasci = txtlines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
describe table txtlines lines n .
data : final_message(40) type c,
one_less type i .
one_less = n - 1 .
loop at txtlines.
if cnt = one_less .
final_message = txtlines .
endif.
cnt = cnt + 1 .
clear txtlines .
endloop.
write : Final_message .
"Your Error log message will be in Final_mesage Varaible .
regards
deepak.
Edited by: Deepak Dhamat on Nov 27, 2011 10:48 AM
Edited by: Deepak Dhamat on Nov 27, 2011 10:54 AM
2011 Nov 27 10:28 AM
Hi Deepak ,
Great. Really ur code helped me a lot.. Thanks a lot ji,, Can i get ur mobile no?
Thanks ,
Ajay
2011 Nov 27 10:46 AM
Hi experts,
I have used ur code . if its test run i am able to fetch the message if its its production run means its not fetching any message from the database.
Just remove the tick mark from the test run n execute.
kindly check and guide me thanks in advance.
Reagrds,
Ajay.
2011 Nov 27 11:11 AM
Hi ,
Check if there is some settings left in OB74
regards
Deepak.
2011 Nov 27 11:17 AM
Hi ,
it is just message that it is not test run => After enter it will actually update database .
regards
deepak.
2011 Nov 27 11:18 AM
Hi Deepak ,
I ve checked OB74 Setting .. but stil it remains the same.
Thanks,
Ajay
2011 Nov 27 11:22 AM
Hi Deepak,
if its not test run ,. its production run. we need it to test in production run only . if i run production run means its not displaying any records,
Kindly help me to reslove this issue
Thanks ,
AJAY.
2011 Nov 27 11:31 AM
hI ,
When you are running in Prduction : it is actually updating or Clearing Account .
what message it will be giving after executing report , it will be there .
You need to execute that and Check , There is no other option , Better Test the same in SANDBOX .
regards
Deepak.
2011 Nov 27 11:36 AM
Hi deepak,
i Can understand ... i have one more doubt actually u ve hard coded the company code n year ..
For ma case i should pass the company code n year from outside... user ll give any company code or year.. so through function module i should give input to the program SAPF124.
Hope u understood my requirement now. Kindly help me to resolve this .
Thanks in advance. can i get ur mob no ?
Regards,
AJay.
2011 Nov 27 12:16 PM
Hi Deepak,
Thanks a lot for spending your valuable time for me to solve this issue.
Greatfull thanks to u Deepak..
Regards,
Ajay.
2011 Nov 28 4:13 AM
Hi ,
There is no need of function module ,
You can pass those Company code and Year using parameter to ranges or directly to submit report .
parameters : p_comp type bseg-bukrs ,
p_gjahr type bseg-gjahr .
**
DATA :lt_selscreen TYPE TABLE OF rsparams WITH HEADER LINE .
lt_selscreen-SELname = 'BUKRX'.
lt_selscreen-sign = 'I'.
lt_selscreen-option = 'EQ'.
lt_selscreen-low = p_comp.
append lt_selscreen.
lt_selscreen-SELname = 'GJAHX'.
lt_selscreen-sign = 'I'.
lt_selscreen-option = 'EQ'.
lt_selscreen-low = p_gjahr.
append lt_selscreen.
regards
Deepak.
4 weeks ago
or pass directly the values to SAPF124 without using LT_SELSCREEN:
submit SAPF124 WITH x_shblf = 'X'
WITH BUKRX = p_comp " Company Code ('BFL')
WITH GJAHX = p_gjahr " Year ('2011')
exporting list to memory
and return.
*submit SAPF124 WITH SELECTION-TABLE lt_selscreen with x_shblf = 'X'