Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interface Run in the Background

Former Member
0 Likes
452

Hello All-

I have a requriement where the Interface has the ALV output where the user is allowed the user activity for validating and posting the records through buttons on the ALV after selecting the records through the checkboxes , Now I want to execute the interface in the background, is that possible with the current scenario.

Thanks in advance

Jatender

2 REPLIES 2
Read only

Nawanandana
Active Contributor
0 Likes
405

hi

you can use this code for the baground




DATA: JOBNAME LIKE TBTCJOB-JOBNAME VALUE
                             'ORDER_REPORT'.
DATA: JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
      HOST LIKE MSXXLIST-HOST.
DATA: BEGIN OF STARTTIME.
        INCLUDE STRUCTURE TBTCSTRT.
DATA: END OF STARTTIME.
DATA: STARTTIMEIMMEDIATE LIKE BTCH0000-CHAR1.

* Job open
  CALL FUNCTION 'JOB_OPEN'
       EXPORTING
            DELANFREP        = ' '
            JOBGROUP         = ' '
            JOBNAME          = JOBNAME
            SDLSTRTDT        = SY-DATUM
            SDLSTRTTM        = SY-UZEIT
       IMPORTING
            JOBCOUNT         = JOBCOUNT
       EXCEPTIONS
            CANT_CREATE_JOB  = 01
            INVALID_JOB_DATA = 02
            JOBNAME_MISSING  = 03.
  IF SY-SUBRC NE 0.
                                       "error processing
  ENDIF.


SUBMIT ZPRODREC02 AND RETURN  VIA SELECTION-SCREEN
                   USER SY-UNAME
                   VIA JOB JOBNAME
                   NUMBER JOBCOUNT.
  IF SY-SUBRC > 0.
                                       "error processing
  ENDIF.

 DATA: JOB_RELEASED LIKE BTCH0000-CHAR1.

 CALL FUNCTION 'JOB_CLOSE'
       EXPORTING
            JOBCOUNT         = JOBCOUNT
            JOBNAME          = JOBNAME
            STRTIMMED        = 'X'
       IMPORTING
            JOB_WAS_RELEASED = JOB_RELEASED
       EXCEPTIONS
            OTHERS           = 99.

Regard,

nawa

Read only

Former Member
0 Likes
405

Hello Jatender,

You can also use CALL FUNCTION 'JOB_SUBMIT' to submit the interface in background.

Thanks,

Augustin.