10-05-2011 6:46 AM
Hello All,
I am calling a report program using below
SUBMIT program EXPORTING LIST TO MEMORY
AND RETURN.
the program called is having one inforamtion message and is coming out after this message appears on screen. I want to capute this information message and need to display in my main program.
Please let me know how capture this type of messages in SUBMIT.
Thanks in advance.
Regards,
Ganesh.
10-05-2011 6:51 AM
Hi Ganesh,
i think it is not possible, don't display messages in called program. pass back to the calling program.
Regards,
Surya
10-05-2011 6:59 AM
Hi Surya,
I can not change the called program as changing it will have huge impact on many objects in our project. But how about if we SUBMIT program to the spool.
can i retrive that message from there..?
Regards,
Ganesh.
10-05-2011 7:11 AM
Hi ,
DATA: text TYPE c LENGTH 10,
lt_selscreen TYPE TABLE OF rsparams WITH HEADER LINE .
lt_selscreen-sign = 'I'.
lt_selscreen-option = 'EQ'.
lt_selscreen-low = '7100'.
append lt_selscreen.
FIELD-SYMBOLS <lt_pay_data> TYPE ANY TABLE.
DATA lr_pay_data TYPE REF TO data.
cl_salv_bs_runtime_info=>set( EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
Submit Wage Type Reporter
SUBMIT ZMR113_NON_MOVING_AGING WITH SELECTION-TABLE lt_selscreen with so_werks ='7100' AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = lr_pay_data ).
ASSIGN lr_pay_data->* TO <lt_pay_data>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).
THis Code i used in my report it was Created by Glen Simpson Expert Blogger : it was nice piece of code to Gain Access from Other ALV Report of SAPGUI
regards
Deepak.
Edited by: Deepak Dhamat on Oct 5, 2011 8:18 AM
Edited by: Deepak Dhamat on Oct 5, 2011 8:21 AM
10-05-2011 7:40 AM
Hi Deepak,
we are working on SAP 4.7c and I am not able to find the class 'cl_salv_bs_runtime_info' in system .
I want to capture that information message as well as i want to get the output of called program in calling program to process it further in calling program.
Regards,
Ganesh.
10-05-2011 7:44 AM
Hi ,
Can you tell me program name which you are using for submit .
regards
Deepak.
10-05-2011 8:05 AM
Hi Deepak,
Its a custome program to upload a file and than validate that file is correct if used for posting data by FB01. Same progarm is also used for posting so we can't make any changes as it is being used in lots of program.
Information message is " Total debit and total credit do not match in file'.
Thanks,
Ganesh.
Edited by: Ganesh Lathi on Oct 5, 2011 9:06 AM
10-05-2011 8:15 AM
HI Ganesh ,
You are Calling Custom Program in submit or FB01 .
we stiil did'nt get what exactly you are achieving .
regards
Deepak.
10-05-2011 8:19 AM
Hi Ganesh,
I dont know whether this will help you or not.
If instead of submitting the program if you create a background job for the submitted program.
Here you can catch the messages also using function module BP_JOBLOG_READ.
Try and let me know if it helped you.
Thanks,
Anmol.
10-05-2011 7:25 AM
Hi,
I don't think it is possible to transfer messages from called program back to the calling program using SUBMIT.
But yes, same can be done using CALL TRANSACTION. You need to use a BDC method of calling transaction.
CALL TRANSACTION 'VA03' USING BDCDATA
OPTIONS FROM GT_OPTIONS
MESSAGES INTO GT_MESSAGE[].
LOOP AT GT_MESSAGE[].
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = GT_MESSAGE-MSGID
MSGNR = GT_MESSAGE-MSGNR
MSGV1 = GT_MESSAGE-MSGV1
MSGV2 = GT_MESSAGE-MSGV2
MSGV3 = GT_MESSAGE-MSGV3
MSGV4 = GT_MESSAGE-MSGV4
IMPORTING
MESSAGE_TEXT_OUTPUT = MESSAGE
EXCEPTIONS "#EC *
OTHERS = 4.
ENDLOOP.
Here, the internal table GT_MESSAGE[] will contain all messages related to your called program which you can display in your calling program.
Regards,
Danish.
10-05-2011 8:07 AM
Hi Ganesh,
If your called program triggers an information message, it will be displayed when you submit that program... I don't really understand your issue... If you want to store that message without displaying it on your main program, without changing the called program, and without using call transaction, If afraid you're going to be stuck...
Kr,
m.
10-05-2011 8:11 AM
A simple workaround could be like this. You can create a small text file of that message on the app server by submitting the program and then access that text file in your other program.
10-05-2011 9:42 AM
The tip given by Anmol is probably the only work-around for this...
You will have to use a submit to sap-spool:
SUBMIT zcalled-prog TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
Use FM BP_JOB_READ to get you spool-id from job step, BP_JOBLOG_READ to get your triggered messages and RSPO_RETURN_ABAP_SPOOLJOB to get your output list...
Kr,
m.
12-09-2011 7:27 AM