Skip to Content

Call transaction Vl23 with variant and execute the background job in custom report.

Hi folks,

I have one requirement in which I have to do mass PGI from the custom program by calling vl23 in background.

I have a below requirement:

Create a new variant in transaction VL23 for a background process. Call the variant and input the delivery order numbers from upload file. Execute the background job for PGI immediately.

Could anyone help on this to how we can proceed for this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 24, 2017 at 12:14 PM

    Well I don’t have experience of using VL23, but I think we have couple of options.

    1: Is it possible to record a BDC session of this transaction. If yes, then you can treat it as a batch input program. Create a recording (through transaction SHDB) and edit it as per your needs.

    2: If above is not possible, please note that by looking at VL23 in SE93 reveals that it is using a program called RV50BTCH.

    If you check this program in SE80, it has a standard variant “SAP&STANDARD”. This variant is in fact pointing to a report called “WS_MONITOR_OUTB_DEL_GDSI”.

    Now this report “WS_MONITOR_OUTB_DEL_GDSI” is a standard report (type 1 executable). So you can call it using “Submit” statement in your code. If you check documentation for Submit command, you can pass data to selection screen variable and you can submit it as a background job. So hopefully by directly calling the report “WS_MONITOR_OUTB_DEL_GDSI” you can resolve this issue.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rashid,

      This button ask for output type 1st then the information regarding when you want to schedule job. Its again 1 and 2 screen after clicking this . So submit won't work I think here and In BDC for vl23 ,the recoeding is not capturing the 1st screen of variant. I think BAPI may work here but I checked some BAPI it also not giving proper result.No luck till now how I can acheive this.

  • Jul 27, 2017 at 05:46 AM

    That screen is for output type/printer specifications and the next one is job schedule screen. Both will not appear while scheduling a job programatically. Check the following link for more information on how to program with ABAP background processing system.

    Programming with the Background Processing System

    And following code example is from ABAP documentation of Submit command. I hope you do have access to ABAP help in your system.

    DATA: number           TYPE tbtcjob-jobcount, 
          name             TYPE tbtcjob-jobname VALUE 'JOB_TEST', 
          print_parameters TYPE pri_params. 
        jobname              = name 
        jobcount             = number 
        cant_create_job  = 1 
        invalid_job_data = 2 
        jobname_missing      = 3 
        OTHERS           = 4. 
    IF sy-subrc = 
      SUBMIT submitable TO SAP-SPOOL 
                        SPOOL PARAMETERS 
                        WITHOUT SPOOL DYNPRO 
                        VIA JOB name NUMBER number 
      IF sy-subrc = 0. 
            jobcount             = number 
            jobname              = name 
            strtimmed            = 'X' 
            cant_start_immediate = 1 
            invalid_startdate    = 2 
            jobname_missing      = 3 
            job_close_failed     = 4 
            job_nosteps          = 5 
            job_notex            = 6 
            lock_failed          = 7 
            OTHERS               = 8. 
        IF sy-subrc <> 0. 
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rashid ,

      Yes that button in working fine as it is scheduling the PGI in background and showing which document is posted and which all are not .

      I will try to implement the submit program logic in my custom report and come back to update was it working or not.

      Thank you for you guidance will Update after the implementation.