Error running ALV report
Hello,
I am tring to run my first ALV report and I am getting a dump when I run it. it is dumping at
<b> Program SAPLSLVC
Include LSLVCF36
Row 3,221
Module type (FORM)
Module Name FILL_DATA_TABLE
macro_cell_data_get
<ls_fcat>
<ls_data>
<l_field_value>
ls_lvc_data-value. </b>
I searched the forum for the "macro_cell_data_get" and I found 1 response that gave a response of
<i>field symbol errors in ALV are usually down to fieldcat columns incorrectly defined. Check your internal table fields of the table you pass to the alv FM against the columns defined in the fieldcat</i>
I am not sure what I should be checking. I am looked at the structure that I have created for the ALV and the internal tables and I am not sure what to look for.
any help would be greatly appreciated.
I hope this is what you are looking for.
FORM create_fieldcatalog USING value(p1_repid) TYPE sy-repid
CHANGING p_it_fieldcat TYPE slis_t_fieldcat_alv.
Local data declarations
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CONSTANTS: c_l TYPE c VALUE 'L'.
Call the FM to build the required field catalog.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = p1_repid
i_internal_tabname = 'IT_OUTDATA'
i_structure_name = 'zfi_ap_unpln_dlvry_csts_STRUCT'
CHANGING
ct_fieldcat = p_it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
LOOP AT p_it_fieldcat INTO wa_fieldcat.
wa_fieldcat-ddictxt = c_l.
Update the fieldcatalog parameters
CASE wa_fieldcat-fieldname.
WHEN 'BUKRS'.
wa_fieldcat-key = c_check.
WHEN OTHERS.
ENDCASE.
MODIFY p_it_fieldcat FROM wa_fieldcat INDEX sy-tabix.
ENDLOOP.
ENDIF.
ENDFORM. " FORM CREATE_FIELDCATALOG
$$----
$$ Form display_report
$$----
FORM display_alv CHANGING p_it_outdata TYPE ty_t_outdata
p_it_fieldcat TYPE slis_t_fieldcat_alv
p_it_alv_sort TYPE ty_t_sort_alv
p1_layout TYPE slis_layout_alv
value(p1_repid) TYPE sy-repid
value(p1_var) TYPE disvariant.
Call the FM to generate the ALV in grid format.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = p1_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = p1_layout
i_structure_name = 'ZFI_AP_UNPLN_DLVRY_CSTS_STRUCT'
it_fieldcat = p_it_fieldcat
it_sort = p_it_alv_sort
i_save = 'A'
is_variant = p1_var
TABLES
t_outtab = p_it_outdata
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
FREE: p_it_outdata.
ENDIF.
ENDFORM. "display_alv
also I checked all of the entries and they seemed to match. I am using the field BELNR which looks like it is a combination of two fields. I am not sure if this is causing my problem or not
Similar Messages
-
Can we run alv reports in background
hi all
can we run alv reports in backgroundHi
Yes You can
see this
Many a times there is a requirement to display ALV Grid (not ALV List) in the background Job. I have checked the SDN Forum for the same and it has been mentioned that ALV Grid cannot be displayed in Background, but the list output of ALV is possible. So user wont have the actual Grid interface but the List interface.
There is a workaround to display ALV Grid in Background Job. The only restriction is you cant schedule the job through SM36. You need to execute the transaction of the report program, fill in the selection screen data and hit Execute.
The job would be executed in background. User will be able to see the Job Log and Job Status after executing the program. User doesnt have to go to SM37 to view the job status/log. Once the Job Status is changed to COMPLETED, user can click on DISPLAY SPOOL to view the ALV Grid.
Limitations:
Cant schedulea background job
The session should be active until the background job is completed. If the session is closed, then user wont be able to check the output in ALV Grid. User would be able to check the output through spool or SM37
Advantages:
If the spool width is greater than 255 characters, then the entire width could be seen in the output because the output is directed to an ALV Grid and not to spool
Interface of ALV Grid is available instead of ALV List even though its a background job.
Program wont give the TIME OUT error
Steps Required:
1. Once you execute the program, the following screen would be displayed
2. Click Display Job Status to check the Status of the Background Job
3. Click on Display the Job Log to check the Log
4. Click on Display Job Status to check the Job Status
5. Click on DISPLAY SPOOL to check the spool content once the Job Status is changed to COMPLETED. Output is displayed in ALV Grid
Programs:
1. Two different programs needs to be created
ZPROGRAM_ONE: This is the 1st program, where the selection screen and all the data validations would be done. Error handling for invalid data should be done in this program.
Once the data validation is done, this program would call the 2nd program ZPROGEAM_TWO. Build the logic to display ALV Grid in this program. The logic will only display ALV in foreground and it wont be reflected in the spool.
ZPROGRAM_TWO: This program would fetch all the data and do all the processing. If you want the spool output along with ALV Grid output, then build the logic in this program to display ALV Grid.
*& Report ZPROGRAM_ONE *
REPORT zprogram_one .
PRASHANT PATIL
TABLES : mara,
tsp01.
type-pools:slis.
TYPES : BEGIN OF t_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
laeda TYPE mara-laeda,
END OF t_mara.
DATA : i_mara TYPE STANDARD TABLE OF t_mara,
wa_mara TYPE t_mara,
wa_index TYPE indx, " For Index details
wa_index_key TYPE indx-srtfd VALUE 'PRG_ONE',
i_jobsteplist TYPE STANDARD TABLE OF tbtcstep, " For spool number
wa_params TYPE pri_params, " To Get Print Parameters
wa_jobhead TYPE tbtcjob, " To know the status of job
wa_jobsteplist TYPE tbtcstep, " To know the spool
w_jobname TYPE tbtco-jobname, " Job name for bckgrnd job
w_jobcount TYPE tbtco-jobcount, " Unique id for bckgrd job
w_path TYPE string, " Upload path
w_lsind TYPE sy-lsind, " Index
wa_seltab TYPE rsparams,
i_seltab TYPE STANDARD TABLE OF rsparams,
wa_index1 TYPE indx, " For Index details
wa_index_key1 TYPE indx-srtfd VALUE 'PRG_TWO',
i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF i_fieldcat.
CONSTANTS DECLARATION *
CONSTANTS :
c_a(1) TYPE c VALUE 'A',
c_m(1) TYPE c VALUE 'M',
c_l(1) TYPE c VALUE 'L',
c_c(1) TYPE c VALUE 'C',
c_zfdr(4) TYPE c VALUE 'ZFDR',
c_x(1) TYPE c VALUE 'X',
c_locl(4) TYPE c VALUE 'LOCL', " Destination is LOCAL
c_f(1) TYPE c VALUE 'F', " Job Status - Failed
c_s(1) TYPE c VALUE 'S',
c_p(1) TYPE c VALUE 'P'.
SELECTION SCREEN PARAMETERS
SELECT-OPTIONS : s_matnr FOR mara-matnr.
START-OF-SELECTION.
Before the export, fill the data fields before CLUSTR
wa_index-aedat = sy-datum.
wa_index-usera = sy-uname.
EXPORT s_matnr
TO DATABASE indx(st) FROM wa_index ID wa_index_key.
To Open the Job for background processing
PERFORM open_job.
To get the print parameters
PERFORM get_print_parameters.
Submit the job in background
PERFORM job_submit.
Close the background job
PERFORM job_close.
This is the output screen with the buttons ********
Create 3 buttons DISPLAY SPOOL, STATUS, JOBLOG
SET PF-STATUS 'ZS001'.
WRITE: / 'The program is submitted in Background'.
WRITE: / 'Press DISPLAY SPOOL to see the spool'.
WRITE: / 'Press STATUS to see the status of the background'.
AT USER-COMMAND.
If user presses the 'BACK' button
IF sy-ucomm = 'BAK'.
IF wa_jobhead-status = c_f OR
wa_jobhead-status = c_a.
LEAVE TO SCREEN 0.
ENDIF.
ENDIF.
If the user presses the 'DISPLAY SPOOL' Button
IF sy-ucomm = 'DISPLAY'.
PERFORM display_spool.
ENDIF.
If the user presses the 'JOB STATUS' Button
IF sy-ucomm = 'STATUS'.
PERFORM display_status.
ENDIF.
If the user presses the 'JOB LOG' Button
IF sy-ucomm = 'JOBLOG'.
PERFORM display_job_log.
ENDIF.
*& Form open_job
text
--> p1 text
<-- p2 text
FORM open_job .
This is to Create a new job which is to be submitted in background to
process sales order/delivery/invoice
Here we would get a unique id ( Jobcount ) which identifies our job
along with the job name which we have assigned to our job
CONCATENATE sy-uname
sy-datum
sy-uzeit
INTO w_jobname . " Assign unique jobname
CALL FUNCTION 'JOB_OPEN'
EXPORTING
DELANFREP = ' '
JOBGROUP = ' '
jobname = w_jobname
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
JOBCLASS =
IMPORTING
jobcount = w_jobcount
CHANGING
RET =
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4
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. " open_job
*& Form get_print_parameters
text
--> p1 text
<-- p2 text
FORM get_print_parameters .
DATA : l_valid TYPE c.
This is to get the Print Parameters for the job which is to be
submitted in background to process sales order/delivery/invoice
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_ID = C_CHAR_UNKNOWN
ARCHIVE_INFO = C_CHAR_UNKNOWN
ARCHIVE_MODE = C_CHAR_UNKNOWN
ARCHIVE_TEXT = C_CHAR_UNKNOWN
AR_OBJECT = C_CHAR_UNKNOWN
ARCHIVE_REPORT = C_CHAR_UNKNOWN
AUTHORITY = C_CHAR_UNKNOWN
COPIES = C_NUM3_UNKNOWN
COVER_PAGE = C_CHAR_UNKNOWN
DATA_SET = C_CHAR_UNKNOWN
DEPARTMENT = C_CHAR_UNKNOWN
destination = c_locl " LOCL
EXPIRATION = C_NUM1_UNKNOWN
immediately = space
IN_ARCHIVE_PARAMETERS = ' '
IN_PARAMETERS = ' '
LAYOUT = C_CHAR_UNKNOWN
LINE_COUNT = C_INT_UNKNOWN
LINE_SIZE = C_INT_UNKNOWN
LIST_NAME = C_CHAR_UNKNOWN
LIST_TEXT = C_CHAR_UNKNOWN
MODE = ' '
new_list_id = c_x
PROTECT_LIST = C_CHAR_UNKNOWN
no_dialog = c_x
RECEIVER = C_CHAR_UNKNOWN
RELEASE = C_CHAR_UNKNOWN
REPORT = C_CHAR_UNKNOWN
SAP_COVER_PAGE = C_CHAR_UNKNOWN
HOST_COVER_PAGE = C_CHAR_UNKNOWN
PRIORITY = C_NUM1_UNKNOWN
SAP_OBJECT = C_CHAR_UNKNOWN
TYPE = C_CHAR_UNKNOWN
user = sy-uname
USE_OLD_LAYOUT = ' '
UC_DISPLAY_MODE = C_CHAR_UNKNOWN
DRAFT = C_CHAR_UNKNOWN
ABAP_LIST = ' '
USE_ARCHIVENAME_DEF = ' '
DEFAULT_SPOOL_SIZE = C_CHAR_UNKNOWN
PO_FAX_STORE = ' '
NO_FRAMES = C_CHAR_UNKNOWN
IMPORTING
OUT_ARCHIVE_PARAMETERS =
out_parameters = wa_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4
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. " get_print_parameters
*& Form job_submit
text
--> p1 text
<-- p2 text
FORM job_submit .
The job which we have created & the unique id ( jobcount ) which we
have got identifies our job. Hence those parameters are passed along
with the name of the background program "ZPROGRAM_TWO"
The job is submitted in background.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
ARCPARAMS =
authcknam = sy-uname
COMMANDNAME = ' '
OPERATINGSYSTEM = ' '
EXTPGM_NAME = ' '
EXTPGM_PARAM = ' '
EXTPGM_SET_TRACE_ON = ' '
EXTPGM_STDERR_IN_JOBLOG = 'X'
EXTPGM_STDOUT_IN_JOBLOG = 'X'
EXTPGM_SYSTEM = ' '
EXTPGM_RFCDEST = ' '
EXTPGM_WAIT_FOR_TERMINATION = 'X'
jobcount = w_jobcount
jobname = w_jobname
LANGUAGE = SY-LANGU
priparams = wa_params
report = 'ZPROGRAM_TWO'
VARIANT = ' '
IMPORTING
STEP_NUMBER =
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10
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. " job_submit
*& Form job_close
text
--> p1 text
<-- p2 text
FORM job_close .
Once the job is submitted in background then the job is closed
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
AT_OPMODE = ' '
AT_OPMODE_PERIODIC = ' '
CALENDAR_ID = ' '
EVENT_ID = ' '
EVENT_PARAM = ' '
EVENT_PERIODIC = ' '
jobcount = w_jobcount
jobname = w_jobname
LASTSTRTDT = NO_DATE
LASTSTRTTM = NO_TIME
PRDDAYS = 0
PRDHOURS = 0
PRDMINS = 0
PRDMONTHS = 0
PRDWEEKS = 0
PREDJOB_CHECKSTAT = ' '
PRED_JOBCOUNT = ' '
PRED_JOBNAME = ' '
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS
strtimmed = c_x
TARGETSYSTEM = ' '
START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
START_ON_WORKDAY_NR = 0
WORKDAY_COUNT_DIRECTION = 0
RECIPIENT_OBJ =
TARGETSERVER = ' '
DONT_RELEASE = ' '
TARGETGROUP = ' '
DIRECT_START =
IMPORTING
JOB_WAS_RELEASED =
CHANGING
RET =
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9
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. " job_close
*& Form display_spool
text
--> p1 text
<-- p2 text
FORM display_spool .
To Read the Job to get the spool details
DATA : l_rqident TYPE tsp01-rqident, " Spool Number
l_spoolno TYPE tsp01_sp0r-rqid_char.
CLEAR : l_rqident,
w_lsind,
wa_jobsteplist.
REFRESH : i_jobsteplist.
SET PF-STATUS 'ZAR02'.
Get the Spool Number
CALL FUNCTION 'BP_JOB_READ'
EXPORTING
job_read_jobcount = w_jobcount
job_read_jobname = w_jobname
job_read_opcode = '20'
JOB_STEP_NUMBER =
IMPORTING
job_read_jobhead = wa_jobhead
TABLES
job_read_steplist = i_jobsteplist
CHANGING
RET =
EXCEPTIONS
invalid_opcode = 1
job_doesnt_exist = 2
job_doesnt_have_steps = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Read the Job Step list to get the spool number
READ TABLE i_jobsteplist INTO wa_jobsteplist INDEX 1.
CHECK wa_jobsteplist-listident <> space.
Spool Number
l_rqident = wa_jobsteplist-listident.
MOVE l_rqident TO l_spoolno.
Check the spool in TSP01
SELECT SINGLE * FROM tsp01 WHERE rqident = l_rqident.
IF sy-subrc = 0.
LEAVE TO LIST-PROCESSING.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = l_spoolno
IMPORTING
RC =
STATUS =
PERFORM show_alv.
ENDIF.
w_lsind = sy-lsind.
IF sy-lsind GE 19.
sy-lsind = 1.
ENDIF.
ENDFORM. " display_spool
*& Form show_alv
text
--> p1 text
<-- p2 text
FORM show_alv .
Before the import, fill the data fields before CLUSTR.
wa_index1-aedat = sy-datum.
wa_index1-usera = sy-uname.
To Import the selection screen data from Calling Program
IMPORT i_mara
FROM DATABASE indx(st) ID wa_index_key1 TO wa_index1.
FREE MEMORY ID wa_index_key1.
This prepares the field-catalog for ALV.
PERFORM prepare_fieldcatalog.
This displays the output in ALV format .
PERFORM display_alv.
ENDFORM. " show_alv
*& Form display_status
text
--> p1 text
<-- p2 text
FORM display_status .
To Display the STATUS of the JOB which is exectued in background
CLEAR : wa_jobsteplist.
REFRESH : i_jobsteplist.
WRITE:/ 'DISPLAYING JOB STATUS'.
CALL FUNCTION 'BP_JOB_READ'
EXPORTING
job_read_jobcount = w_jobcount
job_read_jobname = w_jobname
job_read_opcode = '20'
JOB_STEP_NUMBER =
IMPORTING
job_read_jobhead = wa_jobhead
TABLES
job_read_steplist = i_jobsteplist
CHANGING
RET =
EXCEPTIONS
invalid_opcode = 1
job_doesnt_exist = 2
job_doesnt_have_steps = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
To Display the status text as per the status type
CASE wa_jobhead-status.
WHEN 'S'. WRITE: / 'Scheduled'.
WHEN 'R'. WRITE: / 'Released'.
WHEN 'F'. WRITE: / 'Completed'.
WHEN 'A'. WRITE: / 'Cancelled'.
WHEN OTHERS.
ENDCASE.
IF sy-lsind GE 19.
sy-lsind = 1.
ENDIF.
ENDFORM. " display_status
*& Form display_job_log
text
--> p1 text
<-- p2 text
FORM display_job_log .
To display the log of the background program
LEAVE TO LIST-PROCESSING.
CALL FUNCTION 'BP_JOBLOG_SHOW_SM37B'
EXPORTING
client = sy-mandt
jobcount = w_jobcount
joblogid = ' '
jobname = w_jobname
EXCEPTIONS
error_reading_jobdata = 1
error_reading_joblog_data = 2
jobcount_missing = 3
joblog_does_not_exist = 4
joblog_is_empty = 5
joblog_show_canceled = 6
jobname_missing = 7
job_does_not_exist = 8
no_joblog_there_yet = 9
no_show_privilege_given = 10
OTHERS = 11.
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_job_log
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
FORM prepare_fieldcatalog .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = 'Material no.'.
wa_fieldcat-outputlen = '18'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERSDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = 'Creation date'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = 'Name of Person'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'LAEDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-reptext_ddic = ' Last Change'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " prepare_fieldcatalog
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = i_fieldcat
tables
t_outtab = i_mara.
ENDFORM. " display_alv
ZPROGRAM_TWO: This is the 2nd program which would be called from program ZPROGRAM_ONE.
*& Report ZPROGRAM_TWO *
REPORT zprogram_two .
PRASHANT PATIL
TABLES : mara.
TYPE-POOLS:slis.
TYPES : BEGIN OF t_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
laeda TYPE mara-laeda,
END OF t_mara.
DATA : i_mara TYPE STANDARD TABLE OF t_mara,
wa_mara TYPE t_mara,
wa_index TYPE indx, " For Index details
wa_index_key TYPE indx-srtfd VALUE 'PRG_ONE',
wa_index1 TYPE indx, " For Index details
wa_index_key1 TYPE indx-srtfd VALUE 'PRG_TWO',
i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF i_fieldcat.
SELECT-OPTIONS : s_matnr FOR mara-matnr.
Before the import, fill the data fields before CLUSTR.
wa_index-aedat = sy-datum.
wa_index-usera = sy-uname.
To Import the selection screen data from Calling Program
IMPORT s_matnr
FROM DATABASE indx(st) ID wa_index_key TO wa_index.
FREE MEMORY ID wa_index_key.
SELECT matnr
ersda
ernam
laeda
FROM mara
INTO TABLE i_mara
WHERE matnr IN s_matnr.
PERFORM prepare_fieldcatalog.
PERFORM display_alv.
Before the export, fill the data fields before CLUSTR
wa_index1-aedat = sy-datum.
wa_index1-usera = sy-uname.
EXPORT i_mara
TO DATABASE indx(st) FROM wa_index1 ID wa_index_key1.
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
FORM prepare_fieldcatalog .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '18'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERSDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'LAEDA'.
wa_fieldcat-tabname = 'I_MARA'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " prepare_fieldcatalog
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = i_fieldcat
TABLES
t_outtab = i_mara.
ENDFORM. " display_alv
its possible to display ALV Grid using OO ALV. Following code can be used instead of FM.
In the PBO, add following code
SET PF-STATUS 'ZSTAT'.
If program is executed in background
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = off.
IF off IS INITIAL.
IF container1 IS INITIAL.
CREATE OBJECT container1
EXPORTING
container_name = 'CC_ALV1' .
ENDIF.
ENDIF.
CREATE OBJECT g_grid1
EXPORTING
i_parent = container1.
CALL METHOD g_grid1->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
i_save = 'A'
i_default = ' '
is_layout =
is_print =
IT_SPECIAL_GROUPS =
it_toolbar_excluding =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = i_output
it_fieldcatalog = i_fieldcatalog
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Reward points if useful
Regards
Anji -
Is it possible to run ALV report in background if Yes how?
is it possible to run ALV report in background if Yes how?
Hi,
Why not?Through se38 only you create ALV report. there you can give your report name and go to program on menu bar - click - execute buton- click-Background . You will get new screen there you can choose Execute immediate or schedule.
<REMOVED BY MODERATOR>
Cheers,
Chandra Sekhar.
Edited by: Alvaro Tejada Galindo on Mar 4, 2008 2:12 PM -
Running ALV REPORT in background
Hi Experts ,
Before writing this query , i went through all the threads related to ALV report in background . But found none of them satisfactory .
I am running a alv report in background . I am not using OO ALV . I am using " REUSE_ALV_GRID_DISPLAY" .
This report is schedules through a background job . It is creating a spool .
But I am getting a error message : *" FRONT END NOT AVIALABLE "*
What i have found so far :
I am planning to use sy-batch variable to check whether it is running in background or not , Then I am planning to read the spool and if the spool is created , i will display the ALV .
Is this the correct approach or some other way to generate the ALV REPORT .
Also by this way will the error message *" FRONT END NOT AVIALABLE "* go .
Please advice .
Regards,
AbhishekHello Everyone ,
Thanks for your replies .
I have the spool generated . But it is waiting status .
The issue here is how I am going to say that the spool is in " Completed " status . Because only after when my spool is in completed status , I want to display the status .
Is there way for this ?
Regards ,
Abhishek -
Time Limit exceeded error in ALV report
I am gettting error "Time Limit Exceeded" when i execute ALV report. Can i run the program in background and how to do that?. I had already optimized my query in the program but even then i am facing the same issue.
You can process the alv in background by pressing F9...I guess that the output would be available as a spool in SP01.
You may need to re-check your query...And also, review the alv catalog and any events you are using....
Greetings,
Blag. -
Error running 9i reports from forms.
Hi folks,
i am having problems running 9i reports from a form.
i have installed Oracle 9iDS on a Win XP machine with 256 MB RAM and a Pentium 1.4Ghz processor.
i also have a local Oracle 9i database. i have created several reports that i am trying to run from some forms but all efforts to date have failed.
below is some sample code.
declare
v_rid report_object;
v_rjob varchar2(100);
v_rptstatus varchar2(100);
v_jobid varchar2(100);
BEGIN
/*get handle to report object itself*/
v_rid := find_report_object('pbranchlist');
set_report_object_property(v_rid,REPORT_EXECUTION_MODE,BATCH);
set_report_object_property(v_rid,REPORT_DESFORMAT,'htmlcss');
set_report_object_property(v_rid,REPORT_DESTYPE,'CACHE');
set_report_object_property(v_rid,REPORT_SERVER,'repsrv');
set_report_object_property(v_rid,REPORT_COMM_MODE,synchronous);
v_rjob := run_report_object(v_rid);
v_rptstatus := report_object_status(v_rjob);
while v_rptstatus in ('RUNNING','OPENING_REPORT','ENQUEUED') loop
v_rptstatus := report_object_status(v_rjob);
message(v_rptstatus);
end loop;
if v_rptstatus = 'FINISHED' then
/*display report in browser*/
-- web.show_document('http://steve:8888/reports/rwservlet/getjobid'||
-- substr(v_rptsvrjob,instr(v_rptsvrjob,'_',-1)+1)||'?'||'server=repsrv','_blank');
web.show_document('/reports/rwservlet/getjobid'||substr(v_rjob,instr(v_rjob,'_',-1)+1)||'?'||'server=repsrv','_blank');
else
message('error running Report');
end if;
end;
pbranchlist is defined in the form,
repsrv is a report server i installed and explicitly started.
on clicking the button to run the above code, i get a message on the browser status bar as follows
opening http://steve:8888/reports/rwservlet/getjobid11?server=repsrv...
that's it. it stays like that forever and a progress bar showing the status of the operation gets to the halfway mark and stays there for up to 15 minutes.
I eventually halted the operation by clicking the stop button of the browser. The form then becomes totally non-responsive with the mouse indicator changing to the hour-glass shape and a small vertical bar moving rapidly back and forth at the bottom of the form window.
My only recourse then is to explicitly close the browser window.
I have already configured Reports to run in non single sign-on mode by setting SINGLESIGNON=NO in the rwservlet.properties file.
Is there anything i have not done properly?
Thanks in advance.Steve,
can you check the Reports cache directory if the Reports file got created? I would assume yes, but better check.
Frank -
hi expert i have created alv report ... it is giving runtime error .. in CALL FUNCTION 'REUSE_ALV_EVENTS_GET' how to solve this plz help ....
*& Report ZALVTRIAL *
REPORT ZALVTRIAL .
tables : vbak,vbap.
type-pools: slis.
types : begin of scr1,
vbeln type VBELN_VA,
erdat type erdat,
ernam type ernam,
end of scr1.
data : i_vbak type standard table of scr1,
wa_vbak type scr1.
types : begin of scr2,
vbeln type VBELN_VA,
matnr type matnr,
posnr type posnr_va,
end of scr2.
data : i_vbap type standard table of scr2,
wa_vbap type scr2.
types : begin of scr_final,
vbeln type VBELN_VA,
erdat type erdat,
ernam type ernam,
matnr type matnr,
posnr type posnr_va,
end of scr_final.
data : i_final type standard table of scr_final,
wa_final type scr_final.
**START OF DATA DECLERATION FOR ALV
*DATA FOR CATLOG
DATA: wa_fldcat TYPE slis_fieldcat_alv,
i_fldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE .
*DATA FOR EVENT
DATA : wa_event TYPE slis_alv_event,
i_event TYPE slis_t_event WITH HEADER LINE.
*DATA FOR HEADER
DATA: wa_head TYPE slis_listheader,
i_head TYPE slis_t_listheader WITH HEADER LINE.
*data for layout
DATA: wa_layout TYPE slis_layout_alv.
selection-screen: begin of block b1 with frame title text-001.
select-options: s_vbeln for vbak-vbeln .
SELECTION-SCREEN: END OF BLOCK B1.
start-of-selection.
select vbeln erdat ernam
from vbak
into table i_vbak where vbeln in s_vbeln.
if sy-subrc <> 0.
leave list-processing.
else.
sort i_vbak by vbeln.
endif.
if i_vbak[] is not initial.
select vbeln matnr posnr
from vbap
into table i_vbap
for all entries in i_vbak
where vbeln = i_vbak-vbeln.
endif.
loop at i_vbak into wa_vbak.
wa_final-vbeln = wa_vbak-vbeln.
wa_final-erdat = wa_vbak-erdat .
wa_final-ernam = wa_vbak-ernam .
append wa_final to i_final.
endloop.
if sy-subrc = 0.
loop at i_final into wa_final.
read table i_vbap into wa_vbap
with key vbeln = wa_vbak-vbeln binary search.
if sy-subrc = 0.
wa_final-matnr = wa_vbap-matnr.
wa_final-posnr = wa_vbap-posnr.
modify i_final from wa_final transporting matnr posnr.
endif.
clear : wa_vbap , wa_final.
endloop.
endif.
**WRITE:/1 sy-uline(63).
**WRITE:/1'|', 2 'Sales Document' COLOR 4 ON ,11'|',12 'Date' COLOR 5
**ON
**,21'|',22 'Name' COLOR 4 ON,35'|',
36 'Material Number' COLOR 5 ON, 55'|',56 'line no' COLOR 4 ON
**63'|'.
**WRITE:/1 sy-uline(63).
**LOOP AT i_final INTO wa_final.
WRITE:/1'|', 2 wa_final-vbeln,11'|',12 wa_final-erdat,21'|',22
wa_final-ernam,35'|',
36 wa_final-matnr, 55'|',56 wa_final-posnr,63'|'.
**endloop.
perform builtcatalog.
perform event.
perform listheader.
perform layout.
perform display.
*& Form builtcatalog
text
form builtcatalog.
wa_fldcat-col_pos = '1'.
wa_fldcat-fieldname = 'vbeln'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Sales Document'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '2'.
wa_fldcat-fieldname = 'erdat'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Date'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '3'.
wa_fldcat-fieldname = 'ernam'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Name'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '4'.
wa_fldcat-fieldname = 'matnr'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Material Number'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '5'.
wa_fldcat-fieldname = 'posnr'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Sales Document Item'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
endform. "builtcatalog
*& Form event
text
form event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = i_final[].
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF sy-subrc = 0.
READ TABLE i_event INTO wa_event
WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
wa_event-form = slis_ev_top_of_page.
MODIFY i_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
READ TABLE i_event INTO wa_event
WITH KEY name = slis_ev_pf_status_set .
IF sy-subrc = 0.
wa_event-form = slis_ev_pf_status_set .
MODIFY i_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
READ TABLE i_event INTO wa_event
WITH KEY name = slis_ev_user_command.
IF sy-subrc = 0.
wa_event-form = slis_ev_user_command .
MODIFY i_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. "event
*& Form
text
form listheader.
wa_head-typ = 'H'.
wa_head-info = 'ALV PROGRAM AUTHOR jessy'
APPEND wa_head TO i_head.
endform. "listheader
*& Form layout
text
form layout.
wa_layout-zebra = 'X'.
wa_layout-f2code = 'DUB'.
endform. "layout
*& Form display
text
form display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' sy-repid '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = wa_layout
IT_FIELDCAT = i_fldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_event[]
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. "displayHi,
The error has been corrected.
Copy the following code and execute. You won't get any runtime errors.
*& Report ZALVTRIAL *
REPORT ZALVTRIAL .
tables : vbak,vbap.
type-pools: slis.
types : begin of scr1,
vbeln type VBELN_VA,
erdat type erdat,
ernam type ernam,
end of scr1.
data : i_vbak type standard table of scr1,
wa_vbak type scr1.
types : begin of scr2,
vbeln type VBELN_VA,
matnr type matnr,
posnr type posnr_va,
end of scr2.
data : i_vbap type standard table of scr2,
wa_vbap type scr2.
types : begin of scr_final,
vbeln type VBELN_VA,
erdat type erdat,
ernam type ernam,
matnr type matnr,
posnr type posnr_va,
end of scr_final.
data : i_final type standard table of scr_final,
wa_final type scr_final.
**START OF DATA DECLERATION FOR ALV
*DATA FOR CATLOG
DATA: wa_fldcat TYPE slis_fieldcat_alv,
i_fldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE .
*DATA FOR EVENT
DATA : wa_event TYPE slis_alv_event,
i_event TYPE SLIS_T_EVENT." WITH HEADER LINE. "-----> correction done here
*DATA FOR HEADER
DATA: wa_head TYPE slis_listheader,
i_head TYPE slis_t_listheader WITH HEADER LINE.
*data for layout
DATA: wa_layout TYPE slis_layout_alv.
selection-screen: begin of block b1 with frame title text-001.
select-options: s_vbeln for vbak-vbeln .
SELECTION-SCREEN: END OF BLOCK B1.
start-of-selection.
select vbeln erdat ernam
from vbak
into table i_vbak where vbeln in s_vbeln.
if sy-subrc = 0.
leave list-processing.
else.
sort i_vbak by vbeln.
endif.
if i_vbak[] is not initial.
select vbeln matnr posnr
from vbap
into table i_vbap
for all entries in i_vbak
where vbeln = i_vbak-vbeln.
endif.
loop at i_vbak into wa_vbak.
wa_final-vbeln = wa_vbak-vbeln.
wa_final-erdat = wa_vbak-erdat .
wa_final-ernam = wa_vbak-ernam .
append wa_final to i_final.
endloop.
if sy-subrc = 0.
loop at i_final into wa_final.
read table i_vbap into wa_vbap
with key vbeln = wa_vbak-vbeln binary search.
if sy-subrc = 0.
wa_final-matnr = wa_vbap-matnr.
wa_final-posnr = wa_vbap-posnr.
modify i_final from wa_final transporting matnr posnr.
endif.
clear : wa_vbap , wa_final.
endloop.
endif.
**WRITE:/1 sy-uline(63).
**WRITE:/1'|', 2 'Sales Document' COLOR 4 ON ,11'|',12 'Date' COLOR 5
**ON
**,21'|',22 'Name' COLOR 4 ON,35'|',
*36 'Material Number' COLOR 5 ON, 55'|',56 'line no' COLOR 4 ON
**63'|'.
**WRITE:/1 sy-uline(63).
**LOOP AT i_final INTO wa_final.
WRITE:/1'|', 2 wa_final-vbeln,11'|',12 wa_final-erdat,21'|',22
wa_final-ernam,35'|',
36 wa_final-matnr, 55'|',56 wa_final-posnr,63'|'.
**endloop.
perform builtcatalog.
perform event.
perform listheader.
perform layout.
perform display.
**& Form builtcatalog
*text
form builtcatalog.
wa_fldcat-col_pos = '1'.
wa_fldcat-fieldname = 'vbeln'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Sales Document'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '2'.
wa_fldcat-fieldname = 'erdat'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Date'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '3'.
wa_fldcat-fieldname = 'ernam'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Name'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '4'.
wa_fldcat-fieldname = 'matnr'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Material Number'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
wa_fldcat-col_pos = '5'.
wa_fldcat-fieldname = 'posnr'.
wa_fldcat-tabname = 'I_FINAL'.
wa_fldcat-reptext_ddic = 'Sales Document Item'.
APPEND wa_fldcat TO i_fldcat.
CLEAR wa_fldcat.
endform. "builtcatalog
**& Form event
*text
form event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = i_event "-----> correction done here
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF sy-subrc = 0.
READ TABLE i_event INTO wa_event
WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
wa_event-form = slis_ev_top_of_page.
MODIFY i_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
READ TABLE i_event INTO wa_event
WITH KEY name = slis_ev_pf_status_set .
IF sy-subrc = 0.
wa_event-form = slis_ev_pf_status_set .
MODIFY i_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
READ TABLE i_event INTO wa_event
WITH KEY name = slis_ev_user_command.
IF sy-subrc = 0.
wa_event-form = slis_ev_user_command .
MODIFY i_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. "event
**& Form
*text
form listheader.
wa_head-typ = 'H'.
wa_head-info = 'ALV PROGRAM AUTHOR jessy'
APPEND wa_head TO i_head.
endform. "listheader
**& Form layout
*text
form layout.
wa_layout-zebra = 'X'.
wa_layout-f2code = 'DUB'.
endform. "layout
**& Form display
*text
form display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
*I_INTERFACE_CHECK = ' '
*I_BYPASSING_BUFFER = ' '
*I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' sy-repid '
*I_CALLBACK_PF_STATUS_SET = ' '
*I_CALLBACK_USER_COMMAND = ' '
*I_CALLBACK_TOP_OF_PAGE = ' '
*I_CALLBACK_HTML_TOP_OF_PAGE = ' '
*I_CALLBACK_HTML_END_OF_LIST = ' '
*I_STRUCTURE_NAME =
*I_BACKGROUND_ID = ' '
*I_GRID_TITLE =
*I_GRID_SETTINGS =
IS_LAYOUT = wa_layout
IT_FIELDCAT = i_fldcat[]
*IT_EXCLUDING =
*IT_SPECIAL_GROUPS =
*IT_SORT =
*IT_FILTER =
*IS_SEL_HIDE =
*I_DEFAULT = 'X'
*I_SAVE = ' '
*IS_VARIANT =
IT_EVENTS = i_event[] "-----> correction done here
*IT_EVENT_EXIT =
*IS_PRINT =
*IS_REPREP_ID =
*I_SCREEN_START_COLUMN = 0
*I_SCREEN_START_LINE = 0
*I_SCREEN_END_COLUMN = 0
*I_SCREEN_END_LINE = 0
*IT_ALV_GRAPHICS =
*IT_HYPERLINK =
*IT_ADD_FIELDCAT =
*IT_EXCEPT_QINFO =
*I_HTML_HEIGHT_TOP =
*I_HTML_HEIGHT_END =
*IMPORTING
*E_EXIT_CAUSED_BY_CALLER =
*ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_final "-----> correction done here
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
You need to check the TYPE before passing the internal tables or workareas to the PARAMETERS of a Function Module.
Regards,
Ravi Kiran.. -
Error in alv report (fieldcatlog is not found)
Hai Genious
i am a new of the sap-abap, i have a one problem in my alv report, now i am using the reuse_alv_ fieldcatlog_merge,
i declared with my internal table with type,
my error is :- fieldcatlog not found
for example
types: begin of ty_mara,
matnr type matnr,
meins type meins,
ersda type ersda,
ernam type ernam,
end of ty_mara.
data: wa_mara type ty_mara,
it_mara like table of wa_mara.
select matnr meins ersda ernam from mara into table it_mara.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_MARA'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
call function 'reuse_alv_list_display'Hi,
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_MARA'
I_STRUCTURE_NAME = 'TY_MARA'-->give it
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
also use...
CHANGING
ct_fieldcat = i_fieldtab
data :i_fieldtab TYPE slis_t_fieldcat_alv,
s_fieldtab_body TYPE slis_fieldcat_alv.
fill i_fieldtab like this...
CASE s_fieldtab_body-fieldname.
WHEN 'OA_NO'.
s_fieldtab_body-seltext_l = 'Order Accep. No.'.
MODIFY i_fieldtab FROM s_fieldtab_body INDEX sy-tabix.
CLEAR s_fieldtab_body.
WHEN 'KTEXT'.
s_fieldtab_body-seltext_l = 'Ramco Order No.'.
MODIFY i_fieldtab FROM s_fieldtab_body INDEX sy-tabix.
CLEAR s_fieldtab_body.
and so on -
Workspace Error Running Financial Reports Post HFM Metadata Change
We recently updated the metadata in HFM to use the Custom4 dimention. We are now trying to run reports from Workspace and get an error 5200 - error executing query. I have confirmed that the database connection in Workspace is ok. I am able to run the reports from the Financial Reporting Studio. Any ideas what's wrong when running from Workspace?
That error means that the report is trying to retrieve data from a member that either does not exist or is not valid. I have seen it happen when the user POV chooses [Year] for period.
I would start by trying to get the report to run from Report Studio where you can control the POV settings. If you still get the error, you will need to go through every data point in the report and verify that each member exists. -
Error running BW report frm InfoView when pwd initialized/changed in BW
Hi Experts,
We encountered error "A database error occured. THe databse error text is: unable to connect to sap bw server name or password is incorrect (repeat logon) (WIS 10901)" when we tried to run a BW report from InfoView. We realize this happens only when the user's password is initialized or has been changed in BW.
In our landscape, users SSO into InfoView via Windows Authentication. SSO between InfoView to BW is via SNC.
The error is gone after loggin into InfoView through non-SSO method, then selecting "SAP authentication" method and login
with new BW credentials. It seems like there' s a cache in BOBJ server containing the user's BW credentials. However, this is not a realistic scenario since users change their passwords frequently and we cannot expect them to login to InfoView with SAP authentication each time there is a password change. The requirement is that they are to SSO into InfoView using Windows Authentication.
Similar to when password is initialized, it requires user to login to BW to change the password, then login to InfoView using SAP authentication to "sync" up the credentials. This kinda defeats the purpose of SSO isn't it? Anyone has any solution to this?
THanks,
ZMHi Ingo,
Thanks for the prompt reply. From the behaviour of the testing, it seems like BOBJ server has a cache ( correct me if i'm wrong here) that contains users' BW credentials that is retrieved when user runs BW report in InfoView, as whenever the pwd is changed in BW via SAP GUI, users will always hit the error unless the user logs in the InfoView by selecting "sap" authentication on the logon page, which thus refreshes the cache in BOBJ. If users change their passwords in SAP GUI (BW), this will result in passwords in BW and cache of BOBJ server to be out of sync, and thus error still appears.
1. Is this the standard behaviour for BOBJ cache to store the BW credentials?
2. How can we sync up the user credentials?
Thanks,
ZM -
Error running the report from Form
Hi,
I am try to run the report from the form by using these code of line
DECLARE
RPT_OBJECT REPORT_OBJECT;
RPT_RUN VARCHAR2(100);
BEGIN
RPT_OBJECT := FIND_REPORT_OBJECT('REPORT7');
SET_REPORT_OBJECT_PROPERTY(RPT_OBJECT, REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(RPT_OBJECT, REPORT_DESTYPE, CACHE);
SET_REPORT_OBJECT_PROPERTY(RPT_OBJECT, REPORT_OTHER,'P_CITYCODE'||:CITYCODE||'PARAMFORM = YES');
RPT_RUN := RUN_REPORT_OBJECT(RPT_OBJECT);
END;
but i m not using any Form server and Report Server i m completly using Oracle9iDS
It gives the error rep-0110 file not found and
rep-1070 error while opening and saving the file
please give me the solution
ShehzadShehzad,
this means that Reports Server cannot access the Reports module. You can test this assumption by copying your Reports module into <Oracle Home>\reports\samples\demo. The demo directory is out of the box accessible fro Reports.
If this allows you to run the Report, then all you need to do is to specify the Reports_Path to include the reports modules.
btw.: An other reason can be that your Reports contains uncompiled PLSQL, so you may want to check this too.
Frank -
Run alv report without selection screen in background
Hello Every body,
i programmed a ALV Report without selection screen, and i want to create a job for this alv report.
Any help?
Thank u.
Ouail.Hi Steve,
Can you tell me where i have to put your code?
this is my abap code:
START-OF-SELECTION.
p_filref = '\\SAPSERVER\f\SAFT\ivat\FI_Extract_1000_20140709_102346_910.XML'.
PERFORM copy_from_xml_to_itab TABLES it_ref_file
ref_xml_data
USING p_filref.
**Begin Extraction File
SUBMIT ZZ_FI_IVAT_EXTRACTOR
WITH p_bukrs EQ '1000'
WITH p_gjahr EQ '1998'
WITH filepath EQ '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
WITH cldata eq space
AND RETURN.
DATA: FILE_TABLE TYPE TABLE OF SDOKPATH,
DIR_TABLE TYPE TABLE OF SDOKPATH.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
FILTER = '*.*'
TABLES
FILE_TABLE = FILE_TABLE
DIR_TABLE = DIR_TABLE
EXCEPTIONS
CNTL_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.
"get file name
LOOP AT FILE_TABLE INTO p_filref.
ENDLOOP.
CONCATENATE '\\SAPSERVER\f\SAFT\iVAT_Extractie\' p_filref INTO path.
PERFORM copy_from_xml_to_itab TABLES t_ext_file
ext_xml_data
USING path.
PERFORM fill_xml_tab_in .
perform build_fieldcatalog.
PERFORM compare_data_ref_ext.
PERFORM send_email.
perform display_alv_report.
PERFORM delete_extraction_file.
in the perform copy_from_xml_to_itab TABLES it_ref_file......, i use this code:
CREATE OBJECT gcl_xml.
*Upload XML File
CALL METHOD gcl_xml->import_from_file
EXPORTING
filename = p_filref
RECEIVING
retcode = gv_subrc.
IF gv_subrc = 0.
CALL METHOD gcl_xml->render_2_xstring
IMPORTING
retcode = gv_subrc
stream = gv_xml_string
size = gv_size.
IF gv_subrc = 0.
REFRESH gt_xml_data[].
* Convert XML to internal table
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = gv_xml_string
TABLES
xml_table = gt_xml_data
return = gt_return.
ENDIF.
ENDIF. -
Error running XL Reporter: 'a required COM add-in program..' for Excel 2007
I have 2 users running Excel 2007 that can't run XL reporter. They get the message 'a required COM add-in program for XL Reporter has not been loaded'. I have instructions for Excel 2003, but not for 2007. Does anyone know how to resolve this for Excel 2007?
Gordon,
I have instructions to get the IXXLReporter.dll file in the installation area, but 2007 has completely different layout. I can't find where to go??? Can you please give me the procedure?
Edited by: Pat Frohlich on Apr 1, 2009 10:12 AM -
Text format error in ALV report
Hi Experts,
I am trying to download the ALV report output in to text format but the system is not downloaded the columns correctly. some of the columns are repeating and the alignment also not correct.
Please let me know if anyone have solution for this.
Reward points for good solutions.
Regards,
Venkatuse the Option(SHort Cut) CTRLSHFTF9
Local File->Spread sheet option.
And download to excel file.
Text file you can see format distorted, though it is not distorted.
Better use XLS format.
IF columns are repeating then the problem is with the Fieldcatalog. -
Dear friends
When I try to run the following code, I keep getting a message that says
"The field "GT_FIELD" specified here has a different field type.".
I have run this in many occassions and it has worked before. I would appreciate if some one can help me with this. Following is the code
CODE FOLLOWS----
REPORT ZSAPMZRFT_ZWMSCHED_REPORT MESSAGE-ID zrammessage LINE-SIZE 168
LINE-COUNT 20(6) NO STANDARD PAGE HEADING.
TABLES: zwmsched,
zwmwave.
Data : v_repid LIKE sy-repid,
BEGIN OF s_zwmsched occurs 1,
mandt LIKE zwmsched-mandt,
werks LIKE zwmsched-werks,
lgnum LIKE zwmsched-lgnum,
ship_date LIKE zwmsched-ship_date,
carrier LIKE zwmsched-carrier,
vbeln LIKE zwmsched-vbeln,
kunnr LIKE zwmsched-kunnr,
custname LIKE zwmsched-custname,
city LIKE zwmsched-city,
state LIKE zwmsched-state,
zip LIKE zwmsched-zip,
qty LIKE zwmsched-qty,
uom LIKE zwmsched-uom,
wt LIKE zwmsched-wt,
wt_uom LIKE zwmsched-wt_uom,
volumn LIKE zwmsched-volumn,
vol_uom LIKE zwmsched-vol_uom,
inco LIKE zwmsched-inco,
equipment LIKE zwmsched-equipment,
door LIKE zwmsched-door,
wavenum LIKE zwmsched-wavenum,
load_seq LIKE zwmsched-load_seq,
notes LIKE zwmsched-notes,
pick_stat LIKE zwmsched-pick_stat,
load_stat LIKE zwmsched-load_stat,
bol_stat LIKE zwmsched-bol_stat,
mbol LIKE zwmsched-mbol,
seal LIKE zwmsched-seal,
gm_status LIKE zwmsched-gm_status,
createdate LIKE zwmsched-createdate,
created_by LIKE zwmsched-created_by,
changedate LIKE zwmsched-changedate,
changed_by LIKE zwmsched-changed_by,
END of s_zwmsched,
Begin of temp_zwmsched occurs 1,
so_lgnum LIKE zwmsched-lgnum,
so_vbeln LIKE zwmsched-vbeln,
pa_date LIKE zwmsched-ship_date,
pa_wvno LIKE zwmsched-wavenum,
pa_door LIKE zwmsched-door,
carrier LIKE zwmsched-carrier,
pickstat LIKE zwmsched-pick_stat,
mbol LIKE zwmsched-mbol,
loadstat LIKE zwmsched-load_stat,
bol_stat LIKE zwmsched-bol_stat,
pgi_stat LIKE zwmsched-gm_status,
end of temp_zwmsched.
TYPE-POOLS : slis.
DATA :
gt_field TYPE slis_t_fieldcat_alv,
wa_field TYPE slis_fieldcat_alv,
gt_layout TYPE slis_layout_alv.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS: so_lgnum FOR zwmsched-lgnum,
so_vbeln FOR zwmsched-vbeln,
pa_date FOR zwmsched-ship_date,
pa_wvno FOR zwmsched-wavenum,
pa_door FOR zwmsched-door,
carrier FOR zwmsched-carrier,
pickstat FOR zwmsched-pick_stat,
mbol FOR zwmsched-mbol.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP.
PARAMETERS: loadstat LIKE zwmsched-load_stat,
bol_stat LIKE zwmsched-bol_stat,
pgi_stat LIKE zwmsched-gm_status.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK block2.
select * from zwmsched into corresponding fields of table temp_zwmsched
where
lgnum in so_lgnum AND
vbeln in so_vbeln AND
ship_date in pa_date AND
wavenum in pa_wvno AND
door in pa_door AND
carrier in carrier AND
pick_stat in pickstat AND
mbol in mbol AND
load_stat = loadstat AND
bol_stat = bol_stat AND
gm_status = pgi_stat.
wa_field-col_pos = 1.
wa_field-tabname = 'ZWMSCHED'.
wa_field-fieldname = 'LGNUM'.
wa_field-seltext_l = 'WARE HOUSE'.
wa_field-outputlen = 11.
APPEND wa_field TO gt_field.
*wa_field-col_pos = 2.
*wa_field-fieldname = 'VBELN'.
*wa_field-seltext_l = 'DELIVERY'.
*wa_field-outputlen = 10.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 3.
*wa_field-fieldname = 'SHIP_DATE'.
*wa_field-seltext_l = 'SHIP DATE'.
*wa_field-outputlen = 11.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 4.
*wa_field-fieldname = 'WAVENUM'.
*wa_field-seltext_l = 'WAVENUM'.
*wa_field-outputlen = 11.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 5.
*wa_field-fieldname = 'DOOR'.
*wa_field-seltext_l = 'DOOR'.
*wa_field-outputlen = 5.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 6.
*wa_field-fieldname = 'CARRIER'.
*wa_field-seltext_l = 'CARRIER'.
*wa_field-outputlen = 8.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 7.
*wa_field-fieldname = 'PICK_STAT'.
*wa_field-seltext_l = 'PICK STAT'.
*wa_field-outputlen = 10.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 8.
*wa_field-fieldname = 'MBOL'.
*wa_field-seltext_l = 'MBOL'.
*wa_field-outputlen = 5.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 9.
*wa_field-fieldname = 'LOAD_STAT'.
*wa_field-seltext_l = 'LOAD STAT'.
*wa_field-outputlen = 10.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 10.
*wa_field-fieldname = 'BOL_STAT'.
*wa_field-seltext_l = 'BOL STAT'.
*wa_field-outputlen = 11.
*APPEND wa_field TO gt_field.
*wa_field-col_pos = 11.
*wa_field-fieldname = 'GM_STATUS'.
*wa_field-seltext_l = 'PFI STAT'.
*wa_field-outputlen = 9.
*APPEND wa_field TO gt_field.
gt_layout-zebra = 'X'.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = gt_field
IT_FIELDCAT = gt_layout
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = temp_zwmsched
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.You problem is right here.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
<b>IS_LAYOUT = gt_field
IT_FIELDCAT = gt_layout</b>
IT_EXCLUDING =
Should be....
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
<b>IS_LAYOUT = gt_layout
IT_FIELDCAT = gt_field</b>
IT_EXCLUDING =
Regarsd,
Rich Heilman
Maybe you are looking for
-
Calling stored procedure in a method validation
Hi guys. Please I need help.. In an Entity object called customers there is a field called customer_id. Before recording in the database is necessary that a procedure to be executed, returning a boolean value saying that this record is ok. I would li
-
Replacing image in shared photo stream
Is there a way to replace a photo in a shared photo stream and keep the original place in the stream? The only way I can find is to delete it and re-upload, but this will place the photo as the last photo in the stream.
-
Siri wants to unlock iPhone if I want to use the camera
If I want to take a picture manually I don't have to unlock my phone but when I tell Siri to take a picture it wants me to unlock my iPhone :/
-
Canadian GST Tax Form, Business number ???
I have been setting up tax info, and in the Canadian tax form GST506, it requests a business number. I am just a sole developer residing in Canada looking to have a paid / iAd supported app on the App Store, and don't have a business number. Will I n
-
How can I stop my phone from muting in the middle of calls?
When pressing "send" and making a call, Six boxes pop up on the screen, one of them being the muting option. My problem is that face or ear touch this button while I'm in the middle of a call. I need to be able to manipulate the options that come