Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Error in the code

$
0
0

Hey Guys,

 

I have one question regarding the routine that i have written. This is the routine that i have written:

 

*&---------------------------------------------------------------------*

*& Include           ZBW_SUPERVISOR_EMP_ALD

*&---------------------------------------------------------------------*

DATA: t_source      TYPE TABLE OF _ty_s_sc_1,

          l_source      TYPE _ty_s_sc_1.

 

 

* Save the source data locally

t_source = source_package.

 

 

CHECK NOT t_source IS INITIAL.

 

* Get supervisor details

CLEAR: t_supervisor.

 

SELECT *

     INTO TABLE t_supervisor

     FROM

     FOR ALL ENTRIES IN t_source

     WHERE employee = t_source-employee

     AND dateto     = '99991231'.

 

SORT t_supervisor BY employee objvers dateto.

 

* Check for valid Responsible employee i.e exists in 0employee

* If it does not exist then update 0EMPLOYEE

LOOP AT t_source INTO l_source.

 

     CLEAR: l_supervisor.

     CHECK l_source-employee IS NOT INITIAL.

 

     READ TABLE t_employee INTO l_employee

       WITH TABLE KEY employee    = l_source-employee

                      objvers    = 'A'.

 

     IF sy-subrc = 0.

     

         l_data-supervisor     = l_source-supevisor.

         APPEND l_data TO t_data.

     ENDIF.

 

ENDLOOP.

 

SORT t_data BY employee objvers dateto.

DELETE ADJACENT DUPLICATES FROM t_data

     COMPARING employee objvers dateto.

CHECK t_data[] IS NOT INITIAL.

 

* Attributes to be updated

l_fields-fieldnm = 'SUPERVISOR'.

APPEND l_fields TO t_fields.

l_iobjnm = '0EMPLOYEE'.

 

*CALL method to update Master Data attributes for OEMPLOYEE InfoObject

CALL METHOD cl_rsdmd_update_master_data=>update_attributes_static

     EXPORTING

       i_iobjnm               = l_iobjnm

       i_t_fields             = t_fields

       i_t_data               = t_data

       i_s_minfo              = l_minfo

       i_monitoring           = rs_c_true

     IMPORTING

       e_subrc                = c_subrc

     CHANGING

       c_t_idocstate          = c_t_idocstate

     EXCEPTIONS

       iobj_not_found         = 1

       generate_program_error = 2

       OTHERS                 = 3.

 

*Commit for updated 0EMPLOYEE

CALL FUNCTION 'DB_COMMIT'.

 

source_package = t_source.

 

Now the error that i m facing is, when i check inside include statement it says there is no main program for this. What all things do i need to define outside the include statement? Can anybody tell me about this?

 

Thanks,

NSHAH


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>