1000 CHARACTER TEXT IN ALV FIELD
Hi Experts,
I have a String type variable containing 1000 character text that I am passing in a field on ALV. But ALV field can display on 132 characters. So now my requirement is that when a user double clicks on that field... then a popup or a screen appears where the user can read the entire text of that field.
I have tried some FMs (like POPUP_TO_CONFIRM, POPUP_TO_INFORM, POPUP_DISPLAY_TEXT etc...), but all have length restriction.
Please suggest if there is any FM to get the entire 1000 character text on a popup.... OR if there is any other way to do this...
Thanks in advance
Regards,
Ashish Goyal
I am using this code provided by you, facing error : Field "OB_GUI_DIALOGBOX_CONTAINER" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
Please take a look and suggest.
Using REUSE ALV GRID to display ALV.
TYPES: BEGIN OF tp_text_x .
TYPES: tdname TYPE thead-tdname ,
tdobject TYPE thead-tdobject ,
tdid TYPE thead-tdid ,
tdspras TYPE thead-tdspras ,
tdtxtlines TYPE thead-tdtxtlines .
TYPES: tdline TYPE tline-tdline ,
it_tline TYPE tline_tab .
TYPES: END OF tp_text_x .
CLASS cl_event_reciever DEFINITION DEFERRED.
DATA v_event_reciever TYPE REF TO cl_event_reciever.
CLASS cl_event_receiver DEFINITION .
PRIVATE SECTION.
METHODS: close
FOR EVENT close OF cl_gui_dialogbox_container
IMPORTING sender.
METHODS: init_container .
METHODS: display_textedit
IMPORTING value(st_text_x) TYPE tp_text_x .
ENDCLASS . "cl_event_receiver DEFINITION
CLASS cl_event_receiver IMPLEMENTATION.
METHOD close .
CALL METHOD sender->set_visible
EXPORTING
visible = abap_false.
ENDMETHOD . "handle_close
METHOD init_container .
* DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
IF ob_gui_dialogbox_container IS NOT INITIAL .
* IF EDITOR_CONTAINER IS NOT INITIAL .
me->close( EXPORTING sender = ob_gui_dialogbox_container ) . " EDITOR_CONTAINER ).
ENDIF .
CREATE OBJECT ob_gui_dialogbox_container
EXPORTING
parent = cl_gui_container=>screen0
top = 40
left = 200
lifetime = cntl_lifetime_dynpro
width = 600
height = 100.
ENDMETHOD. "init_container
METHOD display_textedit .
me->init_container( ) .
DATA: ob_gui_textedit TYPE REF TO cl_gui_textedit .
* DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
CREATE OBJECT ob_gui_textedit
EXPORTING
parent = ob_gui_dialogbox_container.
CALL METHOD ob_gui_textedit->set_readonly_mode
EXPORTING
readonly_mode = cl_gui_textedit=>true.
DATA: it_tdline TYPE TABLE OF tdline .
DATA: st_tdline LIKE LINE OF it_tdline .
FIELD-SYMBOLS: <st_tline> LIKE LINE OF st_text_x-it_tline .
LOOP AT st_text_x-it_tline ASSIGNING <st_tline> .
APPEND <st_tline>-tdline TO it_tdline .
ENDLOOP .
CALL METHOD ob_gui_textedit->set_text_as_stream
EXPORTING
text = it_tdline.
ENDMETHOD. "display_textedit
ENDCLASS . "cl_event_receiver IMPLEMENTATION
INITIALIZATION.
CREATE OBJECT v_event_reciever.
DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
CREATE OBJECT ob_gui_dialogbox_container.
START-OF-SELECTION.
v_event_reciever->display_textedit( EXPORTING st_text_x = <st_alv_data_1>-text_1 ) .
Similar Messages
-
E55 contacts note field 1000 character limit
In PC Suite, in can enter really long text into the contacts note field. Unfortunatelly, E55 displays first 1000 characters only (according to my tests), despite data being there after a successful synchronization. How do I know? I can synchronize the same E55 with MSOutlook in the next step, where the complete note field is transfered, not just the first 1000 characters. Is it possible, to get rid of this silly 1000 character display restriction? By the way, in my old E71, I did not have this problem.
Please post what you find with BB10 re: the hard limit or character limit for Contact Notes. If BB10 simply carries over their existing limits to their new platform (which is very stingy), then this could be a deal breaker. I'd be VERY disappointed but definitely NOT surprised.
By the way, I bought a 3rd party program that syncs BB with Outlook and any other program and it's called "CompanionLink" and it works with BB Desktop seamlessly. You don't even know it's running as you still sync using the native BB desktop. CompanionLink increases the hard limit that BB has set for Contact Notes, Tasks, etc. However, there is still a limit. So instead of getting maybe a 1/4 to 1/2 page of notes (on a word doc) you get almost a full page. -
750 character Text field in ICWebclient
Hi All,
I have to add one 750 character Text field to ICWebclient front end, for that I have added textEdit field on the front end and at the backend I am saving the 750 character text in three parts each of 250 char. It's working fine for the text upto 250 char, but I am getting Error on the front end when the text size is >250 char.
Description of the error (on the front end) :
<field name>:input
Can any one please tell me the solution for this issue?
Thanks in Advance.
Regards,
AmitHi SAP experts,
Can anybody try to help with a very complex issue in FB03 documents?
In SAP the documents shows Line Item Text with a simple description, for example:
LINE ITEM TEXT: VENDOR US#34 INVOICE
When the job scheduling team runs an interface that gathers all the FB03 documents to be sent to another legacy, it generates very big TXT files of accounting documents.
When you open the TXT file, the text :
VENDOR US#34 INVOICE
is transformed into :
VENDOR USÂ@34 INVOICE
Which means # is transformed into special characters making failure in the load in the Legacy.
This happens when text contains # - ´ ##
Can anybody shed any light as to why TXT transforms the original text into special characters?
Regards
Rogerio -
Alv- displaying long text in alv output
hi,
as per my requirement, i need to be display long text (length >1000 characters) in alv list or alv grid.
i get the entaire long text and keep it in final internal table and pass it to alv functional module, but it unable to display the compleate long text( in alv-grid).
the alv list displays the complete long text but not in the row, it displays in the second rown and few field labes of long text and its previous field label are displayed in impro[per order.
is there any possible way to display long text in alv.
regards,
revooriHi Ashok,
try to pass the below while filling your long text.
wa_fieldcat-seltext_l = 'Your Long Text'.
wa_fieldcat-ddictxt = 'L'.
for more info check below
Long Text --- 1000 characters
hope it works
Thnaks!
Edited by: Prasanth on Mar 8, 2009 4:03 PM -
Hi experts,
I am having one requiment i am creating one alv report whre i am displyaing ALV grid. So i hav some fields such as org. unit, personal no, position and job id.
so my requiment is i am haivng no of organiztional units i which there are no of peronnal nos and thir postion and job id.
so after completing of each org. i need to count the no of personal no.( here peronal no shows no of persons in that org. unit) so i need to count and display the no of persons in that org unit before staring of the next org. unit. and also i need to show the job id. job id is comman for all in that org. unit.
i hv to show one row at the end of each org unti showing cout of no of person and the job id.
just look at the format i needed.
Org Unit Personnel No.POSITION Job ID
5000001 1 6000001 700001
5000001 2 6000001 700001
<b>............ 2..........................700001</b>
5000002 3 6000002 700002
5000002 44 6000002 700002
5000002 42 6000002 700002
5000002 40 6000002 700002
<b>............ 4..........................700002</b>
note: i need to show the count of persons only . I dont need the sum of perons.
Here 500001, and 500002 are org units. and after completing one org unit. in the same filed personnal no it is showing count of that field and also job id (700001).
How to do in ALv grid display?
<REMOVED BY MODERATOR>
regards,
sunil kairam
Edited by: sunil kairam on Feb 19, 2008 10:50 AM
Edited by: Alvaro Tejada Galindo on Mar 4, 2008 4:05 PMHi check the below code
REPORT zmr_cpw NO STANDARD PAGE HEADING
LINE-SIZE 165
LINE-COUNT 65(2)
MESSAGE-ID zmm.
TABLE DECLARATION
*tables
TABLES: aufk, "Order master data
afvc, "Operations within an order
ekko, "purchasing docs
resb, "reservation/dep requirements
bapiret2. "Return parameter
SELECT-OPTIONS *
PARAMETERS *
*selection parameters
SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS: p_werks LIKE resb-werks OBLIGATORY. "plant
SELECT-OPTIONS: s_matnr FOR resb-matnr, "material
s_lifnr FOR afvc-lifnr, "vendor
s_erdat FOR aufk-erdat. "start date
SELECTION-SCREEN SKIP.
SELECT-OPTIONS: s_reswk FOR ekko-reswk NO-DISPLAY
DEFAULT '1301' OPTION EQ SIGN I. "whse
SELECTION-SCREEN END OF BLOCK b01.
SELECTION-SCREEN SKIP.
*plant report selections
SELECTION-SCREEN ULINE /10(55).
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 12(17) text-s00
FOR FIELD p_obplt.
PARAMETERS: p_obplt RADIOBUTTON GROUP rept.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(17) text-s01
FOR FIELD p_ptven.
PARAMETERS: p_ptven AS CHECKBOX.
SELECTION-SCREEN COMMENT 44(17) text-s02
FOR FIELD p_ptplt.
PARAMETERS: p_ptplt AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
*vendor report selection
SELECTION-SCREEN ULINE /10(55).
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 12(17) text-s03
FOR FIELD p_obven.
PARAMETERS: p_obven RADIOBUTTON GROUP rept.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
*ALV data
TYPE-POOLS slis. "ALV list viewer
DATA: gs_sett TYPE lvc_s_glay,
gs_title TYPE lvc_title,
gx_vari TYPE disvariant,
g_vari TYPE disvariant,
d_extfg(1) TYPE c.
DATA: p_fieldcat TYPE slis_t_fieldcat_alv, "list
t_fieldcat TYPE slis_t_fieldcat_alv, "popup
s_fieldcat TYPE slis_fieldcat_alv,
t_extab TYPE slis_t_extab, "funct exclude
t_extab_x TYPE slis_t_extab,
s_extab TYPE slis_extab,
p_programname LIKE sy-repid.
*----- Processing options -
SELECTION-SCREEN BEGIN OF BLOCK b02 WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP.
PARAMETERS:
p_varia LIKE gx_vari-variant . "Layout
SELECTION-SCREEN END OF BLOCK b02.
DATA: count(2) TYPE n,
header2 TYPE char100,
header3 TYPE char100,
header4 TYPE char100,
datch TYPE char10, "date character
datfr TYPE char10, "reformat date
datto TYPE char10, "reformat date
qfield TYPE char14,
afield TYPE char14,
qtfld TYPE char3 VALUE 'qty',
amfld TYPE char3 VALUE 'dmb',
name1 LIKE lfa1-lifnr.
*internal tables
*BAPI messages
DATA: BEGIN OF t_bapiret2 OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF t_bapiret2.
*-report data
DATA: BEGIN OF t_coredata OCCURS 0.
INCLUDE STRUCTURE zms_coredata.
DATA: flagd.
DATA: ebeln LIKE ekkn-ebeln.
DATA: END OF t_coredata.
DATA: t_coredata_x LIKE t_coredata OCCURS 0 WITH HEADER LINE.
*EKKO
DATA: BEGIN OF t_ekko OCCURS 0,
ebeln LIKE ekko-ebeln,
loekz LIKE ekko-loekz,
zzref LIKE ekko-zzref,
zzref_n LIKE ekko-ebeln,
flagd,
END OF t_ekko.
*-EKKN
DATA: BEGIN OF t_ekkn OCCURS 0,
ebeln LIKE ekkn-ebeln,
aufnr LIKE ekkn-aufnr,
END OF t_ekkn.
*-AUFK
DATA: BEGIN OF t_aufk OCCURS 0,
aufnr LIKE aufk-aufnr,
auart LIKE aufk-auart,
END OF t_aufk.
*descriptions
*-report
DATA: BEGIN OF t_report OCCURS 0,
codet LIKE dd03p-scrtext_m,
lifnr LIKE afvc-lifnr,
namel LIKE lfa1-name1,
aufnr LIKE mseg-aufnr,
auart LIKE aufk-auart,
aufnr_m LIKE mseg-aufnr,
auart_m LIKE aufk-auart,
erdat LIKE aufk-erdat,
matnr LIKE mseg-matnr,
maktx LIKE makt-maktx,
iloan LIKE zms_coredata-iloan,
tplnr LIKE zms_coredata-tplnr,
equnr LIKE zms_coredata-equnr,
eqktx LIKE zms_coredata-eqktx,
quans LIKE zms_coredata-quans,
sernr LIKE zms_coredata-sernr,
count TYPE i,
END OF t_report.
*-detail table
DATA: BEGIN OF t_detail_01 OCCURS 0,
aufnr LIKE mseg-aufnr,
aufnr_m LIKE mseg-aufnr,
ebeln LIKE ekko-ebeln,
matnr LIKE mseg-matnr,
END OF t_detail_01.
CONSTANTS DECLARATION *
CONSTANTS: c_yes TYPE char1 VALUE 'X',
c_nodesc TYPE name1 VALUE '**NO DESCRIPTION**',
c_pov LIKE zms_coredata-ocode VALUE 'POV',"Plant owes vendor
c_pop LIKE zms_coredata-ocode VALUE 'POP',"Plant owes plant
c_vop LIKE zms_coredata-ocode VALUE 'VOP',"Vendor owes plant
c_ub LIKE aufk-auart VALUE 'UB'.
HEADER *
TOP-OF-PAGE.
PERFORM top_of_page.
FOOTER *
INCLUDE zfooter.
END-OF-PAGE *
*END-OF-PAGE.
*PERFORM display_footer.
AT SELECTION-SCREEN.
*message if no reporting option is chosen for Owed by Plant
IF NOT p_obplt IS INITIAL.
IF p_ptven IS INITIAL
AND p_ptplt IS INITIAL.
MESSAGE e000(zmm) WITH text-m02.
ENDIF.
ENDIF.
----- At selection screen on value request for "Layout" -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varia.
PERFORM select_layout.
START-OF-SELECTION
START-OF-SELECTION.
*retrieve CORE data using BAPI
PERFORM get_core_data.
*build report table
PERFORM report_table.
END-OF-SELECTION.
LIST PROCESSING *
*write report
*-heading data
PERFORM heading_data.
PERFORM alv_list_viewer.
SUBROUTINES *
*forms
*& Form get_CORE_DATA
FORM get_core_data.
CALL FUNCTION 'ZMM_BAPI_GET_CORE_OWEAGE'
EXPORTING
bapi_plant = p_werks
TABLES
bapi_rangesmatnr = s_matnr
bapi_rangeslifnr = s_lifnr
bapi_rangesbldat = s_erdat
bapi_rangesreswk = s_reswk
coredata = t_coredata
return = t_bapiret2.
*Vendor owes Plant
IF NOT p_obven IS INITIAL.
DELETE t_coredata WHERE NOT ocode = c_vop.
EXIT.
ENDIF.
*Plant owes
IF NOT p_obplt IS INITIAL.
DELETE t_coredata WHERE ocode = c_vop.
ENDIF.
*Plant owes vendor
IF NOT p_ptven IS INITIAL.
t_coredata-flagd = c_yes.
MODIFY t_coredata TRANSPORTING flagd WHERE ocode = c_pov. "keep
ENDIF.
*Plant owes plant
IF NOT p_ptplt IS INITIAL.
t_coredata-flagd = c_yes.
MODIFY t_coredata TRANSPORTING flagd WHERE ocode = c_pop. "keep
ENDIF.
DELETE t_coredata WHERE flagd IS INITIAL.
*-get additional data
t_coredata_x[] = t_coredata[].
DELETE t_coredata_x WHERE NOT auart = c_ub. "STO
CHECK NOT t_coredata_x[] IS INITIAL.
LOOP AT t_coredata_x.
t_coredata_x-ebeln = t_coredata_x-aufnr.
MODIFY t_coredata_x TRANSPORTING ebeln.
ENDLOOP.
*-get CORE Stock Transport Orders for display
SELECT ebeln loekz zzref
INTO TABLE t_ekko
FROM ekko
WHERE reswk = p_werks.
DELETE t_ekko WHERE NOT loekz IS INITIAL.
DELETE t_ekko WHERE zzref IS INITIAL. "not create w/ref to STO
*reformat field
LOOP AT t_ekko.
t_ekko-zzref_n = t_ekko-zzref(10).
MODIFY t_ekko TRANSPORTING zzref_n.
ENDLOOP.
SORT t_ekko BY zzref_n.
*--Mine Maintenance Order
SELECT ebeln aufnr
INTO TABLE t_ekkn
FROM ekkn
FOR ALL ENTRIES IN t_coredata_x
WHERE ebeln = t_coredata_x-ebeln.
DELETE t_ekkn WHERE aufnr IS INITIAL.
CHECK NOT t_ekkn[] IS INITIAL.
*--Mine Maintenance Order Type
SELECT aufnr auart
INTO TABLE t_aufk
FROM aufk
FOR ALL ENTRIES IN t_ekkn
WHERE aufnr = t_ekkn-aufnr.
ENDFORM. " get_CORE_DATA
*& Form report_table
FORM report_table.
*create report table
SORT t_ekkn BY ebeln.
SORT t_aufk BY aufnr.
LOOP AT t_coredata.
CLEAR t_report.
MOVE-CORRESPONDING t_coredata TO t_report.
*Mine maint order
IF t_report-auart = c_ub.
READ TABLE t_ekkn WITH KEY ebeln = t_report-aufnr BINARY SEARCH.
IF sy-subrc = 0.
t_report-aufnr_m = t_ekkn-aufnr.
READ TABLE t_aufk WITH KEY aufnr = t_ekkn-aufnr BINARY SEARCH.
IF sy-subrc = 0.
t_report-auart_m = t_aufk-auart.
ENDIF.
ENDIF.
ENDIF.
CASE t_coredata-ocode.
WHEN c_pop.
t_report-codet = text-s02.
WHEN c_pov.
t_report-codet = text-s01.
WHEN c_vop.
t_report-codet = text-s03.
ENDCASE.
Add 1 to the count column to use with totaling
t_report-count = '1'.
APPEND t_report.
ENDLOOP.
ENDFORM. " report_table
*& Form ALV_list_viewer
FORM alv_list_viewer.
IF t_report[] IS INITIAL.
WRITE: text-m01.
ENDIF.
CHECK NOT t_report[] IS INITIAL.
SORT t_report BY lifnr matnr aufnr sernr.
PERFORM function_exclude. "this is for the popup view
Call ABAP List Viewer (ALV)
p_programname = sy-repid.
gx_vari-report = sy-repid.
gx_vari-username = sy-uname.
gx_vari-variant = p_varia.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = p_programname
i_internal_tabname = 'T_REPORT'
i_inclname = p_programname
CHANGING
ct_fieldcat = p_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
PERFORM field_catalog TABLES p_fieldcat.
gs_sett-top_p_only = 'X'.
CONCATENATE header3 header4 INTO gs_title SEPARATED BY space.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gx_vari-report
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_user_command = 'USER_COMMAND'
i_grid_settings = gs_sett
i_structure_name = 'T_REPORT'
i_grid_title = gs_title
is_variant = gx_vari
i_save = 'A'
it_fieldcat = p_fieldcat[]
TABLES
t_outtab = t_report.
ENDFORM. " ALV_list_viewer
*& Form field_catalog
FORM field_catalog TABLES p_fieldcat TYPE slis_t_fieldcat_alv.
LOOP AT p_fieldcat INTO s_fieldcat.
CASE s_fieldcat-fieldname.
WHEN 'CODET'.
s_fieldcat-seltext_s = 'Oweage'.
s_fieldcat-seltext_m = 'Oweage'.
s_fieldcat-seltext_l = 'Oweage'.
s_fieldcat-reptext_ddic = 'Oweage'.
WHEN 'NAMEL'.
s_fieldcat-seltext_s = 'Name'.
s_fieldcat-seltext_m = 'Name'.
s_fieldcat-seltext_l = 'Name'.
s_fieldcat-reptext_ddic = 'Name'.
WHEN 'AUFNR_M'.
s_fieldcat-seltext_s = 'MineOrd'.
s_fieldcat-seltext_m = 'Mine Order'.
s_fieldcat-seltext_l = 'Mine Maint Order'.
s_fieldcat-reptext_ddic = 'Mine Order'.
WHEN 'AUART_M'.
s_fieldcat-seltext_s = 'MineOrdTyp'.
s_fieldcat-seltext_m = 'Mine Order Type'.
s_fieldcat-seltext_l = 'Mine Maint Order Type'.
s_fieldcat-reptext_ddic = 'Mine Order Type'.
WHEN 'EBELN'.
s_fieldcat-seltext_s = 'CORE STO'.
s_fieldcat-seltext_m = 'CORE STO'.
s_fieldcat-seltext_l = 'CORE Stock Transport Order'.
s_fieldcat-reptext_ddic = 'CORE STO'.
s_fieldcat-key = ' '.
WHEN 'COUNT'.
s_fieldcat-seltext_s = 'COUNT'.
s_fieldcat-seltext_m = 'COUNT'.
s_fieldcat-seltext_l = 'COUNT'.
s_fieldcat-reptext_ddic = 'COUNT'.
s_fieldcat-key = ' '.
ENDCASE.
MODIFY p_fieldcat FROM s_fieldcat.
ENDLOOP.
ENDFORM. " field_catalog
*& Form heading_data
FORM heading_data.
*-heading data
header2 = text-h01.
*-format date range
IF s_erdat[] IS INITIAL.
SORT t_report BY erdat.
READ TABLE t_report INDEX 1.
s_erdat-low = t_report-erdat.
SORT t_report BY erdat DESCENDING.
READ TABLE t_report INDEX 1.
s_erdat-high = t_report-erdat.
APPEND s_erdat.
ENDIF.
READ TABLE s_erdat INDEX 1.
WRITE s_erdat-low TO datfr.
WRITE s_erdat-high TO datto.
CONCATENATE datfr 'to' datto
INTO header3 SEPARATED BY space.
*plant
READ TABLE t_coredata INDEX 1.
CONCATENATE p_werks t_coredata-namew
INTO header4 SEPARATED BY space.
ENDFORM. " heading_data
*& Form top_of_page
FORM top_of_page.
CALL FUNCTION 'Z_REPORT_HEADER'
EXPORTING
header2 = header2
header3 = header3
header4 = header4.
ENDFORM. " top_of_page
*& Form user_command
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
*F2
CHECK r_ucomm = '&IC1'.
*field deterimines further action
CASE rs_selfield-sel_tab_field.
WHEN 'T_REPORT-AUFNR'. "if STO - display CORE STO
READ TABLE t_report INDEX rs_selfield-tabindex.
CHECK t_report-auart = c_ub."only if order is STO
REFRESH t_detail_01.
LOOP AT t_ekko
WHERE zzref_n = t_report-aufnr.
t_detail_01-aufnr = t_report-aufnr.
t_detail_01-aufnr_m = t_report-aufnr_m.
t_detail_01-ebeln = t_ekko-ebeln.
t_detail_01-matnr = t_report-matnr.
APPEND t_detail_01.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = p_programname
i_internal_tabname = 'T_DETAIL_01'
i_inclname = p_programname
CHANGING
ct_fieldcat = t_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
PERFORM field_catalog TABLES t_fieldcat.
t_extab_x[] = t_extab[].
*these are the FCodes to keep on the popup screen
DELETE t_extab_x WHERE fcode = '&AC1'. "cancel
DELETE t_extab_x WHERE fcode = '%SC'. "find
DELETE t_extab_x WHERE fcode = '%SC+'. "repeat find
DELETE t_extab_x WHERE fcode = '&OUP'. "sort asc
DELETE t_extab_x WHERE fcode = '&ODN'. "sort desc
SORT t_detail_01 BY ebeln.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = text-h02
i_tabname = 'T_DETAIL_01'
it_fieldcat = t_fieldcat[]
it_excluding = t_extab_x
TABLES
t_outtab = t_detail_01.
ENDCASE.
ENDFORM. " user_command
*& Form function_exclude
FORM function_exclude.
*this form excludes all functions on popup screen
*delete entries that should appear on the popup from this table prior to
*REUSE_ALV_POPUP_TO_SELECT
s_extab-fcode = '&ONT'. "copy/enter
APPEND s_extab TO t_extab.
s_extab-fcode = '&ETA'. "detail
APPEND s_extab TO t_extab.
s_extab-fcode = '%SC'. "find
APPEND s_extab TO t_extab.
s_extab-fcode = '%SC+'. "find next
APPEND s_extab TO t_extab.
s_extab-fcode = '&OUP'. "sort asc
APPEND s_extab TO t_extab.
s_extab-fcode = '&ODN'. "sort desc
APPEND s_extab TO t_extab.
s_extab-fcode = '&ILT'. "filter
APPEND s_extab TO t_extab.
s_extab-fcode = '&OL0'. "display variant
APPEND s_extab TO t_extab.
s_extab-fcode = '&CRB'. "H scroll-1st
APPEND s_extab TO t_extab.
s_extab-fcode = '&CRL'. "H scroll-prev
APPEND s_extab TO t_extab.
s_extab-fcode = '&CRR'. "H scroll-next
APPEND s_extab TO t_extab.
s_extab-fcode = '&CRE'. "H scroll-last
APPEND s_extab TO t_extab.
s_extab-fcode = '&AC1'. "Cancel
APPEND s_extab TO t_extab.
s_extab-fcode = '&ALL'. "select all
APPEND s_extab TO t_extab.
s_extab-fcode = '&SAL'. "deselect all
APPEND s_extab TO t_extab.
ENDFORM. " function_exclude -
Subtotal text in ALV using OO ALV
HI All,
How to display subtotal text in ALV using OO ALV?
My output of ALV should be as follows
COL1 COL2 COL3
ABC 900 M1
PQR 100 M1
M1 Subtotal 1000
XYZ 2100 M2
M2 Subtotal 2100
I could put the subtotal, but couldnu2019t add subtotal text.
My code
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = g_alv
CHANGING
t_table = gt_report
CATCH cx_salv_msg .
ENDTRY.
u2026u2026
*Display the table.
g_alv->display( ).Hi
REPORT z_alv_demo_total_text.
Type declaration for final table to display the output
TYPES: BEGIN OF ty_mara,
srno TYPE char40, " Storing the total text
matnr TYPE matnr, " Material
ersda TYPE ersda, " Creation date
ernam TYPE ernam, " Created by
laeda TYPE laeda, " Last change date
aenam TYPE aenam, " Last change by
vpsta TYPE vpsta, " Maintenance status
brgew TYPE brgew, " Gross weight
ntgew TYPE ntgew, " Net weight
gewei TYPE gewei, " Weight Unit
END OF ty_mara.
Type declaration for table storing temp. data
TYPES: BEGIN OF ty_mara_tmp,
matnr TYPE matnr, " Material
ersda TYPE ersda, " Creation date
ernam TYPE ernam, " Created by
laeda TYPE laeda, " Last change date
aenam TYPE aenam, " Last change by
vpsta TYPE vpsta, " Maintenance status
brgew TYPE brgew, " Gross weight
ntgew TYPE ntgew, " Net weight
gewei TYPE gewei, " Weight Unit
END OF ty_mara_tmp.
Internal table for storing final data
DATA: i_mara TYPE STANDARD TABLE OF ty_mara INITIAL SIZE 0.
Work area for final table
DATA: w_mara TYPE ty_mara.
Internal table for storing temp. data
DATA: i_mara_tmp TYPE STANDARD TABLE OF ty_mara_tmp INITIAL SIZE 0.
Work area for temp. table
DATA: w_mara_tmp TYPE ty_mara_tmp.
Object variable for ALV grid
DATA: oref1 TYPE REF TO cl_gui_alv_grid.
Field catalog table for ALV grid
DATA: fieldcat TYPE lvc_t_fcat.
Workarea for field catalog table
DATA: w_field TYPE lvc_s_fcat.
Internal table for storing info. for ALV grid
data: i_sort2 TYPE STANDARD TABLE OF lvc_s_sort INITIAL SIZE 0.
Workarea for sort table
DATA: wa_sort2 TYPE lvc_s_sort.
Workarea for ALV layout
data: wa_layout TYPE lvc_s_layo.
START-OF-SELECTION.
Fetch data
SELECT matnr " Material
ersda " Creation date
ernam " Created by
laeda " Last change date
aenam " Last change by
vpsta " Maintenance status
brgew " Gross weight
ntgew " Net weight
gewei " Weight Unit
FROM mara
INTO TABLE i_mara_tmp
UP TO 100 ROWS.
CHECK sy-subrc = 0.
Populate final table
LOOP AT i_mara_tmp INTO w_mara_tmp.
Storing the Total text need to be displayed in
ALV
w_mara-srno = 'Total weight (Gross & Net)'.
w_mara-matnr = w_mara_tmp-matnr.
w_mara-ersda = w_mara_tmp-ersda.
w_mara-ernam = w_mara_tmp-ernam .
w_mara-laeda = w_mara_tmp-laeda.
w_mara-aenam = w_mara_tmp-aenam.
w_mara-vpsta = w_mara_tmp-vpsta.
w_mara-brgew = w_mara_tmp-brgew.
w_mara-ntgew = w_mara_tmp-ntgew.
w_mara-gewei = w_mara_tmp-gewei.
APPEND w_mara TO i_mara.
ENDLOOP.
Calling the screen to display ALV
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
Display ALV report
MODULE status_0100 OUTPUT.
IF oref1 IS INITIAL.
Create ALV grid object
In this case we have not created any custom container in the screen,
Instead of that dummy container name is passed
ADVANTAGE: we can run this report in background without any problem
CREATE OBJECT oref1
EXPORTING
i_parent = cl_gui_custom_container=>screen0
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
CHECK sy-subrc = 0.
Preparing the field catalog
ZDEMO: Defined in DDIC, it's structure is same as TYPE ty_mara
defined in the program
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZDEMO'
CHANGING
ct_fieldcat = fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
LOOP AT fieldcat INTO w_field.
IF w_field-fieldname = 'BRGEW' OR
w_field-fieldname = 'NTGEW'.
Summation for Gross & Net weight
w_field-do_sum = 'X'.
MODIFY fieldcat FROM w_field TRANSPORTING do_sum.
ENDIF.
IF w_field-fieldname = 'SRNO'.
Hide this field so that it can display it's content i.e.
Total text in Subtotal level
w_field-tech = 'X'.
w_field-no_out = 'X'.
MODIFY fieldcat FROM w_field TRANSPORTING tech no_out.
ENDIF.
CLEAR w_field.
ENDLOOP.
ENDIF.
Populate Sort table with SRNO field so that we can display the total
text in it's subtotal level
wa_sort2-spos = 1.
wa_sort2-fieldname = 'SRNO'.
wa_sort2-up = 'X'.
wa_sort2-subtot = 'X'.
APPEND wa_sort2 TO i_sort2.
Hide the total line
wa_layout-no_totline = 'X'.
Display the ALV grid
CALL METHOD oref1->set_table_for_first_display
EXPORTING
is_layout = wa_layout
CHANGING
it_outtab = i_mara[]
it_fieldcatalog = fieldcat
it_sort = i_sort2
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
Set the focus on the grid
CALL METHOD cl_gui_alv_grid=>set_focus
EXPORTING
control = oref1
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
These will defintely help in u displaying subtotal text check it
thanks -
Display a Long Text in ALV report
Hi,
I want to display the PO header long text in ALV Report that is 255 character width.
Please help me out how to do this.
please it is very urgent
Thanks and regards
KrishnaUse READ_TEXT and concatenate the first lines of the text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = lv_name " purchase order with leading zeroes
object = 'EKKO'
TABLES
lines = t_lines
EXCEPTIONS
OTHERS = 8.
Regards -
How to get Grand Total Text in ALV GRID
Hi Folks,
I am able to get the SUBTOTAL TEXT .....But i need...
How to get Grand Total Text in ALV GRID Display...
Can any one give a Solution for this...Hi Surendar,
Check out this code.. this is showing Total Text in Toal line in the very first column.
REPORT zsales_ord_det_1 .
TABLES: ztable_10.
TYPE-POOLS: slis.
DATA: BEGIN OF it OCCURS 0,
srno(6) type c,
name LIKE ztable_10-name,
age LIKE ztable_10-age,
END OF it.
DATA : BEGIN OF it_temp OCCURS 0,
name LIKE ztable_10-name,
age LIKE ztable_10-age,
END OF it_temp.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: v_repid LIKE sy-repid,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
gs_layout TYPE slis_layout_alv,
gd_layout TYPE slis_layout_alv,
i_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
START-OF-SELECTION.
v_repid = sy-repid.
SELECT * FROM ztable_10 INTO TABLE it_temp.
LOOP AT it_temp .
it-srno = 'Total'.
it-name = it_temp-name.
it-age = it_temp-age.
APPEND it.
ENDLOOP.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'IT'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'SRNO'.
wa_fieldcat-tabname = it.
append wa_fieldcat to i_fieldcat.
LOOP AT i_fieldcat INTO wa_fieldcat.
IF wa_fieldcat-fieldname = 'AGE'.
wa_fieldcat-do_sum = 'X'.
MODIFY i_fieldcat FROM wa_fieldcat.
ENDIF.
IF wa_fieldcat-fieldname = 'SRNO'.
Hide this field so that it can display it's content i.e.
Total text in Subtotal level
wa_fieldcat-tech = 'X'.
wa_fieldcat-no_out = 'X'.
MODIFY i_fieldcat FROM wa_fieldcat TRANSPORTING tech no_out.
ENDIF.
ENDLOOP.
wa_sort-spos = 1.
wa_sort-fieldname = 'SRNO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort.
gd_layout-no_totalline = 'X'.
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 = '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 = gd_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = i_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 = it
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.
Regards,
Seema -
Wrapping of the text in form field text box
Hi,
We are using adobe acrobat x pro 10.1.0 licensed versions
Issue
In a pdf file we have text boxes (Form fields), we are populating it dynamically,We have the issue in wrapping of the text
I had set multi line property (in a line we can accommodate 39 characters, total there are 49 characters)
The last character is getting displayed half, Please find the issue as in line image
Requirement
We need to wrap the text and display it correctly, please find the requirement as inline image
Please let me know your valuable suggestions
Regards,
S.N.PrasadYou'll want to ask in the Acrobat forum: http://forums.adobe.com/community/acrobat/acrobat_windows
-
HI ALL,
could any one send me how to display the subtotal Text in ALV grid output with code sample.
with thanks.
kannanhi,
means u want to print some text instead of star ( coming in subtotal) ?
If so than try like,
*& Report ZALV_LIST
REPORT zalv_list.
TABLES : mseg.
TYPE-POOLS : slis.
DATA : BEGIN OF itab OCCURS 0,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
menge LIKE mseg-menge,
line_color(4) TYPE c,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
menge LIKE mseg-menge,
line_color(4) TYPE c,
END OF itab1.
DATA : t_fcat TYPE slis_t_fieldcat_alv,
t_eve TYPE slis_t_event,
t_subtot TYPE slis_t_sortinfo_alv,
subtot LIKE LINE OF t_subtot,
wa_fcat LIKE LINE OF t_fcat,
gd_layout TYPE slis_layout_alv.
DATA : gt_menge LIKE mseg-menge,
st_menge LIKE mseg-menge.
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : doc FOR mseg-mblnr.
SELECTION-SCREEN : END OF BLOCK blk1.
INITIALIZATION.
PERFORM build_cat USING t_fcat.
PERFORM build_eve.
PERFORM build_layout.
START-OF-SELECTION.
PERFORM get_data.
PERFORM display.
*& Form build_cat
text
-->TEMP_FCAT text
FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MBLNR'.
wa_fcat-seltext_m = 'Material Doc.'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-seltext_m = 'Material'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'WERKS'.
wa_fcat-seltext_m = 'Plant'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MENGE'.
wa_fcat-seltext_m = 'Quantity'.
wa_fcat-do_sum = 'Y'.
APPEND wa_fcat TO temp_fcat.
CLEAR wa_fcat.
subtot-spos = 1.
subtot-fieldname = 'MBLNR'.
subtot-tabname = 'ITAB'.
subtot-up = 'X'.
subtot-group = 'X'.
subtot-subtot = 'X'.
subtot-expa = 'X'.
APPEND subtot TO t_subtot.
ENDFORM. "build_cat
*& Form build_eve
text
FORM build_eve.
DATA : wa_eve TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = t_eve
EXCEPTIONS
list_type_wrong = 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.
READ TABLE t_eve WITH KEY name = slis_ev_top_of_page
INTO wa_eve.
IF sy-subrc = 0.
MOVE 'TOP_OF_PAGE' TO wa_eve-form.
APPEND wa_eve TO t_eve.
ENDIF.
ENDFORM. "build_eve
*& Form build_layout
text
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-info_fieldname = 'LINE_COLOR'.
gd_layout-subtotals_text = 'Sub Total'.
ENDFORM. " BUILD_LAYOUT
*& Form get_data
text
FORM get_data.
SELECT mblnr matnr werks menge FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab
WHERE mblnr IN doc.
SORT itab BY mblnr.
LOOP AT itab.
AT NEW mblnr.
LOOP AT itab WHERE mblnr = itab-mblnr.
st_menge = st_menge + itab-menge.
itab1-mblnr = itab-mblnr.
itab1-matnr = itab-matnr.
itab1-werks = itab-werks.
itab1-menge = itab-menge.
APPEND itab1.
ENDLOOP.
itab1-mblnr = 'Sub_Total'.
itab1-matnr = ''.
itab1-werks = ''.
itab1-menge = st_menge.
itab1-line_color = 'C710'.
APPEND itab1.
itab1-line_color = ''.
CLEAR st_menge.
ENDAT.
ENDLOOP.
LOOP AT itab.
gt_menge = gt_menge + itab-menge.
ENDLOOP.
itab1-mblnr = 'Total'.
itab1-matnr = ''.
itab1-werks = ''.
itab1-menge = gt_menge.
itab1-line_color = 'C310'.
APPEND itab1.
ENDFORM. "get_data
*& Form display
text
FORM display.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZALV_LIST'
is_layout = gd_layout
it_fieldcat = t_fcat
it_sort = t_subtot
it_events = t_eve
TABLES
t_outtab = itab1
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
*& Form top_of_page
text
FORM top_of_page.
WRITE:/ 'Data'.
ENDFORM. "top_of_page
reward if useful....
Edited by: Dhwani shah on Dec 20, 2007 1:20 PM -
Is there a character limit for a field in CrystalReports?
Is there a character limit for a field in CrystalReports?
Hello,
I'm trying to display a long text (+100.000 characters) stored in a MySql database in CrystalReports but CR is not showing the complete text. Is this because there is a length limit for fields in CR?
Thanks,
Eddy G.This is not a great answer, but you can base your report on a SQL Command, then use something like this for the command(MS SQL):
select
case when length(table.field) > 65535
then substring(table.field,1,65535)
else table.field end as field_part1,
case when length(table.field) > 65536+65535
then substring(table.field,65536, 65535)
when length(table.field) between 65536 and 65536+65535
then substring(table.field,65536, length(table.field)-65535)
else '' end as field_part2
from table...
Then in the report, display both fields where you want the BLOB data.
HTH,
Carl -
Dear Experts,
I have a requirement where the user wants me to display the standard text in SO10 using ALV.
The text must be displayed exactly like how the user maintaned in SO10.
What is the best way? The user do not want the solution to have a button in the text field, and pop up screen in alv to display the text.The problem not related to the data retrieval.
Its about how to display the text in ALV. I dont wantto display the text in single line in alv coz it gonna be very long and will no longer in original format.
Edited by: Castelloz Alfonso on Sep 24, 2009 7:59 AM -
How to print sub total text in ALV
Hi All,
I have a prblem in printing sub total text in ALV. I am passing the text for sub total in ALV layout to the field SUBTOTALS_TEXT. Even then the text is not displayed where as this is working for TOTAL with the field TOTALS_TEXT.
Could any one provide me the solution please?
Thanks & Regards,
S.LakshmiHi Lakshmi,
Please refer to the following code :
report zalv10.
type-pools: slis.
data: g_repid like sy-repid,
gs_print type slis_print_alv,
gt_list_top_of_page type slis_t_listheader,
gt_events type slis_t_event,
gt_sort type slis_t_sortinfo_alv,
gs_layout type slis_layout_alv,
gt_fieldcat type slis_t_fieldcat_alv,
fieldcat_ln like line of gt_fieldcat,
col_pos type i.
data: begin of itab,
field1(5) type c,
field2(5) type c,
field3(5) type p decimals 2,
end of itab.
data: begin of itab1 occurs 0.
include structure itab.
data: end of itab1.
data: begin of itab_fieldcat occurs 0.
include structure itab.
data: end of itab_fieldcat.
Print Parameters
parameters:
p_print as checkbox default ' ', "PRINT IMMEDIATE
p_nosinf as checkbox default 'X', "NO SELECTION INFO
p_nocove as checkbox default ' ', "NO COVER PAGE
p_nonewp as checkbox default ' ', "NO NEW PAGE
p_nolinf as checkbox default 'X', "NO PRINT LIST INFO
p_reserv type i. "NO OF FOOTER LINE
initialization.
g_repid = sy-repid.
perform print_build using gs_print. "Print PARAMETERS
start-of-selection.
TEST DATA
move 'TEST1' to itab1-field1.
move 'TEST1' to itab1-field2.
move '10.00' to itab1-field3.
append itab1.
move 'TEST2' to itab1-field1.
move 'TEST2' to itab1-field2.
move '20.00' to itab1-field3.
append itab1.
do 50 times.
append itab1.
enddo.
end-of-selection.
perform build.
perform eventtab_build changing gt_events.
perform comment_build changing gt_list_top_of_page.
perform call_alv.
form build.
DATA FIELD CATALOG
Explain Field Description to ALV
data: fieldcat_in type slis_fieldcat_alv.
clear fieldcat_in.
fieldcat_ln-fieldname = 'FIELD1'.
fieldcat_ln-tabname = 'ITAB1'.
*FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
fieldcat_ln-key = ' '. "SUBTOTAL KEY
fieldcat_ln-no_out = ' '.
fieldcat_ln-seltext_l = 'HEAD1'.
append fieldcat_ln to gt_fieldcat.
clear fieldcat_in.
fieldcat_ln-fieldname = 'FIELD2'.
fieldcat_ln-tabname = 'ITAB1'.
fieldcat_ln-no_out = 'X'.
fieldcat_ln-seltext_l = 'HEAD2'.
append fieldcat_ln to gt_fieldcat.
clear fieldcat_in.
fieldcat_ln-fieldname = 'FIELD3'.
fieldcat_ln-tabname = 'ITAB1'.
fieldcat_ln-ref_fieldname = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
fieldcat_ln-ref_tabname = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
fieldcat_ln-no_out = ' '.
fieldcat_ln-do_sum = 'X'. "SUM UPON DISPLAY
append fieldcat_ln to gt_fieldcat.
DATA SORTING AND SUBTOTAL
data: gs_sort type slis_sortinfo_alv.
clear gs_sort.
gs_sort-fieldname = 'FIELD1'.
gs_sort-spos = 1.
gs_sort-up = 'X'.
gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT****
append gs_sort to gt_sort.
clear gs_sort.
gs_sort-fieldname = 'FIELD2'.
gs_sort-spos = 2.
gs_sort-up = 'X'.
*GS_SORT-SUBTOT = 'X'. **THIS SHOULD NOT BE UNCOMENTED*
append gs_sort to gt_sort.
endform.
form call_alv.
ABAP List Viewer
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = g_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_structure_name = 'ITAB1'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gt_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = gt_events[]
IT_EVENT_EXIT =
is_print = gs_print
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = itab1
exceptions
program_error = 1
others = 2.
endform.
HEADER FORM
form eventtab_build changing lt_events type slis_t_event.
constants:
gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = lt_events.
read table lt_events with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move gc_formname_top_of_page to ls_event-form.
append ls_event to lt_events.
endif.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
endform.
form comment_build changing gt_top_of_page type slis_t_listheader.
data: gs_line type slis_listheader.
clear gs_line.
gs_line-typ = 'H'.
gs_line-info = 'HEADER 1'.
append gs_line to gt_top_of_page.
clear gs_line.
gs_line-typ = 'S'.
gs_line-key = 'STATUS 1'.
gs_line-info = 'INFO 1'.
append gs_line to gt_top_of_page.
gs_line-key = 'STATUS 2'.
gs_line-info = 'INFO 2'.
append gs_line to gt_top_of_page.
CLEAR GS_LINE.
GS_LINE-TYP = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
endform.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
write: sy-datum, 'Page No', sy-pagno left-justified.
endform.
form end_of_page.
write at (sy-linsz) sy-pagno centered.
endform.
PRINT SETTINGS
form print_build using ls_print type slis_print_alv.
ls_print-print = p_print. "PRINT IMMEDIATE
ls_print-no_print_selinfos = p_nosinf. "NO SELECTION INFO
ls_print-no_coverpage = p_nocove. "NO COVER PAGE
ls_print-no_new_page = p_nonewp.
ls_print-no_print_listinfos = p_nolinf. "NO PRINT LIST INFO
ls_print-reserve_lines = p_reserv.
endform.
<b>Please reward points if helpful.</b>
Regards,
Amit Mishra -
Reg: Subtotal text in alv grid.
Hi All,
I need to display the subtotal text in ALV.
If:
data: i_layout type slis_layout_alv.
Then, we can used
i_layout-subtotal_text = my subtotal text.
But my declaration is :
Data: ls_layout type lvc_s_layo.
This dosnt have subtotaltext.
I have tried the method:
method subtotal_text.
perform event_subtotal_text using es_subtottxt_info
ep_subtot_line
e_event_data.
and also used the handle.
as per the coding in : BCALV_TEST_GRID_EVENTS
Still its not working.
Waiting for your valuable inputs.
Thanks & Regards,
AnjaliHi Anjali,
Try this sample code.
REPORT z_demo_alv_sort.
TABLES : vbak.
TYPE-POOLS: slis. " ALV Global types
SELECT-OPTIONS :
s_vkorg FOR vbak-vkorg, " Sales organization
s_kunnr FOR vbak-kunnr, " Sold-to party
s_vbeln FOR vbak-vbeln. " Sales document
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA:
BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg, " Sales organization
kunnr LIKE vbak-kunnr, " Sold-to party
vbeln LIKE vbak-vbeln, " Sales document
netwr LIKE vbak-netwr, " Net Value of the Sales Order
waerk LIKE vbak-waerk, " Document currency
END OF gt_vbak.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
PERFORM f_read_data.
PERFORM f_display_data.
Form f_read_data
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak
UP TO p_max ROWS
WHERE kunnr IN s_kunnr
AND vbeln IN s_vbeln
AND vkorg IN s_vkorg.
ENDFORM. " F_READ_DATA
Form f_display_data
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-do_sum = &2.
ls_fieldcat-cfieldname = &3.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'NETWR' 'X' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
m_sort 'VKORG' 'X'. " Sort by vkorg and subtotal
m_sort 'KUNNR' 'X'. " Sort by kunnr and subtotal
m_sort 'VBELN' ''. " Sort by vbeln
ls_layout-cell_merge = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
TABLES
t_outtab = gt_vbak.
ENDFORM. " F_DISPLAY_DATA
Hope this helps,
Thanks,
Priya. -
Hi ,
I wanted to display a long text in my grid. Suppose I have a field's long text having field length 3000.
It is varying for other fields.
Anybody will tell me how to display the whole long text in alv grid.hi,
if it is a heading then in the field catlog u can do it.
i don know th length limitation.
fieldcatalog-fieldname = 'EBELP'.
<b> fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-seltext_s = 'PO Item'.
fieldcatalog-seltext_l = 'PO Item'.</b>
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
rgds
Anver
Maybe you are looking for
-
Why is the original YouTube app not in update 6.1.3?
I recently updated and there is no YouTube, can someone please tell me why this is or how to get it back? Much appreciated.
-
Issue with ODI agent- Running continuously without any error
Please refer the below thread for more details Re: Difference between running the PKGs with remote agent and Local agent
-
How can I embed glassfish openesb in a lightweight mode?
Is there a way embed a lightweight mode of glassfish esb? I want to use it as far ligntweight as possible,maybe just the jbi runtime,the core BCs,SEs.When try to install glassfish esb,I find netbeans,glassfish must exist.
-
While trying to get Spatial Database Engine set up to work with Oracle 9i on a Solaris 9 platform, I get the following. Does this mean that Sqlplus is working but Oracle itself is down?: sqlplus "/as sysdba" SQL*Plus: Release 9.0.1.0.0 - Production o
-
Hi All, what is P0763-XINSI? Using existing field flag P0763-XINSI logic as an example , how to create a new field P0763-Zxxx . Thanks and Regards Shital.