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

Issue with Field symbol

$
0
0

Hi experts,

 

I am having an issue with the field symbol <fs_pa0001> in the under-mentioned code.

In fact, i don't know how to declare it, i've tried many combination, none of them is working.

The best one that i found is to declare it like :

 

field-symbols: <fs_pa0001> type any.


 

Sans titre.png

 

Here's the code:

 

TYPES: BEGIN OF s_pa0001,
 pernr TYPE pa0001-pernr,
 plans TYPE pa0001-plans,
 begda TYPE pa0001-begda,
 endda TYPE pa0001-endda,
 END OF s_pa0001.

 DATA: l_s_hrms_biw_io_occupancy LIKE hrms_biw_io_occupancy.

 DATA: it_pa0001 TYPE STANDARD TABLE OF s_pa0001.
 DATA: lit_lead_pos TYPE STANDARD TABLE OF hrobject,
 lwa_lead_pos TYPE hrobject.

 DATA: var_pos TYPE hrp1001-sobid.

 field-symbols: <fs_pa0001> type any.

 REFRESH lit_lead_pos[].

 SELECT pernr plans begda endda FROM pa0001 INTO TABLE it_pa0001
 WHERE begda <= sy-datum
 AND endda >= sy-datum.

 IF sy-subrc EQ 0.
   SORT it_pa0001 BY pernr plans.   DELETE ADJACENT DUPLICATES FROM it_pa0001 COMPARING ALL FIELDS.
 ENDIF.

 var_pos = l_s_hrms_biw_io_occupancy-plans.

 CALL FUNCTION 'RH_GET_LEADING_POSITION'
   EXPORTING     plvar             = '01'     otype             = 'S'     sobid             = var_pos     date              = sy-datum     auth              = 'X'     buffer_mode       = ' '     consider_vac_pos  = ' '   TABLES     leading_pos       = lit_lead_pos   EXCEPTIONS     no_lead_pos_found = 1     OTHERS            = 2.

 IF sy-subrc EQ 0.
   CLEAR: lwa_lead_pos.   READ TABLE lit_lead_pos INTO lwa_lead_pos INDEX 1.   READ TABLE it_pa0001 ASSIGNING <fs_pa0001> WITH KEY plans = lwa_lead_pos-objid.   IF sy-subrc EQ 0.     l_s_hrms_biw_io_occupancy-zzxxxxxx = <fs_pa0001>-pernr.
 *      Start of code for calculating super supervisor (Raj Kumar Rai), Infosys Pune   ELSE.   " This portion of code executes when there is no active supervior for sup pos     v_flag = 0.     WHILE ( v_flag = 0 ).       CLEAR var_pos.       CLEAR lit_lead_pos.       var_pos = lwa_lead_pos-objid.       CALL FUNCTION 'RH_GET_LEADING_POSITION'         EXPORTING           plvar             = '01'           otype             = 'S'           sobid             = var_pos           date              = sy-datum           auth              = 'X'           buffer_mode       = ' '           consider_vac_pos  = ' '         TABLES           leading_pos       = lit_lead_pos         EXCEPTIONS           no_lead_pos_found = 1           OTHERS            = 2.       IF sy-subrc EQ 0.         CLEAR: lwa_lead_pos.         READ TABLE lit_lead_pos INTO lwa_lead_pos INDEX 1.         READ TABLE it_pa0001 ASSIGNING <fs_pa0001> WITH KEY plans = lwa_lead_pos-objid.         IF sy-subrc EQ 0.           l_s_hrms_biw_io_occupancy-zzxxxxxx = <fs_pa0001>-pernr.           v_flag = 1.  " Setting flag to 1 in case there exist an active supervisor for supervisor position.         ENDIF.       ELSE.         EXIT.       ENDIF.     ENDWHILE.   ENDIF.
 ENDIF.

Thanks.

 

Amine

 



Viewing all articles
Browse latest Browse all 8332

Trending Articles