Application Development 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: 

VL06F Background problem

Former Member
0 Kudos

Hi Experts,

We are having an issue with transaction VL06F.

When VL06F is run in foreground it displays all possible columns.

But when the same is ran in background the columns get restricted to only 4.

I raised a question to SAP for this, and they advised to put in the output type in the selection criteria.

When VL06F is ran in background without giving an output type is does NOT display any column. But when output type is given it is displaying only FOUR columns. Whereas for the same selection criteria the transaction displays all possible columns in FOREGROUND.

Regarding the 4 column question SAP says it is a consulting issue.

In debug I see when ran background it calls a different FM to list the data --> call function 'WS_LM_BACKGROUND_PROCESSING'

Can anyone please suggest what could be the problem here or has anyone faced a similar problem?

Thanks

Saurabh

1 REPLY 1

Former Member
0 Kudos

There is the possibility to call VL06F in Batch Input mode and then it will NOT follow the specific background output function.

We did a Call Transaction of SA38 of program 'WS_MONITOR_OUTB_DEL_FREE' with a specific Execution Variant and that works. We pick up the created Spool afterwards & attach it to a mail in PDF format.

Some extractions of the code:


CONSTANTS:
  c_programm TYPE rs38m-programm
             VALUE 'WS_MONITOR_OUTB_DEL_FREE',
  c_tcode_tech TYPE tcode
               VALUE 'SA38',
  c_tcode_func TYPE tcode
               VALUE 'VL06F',
... ... ...
PARAMETERS:
  programm TYPE rs38m-programm
             DEFAULT c_programm
             MODIF ID noi
             OBLIGATORY,
  selset TYPE rs38m-selset
         OBLIGATORY.

*&---------------------------------------------------------------------*
*     AT SELECTION-SCREEN ON VALUE-REQUEST FOR selset.
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR selset.
  PERFORM select_selset
          USING c_programm
          CHANGING selset.

*&---------------------------------------------------------------------*
*     START-OF-SELECTION.
*&---------------------------------------------------------------------*
START-OF-SELECTION.
*  break tyriardd.                                                " TEST
  AUTHORITY-CHECK OBJECT 'S_TCODE'
           ID 'TCD' FIELD c_tcode_func.
  IF sy-subrc <> 0.
    MESSAGE e003(1w) WITH c_tcode_func.
*   No authorization to run transaction &
  ENDIF.
... ... ...
  PERFORM fill_bdc
          USING programm
                selset
          CHANGING gt_bdc.
  PERFORM fill_bdc_options
          CHANGING g_options.
  CALL TRANSACTION c_tcode_tech
                   USING gt_bdc
                   OPTIONS FROM g_options
                   MESSAGES INTO gt_messages.
*  break tyriardd.                                                " TEST
  LOOP AT gt_messages
          ASSIGNING <message>.
    IF <message>-msgid = 'SY' AND
       <message>-msgnr = '355'.
* SY(355) Spool request (number &) created without immediate output
      g_spoolnr = <message>-msgv1.
      MESSAGE i355(sy) WITH g_spoolnr.
    ELSEIF <message>-msgid = 'SY' AND
       <message>-msgnr = '374'.
* SY(374) Spool request (number &) sent to SAP printer &
      g_spoolnr = <message>-msgv1.
      MESSAGE i374(sy) WITH g_spoolnr
                            <message>-msgv2.
    ENDIF.
  ENDLOOP.
... ... ...
*&---------------------------------------------------------------------*
*&      Form  SELECT_SELSET
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_PROGRAMM  text
*      <--P_SELSET  text
*----------------------------------------------------------------------*
FORM select_selset
     USING value(p_programm) TYPE rs38m-programm
     CHANGING p_selset TYPE rs38m-selset.
  CALL FUNCTION 'RS_VARIANT_CATALOG'
    EXPORTING
      report                     = p_programm
*   NEW_TITLE                  = ' '
*   DYNNR                      =
*   INTERNAL_CALL              = ' '
*   MASKED                     = 'X'
      variant                    = selset
*   POP_UP                     = ' '
    IMPORTING
      sel_variant                = selset
*   SEL_VARIANT_TEXT           =
* TABLES
*   BELONGING_DYNNR            =
    EXCEPTIONS
      no_report                  = 1
      report_not_existent        = 2
      report_not_supplied        = 3
      no_variants                = 4
      no_variant_selected        = 5
      variant_not_existent       = 6
      OTHERS                     = 7.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

ENDFORM.                    " SELECT_SELSET
*&---------------------------------------------------------------------*
*&      Form  FILL_BDC
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--PT_BDC  text
*----------------------------------------------------------------------*
FORM fill_bdc
     USING programm TYPE rs38m-programm
           selset TYPE rs38m-selset
     CHANGING pt_bdc TYPE tab_bdcdata.
  DATA:
    l_programm TYPE bdcdata-fval,
    l_selset TYPE bdcdata-fval.

  CLEAR pt_bdc[].
  l_programm = programm.
  l_selset = selset.
* Start TRx SA38 => execute WS_MONITOR_OUTB_DEL_FREE with variant
  PERFORM bdc_screen USING 'SAPMS38M' '0101'            CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_CURSOR' 'RS38M-PROGRAMM' CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_OKCODE' '=STRV'          CHANGING pt_bdc.
  PERFORM bdc_field USING 'RS38M-PROGRAMM' l_programm   CHANGING pt_bdc.

  PERFORM bdc_screen USING 'SAPLS38R' '0020'            CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_CURSOR' 'RS38M-SELSET'   CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_OKCODE' '=STRT'          CHANGING pt_bdc.
  PERFORM bdc_field USING 'RS38M-SELSET' l_selset       CHANGING pt_bdc.

  PERFORM bdc_screen USING programm '1000'              CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_OKCODE' '=ONLI'          CHANGING pt_bdc.

  PERFORM bdc_screen USING 'SAPMSSY0' '0120'            CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_CURSOR' '04/03'          CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_OKCODE' '=&RNT'          CHANGING pt_bdc.
  PERFORM bdc_screen USING 'SAPLSPRI' '0100'            CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_CURSOR' 'PRI_PARAMS-PDEST' CHANGING pt_bdc.
  PERFORM bdc_field USING 'BDC_OKCODE' '=PRIN'          CHANGING pt_bdc.
  PERFORM bdc_field USING 'PRI_PARAMS-PDEST' 'LOCL'     CHANGING pt_bdc.

ENDFORM.                    " FILL_BDC

*&---------------------------------------------------------------------*
*&      Form  BDC_SCREEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM bdc_screen
     USING value(p_program) TYPE bdcdata-program
           value(p_screen) TYPE bdcdata-dynpro
     CHANGING pt_bdc TYPE tab_bdcdata.
  DATA:
    l_bdc TYPE bdcdata.
  l_bdc-program = p_program.
  l_bdc-dynpro = p_screen.
  l_bdc-dynbegin = abap_true.
  APPEND l_bdc TO pt_bdc.
ENDFORM.                    " BDC_SCREEN

*&---------------------------------------------------------------------*
*&      Form  BDC_FIELD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM bdc_field
     USING value(p_fnam) TYPE bdcdata-fnam
           value(p_fval) TYPE bdcdata-fval
     CHANGING pt_bdc TYPE tab_bdcdata.
  DATA:
    l_bdc TYPE bdcdata.
  l_bdc-fnam = p_fnam.
  l_bdc-fval = p_fval.
  APPEND l_bdc TO pt_bdc.
ENDFORM.                    " BDC_FIELD
*&---------------------------------------------------------------------*
*&      Form  FILL_BDC_OPTIONS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_G_OPTIONS  text
*----------------------------------------------------------------------*
FORM fill_bdc_options
     CHANGING p_options TYPE ctu_params.
*  p_options-dismode = 'A'.  " All Screens with                   " TEST
  p_options-dismode = 'P'.  " No Screens with Debugging Branching
  p_options-updmode = 'S'.  " Synchronous
  p_options-cattmode = abap_false.
  p_options-defsize = abap_false.
  p_options-racommit = abap_true.
  p_options-nobinpt = abap_false.
  p_options-nobiend = abap_false.
ENDFORM.                    " FILL_BDC_OPTIONS
... ... ...