Posted: Sat Sep 22, 2007 6:12 pm Post subject: Submit program and populate the selection screen
Have a look at the 'WITH' clause of the SUBMIT command. The function modules surrounding the submit in this example cause the program to run as a background job:
This example runs the program in the forground and then returns the report that would have been displayed. It then turns the report into human readable for for further processing:
Code:
Submit ZCOIN006
Exporting List To memory
With R4 = True
With P1 = c_planner_profile
With P2 = c_controlling_area
With P3 = pu_bukrs
With P4 = pu_gjahr
With P5 = t_version-versn
With R8 = True
With R9 = True
With p_file = w_rlgrap_file
With R11 = True
With p_caller = c_main_program
And Return.
Call Function 'LIST_FROM_MEMORY'
Tables
Listobject = t_list
Exceptions
Not_Found = 1
Others = 2.
If sy-subrc <> 0.
Move Text-046 to g_results-msg.
Else.
*
* Update the results table.
*
Describe Table t_list lines w_lines.
If w_lines > 0.
Move t_list[] to g_results-list[].
*
* Check for any words contained in t_errors
*
Call Function 'LIST_TO_ASCI'
Tables
Listasci = t_asci
Listobject = t_list
Exceptions
Empty_List = 1
List_Index_Invalid = 2
Others = 3.
If sy-subrc <> 0.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.