Reduce out put field length of alv output in back ground
Hi all,
Is there a way to reduce the output length of the field in back groundfor ALV out put
Its back ground
I have thsi things in my field catalog
wa_fieldcat-outputlen = 10.
wa_fieldcat-ddic_outputlen = 10.
If the field has value of length 10 characters its ok
but when the field has lenth of more than 10 characters
(say 20 char). in fore ground it displays 10 characters and then we can move the column to see full thing , but in back ground it displays 20 char.
In fact that is what i have to see because in background you cannot drag the column to see entire thing , but i want to cut short to 12 char even if i don't see the remaining thing its ok
Thanks
Hi Vasu,
WHAT EXACTLY SY-BATCH DOES .
I tried reducing wa_fieldcat-outputlen = 10. and then i tried
wa_fieldcat-outputlen = 5., but it doesnot really changed anything in back ground but it did in fore ground . I haven't used any called sy-batch
Let me know
This is how my field catalog looks for mATNR
clear wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_l = ' Material #'.
wa_fieldcat-seltext_m = 'Material #'.
wa_fieldcat-seltext_s = ' Material #'.
wa_fieldcat-reptext_ddic = 'Material #'.
wa_fieldcat-ddictxt = 'L'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-outputlen = 18.
wa_fieldcat-intlen = 18.
wa_fieldcat-ddic_outputlen = 18.
wa_fieldcat-tabname = '1'.
append wa_fieldcat to fieldcat.
NEXT TIME I COMMENTED THIS AND HAD
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_l = ' Material #'.
wa_fieldcat-seltext_m = 'Material #'.
wa_fieldcat-seltext_s = ' Material #'.
wa_fieldcat-reptext_ddic = 'Material #'.
wa_fieldcat-ddictxt = 'L'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-outputlen = 10.
wa_fieldcat-intlen = 10.
wa_fieldcat-ddic_outputlen = 10.
wa_fieldcat-tabname = '1'.
append wa_fieldcat to fieldcat.
BUT I DID SEE DIFFERENCE IN FOREBROUND BUT NOT IN BACK GROUND
Let me know
Thanks
Similar Messages
-
I am trying to set the field length in ALV
so i wrote
<fs_fcat>-outputlen = 15.
and in layout...
wa_layout-colwidth_optimize = space . tried by commenting this statment also
But it doesnt show any effect
" in fact field length is depend on field lable and on its content..."
so plz help me some buddy.....
Edited by: anurodh_t on Sep 29, 2010 3:58 PMHello,
Try updating the description fields of the Fieldcat records prior to defining the outputlen field. Depending on the way you are implementing your ALV, try updating the following fields:
scrtext_l
scrtext_m
scrtext_s
or
seltext_l
seltext_m
seltext_s
Best regards,
Mário Espinheira -
Hi friends, i got some problem in alv grid while i am running it in back ground.
my report contains some currency(amount) field in out put. when i am removing the amount field it is good result in back ground. but when it consist of amount field it is giving error. it indicating some string length problem. and error analysis as follows.
Error analysis
In statement
"STRLEN( obj )..."
the argument "obj" can only take a character-type data object.
In this case, the operand "obj" has the non-character type "P".
pls tell me can't we run amount field in back ground. if s how to solve my error. pls give me some ideas.
Kumar.Hi
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.
/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job -
Hi experts ,
Hi have 70 fields in my ALV output. When the data is huge the output format in back ground is destorted ( overlapping).
When the data is less i could able to see alla colums appearing fine and can able to down load well?
I wanna know is there any limitation of spool capacity or number of coulumns * rows in ALV format .
Your help is highly rewarded.
Thanks n Regards,
VamsiHi,
Well then did you try to increase the line-size in the report statement of the program?
report ztest line-size 1023.
Regards,
Vikranth -
Hi All,
Can we run alv report in back ground,if yes how?
Thanks&Regards.
Srikanth.Vhi Ramu,
Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
if sy-batch = ' '.
call 'REUSE_ALV_GRID_DISPLAY'.
else.
call 'REUSE_ALV_LIST_DISPLAY'.
endif.
if you are using OO alv then write this code..
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING e_offline = off.
IF off IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
ENDIF. -
Field Length in Alv Grid out put
hi,
How to increase the length of the filed in the output of alv grid,
Actually i am getting one blank field in the alv grid out put, my requirement is to increase the length through out the column how to do that
can anyone guide me plz
SIRIin your fieldcat of the field
wfieldcat-fieldname = '<your fieldname in caps>'
wfieldcat-outputlen = 10 (or the length you want for the field)
<you can define any other property also for that field>
append wfieldcat to ifieldcat.
now pass it in fm.
regards
shiba dutta -
Arrow mark with kunnr field values in alv output.
Hi ,
I need to increase the column field length. I am using Function Module REUSE_ALV_LIST_DISPLAY because alv_grid display fm is not available in 4.0b version. I have used column optimization in layout. The column kunnr is coming with a small arrow though there is no data loss. Is there any way I can remove the arrow mark with kunnr field values.Hi,
You can increase your column lenght in fieldcat by using Fcat-columnwidth = "SIZE OF KUNNR ".
Set the size of kunnr field in fieldcat and get the appropiate output.
Regards
Abdul -
How do i put a picture on my home screen back ground
im trying to put a picture on my home screen back-groud and i don't know how... YET
if you have an 8 gig 3g, you can't, as it is not supported. otherwise it would be an option after you select the photo you want as the background. it would ask you to set lock screen, home screen or both.
-
hi experts,
i have a small doubt in alv.
In fieldcat i have one field called amount and am defining its length 19.
but actual its length in database is 14.when i tried to display the this amount field using reuse_alv_list_display the data in amount field is showing only 14 digits,but i need to display its total length(even if it is greater than database length).........
correct answers rewarded with maximum points????????????Hi
Check while preparing Fieldcatalog you are giving length 19 to this amount fields .
For this u have a option of output length in fieldcatalog .
Try this .
Hope this helps .
Praveen
Message was edited by:
praveen parasiya -
Editable fields in Hierarchical ALV output
Hi Experts,
I have developed a report using hierarchical ALV display. I wanted to make some of the fields(in a particular column) editable in the output of Hierarchical ALV. Please provide your suggestions with examples.
Regards,
RajeshI am not getting what u mean,.
Coz I have done the editable property in my hierarcical ALV only...
I have header line and correspodning item lines.
In all header line I will make the 3rd column as editable...
CHECK below
*& Report ZFIR_WRITE_OFF
REPORT zfir_write_off
NO STANDARD PAGE HEADING
MESSAGE-ID zles.
TYPE-POOLS
TYPE-POOLS:slis.
TABLES
TABLES: kna1, t001, zdunning_data, bsid, t052.
INTERNAL TABLES
To check for bukrs in selection screen
DATA: BEGIN OF t_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
END OF t_t001.
To check for the customer in selection screen
DATA: BEGIN OF t_kna1 OCCURS 0,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
END OF t_kna1.
*Data from BSID table
DATA: BEGIN OF t_bsid OCCURS 0,
bukrs LIKE bsid-bukrs,
budat LIKE bsid-budat,
kunnr LIKE bsid-kunnr,
belnr LIKE bsid-belnr,
zfbdt LIKE bsid-zfbdt,
zterm LIKE bsid-zterm,
dmbtr LIKE bsid-dmbtr,
waers LIKE bsid-waers,
vbeln LIKE bsid-vbeln,
END OF t_bsid.
*Data from ZDunning_data
DATA: BEGIN OF t_zdunning OCCURS 0,
belnr LIKE zdunning_data-belnr,
kunnr LIKE zdunning_data-kunnr,
zdef_notice_flg LIKE zdunning_data-zdef_notice_flg,
zterm_notice_flg LIKE zdunning_data-zterm_notice_flg,
END OF t_zdunning.
*Data from t052 for base line days
DATA: BEGIN OF t_t052 OCCURS 0,
zterm LIKE t052-zterm,
ztag1 LIKE t052-ztag1,
END OF t_t052.
*with duedate and date for write off calculation
DATA: BEGIN OF t_data OCCURS 0,
belnr LIKE bsid-belnr,
kunnr LIKE bsid-kunnr,
zterm LIKE bsid-zterm,
zfbdt LIKE bsid-zfbdt,
ztag1 LIKE t052-ztag1,
duedate LIKE bsid-zfbdt,
wdate LIKE bsid-zfbdt,
vbeln LIKE bsid-vbeln,
dmbtr LIKE bsid-dmbtr,
waers LIKE bsid-waers,
budat LIKE bsid-budat,
vbelv like vbfa-vbelv,
Name1 like kna1-name1,
END OF t_data.
*Output display in ALV report
DATA: BEGIN OF t_output OCCURS 0,
Flag type C,
bukrs LIKE bsid-bukrs,
kunnr LIKE bsid-kunnr,
vbeln LIKE bsid-vbeln, "Invoice
posnv like vbfa-posnv,
wdate LIKE bsid-zfbdt,
belnr LIKE bsid-belnr,
dmbtr LIKE bsid-dmbtr,
waers LIKE bsid-waers,
budat LIKE bsid-budat,
vbelv like vbfa-vbelv, "Contract
name1 like kna1-name1,
duedate like bsid-zfbdt,
END OF t_output.
To get contract number for the billing document number
DATA: BEGIN OF t_vbfa OCCURS 0,
vbelv LIKE vbfa-vbelv,
vbeln LIKE vbfa-vbeln,
POSNV like vbfa-POSNV,
END OF t_vbfa.
data: begin of t_cust occurs 0,
KUNNR like kna1-kunnr,
name1 like kna1-name1,
end of t_cust.
data: begin of t_head occurs 0,
VBELv like vbfa-vbelv,
posnv like vbfa-posnv,
VKUEGRU type ZLIST_WO_RCANCEL,
end of t_head.
data: begin of it_veda occurs 0,
VBELn LIKE Veda-VBELN,
POSNR LIKE Veda-VPOSN,
VKUEGRU LIKE Veda-VKUEGRU,
end of it_veda.
VARIABLE DECLARATION
DATA: l_duedate LIKE bsid-zfbdt,
l_wdate LIKE bsid-zfbdt.
VARIABLE FOR ALV DISPLAY
DATA: t_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: t_fieldcat1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
wa_fieldcat1 TYPE slis_fieldcat_alv.
DATA: t_layout TYPE slis_layout_alv.
DATA: g_repid LIKE sy-repid.
SELECTION-SCREEN
*Selection Screen Parameters for user input
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:
*Company Code
p_bukrs LIKE t001-bukrs OBLIGATORY.
SELECT-OPTIONS:
*Customer Number
s_kunnr FOR kna1-kunnr OBLIGATORY DEFAULT '0' TO 'ZZZZZZZZZZ'.
PARAMETERS:
*Write Off Date
p_wodate TYPE sy-datum OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1 .
AT SELECTION-SCREEN
*Selection Screen validation for Company code
AT SELECTION-SCREEN ON p_bukrs.
SELECT SINGLE bukrs FROM t001 "#EC *
INTO t_t001
WHERE bukrs = p_bukrs.
IF sy-subrc NE 0.
*Error message for Invalid Company Code
MESSAGE e000 WITH text-002.
ENDIF.
*Selection Screen Validation for Customer
AT SELECTION-SCREEN ON s_kunnr.
IF NOT s_kunnr IS INITIAL.
SELECT SINGLE kunnr name1
FROM kna1 "#EC *
INTO t_kna1
WHERE kunnr IN s_kunnr.
IF sy-subrc NE 0.
*Error message for Invalid Customer Number
MESSAGE e000 WITH text-003.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON p_wodate.
IF p_wodate IS INITIAL.
p_wodate = sy-datum.
ENDIF.
INITIALIZATION
INITIALIZATION.
PERFORM clear_data.
START-OF-SELECTION
START-OF-SELECTION.
*Get the Accounting Document Number and base line date from BSID
SELECT bukrs kunnr belnr budat zfbdt zterm dmbtr waers vbeln
FROM bsid
INTO corresponding fields of TABLE t_bsid
WHERE kunnr IN s_kunnr AND
bukrs = p_bukrs.
IF NOT t_bsid[] IS INITIAL.
*Get the Dunning data based on the Accounting Document Number from BSID
SELECT belnr kunnr zdef_notice_flg zterm_notice_flg
FROM zdunning_data
INTO TABLE t_zdunning
FOR ALL ENTRIES IN t_bsid
WHERE kunnr = t_bsid-kunnr AND
belnr = t_bsid-belnr AND
zdef_notice_flg = 'Y' AND
zterm_notice_flg = 'Y'.
*Get the base line days from t052 table based on BSID data
SELECT zterm ztag1
FROM t052
INTO TABLE t_t052
FOR ALL ENTRIES IN t_bsid
WHERE zterm = t_bsid-zterm.
*Calculate the due date(bse line date BSID-ZFBDT + base line days
*T052-ZTAG )
IF NOT t_zdunning[] IS INITIAL.
Get the customer name
Select KUNNR NAME1 from KNA1
INTO table t_cust
for all entries in t_zdunning
where kunnr = t_zdunning-kunnr.
LOOP AT t_zdunning.
LOOP AT t_bsid.
CLEAR t_zdunning.
READ TABLE t_zdunning WITH KEY belnr = t_bsid-belnr
kunnr = t_bsid-kunnr.
CHECK sy-subrc = 0.
CLEAR t_t052.
READ TABLE t_t052 WITH KEY zterm = t_bsid-zterm.
IF sy-subrc = 0 .
t_data-belnr = t_zdunning-belnr.
t_data-kunnr = t_zdunning-kunnr.
Clear t_cust.
read table t_cust with key kunnr = t_zdunning-kunnr.
if sy-subrc = 0.
t_data-name1 = t_cust-name1.
endif.
t_data-zterm = t_bsid-zterm.
t_data-zfbdt = t_bsid-zfbdt.
t_data-ztag1 = t_t052-ztag1.
t_data-vbeln = t_bsid-vbeln.
t_data-dmbtr = t_bsid-dmbtr.
t_data-waers = t_bsid-waers.
t_data-budat = t_bsid-budat.
*calculate duedate
CLEAR l_duedate.
l_duedate = t_bsid-zfbdt + t_t052-ztag1.
t_data-duedate = l_duedate.
*calculate date for write off
CLEAR l_wdate.
l_wdate = l_duedate + 180.
t_data-wdate = l_wdate.
APPEND t_data.
CLEAR l_wdate.
CLEAR l_duedate.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE s000 WITH text-005.
ENDIF.
*Check the wdate with write off date in the selection screen value.
*If this calculated date is Greater than value enetred in selection
*screen, display the corresponding data in ALV report.
IF NOT t_data[] IS INITIAL.
SELECT vbelv vbeln
POSNV
FROM vbfa
INTO TABLE t_vbfa
FOR ALL ENTRIES IN t_data
WHERE vbeln = t_data-vbeln.
and
VBTYP_V = 'G'.
*If reason for cancelation is there, no writeoff.
Select VBELn VPOSN VKUEGRU from Veda
into table it_veda
for all entries in t_vbfa
where vbeln = t_vbfa-vbelv.
SELECT vbelv
POSNV
FROM vbfa
INTO TABLE t_Head
FOR ALL ENTRIES IN t_data
WHERE vbeln = t_data-vbeln
and
VBTYP_V = 'G'.
loop at t_head.
clear it_veda.
Read table it_veda with key vbeln = t_head-vbelv
posnr = t_head-posnv.
if not it_veda-VKUEGRU is initial.
Delete t_head where vbelv = it_veda-vbeln and
posnv = it_veda-posnr.
endif.
endloop.
LOOP AT t_data.
IF t_data-wdate LE p_wodate.
t_output-bukrs = p_bukrs.
t_output-kunnr = t_data-kunnr.
CLEAR t_vbfa.
READ TABLE t_vbfa WITH KEY vbeln = t_data-vbeln.
read table t_head with key vbelv = t_vbfa-vbelv
posnv = t_vbfa-posnv.
if sy-subrc = 0.
t_output-vbelv = t_vbfa-vbelv.
t_output-posnv = t_vbfa-posnv.
t_output-name1 = t_data-name1.
t_output-wdate = t_data-wdate.
t_output-belnr = t_data-belnr.
t_output-dmbtr = t_data-dmbtr.
t_output-waers = t_data-waers.
t_output-budat = t_data-budat.
t_output-vbeln = t_data-vbeln.
t_output-duedate = t_data-duedate .
APPEND t_output.
ENDIF.
clear t_output.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE s000 WITH text-006.
ENDIF.
*ALV display for the output records
IF NOT t_output[] IS INITIAL.
PERFORM alv_display.
ELSE.
MESSAGE s000 WITH text-006.
ENDIF.
ELSE.
MESSAGE s000 WITH text-004.
ENDIF.
*& Form clear_data
text
--> p1 text
<-- p2 text
FORM clear_data .
CLEAR:t_t001,
t_kna1,
t_bsid,
t_zdunning,
t_t052,
t_data,
t_output,
wa_fieldcat,
t_layout,
t_fieldcat,
t_vbfa.
REFRESH:t_t001,
t_kna1,
t_bsid,
t_zdunning,
t_t052,
t_data,
t_output,
t_fieldcat,
t_vbfa.
clear:t_head,
it_veda.
Refresh:t_head,
it_veda.
Clear T_cust.
Refresh t_data.
ENDFORM. " clear_data
*& Form alv_display
text
--> p1 text
<-- p2 text
FORM alv_display .
*To build the field catalogue
PERFORM build_fieldcatalog1.
PERFORM build_fieldcatalog.
*To build the ALV layout
PERFORM build_layout.
*To displayt the data in ALV report
PERFORM display_alv_report.
ENDFORM. " alv_display
*& Form build_fieldcatalog
text
--> p1 text
<-- p2 text
FORM build_fieldcatalog1 .
REFRESH t_fieldcat1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '1'.
wa_fieldcat-fieldname = 'VBELV'.
wa_fieldcat-tabname = 'T_HEAD'.
wa_fieldcat-seltext_l = 'Contract Number'.
wa_fieldcat-Checkbox = 'X'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-no_out = 'X'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-fieldname = 'POSNV'.
wa_fieldcat-tabname = 'T_HEAD'.
wa_fieldcat-seltext_l = 'Item Number'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '3'.
wa_fieldcat-fieldname = 'VKUEGRU'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-input = 'X'.
wa_fieldcat-tabname = 'T_HEAD'.
wa_fieldcat-drdn_hndl = '1'.
wa_fieldcat-seltext_l = 'Reason for Cancel'.
wa_fieldcat-outputlen = '25'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
endform.
FORM build_fieldcatalog .
REFRESH t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '4'.
wa_fieldcat-fieldname = 'KUNNR'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Customer Number'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '5'.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Customer Name'.
wa_fieldcat-outputlen = '30'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '6'.
wa_fieldcat-fieldname = 'VBELV'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Contract Number'.
wa_fieldcat-outputlen = '20'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '7'.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Invoice No.'.
wa_fieldcat-outputlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '8'.
wa_fieldcat-fieldname = 'BELNR'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Acc doc Number'.
wa_fieldcat-outputlen = '20'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '9'.
wa_fieldcat-fieldname = 'WAERS'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Currency'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '10'.
wa_fieldcat-fieldname = 'DMBTR'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-do_sum = 'X'. "SUM UPON DISPLAY
wa_fieldcat-datatype = 'CURR'.
wa_fieldcat-seltext_l = 'Amount'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '11'.
wa_fieldcat-fieldname = 'DUEDATE'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Due Date'.
wa_fieldcat-outputlen = '20'.
APPEND wa_fieldcat TO t_fieldcat.
data: lt_dropdown type lvc_t_drop,
ls_dropdown type lvc_s_drop.
First listbox (handle '1').
ls_dropdown-handle = '1'.
ls_dropdown-value = 'KG'.
append ls_dropdown to lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = 'G'.
append ls_dropdown to lt_dropdown.
call method g_grid->set_drop_down_table
exporting it_drop_down = lt_dropdown.
ENDFORM. " build_fieldcatalog
*& Form build_layout
text
--> p1 text
<-- p2 text
FORM build_layout .
t_layout-no_input = 'X'.
t_layout-colwidth_optimize = 'X'.
ENDFORM. " build_layout
*& Form display_alv_report
text
--> p1 text
<-- p2 text
FORM display_alv_report .
g_repid = sy-repid.
data g_keyinfo type SLIS_KEYINFO_ALV.
g_keyinfo-HEADER01 = 'VBELV'.
g_keyinfo-ITEM01 = 'VBELV'.
g_keyinfo-HEADER02 = 'POSNV'.
g_keyinfo-ITEM02 = 'POSNV'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_interface_check = 'I'
i_callback_program = g_repid
i_callback_pf_status_set = 'SET_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = t_fieldcat[]
i_default = ' '
i_save = 'A'
i_tabname_header = 'T_HEAD'
i_tabname_item = 'T_OUTPUT'
i_structure_name_header = v_headers_table
i_structure_name_item = v_items_table
is_keyinfo = g_keyinfo
i_bypassing_buffer = 'X'
TABLES
t_outtab_header = t_head[]
t_outtab_item = i_result
t_outtab_item = t_output[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
REFRESH: t_fieldcat[].
refresh t_fieldcat1[].
ENDFORM. " display_alv_report
form SET_STATUS using extab TYPE slis_t_extab.
SET PF-STATUS 'ZEO_S1' .
endform.
*& Form Top_Of_Page
Top_Of_Page event in ALV
FORM top_of_page .
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
Title
wa_header-typ = 'H'.
wa_header-info = ' Write Off Worklist'.
APPEND wa_header TO t_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM. "Top_Of_Page
*User Command for the button
form user_command using r_ucomm type syucomm
ls_selfield type SLIS_SELFIELD.
Break-point.
case r_ucomm.
when 'EXEC'.
data: begin of lt_cancel occurs 0.
include structure ZCANCEL.
data end of lt_cancel.
Clear lt_cancel.
Refresh lt_cancel.
Data: ref1 type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
call method ref1->check_changed_data.
loop at t_Head where VKUEGRU is not initial.
if ( t_HEAD-VKUEGRU NE '1' ) or
( t_Head-VKUEGRU NE '2' ) or
( t_head-VKUEGRU NE '3' ).
Clear t_head-vkuegru.
message e000 with text-110.
endif.
lt_cancel-vbeln = t_head-vbelv.
lt_cancel-posnr = t_head-posnv.
lt_cancel-VKUEGRU = t_head-VKUEGRU.
Append lt_cancel.
Clear lt_cancel.
Endloop.
CALL FUNCTION 'ZSD_CNTR_CANCEL'
TABLES
zcancel = lt_cancel.
message s000 .
endcase.
endform. -
hi,
if we increase the length of field using <b>outputlen</b> with fieldcatalog.
if i do it that length is applicable for data as well as for text.......
example:
balance(17).
but with this balance field i want to display amount more than 17 characters....
is it possible with ouputlen option of fieldcatalog........move that field to some bigger variable. and display that bigger variable.
Say,
data: amt(32) type p decimals 2.
than
itab-amt = itab-balance.
modify Itab
Dispaly itab-AMT instead of the itab-BALANCE.
Regards,
Naimesh Patel -
Changing the Infoset Query out put field
Hi,
Please let me know can we do the changes for the Input/Output field for the infoset query in PRD. That mean if some of the fields are hidden and we want to show them at the output can we directly do the changes in PRD .
Thanks & Best Regards,
Maheshhi
Create the infoset with PNP database and add all the infotypes required (including custom ones). Add all fields.. vale, text etc. as seperate fields of the custom Z tables as additional fields in the infotypes and write your code accordingly to select the data into these fields based on the already existing infotype fields. For example if you want to get designation based on position you will write:
select <designation> from ZDESG
into <custom field>
where PLANS = P0001-PLANS
Creating joins over already existing joins will not be a stable solution.
thanks & regards
Satish -
Download ALV report in back ground in local directry
thanks to all but my porblem is download the ALV report in background in local directry.
sriram.HI ,
Find the small code to download the file in background.
n SAP ABAP you can transfer the contents of the internal table to a file. This is required when you wish to extract data from SAP tables into a flat file. This file can then be used to transfer data to another SAP or NON SAP system. This can also be used for an interfacing when you wish to transfer data on a daily or a weekly basis from R/3 to NON R/3 or SAP. The command used to create a file on the application server is as follows.
OPEN DATASET
Please see example code below.
REPORT ZEX_DATATOFILE .
*& ABAPLOVERS: Data Transfer
Parameters to enter the path
PARAMETERS FILENAME(128) DEFAULT '/usr/tmp/testfile.dat'
LOWER CASE.
Table Declaration
TABLES VBAK.
Data Declaration
DATA D_MSG_TEXT(50).
Get data for file transfer
DATA INT_VBAK LIKE VBAK OCCURS 100
WITH HEADER LINE.
SELECT * FROM VBAK INTO TABLE INT_VBAK.
SORT INT_VBAK BY VBELN.
LOOP AT INT_VBAK.
WRITE: / INT_VBAK-VBELN,
INT_VBAK-KUNNR.
ENDLOOP.
Opening the File
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE
MESSAGE D_MSG_TEXT.
IF SY-SUBRC NE 0.
WRITE: 'File cannot be opened. Reason:', D_MSG_TEXT.
EXIT.
ENDIF.
Transferring Data
LOOP AT INT_VBAK.
TRANSFER INT_VBAK-VBELN TO FILENAME.
ENDLOOP.
Closing the File
CLOSE DATASET FILENAME.
Regards,
Rajesh Akarte -
Fixed length for the fields of ALV output
Hi,
How to fix a field in the ALV output to its max length..For example..if a field's max length is 10...that coloumn should not be dragged or moved to right..Its lenght shluld be fixed to 10...Could any bod suggest me how to perform this...thanks..
Shyam.Hi,
U can better optimize the width.it will be good.
data : W_LAYOUT TYPE SLIS_LAYOUT_ALV.
W_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_STRUCTURE_NAME = 'T_ALV'
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = T_FIELDCAT_ALV
I_CALLBACK_TOP_OF_PAGE = 'ALV_TOP_OF_PAGE'
TABLES
T_OUTTAB = T_ALV
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. -
Alv and excel sheet out put.
hi friends,
now i am working on sales and purchase order report. For this i have created three radio button on selection screen one for sales 2nd for purchase and 3rd for both. when i click sales radio button it is going to display only sales data in ALV out put list as well as in EXCEL sheet.
problem:-
Some layout fileds (out put fields) i am storing in VARIENT and when i have passed this VARIANT in a SELECTION-SCREEN so here the output is ok for me, and i am unable to display these same fields in EXCEL sheet for this Please could u tell that how we do this. please send the logic for this.
thands and regards.
sagi.Hi Amol,
you are not getting me ...
see your itab will have all the fields irrespective of variant used. so you can directly use itab to download.
i guess you are using alv tool bar option to download.
but i am telling to use your own button to download the report using your own button with GUI_DOWNLOAD Fm.
for this you pass your ITAB and and then give the file name then this will save all the fields to excel file.
Regards
vijay
Maybe you are looking for
-
Creation of Multi language Hot links in OracleAS Portal 10g
Hi, Will Oracle App Server + OracleASPortal 10.1.4 will support multil language Hotlinks creations?. multi-lang capability(something like www.domain.com/test?lang=CN) Usually under htdocs folder we can create one folder ie as test and include .htm fi
-
Do I need to re-download all app updates?
I, unfortunately, have a cap on my Internet usage. So, I take my MacBook to a different location to download apps and updates. Is there any installer file that gets saved to the computer that I could use to install apps and updates onto my iMac witho
-
My iphone 4s camera is not working shutter does not open
my iphone 4s camera is not working tried the hard reset too anymore suggestions
-
Hi I'm wondering you someone can help me. I'm syncing a Multicam sequence, but when I get to the sync dialog box the audio sync option is missing where is it? I have premier cs6 cc. And all my software is updated. What's up?
-
Lines and shading on stacked column chart
I have created a waterfall chart using a stacked column chart. I have made Series 1 white so that the bars appear to "float" . So far so good. the issue is that the white bars in the default setting have light shading and lines around the outsides