SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Submit program and populate the selection screen



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP Objects
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Sep 22, 2007 6:12 pm    Post subject: Submit program and populate the selection screen Reply with quote

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:
Code:

Call Function 'JOB_OPEN'
               Exporting
                    Jobgroup         = w_Group
                    Jobname          = w_Jobname
               Importing
                    Jobcount         = w_Jobcount
               Exceptions
                    Cant_Create_Job  = 01
                    Invalid_Job_Data = 02
                    Jobname_Missing  = 03.
          Submit z_ADC_Q And Return
                          User w_Ernam
                          Via Job w_JobName Number w_Jobcount
                          with p_Vbeln = w_Queue_Entry-Vbeln.
          Call Function 'JOB_CLOSE'
               Exporting
                    Jobcount             = w_Jobcount
                    Jobname              = w_JobName
                    Strtimmed            = 'X'
               Exceptions
                    Cant_Start_Immediate = 01
                    Invalid_Startdate    = 02
                    Jobname_Missing      = 03
                    Job_Close_Failed     = 04
                    Job_Nosteps          = 05
                    Job_Notex            = 06
                    Lock_Failed          = 07.

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP Objects All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.