cancel
Showing results for 
Search instead for 
Did you mean: 

scheduling Web dynpro in background ?

Former Member
0 Kudos

Hello Experts,

when I came across this situation (scheduling wd component in background) I've gone through some threads hear in scn, In that process I found this . But as a beginner I'm not able to understand the what it exactly means. Can any body provide me a sample example so that I could get clear vision on this. Thank you

Reagards

Nagendra.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can not background schedule web dynpro components as per its architecture. If you want to schedule any jobs in backgroud, better go for classical dynpro application i.e ABAP but now WDP-ABAP.

Thanks

KH

Former Member
0 Kudos

Hi,

Can you tell me the what are the necessary steps I need to perform, It would be nice if you could give me any sample coding

Thank you

Former Member
0 Kudos

Hi,

Can you let me know what is your exact requirement?.

Thanks

KH

Former Member
0 Kudos

Hi,

My requirement is to schedule a web dynpro component which is for displaying a report. I've gone through this link Background Scheduling for a webdynpro component . where Thomas Jung has provided the solution But I'm not able understand what exactly it means . Could you give me any sample coding how to approach his solution

Thank you,

Regards

Nagendra

former_member197475
Active Contributor
0 Kudos

Hi Nagendra,

See webdynpro is for UI interaction.

If you need some application that you ought for back ground jobs, there is no other way, you should go only for classic dynpro.

Thomas Jung also stated the same thing, that you have to use SE38:)

BR,

RAM.

Former Member
0 Kudos

Hi,

If you want to display report by scheduling background job, you need to create program using SE38 t-code but not webdynpro.

PFB the code snippet to display data into ALV(here im using FM : RESUE_ALV_GRID_DISPLAY)


REPORT  ZTESTALV_REPORT_SFLIGHT.
TABLES : SFLIGHT.
TYPE-POOLS : SLIS. **INTERNAL TABLE DECLARTION
DATA : WA_SFLIGHT TYPE SFLIGHT,
       IT_SFLIGHT TYPE TABLE OF SFLIGHT. **DATA DECLARTION
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
      GD_REPID     LIKE SY-REPID,
      G_SAVE TYPE C VALUE 'X',
      G_VARIANT TYPE DISVARIANT,
      GX_VARIANT TYPE DISVARIANT,
      G_EXIT TYPE C,
      ISPFLI TYPE TABLE OF SPFLI. * To understand the importance of the following parameter, click here.
**SELECTION SCREEN DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002 .
PARAMETERS: VARIANT LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK B1.
**GETTING DEFAULT VARIANT
INITIALIZATION.
  GX_VARIANT-REPORT = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
      I_SAVE     = G_SAVE
    CHANGING
      CS_VARIANT = GX_VARIANT
    EXCEPTIONS
      NOT_FOUND  = 2.
  IF SY-SUBRC = 0.
    VARIANT = GX_VARIANT-VARIANT.
  ENDIF. **PERFORM DECLARATIONS
START-OF-SELECTION.
  PERFORM DATA_RETRIVEL.
  PERFORM BUILD_FIELDCATALOG.
  PERFORM DISPLAY_ALV_REPORT.
*&---------------------------------------------------------------------*
*&      Form  BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM BUILD_FIELDCATALOG .   FIELDCATALOG-FIELDNAME   = 'CARRID'.
  FIELDCATALOG-SELTEXT_M   = 'Airline Code'.
  FIELDCATALOG-COL_POS     = 0.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
   FIELDCATALOG-FIELDNAME   = 'CONNID'.
  FIELDCATALOG-SELTEXT_M   = 'Flight Connection Number'.
  FIELDCATALOG-COL_POS     = 1.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.   FIELDCATALOG-FIELDNAME   = 'FLDATE'.
  FIELDCATALOG-SELTEXT_M   = 'Flight date'.
  FIELDCATALOG-COL_POS     = 2.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.   FIELDCATALOG-FIELDNAME   = 'PRICE'.
  FIELDCATALOG-SELTEXT_M   = 'Airfare'.
  FIELDCATALOG-COL_POS     = 3.
  FIELDCATALOG-OUTPUTLEN   = 20.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
ENDFORM.                    " BUILD_FIELDCATALOG


*&---------------------------------------------------------------------*
*&      Form  DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM DISPLAY_ALV_REPORT .
  GD_REPID = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = GD_REPID
      I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'  "see FORM
      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
      IT_FIELDCAT             = FIELDCATALOG[]
      I_SAVE                  = 'X'
      IS_VARIANT              = G_VARIANT
    TABLES
      T_OUTTAB                = IT_SFLIGHT
    EXCEPTIONS
      PROGRAM_ERROR           = 1
      OTHERS                  = 2.
  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.                    "DISPLAY_ALV_REPORT " DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
*&      Form  DATA_RETRIVEL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM DATA_RETRIVEL .
  SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT.
ENDFORM.                    " DATA_RETRIVEL *-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
FORM TOP-OF-PAGE.
*ALV Header declarations
  DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
        WA_HEADER TYPE SLIS_LISTHEADER,
        T_LINE LIKE WA_HEADER-INFO,
        LD_LINES TYPE I,
        LD_LINESC(10) TYPE C. * Title
  WA_HEADER-TYP  = 'H'.
  WA_HEADER-INFO = 'SFLIGHT Table Report'.
  APPEND WA_HEADER TO T_HEADER.
  CLEAR WA_HEADER. * Date
  WA_HEADER-TYP  = 'S'.
  WA_HEADER-KEY = 'Date: '.
  CONCATENATE  SY-DATUM+6(2) '.'
               SY-DATUM+4(2) '.'
               SY-DATUM(4) INTO WA_HEADER-INFO.   "todays date
  APPEND WA_HEADER TO T_HEADER.
  CLEAR: WA_HEADER.
   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = T_HEADER.
ENDFORM. 

Hope this helps you.

Thanks

KH

Former Member
0 Kudos

Hi KH,

sorry to bug you again on this,

In that thread they mentioned the following.

"I put my business logic in a FM and call that FM in my webdyn component. And when it is required to background schedule it I will call that FM in an executable code."


Can you explain this with a sample coding in web dynpro.


Thank you.

Former Member
0 Kudos

Hi,


"I put my business logic in a FM and call that FM in my webdyn component. And when it is required to background schedule it I will call that FM in an executable code."

Pls check the response carefully from


Yes.  You will have to write a classic dynpro application to call the FM or class with your business logic and if you are producing a report - use old style list processing of the CL_SALV* classes to produce the report.


Former Member
0 Kudos

Hi,

If you could give me any example for the above ,I would be thankful to you.

Thank you,

Regards

Nagendra

Former Member
0 Kudos

Hi,

You can write your business logic ( i.e the data which you want to display it in report) in FM or Method and use that FM/Method in your report prg and use old style list processing of the CL_SALV* classes to produce the report.

Now you can schedule a background job for your report created through SE38.Also check the sample code in my earlier reply.

Thanks

KH