Skip to Content
0
Sep 15, 2011 at 09:57 PM

RFC Starting New Task

40 Views

All,

I have a function which is being called in RFC. I am not able to write the code successfully as i am getting stuck on the subroutine.

Please review the following code and let me know what wrong i am done and how to correct.

FUNCTION zmam_bcc_pubdate_getlist_wrap.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(PUB_START_DATE) LIKE  ZMAM_BCC_LIST-S_TERMIN OPTIONAL
*"     VALUE(PUB_END_DATE) LIKE  ZMAM_BCC_LIST-E_TERMIN OPTIONAL
*"     VALUE(CHANGE_FROM_DATE) LIKE  JHAE-AENDATE OPTIONAL
*"     VALUE(CHANGE_FROM_TIME) LIKE  JHAE-AENTIME OPTIONAL
*"     VALUE(CHANGE_TO_DATE) LIKE  JHAE-AENDATE OPTIONAL
*"     VALUE(CHANGE_TO_TIME) LIKE  JHAE-AENTIME OPTIONAL
*"     VALUE(SALES_ORDER_NO) LIKE  JHAK-AVM_NR OPTIONAL
*"     VALUE(GET_PUBD_LINES) TYPE  CHAR1 OPTIONAL
*"  TABLES
*"      ZMAM_BCC_LIST STRUCTURE  ZMAM_BCC_LIST OPTIONAL
*"      ZMAM_INHK_KFM STRUCTURE  ZMAM_INHK_KFM OPTIONAL
*"      ZMAM_INHK_KFM_WEBFLAG STRUCTURE  ZMAM_INHK_KFM OPTIONAL
*"      ZMAM_BOOKING_UNIT STRUCTURE  ZMAM_BOOKING_UNIT OPTIONAL
*"      ZMAM_PSTYV STRUCTURE  ZMAM_PSTYV OPTIONAL
*"      ZMAM_INHK_KFM_NOWEBFLAG STRUCTURE  ZMAM_INHK_KFM OPTIONAL
*"      IGNORE_CHANGES_BY STRUCTURE  ZMAM_IGRNOREID OPTIONAL
*"----------------------------------------------------------------------
* This is a wrapper to the function  ZMAM_BCC_PUBDATE_GETLIST.
* Since that function is timing out, this wrapper will call that
* function in background mode
  DATA :lt_zmam_bcc_list            TYPE STANDARD TABLE OF  zmam_bcc_list,
        lt_zmam_inhk_kfm            TYPE STANDARD TABLE OF  zmam_inhk_kfm,
        lt_zmam_inhk_kfm_webflag    TYPE STANDARD TABLE OF  zmam_inhk_kfm,
        lt_zmam_booking_unit        TYPE STANDARD TABLE OF  zmam_booking_unit,
        lt_zmam_pstyv               TYPE STANDARD TABLE OF  zmam_pstyv,
        lt_zmam_inhk_kfm_nowebflag  TYPE STANDARD TABLE OF  zmam_inhk_kfm,
        lt_ignore_changes_by        TYPE STANDARD TABLE OF  zmam_igrnoreid.

  lt_zmam_bcc_list[]            =  zmam_bcc_list[].
  lt_zmam_inhk_kfm[]            =  zmam_inhk_kfm[].
  lt_zmam_inhk_kfm_webflag[]    =  zmam_inhk_kfm[].
  lt_zmam_booking_unit[]        =  zmam_booking_unit[].
  lt_zmam_pstyv[]               =  zmam_pstyv[].
  lt_zmam_inhk_kfm_nowebflag[]  =  zmam_inhk_kfm[].
  lt_ignore_changes_by[]        =  ignore_changes_by[].


  CALL FUNCTION 'ZMAM_BCC_PUBDATE_GETLIST' STARTING NEW TASK
    'mytask' PERFORMING output ON END OF TASK
    EXPORTING
      pub_start_date          = pub_start_date
      pub_end_date            = pub_end_date
      change_from_date        = change_from_date
      change_from_time        = change_from_time
      change_to_date          = change_to_date
      change_to_time          = change_to_time
      sales_order_no          = sales_order_no
      get_pubd_lines          = get_pubd_lines
    TABLES
      zmam_bcc_list           = lt_zmam_bcc_list
      zmam_inhk_kfm           = lt_zmam_inhk_kfm
      zmam_inhk_kfm_webflag   = lt_zmam_inhk_kfm_webflag
      zmam_booking_unit       = lt_zmam_booking_unit
      zmam_pstyv              = lt_zmam_pstyv
      zmam_inhk_kfm_nowebflag = lt_zmam_inhk_kfm_nowebflag
      ignore_changes_by       = lt_ignore_changes_by.

ENDFUNCTION.

Subroutine as follow

*----------------------------------------------------------------------*
***INCLUDE ZMAM_BCC_PUBDATE_WRAPPER .
*----------------------------------------------------------------------*
*---------------------------------------------------------------------*
*      Form  OUTPUT
*---------------------------------------------------------------------*
* This routine is called within function ZMAM_BCC_PUBDATE_GETLIST_WRAP
*----------------------------------------------------------------------*
FORM output  TABLES   p_zmam_bcc_list           STRUCTURE zmam_bcc_list
                      p_zmam_inhk_kfm           STRUCTURE zmam_inhk_kfm
                      p_zmam_inhk_kfm_webflag   STRUCTURE zmam_inhk_kfm
                      p_zmam_booking_unit       STRUCTURE zmam_booking_unit
                      p_zmam_pstyv              STRUCTURE zmam_pstyv
                      p_zmam_inhk_kfm_nowebflag STRUCTURE zmam_inhk_kfm
                      p_ignore_changes_by       STRUCTURE zmam_igrnoreid.


  zmam_bcc_list[]             = p_zmam_bcc_list[].
  zmam_inhk_kfm[]             = p_zmam_inhk_kfm[].
  zmam_inhk_kfm_webflag[]     = p_zmam_inhk_kfm_webflag[].
  zmam_booking_unit[]         = p_zmam_booking_unit[].
  zmam_pstyv[]                = p_zmam_pstyv[].
  zmam_inhk_kfm_nowebflag[]   = p_zmam_inhk_kfm_nowebflag[].
  ignore_changes_by[]         = p_ignore_changes_by[].


ENDFORM.                    " OUTPUT

Any help is on this is highly appreciated.