‎2016 Aug 07 7:11 AM
Hello Experts,
I am having a hard time adding a AVL grid to a program. I save the program and at the CASE TIME_DATA_ZL-BTRTL there is an error with "Statement not accessible". I copied it from another program and it is not working.
‎2016 Aug 07 9:58 AM
It's not because of the statement itself (it could be any other statement too), it's because this part of the code cannot be reached, so you have to look in the lines above (for instance if the previous statement is ENDFORM).
‎2016 Aug 07 9:58 AM
It's not because of the statement itself (it could be any other statement too), it's because this part of the code cannot be reached, so you have to look in the lines above (for instance if the previous statement is ENDFORM).
‎2016 Aug 07 12:16 PM
‎2016 Aug 07 2:43 PM
Sorry for not being able to help you, but my crystal ball don't see what is above your code.
‎2016 Aug 07 2:49 PM
This is how the report looks like. I am still new to ABAP.
This is what I am trying to add. I know if I add the code the it will be deleted. I added the code but it isn't working and I don't know how I can let you see the code.
‎2016 Aug 07 2:58 PM
‎2016 Aug 07 3:10 PM
The "ZPY_R_QTD_HOURS" is the one that needs to be changed. The "Z_PAYROLL_HOURS_BY_DETAIL" has the ALV grid that I am trying to add and I have been awake all night trying to figure it out and I have no idea how to get it to work. Thanks.
‎2016 Aug 07 3:42 PM
Currently, the code is out of phase compared to your initial question. I doubt you have the same error now.
Could you please provide the code for which you have the error, and indicate at which line the error is NOW ? Thx
‎2016 Aug 07 3:46 PM
I don't have an error anymore. The problem now is that the grid isn't working. Thanks.
‎2016 Aug 07 11:24 PM
Shawn,
It looks like you have inherited a terrible report. This is what you have to do to fix it:
1. define a structure (in the data dictionary SE11) that contains all the values you want to display in the ALV
2. define an internal table (in your program) based on this structure
3. write a subroutine to fill this internal table. Unfortunately that program has a separate global variable for each reportable value!
4. write another subroutine to display the internal table in ALV. All it needs is something like this:
DATA: lv_title TYPE lvc_title.
lv_title = 'Workitems closed'(001).
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_structure_name = 'DFKKWLI' "structure of the internal table
i_grid_title = lv_title
TABLES
t_outtab = gt_closed "internal table of report data
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.
All of these steps are very simple except (in your case) step 3.
If it was me, I would just rewrite the whole thing.
good luck!
Paul
‎2016 Aug 08 1:10 AM
Paul,
I'm the one that added the ALV grid to ZPY_R_QTD_HOURS. I have been trying to add the ALV grid to the program but I've been unsuccessful.
‎2016 Aug 08 5:16 AM
‎2016 Aug 08 4:56 PM
I need help to where I can add this code to the program.
* Check if EXEMPT 0001 OR NON-EXEMPT.
CASE EMP_DATA_1-BTRTL.
WHEN '0001'.
X_OUTREC-RPT_CATG = '900-ADMIN'.
CASE EMP_DATA_1-PER_AREA.
WHEN 'FORT'.
X_OUTREC-RPT_LOCT = 'PAREA-1-FORT'.
WHEN 'SHIP'.
X_OUTREC-RPT_LOCT = 'PAREA-2-SHIP'.
WHEN 'RMSO'.
X_OUTREC-RPT_LOCT = 'PAREA-2.5-RMSO'.
WHEN 'CHIN'.
X_OUTREC-RPT_LOCT = 'PAREA-3-CHIN'.
WHEN 'TUBA'.
X_OUTREC-RPT_LOCT = 'PAREA-4-TUBA'.
WHEN 'CRWN'.
X_OUTREC-RPT_LOCT = 'PAREA-5-CRWN'.
WHEN 'KAYT'.
X_OUTREC-RPT_LOCT = 'PAREA-6-KAYT'.
WHEN 'DILK'.
X_OUTREC-RPT_LOCT = 'PAREA-8-DILK'.
WHEN OTHERS.
X_OUTREC-RPT_LOCT = 'PAREA-9-HQ'.
ENDCASE.
WHEN OTHERS.
CASE EMP_DATA_1-PER_AREA.
WHEN 'FORT'.
X_OUTREC-RPT_LOCT = 'PAREA-1-FORT'.
WHEN 'SHIP'.
X_OUTREC-RPT_LOCT = 'PAREA-2-SHIP'.
WHEN 'RMSO'.
X_OUTREC-RPT_LOCT = 'PAREA-2.5-RMSO'.
WHEN 'CHIN'.
X_OUTREC-RPT_LOCT = 'PAREA-3-CHIN'.
WHEN 'TUBA'.
X_OUTREC-RPT_LOCT = 'PAREA-4-TUBA'.
WHEN 'CRWN'.
X_OUTREC-RPT_LOCT = 'PAREA-5-CRWN'.
WHEN 'KAYT'.
X_OUTREC-RPT_LOCT = 'PAREA-6-KAYT'.
WHEN 'DILK'.
X_OUTREC-RPT_LOCT = 'PAREA-8-DILK'.
WHEN OTHERS.
X_OUTREC-RPT_LOCT = 'PAREA-9-HQ'.
ENDCASE.
CASE EMP_DATA_1-BUS_AREA.
WHEN '100'.
X_OUTREC-RPT_CATG = '100-ELECTRIC'.
WHEN '200'.
X_OUTREC-RPT_CATG = '200-GAS'.
WHEN '300'.
X_OUTREC-RPT_CATG = '300-WATER'.
WHEN '350'.
X_OUTREC-RPT_CATG = '350-WASTEWATER'.
WHEN '400'.
X_OUTREC-RPT_CATG = '400-SOLAR'.
WHEN '500'.
X_OUTREC-RPT_CATG = '500-COMM SYS DIV'.
WHEN '900'.
X_OUTREC-RPT_CATG = '900-ADMIN'.
ENDCASE.
* MECHANICS.
CASE EMP_DATA_1-KOSTL.
WHEN '1165' OR '1265' OR '1365' OR '1465' OR '1565' OR '1665' OR '1865' OR '2067'.
X_OUTREC-RPT_CATG = 'MECHANICS'.
ENDCASE.
‎2016 Aug 10 8:39 AM
Thread is suffering from scope creep. When one question is resolved, close it, and ask the next question as a new question. Link to the old if necessary.
Thread locked.