Issue in display format of a internal table in SMARTFORM
I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
Because of the size of the coloumn in table ,"ed." comes down as shown.
+ text to be print
ed.
I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
starts in the above line.
Notice that the requirement is to print "ed" after '4' spaces.
Please suggest what i need to do to get the desired result...
Regards
Rudra
Unfortunately there is no such way.
Similar Messages
-
Issue in display format of internal table in smartform
I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
Because of the size of the coloumn in table ,"ed." comes down as shown.
<b>+ text to be print
ed. </b>
its coming by default.
I want it like <b>+ text to be print
ed</b>
I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
starts in the above line.
Notice that the requirement is to print "ed" after '2' spaces.And we can not use the string length concept bcoz not of characters after which the line comes down is not fixed.May be some change of setting in smartform will do the trick.
Please suggest what i need to do to get the desired result...
Regards
RudraUnfortunately there is no such way.
-
OO ALV displaying without Values despite Internal table contains
My below OO ALV displaying without Values despite Internal table contains the values ...
Help please ...
REPORT zsd_concession1 NO STANDARD PAGE HEADING
LINE-SIZE 285
LINE-COUNT 64
MESSAGE-ID zz.
Program Description ******************************
This report is to Calculate consession against Quotations
complying standards for enhanced Performance, Readability &
Maintenance.
Change Log *********************************
Remedy # / Who When Why / What
Transport #
CLASS lcl_event_handler DEFINITION DEFERRED.
*& Data Definitions .
DATA: BEGIN OF vbap_wa,
vbeln TYPE vbak-vbeln, "Quotation#
erdat TYPE vbak-erdat, "Quot date
knumv TYPE vbak-knumv, "Cond Rec#
posnr TYPE vbap-posnr, "Line Item
matnr TYPE vbap-matnr, "Mat#
zansicat TYPE zmarall-zansicat, "AnsiCat#
zansigrd TYPE zmarall-zansigrd, "Grade
zcurrvaltnarea TYPE zco002-zcurrvaltnarea,"Val Area
zcurrcstusd TYPE zco002-zcurrcstusd, "Cost$
zzbrndnm TYPE mara-zzbrndnm, "Brand
zqedscgrp TYPE zglbprc-zqedscgrp, "QE Disc Grp
mstav TYPE mara-mstav, "Status
kwmeng TYPE vbap-kwmeng, "Qty
lprc TYPE konv-kbetr, "List Price ZBP1
sprc TYPE konv-kbetr, "Std Pric ZNAA,ZNAX
netpr TYPE vbap-netpr, "Quot price
mrgn TYPE konv-kbetr, "margin%
END OF vbap_wa,
BEGIN OF konv_wa,
knumv TYPE konv-knumv, "Cond#
kposn TYPE konv-kposn, "Cond Item#
kappl TYPE konv-kappl, "Applic
kschl TYPE konv-kschl, "Cond Typ
kbetr TYPE konv-kbetr, "Price ZBP1,ZNAA,ZNAX
END OF konv_wa,
BEGIN OF vbpa_wa,
vbeln TYPE vbpa-vbeln, "Quot#
posnr TYPE vbpa-posnr, "Item#
parvw TYPE vbpa-parvw, "Prt Fn
kunnr TYPE vbpa-kunnr, "Cust#
END OF vbpa_wa,
BEGIN OF result_wa,
posnr TYPE vbap-posnr, "Line Item
matnr TYPE vbap-matnr, "Mat#
zansicat TYPE zmarall-zansicat, "AnsiCat#
zansigrd TYPE zmarall-zansigrd, "Grade
zcurrvaltnarea TYPE zco002-zcurrvaltnarea,"Val Area
zcurrcstusd TYPE zco002-zcurrcstusd, "Cost$
zzbrndnm TYPE mara-zzbrndnm, "Brand
zqedscgrp TYPE zglbprc-zqedscgrp, "QE Disc Grp
mstav TYPE mara-mstav, "Status
kwmeng TYPE vbap-kwmeng, "Qty
lprc TYPE konv-kbetr, "List Price ZBP1
sprc TYPE konv-kbetr, "Std Pric ZNAA,ZNAX
netpr TYPE vbap-netpr, "Quot price
mrgn TYPE konv-kbetr, "margin%
END OF result_wa.
DATA: ikonv LIKE STANDARD TABLE OF konv_wa,
ivbap LIKE STANDARD TABLE OF vbap_wa,
ivbpa LIKE STANDARD TABLE OF vbpa_wa,
iresult LIKE STANDARD TABLE OF result_wa.
*Work storage
DATA: BEGIN OF ws,
vbeln TYPE vbak-vbeln,
ok_code TYPE sy-ucomm,
alv_save TYPE c, "ALV save
alv_variant TYPE disvariant, "ALV Variant
alv_sort TYPE lvc_t_sort, "Sort table
END OF ws.
*Data declarations for ALV Main list
DATA : ty_lay1 TYPE lvc_s_layo,
it_fieldcat TYPE lvc_t_fcat ,
ty_fieldcat TYPE lvc_s_fcat ,
l_smenu TYPE REF TO cl_ctmenu,
c_alv1 TYPE REF TO cl_gui_alv_grid,
c_cont1 TYPE REF TO cl_gui_custom_container,
e_dclick TYPE REF TO lcl_event_handler.
*Data declarations for ALV Interactive list
DATA : ty_lay2 TYPE lvc_s_layo,
it_fcat TYPE lvc_t_fcat ,
ty_fcat TYPE lvc_s_fcat ,
c_alv2 TYPE REF TO cl_gui_alv_grid,
c_cont2 TYPE REF TO cl_gui_custom_container.
*Field-Symbols
FIELD-SYMBOLS:
<konv> LIKE konv_wa,
<vbap> LIKE vbap_wa.
*Constants
CONSTANTS:
c_end_row TYPE i VALUE 65000.
*CLASS lcl_event_receiver DEFINITION
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row.
ENDCLASS. "lcl_event_handler DEFINITION
*CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_double_click.
DATA: sec_wa LIKE LINE OF iresult.
*Reading the selected data into a variable
READ TABLE iresult INDEX e_row-index INTO sec_wa.
*Select the field details of the selected table
SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
WHERE tabname EQ ls_dd02l-tabname.
*Calling the ALV containing the field values
CALL SCREEN 101.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_event_handler IMPLEMENTATION
*& SELECTION-SCREEN.
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_vbeln FOR ws-vbeln DEFAULT '2002354788' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK a.
INITIALIZATION.
PERFORM setup_screen_defaults.
START-OF-SELECTION.
PERFORM gather_report_data.
END-OF-SELECTION.
PERFORM create_output.
*& Form initialization
FORM setup_screen_defaults.
CLEAR: ws, konv_wa, vbap_wa, vbpa_wa.
REFRESH: ivbpa, ikonv, ivbap, iresult.
ENDFORM. " setup_screen_defaults
*& Form gather_report_data
FORM gather_report_data.
SELECT vbeln posnr parvw kunnr
INTO TABLE ivbpa
FROM vbpa
WHERE vbeln IN s_vbeln
AND ( parvw = 'SP' OR "SoldTO
parvw = 'WE' OR "ShipTo
parvw = 'ZT' ). "Top Parent
SELECT vkvbeln vkerdat vkknumv vpposnr vp~matnr
z1zansicat z1zansigrd z2~zcurrvaltnarea
z2zcurrcstusd m1zzbrndnm zg~zqedscgrp
m1mstav vpkwmeng vp~netpr
INTO CORRESPONDING FIELDS OF TABLE ivbap
FROM vbak AS vk
INNER JOIN vbap AS vp
ON vpvbeln = vkvbeln
INNER JOIN zmarall AS z1
ON z1matnr = vpmatnr
INNER JOIN zco002 AS z2
ON z2matnr = vpmatnr
INNER JOIN zglbprc AS zg
ON zgmatnr = vpmatnr
INNER JOIN mara AS m1
ON m1matnr = vpmatnr
WHERE vk~vbeln IN s_vbeln
AND vk~auart = 'AG'."AG = Quot
SORT ivbap BY posnr matnr.
SELECT kvknumv kvkposn kvkappl kvkschl kv~kbetr
INTO TABLE ikonv
FROM konv AS kv
FOR ALL ENTRIES IN ivbap
WHERE kv~knumv = ivbap-knumv
AND kv~kposn = ivbap-posnr
AND kv~kappl EQ 'V'
AND ( kv~kschl EQ 'ZBP1'
OR kv~kschl EQ 'ZNAX'
OR kv~kschl EQ 'ZNAA' ).
SORT ikonv BY knumv kposn.
LOOP AT ivbap ASSIGNING <vbap>.
CLEAR konv_wa.
READ TABLE ikonv INTO konv_wa WITH KEY
knumv = <vbap>-knumv
kposn = <vbap>-posnr
kschl = 'ZBP1'
BINARY SEARCH.
IF sy-subrc EQ 0.
<vbap>-lprc = konv_wa-kbetr.
ENDIF.
READ TABLE ikonv INTO konv_wa WITH KEY
knumv = <vbap>-knumv
kposn = <vbap>-posnr
kschl = 'ZNAX'
BINARY SEARCH.
IF sy-subrc EQ 0.
<vbap>-sprc = konv_wa-kbetr.
ENDIF.
READ TABLE ikonv INTO konv_wa WITH KEY
knumv = <vbap>-knumv
kposn = <vbap>-posnr
kschl = 'ZNAA'
BINARY SEARCH.
IF sy-subrc EQ 0.
<vbap>-sprc = konv_wa-kbetr.
ENDIF.
ENDLOOP.
SORT ivbap BY posnr matnr.
LOOP AT ivbap INTO vbap_wa.
MOVE-CORRESPONDING vbap_wa TO result_wa.
APPEND result_wa TO iresult.
CLEAR: vbap_wa, result_wa.
ENDLOOP.
ENDFORM. " gather_report_data
*& Form create_output
FORM create_output.
CALL SCREEN 100.
FREE: iresult.
ENDFORM. " create_output
*& Module PBO_0100 OUTPUT
text
MODULE pbo_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
IF c_cont1 IS INITIAL.
*Creating object of container
CREATE OBJECT c_cont1
EXPORTING
container_name = 'CCONT1'.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Creating object of alv
CREATE OBJECT c_alv1
EXPORTING
i_parent = c_cont1.
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 layout
PERFORM alv_100_layout.
PERFORM save_alv_layout.
*Alv field catalogue
PERFORM alv_100_fieldcat.
*Displaying the ALV grid
CALL METHOD c_alv1->set_table_for_first_display
EXPORTING
is_layout = ty_lay1
i_save = ws-alv_save
is_variant = ws-alv_variant
CHANGING
it_outtab = iresult[]
it_sort = ws-alv_sort
it_fieldcatalog = it_fieldcat[].
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Create object of the event class
*and setting handler for double click
CREATE OBJECT e_dclick.
SET HANDLER e_dclick->handle_double_click FOR c_alv1.
ENDIF.
ENDMODULE. " PBO_0100 OUTPUT
*& Module PAI_0100 INPUT
text
MODULE pai_0100 INPUT.
ws-ok_code = sy-ucomm.
CASE ws-ok_code.
WHEN 'BACK'.
CALL SELECTION-SCREEN 1000.
CLEAR ws-ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
CLEAR ws-ok_code.
EXIT.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
CLEAR ws-ok_code.
EXIT.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " PAI_0100 INPUT
*& Form alv_100_layout
text
--> p1 text
<-- p2 text
FORM alv_100_layout.
ty_lay1-numc_total = 'X'. " Numc total line
ty_lay1-cwidth_opt = 'X'. " Optimal column width
ty_lay1-detailinit = 'X'. " Show values that are initial in
ty_lay1-sel_mode = 'A'. " Column selection mode
ty_lay1-no_merging = 'X'. " No merging while sorting columns
ty_lay1-keyhot = 'X'.
ty_lay1-grid_title = 'SD Concessions'.
ty_lay1-zebra = 'X'.
ty_lay1-no_toolbar = ' '.
ENDFORM. " alv_100_layout
*& Form alv_100_fieldcat
text
--> p1 text
<-- p2 text
FORM alv_100_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 1.
ty_fieldcat-fieldname = 'posnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Item#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 2.
ty_fieldcat-fieldname = 'matnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Mat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 3.
ty_fieldcat-fieldname = 'zansicat'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'AnsiCat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 4.
ty_fieldcat-fieldname = 'zansigrd'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Grade'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 5.
ty_fieldcat-fieldname = 'zcurrvaltnarea'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Val Area'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 6.
ty_fieldcat-fieldname = 'zcurrcstusd'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Cost $'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 7.
ty_fieldcat-fieldname = 'zzbrndnm'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Brand'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 8.
ty_fieldcat-fieldname = 'zqedscgrp'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'QE'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 9.
ty_fieldcat-fieldname = 'mstav'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Status'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 9.
ty_fieldcat-fieldname = 'kwmeng'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Qty'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 10.
ty_fieldcat-fieldname = 'lprc'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'List Price'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 11.
ty_fieldcat-fieldname = 'sprc'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Discount'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 12.
ty_fieldcat-fieldname = 'netpr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Quot Price'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 13.
ty_fieldcat-fieldname = 'mrgn'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Margin%'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
ENDFORM. " alv_100_fieldcat
*& Module PBO_0101 OUTPUT
text
MODULE pbo_0101 OUTPUT.
*Check if the Custom container exists.
IF c_cont2 IS INITIAL.
*Creating container object
CREATE OBJECT c_cont2
EXPORTING
container_name = 'CCONT2'.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*creating ALV grid for interactive list
CREATE OBJECT c_alv2
EXPORTING
i_parent = c_cont2.
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 layout
PERFORM alv_101_layout.
*ALV fieldcatalogue
PERFORM alv_101_fieldcat.
*Sorting the output by field position
SORT iresult BY posnr.
*ALV for display field details
CALL METHOD c_alv2->set_table_for_first_display
EXPORTING
is_layout = ty_lay2
CHANGING
it_outtab = iresult[]
it_fieldcatalog = it_fieldcat.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDMODULE. " PBO_0101 OUTPUT
*& Module PAI_0101 INPUT
text
MODULE pai_0101 INPUT.
ENDMODULE. " PAI_0101 INPUT
*& Form alv_101_layout
text
--> p1 text
<-- p2 text
FORM alv_101_layout.
ty_lay2-grid_title = 'Line Details'.
ty_lay2-zebra = 'X'.
ty_lay2-no_toolbar = 'X'.
ENDFORM. " alv_101_layout
*& Form alv_101_fieldcat
text
--> p1 text
<-- p2 text
FORM alv_101_fieldcat.
REFRESH it_fieldcat.
REFRESH it_fcat.
CLEAR ty_fcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 1.
ty_fieldcat-fieldname = 'posnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Item#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 2.
ty_fieldcat-fieldname = 'matnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Mat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 3.
ty_fieldcat-fieldname = 'zansicat'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'AnsiCat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 4.
ty_fieldcat-fieldname = 'zansigrd'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Grade'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 5.
ty_fieldcat-fieldname = 'zcurrvaltnarea'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Val Area'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
ENDFORM. " alv_101_fieldcat
*& Form save_alv_layout
text
--> p1 text
<-- p2 text
form save_alv_layout.
ws-alv_save = 'A'.
ws-alv_variant-report = sy-repid.
endform. " save_alv_layoutHello
Creating fieldcatalogs manually is one of the major error sources in ALV programming.
There is hardly any reason why NOT to use the standard-fm LVC_FIELDCATALOG_MERGE in order to create a proper fieldcatalog.
If you need some modification of the standard fieldcatalog (e.g. renaming of columns, etc.) just do your post-processing after calling the fm.
Regards
Uwe -
Passing internal tables into smartforms
Hi All,
I am testing a smartform for PO. But the smartform is already designed and it has two internal tables of type EKKO and EKPO. When i run the smartform its displaying the layout correctly but with no data ,which is true as the two internal tables have no data. So i want to fill those two internal tables based on the purchase order number/ numbers. So that i can test the smartform with those purchase order numbers.
I want to create a parameter / select option in smartform so that when we enter the PO number those internal tables will be filled. How to create those options in the smartform.
If i have to create through an ABAP program then i want to know how to pass those two internal tables to smartform. (Shall i have to call the FM couple of times and then pass those two internal tables).
Thanks in AdvanceYou fill the tables in the print program and pass the tables to the SmartForm function module under the tables section. See the FM call below (CALL FUNCTION lf_fm_name) and note that I am only passing in one internal table. If you wish you may pass in more than one table.
*& Form smartform_print
* text
* --> p1 text
* <-- p2 text
FORM smartform_print .
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_addr_key LIKE addr_key.
PERFORM set_print_param USING ls_addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
retcode.
*Get the Smart Form name.
IF NOT tnapr-sform IS INITIAL.
lf_formname = tnapr-sform.
ELSE.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF vbdkr-vkorg = '0035'.
IF w_regio = 'QC'.
tnapr-fonam = 'ZPCC_INVOICE_FR'.
ENDIF.
ENDIF.
* IF NOT tnapr-sform IS INITIAL.
* lf_formname = tnapr-sform.
* ELSE.
* MESSAGE e001(/smb40/ssfcomposer).
* ENDIF.
* determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
* variant = ' '
* direct_call = ' '
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* error handling
retcode = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer).
ENDIF.
PERFORM protocol_update.
ENDIF.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
* ARCHIVE_INDEX_TAB =
archive_parameters = arc_params
control_parameters = ls_control_param
* MAIL_APPL_OBJ =
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
vbdkr = vbdkr
temp_jmval = temp_jmval
temp_agval = temp_agval
w_ship = w_ship
w_ktgrd = w_ktgrd
likp = likp
w_trlrnbr = w_trlrnbr
w_sealnbr = w_sealnbr
w_booknbr = w_booknbr
w_lc = w_lc
w_shippoint = w_shippoint
billto_fedid = billto_fedid
soldto_fedid = soldto_fedid
shipto_fedid = shipto_fedid
vbco3 = vbco3
w_z4_address = w_z4_address
w_stawn = w_stawn
w_herkl = w_herkl
new_rate = new_rate
vblkp = vblkp
TABLES
vbdpr = tvbdpr
* t_containers = t_containers
* tdomvd = tkomvd
* da_xfplt = da_xfplt
* payment_split = payment_split
* komk = komk
* frt_conditions = frt_conditions
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
retcode = sy-subrc.
PERFORM protocol_update.
* get SmartForm protocoll and store it in the NAST protocoll
PERFORM add_smfrm_prot.
ENDIF.
ENDFORM. " smartform_print
Davis -
Declaring an internal table in smartform
hi,
can anyone tell how to declare internal table in smartform.
the internal table contains fields from 2 or more data dictionary tables(eg.kna1
and adrc). after this from the print program(internal table containing data in print
program) internal table should be passed to the smartform.
thanks.hi laxya,
if u want to pass the data from internal table in print program to Smartform.. there is only way.. that is using form interface..
1. goto se11, create a structure same as the itab in the print program.ex. <b>z_itab</b>
2. create line type... se11>select radio button-DATA type><b>z_it_itab</b> >press create>then select>TABLE Type> then entrer some text--> in the line type Field in giveth Str name u have created in STEP 1. activate it.
3. got SMARTFORMS-> form inteface>tables tabe--> give some name ex <b>IT_tab type z_it_itab</b>.
then acivate it.. then in the driver progam pass this table data.
Exapmpel
CALL FUNCTION fp_v_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = fp_st_control_parameters
user_settings = space
output_options = fp_st_output_options
wa_vbdkr = fp_st_vbdkr
IMPORTING
job_output_info = l_it_ssfcrescl
job_output_options = l_it_ssfcresop
TABLES
<b> IT_tab = z_it_itab (or table in driver program)</b>
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Another way is cteate a type in Globaldifination-->types tab..
ex:
types: begin of ty_itab,
matnr type matnr,
meins type meins
vrkme type vrkme,
end of ty_itab,
ty_it_itab type standard table of ty_itab.
then GLOBAL DIFINATION>GLOBAL DATA TAB>IT)ITAB TYPE TY_IT_ITAB.
BUT In this u can't pass the data from the print Program.. if u want to populate data in to this table... u have to write the Select query in the GLOBAL DIFINATIONS-->INITILIZATIONS TAB.
Please Close this thread.. when u r problem is solved
Reward if Helpful
Regards
Naresh Reddy K
Message was edited by:
Naresh Reddy -
How to Define Internal Table in Smartform
Hello,
I have some problem on define Internal Table in Smartform
I define a Temp_IT_Gen Type LBBIL_IT_GEN in Global Definiations
but i find that it is not available for me to append data into it,
the error message is Temp_IT_Gen is not a Internal Table - the Occurs n Specification is missing
so how can i solve it?
i want to use the internal table in the hold program.
Thanks a lot in advance.Hi,
First U define the Table type in 'TYPES' tab of Global Definitions and then assing that table type to Internal table in 'Global Data' tab.
Eg:
define the Table Type like below in TYPES tab.
TYPES:BEGIN OF ty_TEMP.
INCLUDE STRUCTURE XXXXXXX.
TYPES:END OF ty_TEMP.
TYPES: g_t_temp TYPE STANDARD TABLE OF ty_TEMP .
Now, define the Internal table in Global Data tab like below:
Variable Name Type assignment Associated Type
G_T_ITEM_1 TYPE G_T_TEMP
NOTE: whatever U define in Global Definitions can be used only in SMARTFORM, if u want to use it in Program U must define in Form Interface.
Hope it helps!!
Rgds,
Pavan -
How to Import customized internal table to smartform from Print Program
Hi Gurus,
I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
With regards,
S.SaravananThere is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
Regards,
Raymond -
Help on ALV GRID display outputting format for 2 internal tables
Hi,
I have requirement in ALV GRID where I need to display the data from 2 internal tables. The first internal table has the content of Delivery due list data and second the internal table has the corresponding stock transfer data of the Delivery Due list. I have a checbox on my selection screen, when unchecked it should output the 1st internal table data, i.e for Delivery due list. When it is checked then it should output 1st Internal table data + 2nd internal table data of stock transfer. For example, 1 document delivery due list data and 2nd line for that document should show the stock transfer data. You can also check the transaction code VL10E for that will show a delivery due list...and for stock tranfer,you need to check with Purchase order in in the USer Role tabstrip. Pls suggest.
Regards,
MiraHi,
U can try out this code
REPORT zzz_test NO STANDARD PAGE HEADING
MESSAGE-ID zz.
The Data Declarations
INCLUDE zzm_test_alv_data.
The Selection Screen Definition
INCLUDE zzm_test_alv_selscrn.
The definition and implementation of the event reciever class
INCLUDE zzm_test_alv_class.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM f1000_load_itabs.
END-OF-SELECTION
END-OF-SELECTION.
IF NOT cb_disp IS INITIAL.
CALL SCREEN 9001.
ENDIF.
Include for getting data
INCLUDE zzm_test_alv_forms.
Include for PAI and PBO of screen
INCLUDE zzm_test_alv_screen.
INCLUDE ZZM_TEST_ALV_DATA *
This include has all the data declaration defined
Author............: Judith Jessie Selvi
Creation Date.....: 28/03/2005
Table Declarations:
TABLES: mara,
makt.
Internal Tables:
The following structure type must be defined in the data dictionary
DATA: i_fieldcat TYPE lvc_t_fcat,
i_fieldcat1 TYPE lvc_t_fcat,
i_output1 TYPE STANDARD TABLE OF mara,
i_output2 TYPE STANDARD TABLE OF makt,
Work Areas:
w_output1 TYPE STANDARD TABLE OF mara,
w_output2 TYPE STANDARD TABLE OF makt.
Variable:
DATA: lv_repid LIKE sy-repid.
lv_repid = sy-repid.
INCLUDE ZZM_TEST_ALV_SELSCRN *
Author............: Judith Jessie Selvi
Creation Date.....: 28/03/2005
SELECTION-SCREEN BEGIN OF BLOCK b_main WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS: cb_disp AS CHECKBOX.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN END OF BLOCK b_main.
INCLUDE ZZM_TEST_ALV_CLASS *
This include has all the data declaration defined for ALV
Author............: Judith Jessie Selvi
Creation Date.....: 28/03/2005
INCLUDE <icon>.
Predefine a local class for event handling to allow the
declaration of a reference variable before the class is defined.
DATA : o_alvgrid1 TYPE REF TO cl_gui_alv_grid ,
o_alvgrid2 TYPE REF TO cl_gui_alv_grid ,
cont_for_cognos1 TYPE scrfname VALUE 'BCALC_GRID_01_9100',
cont_for_cognos2 TYPE scrfname VALUE 'BCALC_GRID_01_9200',
custom_container1 TYPE REF TO cl_gui_custom_container,
custom_container2 TYPE REF TO cl_gui_custom_container,
Work Area
w_layout TYPE lvc_s_layo ,
w_variant TYPE disvariant.
Constants
CONSTANTS : c_lay(1) TYPE c VALUE 'A' . " All Layouts
CONSTANTS: BEGIN OF c_main_tab,
tab1 LIKE sy-ucomm VALUE 'MAIN_TAB_FC1', "
tab2 LIKE sy-ucomm VALUE 'MAIN_TAB_FC2', "
END OF c_main_tab.
INCLUDE ZZM_TEST_ALV_FORMS *
This Include has the various forms used in the program
Author............: Judith Jessie Selvi
Creation Date.....: 28/03/2005
*& Form f9001_build_field_cat
To Build Field Catalog
-->P_I_FIELDCAT text
-->P_0021 text
FORM f9001_build_field_cat TABLES p_fieldcat STRUCTURE lvc_s_fcat
USING value(p_structure).
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_structure
CHANGING
ct_fieldcat = p_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE i005 WITH 'Error in ALV field catalogue creation'.
" text-e05.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " f9001_build_field_cat
*& Form f9000_objects_create
For creating Custom Containers
--> p1 text
<-- p2 text
FORM f9000_objects_create.
CREATE OBJECT custom_container1
EXPORTING
container_name = cont_for_cognos1
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
CREATE OBJECT custom_container2
EXPORTING
container_name = cont_for_cognos2
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc NE 0.
add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = lv_repid
txt2 = sy-subrc
txt1 = 'The control could not be created'(510).
ENDIF.
CREATE OBJECT o_alvgrid1
EXPORTING i_parent = custom_container1.
CREATE OBJECT o_alvgrid2
EXPORTING i_parent = custom_container2.
ENDFORM. " f9000_objects_create
*& Form f9003_layout
To define the layout
-->P_SY_TITLE text
-->P_0030 text
-->P_0031 text
-->P_0032 text
FORM f9003_layout USING value(ptitle)
value(pzebra)
value(pmode)
value(pwidth).
w_layout-grid_title = ptitle.
w_layout-zebra = pzebra.
w_layout-sel_mode = pmode.
w_layout-cwidth_opt = pwidth.
w_variant-report = sy-repid.
ENDFORM. " f9003_layout
*& Form f9006_error_handle
To handle event
-->P_PTEXT text
FORM f9006_error_handle USING value(ptext).
IF sy-subrc NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-e03 " Error Note
txt2 = sy-subrc
txt1 = ptext.
ENDIF.
ENDFORM. " f9006_error_handle
FORM EXIT_PROGRAM *
FORM exit_program.
CALL METHOD custom_container1->free.
CALL METHOD custom_container2->free.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = lv_repid
txt2 = sy-subrc
txt1 = 'Error in FLush'(500).
ENDIF.
ENDFORM.
*& Form f1000_load_itabs
Select from Database
--> p1 text
<-- p2 text
form f1000_load_itabs.
SELECT * FROM mara
INTO TABLE i_output1
UP TO 50 rows.
SELECT * FROM makt
INTO TABLE i_output2
UP TO 50 rows.
endform. " f1000_load_itabs
INCLUDE ZZM_TEST_ALV_SCREEN *
2/ Description / Include functions
This include contains PBO and PAI events for the screen of report
ZZZJJ_TEST_ALV
3/ Responsibility
Author............: Judith Jessie Selvi
Creation Date.....: 28/03/2005
DATA FOR TABSTRIP 'MAIN_TAB'
CONTROLS: main_tab TYPE TABSTRIP.
DATA: BEGIN OF i_main_tab,
subscreen LIKE sy-dynnr,
prog LIKE sy-repid VALUE
'ZZZ_TEST',
pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
END OF i_main_tab.
*& Module STATUS_9001 OUTPUT
text
MODULE status_9001 OUTPUT.
IF custom_container1 IS INITIAL.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'ZTITLE'.
Creating Object
PERFORM f9000_objects_create.
Building the field catalog
PERFORM f9001_build_field_cat TABLES i_fieldcat
USING 'MARA'.
PERFORM f9001_build_field_cat TABLES i_fieldcat1
USING 'MAKT'.
Modifying the field catalog
PERFORM f9002_modify_field_cat TABLES i_fieldcat.
For Layout
PERFORM f9003_layout USING sy-title 'X' 'B' 'X'.
ENDIF.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module MAIN_TAB_ACTIVE_TAB_SET OUTPUT
Call method to display in the output grid
MODULE main_tab_active_tab_set OUTPUT.
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
To display report
i_main_tab-subscreen = '9100'.
CALL METHOD o_alvgrid1->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_lay
is_layout = w_layout
CHANGING
it_outtab = i_output1[]
it_fieldcatalog = i_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i000 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
WHEN c_main_tab-tab2.
To display report
i_main_tab-subscreen = '9200'.
CALL METHOD o_alvgrid2->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_lay
is_layout = w_layout
CHANGING
it_outtab = i_output2[]
it_fieldcatalog = i_fieldcat1[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i005 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. MAIN_TAB_ACTIVE_TAB_SET OUTPUT
*& Module MAIN_TAB_ACTIVE_TAB_GET INPUT
Check & Process the selected Tab
MODULE main_tab_active_tab_get INPUT.
CASE sy-ucomm.
WHEN c_main_tab-tab1.
i_main_tab-pressed_tab = c_main_tab-tab1.
WHEN c_main_tab-tab2.
i_main_tab-pressed_tab = c_main_tab-tab2.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. MAIN_TAB_ACTIVE_TAB_GET INPUT
*& Module USER_COMMAND_9001 INPUT
User Command
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
PERFORM exit_program.
SET SCREEN '0'.
WHEN 'EXIT' OR 'CANC'.
PERFORM exit_program.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. USER_COMMAND_9000 INPUT
*& Module MAIN_TAB_ACTIVE_TAB_SET INPUT
Set sunscreen
MODULE main_tab_active_tab_set INPUT.
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
i_main_tab-subscreen = '9100'.
WHEN c_main_tab-tab2.
i_main_tab-subscreen = '9200'.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. MAIN_TAB_ACTIVE_TAB_SET INPUT
Thanks & Regards,
Judith. -
Issue in populating the dynamic internal table in SMARTFORMS
Hi Experts,
My requirement is I have a table in the below format.
Measuring Point
Description of Measuring Point
UOM
Date
Time
Reading
96
POWER GENERATED
kwh
20140501
101837
1.00E+04
96
POWER GENERATED
kwh
20140502
102220
1.00E+04
96
POWER GENERATED
kwh
20140503
104623
1.25E+01
96
POWER GENERATED
kwh
20140504
101111
2.00E+03
98
AUX POWER CONSUME
kwh
20140501
101837
1.00E+05
98
AUX POWER CONSUME
kwh
20140502
102220
1.00E+05
99
NET POWER EXPORTED
kwh
20140501
101837
1.00E+07
99
NET POWER EXPORTED
kwh
20140502
102220
1.00E+07
100
AVG POWER GENERATED
MW
20140501
101837
1.00E+02
100
AVG POWER GENERATED
MW
20140502
102220
1.00E+02
101
AUX POWER CONSUMED(%)
20140501
101837
1.00E+02
101
AUX POWER CONSUMED(%)
20140502
102220
1.01E+01
102
PLANT AVAILABLE HRS
hrs
20140501
101837
1.01E+01
102
PLANT AVAILABLE HRS
hrs
20140502
102220
1.01E+01
103
PLANT RUN HOURS
hrs
20140501
101837
1.01E+01
103
PLANT RUN HOURS
hrs
20140502
102220
1.01E+01
104
PLANT AVAILABLITY FACTOR
20140501
101837
1.00E+02
104
PLANT AVAILABLITY FACTOR
20140502
102220
1.00E+02
which i need to display like below based on the user Requirement for print out.
DATE
POWER GENERATED(96)
AUX POWER CONSUME(98)
NET POWER EXPORTED(99)
AVG POWER GENERATED(100)
AUX POWER CONSUMED(%)(101)
PLANT AVAILABLE HRS(102)
PLANT RUN HOURS(103)
PLANT AVAILABLITY FACTOR(104)
kwh
kwh
kwh
MW
hrs
hrs
01.05.2014
1.00E+04
1.00E+05
1.00E+07
1.00E+02
1.00E+02
1.01E+01
1.01E+01
1.00E+02
02.05.2014
1.00E+04
1.00E+05
1.00E+07
1.00E+02
1.01E+01
1.01E+01
1.01E+01
1.00E+02
03.05.2014
1.25E+01
04.05.2014
2.00E+03
Now the issue is how to assign the values of stops from the internal table to dynamically for a specific date in SMARTFORMS?
Please help me in resolving this issue.Hi,
See if this articale is good for you:
The case of "dynamic columns in smartform"
Regards. -
Displaying the contents of internal table- in email Step of workflows
Hello Folks,
I wanted to display the contents of an internal table ( would contain a list of opportunites ), in an email sent throught the workflow:
My idea was to LOOP AT <ITAB> into <WA> from an external program and then call the workflow for each content of the <WA>. This will be a problem as, if there are like 1000 records in the internal table, then workflows will be called 1000 times...sending 1000 emails..
My requirement is that we need to send a single email to the single person, displaying the content of the internal table in the email body......
My question
1) Is this scenario possible through worflows ?
2) If not, please provide an alternative ..
Thanks
AnandDo you mean to say that just by inserting the multiline element
within the body of the 'Send email' step type, the contents
of the multiline element is displayed automatically without
we having to loop at it somehow ?
Follow the below apporach,
1. First create a multiline container element in the workflow conatiner.
2. Populate the internla table , by using the bor methods and pass back the populated ITAB to the WF by using the binding concept.
3. Now create a mail step in the workflow, you have the option of inserting the workflow container elements into the mail conten, so insert the multiline container element , then it prompts to select the option like a) Do you liek to display only first line b) Display the ITAB line by line c) Display ITAB lines continuously with out line break.
4. based upon the requirement select any one of the options.
Note: Make sure the line length of the ITAB won't excced 132 charecters, because the send mail step will consider only 132 characters. -
Getting Issue while uploading CSV file into internal table
Hi,
CSV file Data format as below
a b c d e f
2.01E14 29-Sep-08 13:44:19 2.01E14 SELL T+1
actual values of column A is 201000000000000
and columen D is 201000000035690
I am uploading above said CSV file into internal table using
the below coding:
TYPES: BEGIN OF TY_INTERN.
INCLUDE STRUCTURE KCDE_CELLS.
TYPES: END OF TY_INTERN.
CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
EXPORTING
I_FILENAME = P_FILE
I_SEPARATOR = ','
TABLES
E_INTERN = T_INTERN
EXCEPTIONS
UPLOAD_CSV = 1
UPLOAD_FILETYPE = 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.
am getting all columns data into internal table,
getting problem is columan A & D. am getting values into internal table for both; 2.01E+14. How to get actual values without modifying the csv file format.
waiting for your reply...
thanks & regards,
abhiHi Saurabh,
Thanks for your reply.
even i can't double click on those columns.
b'se the program needs be executed in background there can lot of csv file in one folder. No manual interaction on those csv files.
regards,
abhi -
Display 2 different structured internal tables in single screen using ALV
Hi,
I have two internal tables. Both has different structures. My requirement is to display both the internal tables in single screen using ALV Grid but NOT using OO ALV Grid display.
Is there any way of spliting the Final ALV display screen into two with two different headers and details as shown below.
Header1 for internal table 1
Data of internal table 1
Header1 for internal table 2
Data of internal table 2
Can anyone suggest a better way to display this.
Regards,
Senthilhi
first think i can say ALV GRID means only for OO ALV it is not possible to display two I.T. data in singr report screen.
better to use of the fm: REUSE_ALV_BLOCK_LIST_DISPLAY
so that u can display both I.T. data in separate report list under single screen
Check the example programs:
BALVBT01 Testprogram ALV: Block list
BCALV_TEST_BLOCK_LIST Program BCALV_TEST_BLOCK_LIST
Regards,
deepak -
Really urgent: reagrding alv format for like (internal tables)
Hi,
I making a report in which i am using the concept of 2 internal tables and i am usnig the concept of likes in a internal table .
for instance,
DATA : BEGIN OF ITAB OCCURS 0,
ITEMID LIKE CHVW-MATNR,
WERKS LIKE CHVW-WERKS,
CHARG LIKE CHVW-CHARG,
SHKZG LIKE CHVW-SHKZG,
MENGE LIKE CHVW-MENGE,
MEINS LIKE CHVW-MEINS,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
MATNR TYPE BSEG-MATNR,
LIFNR TYPE BSEG-LIFNR,
AUGDT TYPE BSEG-AUGDT,
WRBTR TYPE BSEG-WRBTR,
END OF IT_BSEG.
and i am able to create ALV for 1 itab only as i had declared all fields in a 1 itab ,but now i have to declare 1 more itab and i dont know how to perform ALV with 2 itabs..
Plzz help me out as it is really urgent to me.
Edited by: ric .s on Apr 22, 2008 11:45 AM
Edited by: ric .s on Apr 23, 2008 7:21 AM
Edited by: ric .s on Apr 23, 2008 7:55 AMHi Ric,
Yes, You can .
Check the sample ALV program which helps u in displaying output using ALV . Comments have been made everywhere .
report zvenkat_alv_2_grid_description.
types:
begin of t_mard,
werks type mard-werks,
lgort type mard-lgort,
matnr type mard-matnr,
insme type mard-insme,
einme type mard-einme,
speme type mard-speme,
end of t_mard.
data:
w_mard type t_mard.
data:
i_mard type standard table of t_mard.
" ALV Declarations
" ALV internal tables and Structures
" To refer ALV tables(slis tables) and structures.SLIS must be
" declared under TYPE-POOLS(see below).SLIS is a Type group which is
" defined in Dictionary.Internal tables and structures and constants
" are defined under type group.(Double click on SLIS).
* Types Pools
type-pools:
slis.
* Types
types:
t_fieldcat type slis_fieldcat_alv,
t_events type slis_alv_event,
t_layout type slis_layout_alv.
* Workareas
data:
w_fieldcat type t_fieldcat,
w_events type t_events,
w_layout type t_layout.
* Internal Tables
data:
i_fieldcat type standard table of t_fieldcat,
i_fieldcat1 type standard table of t_fieldcat,
i_events type standard table of t_events.
*& START-OF-SELECTION
start-of-selection.
perform get_data_from_database .
" END-OF-SELECTION
" Steps to create simple ALV program
" 1. Pass an internal table with the set of output information
" 2. Pass a field catalog as an internal table
" 3. Pass a structure with general list layout details
end-of-selection.
perform build_fieldcatalog.
perform build_events.
perform build_layout.
perform display_data.
" Form build_fieldcatalog
" Fieldcatalog Internal table
" 1. It contains descriptions of the list output fields
" (usually a subset of the internal output table fields).
" 2. A field catalog is required for every ALV list output.
form build_fieldcatalog .
clear :
w_fieldcat,
i_fieldcat[].
perform build_fcat using:
"Field Int.Table Column headings
'WERKS' 'I_MARD' 'WERKS',
'LGORT' 'I_MARD' 'LGORT',
'MATNR' 'I_MARD' 'MATNR',
'INSME' 'I_MARD' 'INSME',
'EINME' 'I_MARD' 'EINME',
'SPEME' 'I_MARD' 'SPEME'.
endform. " build_fieldcatalog
*& Form display_data
form display_data .
data :program like sy-repid value sy-repid.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = program
is_layout = w_layout
it_fieldcat = i_fieldcat
it_events = i_events
tables
t_outtab = i_mard.
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_data
*& Form get_data_from_database
* text
form get_data_from_database .
clear :i_mard,
i_mard[].
select werks lgort matnr insme einme speme
from mard
into corresponding fields of table i_mard
up to 100 rows.
endform. " get_data_from_database
*& Form top_of_page
* text
form top_of_page.
data :
i_header type slis_t_listheader,
w_header like line of i_header.
data:l_date1 type datum,
l_date2 type datum.
w_header-typ = 'S'.
w_header-info = sy-title.
append w_header to i_header.
clear w_header.
w_header-typ = 'H'.
w_header-info = sy-repid.
append w_header to i_header.
clear w_header.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = i_header
i_logo = 'ENJOYSAP_LOGO'.
endform. "top_of_page
*& Form BUILD_FCAT
form build_fcat using l_field l_tab l_text.
w_fieldcat-fieldname = l_field.
w_fieldcat-tabname = l_tab.
w_fieldcat-seltext_m = l_text.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
endform. " BUILD_FCAT
" Form build_events
" Events
" 1. When we use ALV,certain events TOP-OF-PAGE ,END-OF-PAGE,
" AT LINE-SELECTION,AT USER-COMMANDs are not triggered.
" 2. To perform those Functions ,we have to build Events table and
" pass this table through REUSE_ALV_LIST_DISPALY Function.
form build_events .
clear :
w_events,i_events[].
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to i_events.
clear w_events.
endform. " build_events
"& Form build_layout
" Layouts
" Use :We change the display of our list using layouts.
" ===
" Features
" ========
" The layouts that you can use vary according to the type of list:
" 1-->In all lists, you can do the following:
" (a).Choose one of the std layouts supplied with the std system.
" (b).Change the current layout of the list .
" 2-->In lists that use only the standard layouts in the std system
" you cannot save your changes to the current layout.When you
" choose the layouts, only the standard layouts will be proposed.
" 3-->In some lists, you can also save the layouts that you have
" defined as our own layouts.
" User-defined layouts are generally saved for all users. They can
" then be used by all users. All users will be able to choose from
" the user-defined layouts as well as the standard layouts.
" 4-->In some lists, you can also save user-specific layouts that you
" have defined . When you choose the current layout,only these
" layouts are available to you.
" 5-->You can delete or transport layouts, or define them as initial
" layouts
" 6-->STRUCTURE :SLIS_LAYOUT_ALV.
form build_layout .
clear:
w_layout.
w_layout-colwidth_optimize = 'X'.
endform. " build_layout
Regards,
Venkat.O -
SAP Query Display data from 2 internal tables
Hi ABAP Gurus,
I am developing a SAP Query.
I have created an infoset with the custom infotype 9050 and added the table ZPA9050 into the Infoset.
How do I input values to the ZPA9050 fields? A checkbox for making a Selection field is not available in the Query (SQ01)
For every pa9050 entry there exist multiple records of ZPA9050. I need to display the pa9050 fields in the 1st row and the corresponding zpa9050 fields in the subsequent rows.
Kindly advise how to accomplish this task.
A quick reply is highly appreciated.
Useful answers will be rewarded.
Thanks
SriramHi Deepika,
Your reqirement is to print data from the two internal tables ..and if u r not using interactive alv then u need to merge data into single internal table... if anycase u dont want to merge in the table itab as u told u can use another final internal table in which u can merge data from the two previous interal tables then u pass this final internal table to ur FM.
Thanks & Regards
Ashu Singh -
How to format data in internal table
Hi Friendz...
In a program i have transferred the data from a Excel Spread sheet (.xls file) to an internal table using FM <b>"ALSM_EXCEL_TO_INTERNAL_TABLE"</b>.
The internal table is like this:
begin of xl_data occurs 0,
vendor name
street
address
vat reg no
bank no
end of xl_data.
now i have to include some more fields to this internal table and then i have to download this data to a <b>.txt</b> file.
could you please tell me how should i do this?Please see this sample program. It will upload from excel into internal table, move data to another itab with other fields and download to C:\ drive.
report zrich_0002.
types: begin of ttab ,
fld1(30) type c,
fld2(30) type c,
fld3(30) type c,
fld4(30) type c,
fld5(30) type c,
end of ttab.
types: begin of ttab2 ,
fld1(30) type c,
fld2(30) type c,
fld3(30) type c,
fld4(30) type c,
fld5(30) type c,
fld6(30) type c,
fld7(30) type c,
end of ttab2.
data: itab type table of ttab with header line.
data: itab2 type table of ttab2 with header line.
selection-screen skip 1.
parameters: p_file type localfile default
'C:test.txt'.
selection-screen skip 1.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
clear itab. refresh itab.
perform upload_data.
loop at itab.
clear itab2.
move-corresponding itab to itab2.
itab2-fld6 = 'Another Field'.
itab2-fld7 = 'No, really last one'.
append itab2.
endloop.
call function 'GUI_DOWNLOAD'
exporting
filename = 'C:itab2.txt'
tables
data_tab = itab2
exceptions
others = 22.
* Upload_Data
form upload_data.
data: file type rlgrap-filename.
data: xcel type table of alsmex_tabline with header line.
file = p_file.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '200'
i_end_row = '5000'
tables
intern = xcel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
loop at xcel.
case xcel-col.
when '0001'.
itab-fld1 = xcel-value.
when '0002'.
itab-fld2 = xcel-value.
when '0003'.
itab-fld3 = xcel-value.
when '0004'.
itab-fld4 = xcel-value.
when '0005'.
itab-fld5 = xcel-value.
endcase.
at end of row.
append itab.
clear itab.
endat.
endloop.
endform.
Regards,
Rich Heilman
Maybe you are looking for
-
Report Query with Bind variables working very slowly
Hi everyone, I'm having a hard time with one of my Reports. Basically the query looks like this: Select * from x,y,z where x.lang_id = :P1_LANG and y.name = :P1_LANG; I have a textfield and a Select List on my Page which have to have a value before t
-
What are the requirements to build a live video chat application?
I am looking into making a live video chat application. I have seen several examples on the web so my question is not "how" to do it. My question is "what do I need" to do it? It seems that all the examples use Flex Data Services and then some sort o
-
Probably the mother of all stupid display questions...
I just bought a Gateway 22" widescreen for my PowerMac. Max resolution is 1680 by 1050 which is the default the Mac set it to (DVI connection btw). I was messing around playing UT2004 with this new display. My question is this...would the display or
-
What graphics card do I have in Satellite P850-138
Hello, I bought my Satellite P850-138 from PC world and was told that it had a dedicated graphics card but when i run dxdiag, it says that my graphics card is Intel(R) HD Graphics 3000 can anyone offer any incite?
-
SSF error: Decoding not possible
Hi all, I need to get the absolute URI from a DOC_ID (TOAHR table), to display an employee photo in the browser. I'm trying with the following FM: SCMS_AO_URL_READ ARCHIVELINK_URL_GENERATE but both returns me sy-subrc = 0, the same URL and the same e