‎2008 Jul 25 1:09 PM
Hi,
I have a report which generates a spool file when executed in background.
The error is that the in one of the fields (Delivery No.) the last digit is getting truncated.
It displays like '12345678...'.
The value should have been '123456789'.
The field length has been specified as 15 which very well coverys the delivery no.
Please help me to know the error and how it can be resolved.
Thanks.
Edited by: David D on Jul 25, 2008 2:10 PM
‎2008 Jul 25 1:13 PM
Hi David,
Do you have a Field Labels printed...
Delivery is of length 8
so is your display check if thats affecting your output.
santhosh
‎2008 Jul 25 1:13 PM
Hi David,
Do you have a Field Labels printed...
Delivery is of length 8
so is your display check if thats affecting your output.
santhosh
‎2008 Jul 25 1:14 PM
Hi,
when i run in foreground, the ALV displays the delivery number correctly. This error occurs only in spool.
Thanks.
‎2008 Jul 25 1:17 PM
You specify the output length for the field and see..
FIELDCAT-OUTPUTLEN = '15'.
It happens in some cases. when you don't specify the Outputlength or Specifying less Length then you will get the problem.
‎2008 Jul 25 1:19 PM
Hi Vijay,
This is exactly what I have done.
And the ALV displays correct output.
The error is only in spool.
Thanks.
‎2008 Jul 25 1:22 PM
Hi David,
Did you by chance passed
colwidth_optimize = 'X'. in Layout?
if not while populating the SELTEXT_L, SELTEXT_M and SELTEXT_S
try to give "Delivery Number" in FULL and try...
santhosh
‎2008 Jul 25 1:26 PM
The Problem is with this
NO_ZERO = 'X'. set it for the field/column which you want in the fieldcatalog.
you set this and see the Background spool .
wa_field-no_zero = 'X'.
‎2008 Jul 25 1:27 PM
Check this one in Foreground and Background.
REPORT ztest_alv.
TYPE-POOLS:slis.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
wa_field LIKE LINE OF it_fieldcat.
DATA: BEGIN OF it_likp OCCURS 0,
vbeln TYPE likp-vbeln,
END OF it_likp.
DATA: layout TYPE slis_layout_alv.
wa_field-fieldname = 'VBELN'.
wa_field-tabname = 'IT_LIKP'.
wa_field-hotspot = 'X'.
wa_field-outputlen = 10.
wa_field-no_zero = 'X'.
wa_field-seltext_l = 'Sales'.
APPEND wa_field TO it_fieldcat.
SELECT vbeln FROM likp
UP TO 10 ROWS
INTO TABLE it_likp.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = layout
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_likp
EXCEPTIONS
program_error = 1.
*&---------------------------------------------------------------------*
*& Form user_Command
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->UCOMM text
* -->SELFIELD text
*----------------------------------------------------------------------*
FORM user_command USING ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN '&IC1'.
SET PARAMETER ID 'VL' FIELD selfield-value.
CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. "user_CommandRegards
Vijay Babu Dudla
‎2008 Jul 28 8:31 AM
Thanks Vijay,
The issue is resolved.
Your solution was of great help.
Thanks.