Attach document from Data Base Table Document in email attachment Option
HI Friends,
i have create an email option in my application .i have a table CRM_DOC_FILE.this table have collection of all document file.
i want to send an email with attchment but i want to attch file from my table Named CRM_DOC_FILE ,so i have created an report region with list of all documents .i want jus a button in last column in this report when i click on this button then corresponding document should be attch ,i want to attch more then one document .
How can i attch a button in last column in report where i would be click on this button to attch documents.
How can i attch documents click on Attch button.
how can i do this.
i have ctreated a Dummy Application
Workspace: SKILLS IMPROVE
User: [email protected]
Password :desomu
Application: 42370
page No 4 For Sending email .
Thanks
Edited by: 805629 on Nov 28, 2010 11:36 PM
PLEASE DO NOT POST THE SAME QUESTION MULTIPLE TIMES.... Please see the OTHER version of this question for a possible solution. Please close one of these questions, so others do NOT waste their time answering multiple versions of your questions..
Thank you,
Tony Miller
Webster, TX
Similar Messages
-
Util class to extract Data from Data base Table.
Is there any Util class to extract all records from Data base table into DAT file.For example(get all amployees from EMPLOYEE table in to employee.DAT )
What is a DAT file?
Anyway, this can be achieved using a shot of JDBC [1] and some business logic [2] to populate/group/concat the data together in a DAT format and writing [3] it to that DAT file.
[1] JDBC tutorial: http://www.google.com/search?q=jdbc+tutorial+site:sun.com
[2] Use your brains and things you ever learnt in maths and basic Java tutorials/books.
[3] I/O tutorial: http://www.google.com/search?q=io+tutorial+site:sun.com -
UNIQUE Problem in pulling DATA from DATA base table to internal table
Dear Experts,
I am new to ABAP. I have a very basic question but looks a quite puzzling one to me. Hemnce I am posting it here.
I am facing an unique problem in pulling data from database table and populating that data into internal table for further use.
The data in the database table "Zlt_mita" with fields M1 (Employee Name, Type: Char20) and M2 (Employee Code, Type Char7) are:
Plz refer the screenshot in the attached file:
My Code:
1) When I try to pull data from Dbase table by taking M2 as parameter.
This code is succcessful and I am able to populate data in internal table it_dat.
TYPES: Begin Of ty_DAT,
M1 TYPE Zlt_mita-M1,
M2 TYPE ZLT_mita-M2,
END OF ty_DAT.
DATA: it_dat TYPE STANDARD TABLE OF ty_dat with header line,
wa_dat TYPE ty_dat.
PARAMETERS: p_mitar TYPE Zlt_Mita-M2.
SELECT M1
M2
FROM ZLt_mita
INTO TABLE it_dat
Where M2 = p_mitar.
Loop at it_dat into wa_dat.
WRITE:/2 wa_dat-M1,
10 wa_dat-M2.
ENDLOOP.
2) When I try to pull data from Dbase table by taking M1 as parameter.
This code is NOT succcessful and I am NOT able to populate data in internal table it_dat.
TYPES: Begin Of ty_DAT,
M1 TYPE Zlt_mita-M1,
M2 TYPE ZLT_mita-M2,
END OF ty_DAT.
DATA: it_dat TYPE STANDARD TABLE OF ty_dat with header line,
wa_dat TYPE ty_dat.
PARAMETERS: P_Mita TYPE ZLT_Mita-M1.
SELECT M1
M2
FROM ZLt_mita
INTO TABLE it_dat
Where M1 = P_Mita.
Loop at it_dat into wa_dat.
WRITE:/2 wa_dat-M1,
10 wa_dat-M2.
ENDLOOP.
Why is this happening when both M1 and M2 are Type Character fields.
Looking forward for your replies.
Regards
Chandan KumarHi Chandan ,
Database fetch is case sensitive ,So u need to give exact format in where condition.
Make your parameter and database in same case so that you need not worry about case sensitivity .
Check the lowecase check box in the domain .
Then declare your parameter
PARAMETERS:
P_Mita
TYPE ZLT_Mita-M1 LOWER CASE .
You can do the vice versa also by unchecking lowercase and giving Upper case instead of lower in parameter declartion .
Regards ,
Juneed Manha -
How to populate last 10 records from data base table
Hi,
My requirement is to populate last 10 transfer order items confirmed from LTAP. as the table is too large there is no point to fetch all the records and filter them...
Please let me know better way (in terms of performace) to get last 10 records from LTAP.
Thanks in advance.
NagHi brother,
the following code is working......(sample code)
data itmara type mara occurs 0 with header line.
select matnr from mara into corresponding fields of table itmara up to 20 rows.
sort itmara descending by matnr.
loop at itmara .
write:/ itmara-matnr.
if sy-tabix = 10.
exit.
endif.
endloop.
plz reward with maximum points
Edited by: sreejith gn on May 13, 2008 12:52 PM -
Where can get IDOC Error Message from Data base tables
Hi ,
i am automating idoc checking process,in which i am getting control record from EDIDC tables,now i need to fetch Error message
using this idoc no.
How can fetch error message text ?
Thanks in advance.
Regards
sarathHi its a structure, it doesnt store data.
Take it from the table specified,
Pass STAMID,STAMNO,STAPA1,STAPA2,STAPA3,STAPA4 to function module MESSAGE_PREPARE and you will get the message text.
Also check the function module IDOC_READ_COMPLETELY -
Copy data from data base table
Hello friends,
I have some data in a Z-table in QAS. I want to copy all the data from QAS to the table in SDV. Is there way that I can copy without writing a program.
Thanks in advance,
Shejal.hi,
use se09-display object list
insert new line with:
R3TR TABU "ZTAB01"
-> insert key:
Mandt = sy-mandt
and key = *
A.
Message was edited by:
Andreas Mann -
Get the data from data base tables
Hi ..
Iam preparing quotation layout . In that i have to display the address in address window form two tables, means i have to get the address by using two tables like have to select the data from that tables ...
How can i do that one?
Can anybody expalin abt that pls...
Regards,
pandu.Hello,
If you are looking at fetching the adress details for partner function(Say Ship to, Sold to , payer etc) in the quotation, then you can proceed like this:
Take the Quotataion number and the item number and the respective partner function say PY for payer etc and then Go to VBPA table and fetch field ADRNR from the table for this partner. With this ADRNR call the FM ADDR_SELECT_ADRC_SINGLE and as an output of this FM, you will get address details.
Regards
<b>Reward points if useful</b>
Saket Sharma
Saket Sharma -
Selecting data from data base tables into itab with multiple select queries
Hi all,
i am dealing with a situation where in there is 3 DB tables in all say
1. ITAB - ZTBL_MAIN.
2. DB table - ZTBL_SUB1.
3. DB table - ZTBL_SUB2.
ZTBL_MAIN contains feilds from both tables 2 and 3 so to choose some records from ZTBL_SUB1 into the ITAB a select query has been written as below.
SELECT * FROM ZTBL_SUB1 INTO CORRESPONDING FIELDS OF TABLE ZTBL_MAIN
WHERE <condition>.
now i also want some feilds in main for each record to be filled from the other DB table for which if i use another select query after the above one in my report prog. say..
SELECT * FROM ZTBL_SUB2 INTO CORRESPONDING FIELDS OF TABLE ZTBL_MAIN
WHERE <condition>.
then all the previous records are going to be erased..Kindly let me know a way in which i can implement the above implementation.
Thanks&Rgds,
Naveen Mhi,
Ur suggestions solved the syntax error. However my intial problem was not solved i.e., using the statement
SELECT * FROM ztbl_sub2 APPENDING CORRESPONDING FIELDS OF TABLE ztbl_main FOR ALL ENTRIES IN ztbl_main
WHERE <field1> = ztbl_main-<field1>.
creates or appends some more entries into the itab thats all.. But that is not what i am trying to implement.
As explained before the first select query would have filled certain fields for all records in ztbl_main from ztbl_sub1.
Now in the second select query i want to fill other fields of ztbl_main for all the records already fetched using first select query by using my where condition.
The above select query that was suggested only creates new records in the table ztab_main but does not fill the fields of the records as i expected.
how do i fullfil my requirment..
kindly help.
thnks & Rgds,
Naveen M -
When to refresh Servlet data from Data Base
Hello all,
I have a servlet that retrive few hundreds thousands records from data base table.
The data in data base table being updated once or twice in every week.
Since same servlet instance serve all users, that access the servlet many times a day.
I would like to avoid retriving the data from data base on each servlet access.
and make the users use same data already retrieved and kept in servlet members.
First, what is the best way to avoid data retrive from data base on each servlet access?
and how could I have some kind of trigger that will refresh servlet data from data base every few days?
Thanks in advance for every idea.
AmiJava_A wrote:
Thanks Saish for your reply.
I'm not using DAO in my application but retrive the data from BI data base using a web service. response time querying the BI data base is not quick enuogh.
Since, I wouldn't want to query the BI server on each servlet access.
Because the data I retrived at the begining using the web service contains all required data for all servlet requests, I thought to store the data (~200K rows) once in the servlet which will be using for all requests.
Why not store the results locally in your own database after you fetch them?
This still leave me with the questions: in which event should I query the BI data, and also when or in which event should I update the data again from BI server?
Query at startup, an user demand, when data becomes stale. It depends on your requirements.
>
Thanks
Ami- Saish -
How to insert data from different internal table into a data base table
hi all,
I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
in short i want to do something like the foll:
INSERT INTO ZMIS_CODES-CODE VALUE '1'.
*INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)REPORT ZINSERT.
tables kna1.
data: itab LIKE KNA1.
data lv_kUNAG LIKE KNA1-KUNNR.
lv_kuNAG = '0000010223'.
ITAB-kuNNR = lv_kuNAG.
ITAB-name1 = 'XYZ'.
INSERT INTO KNA1 VALUES ITAB.
IF SY-SUBRC = 0.
WRITE:/ 'SUCCESS'.
ELSE.
WRITE:/ 'FAILED'.
ENDIF.
Here lv_kunag is ref to kna1 kunnr passed in different name
In internal table .
Try and let me know if this logic dint work. -
Fields comming from which data base tables
Hi Experts,
Every extractor should fetch data from some data base table. For generic data source and LO data source I know to see but could you please tell me, how I can find for business content (ex: 0FI_GL_4) data source which field data coming from which data base table.
Regards
Lokanatha.Hi,
We can get from SAP help about the tables being used in each business content extractor.
For Eg-0fi_gl_4, data coming from BKPF,BSEG tables.
Go thru this link which tells the table for the above extractor..
http://help.sap.com/saphelp_nw70/helpdata/en/8b/02f93abb013b0de10000000a114084/content.htm
Hope this helps..
Thanks & Regards,
Pradeep -
How to stored data after clicking check box save in data base table
TABLES:mseg,mard,mkpf.
TYPE-POOLS:slis.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
smatnr FOR mseg-matnr MODIF ID m2,
swerks FOR mard-werks MODIF ID m3,
slgort FOR mard-lgort MODIF ID m4,
slgpbe FOR mard-lgpbe MODIF ID m5,
scharg FOR mseg-charg MODIF ID m6,
sbwart FOR mseg-bwart MODIF ID m7,
skostl FOR mseg-kostl MODIF ID m8,
saufnr FOR mseg-aufnr MODIF ID m9,
srsnum FOR mseg-rsnum MODIF ID m10.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
pse RADIOBUTTON GROUP radi,
bps RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETER:layout TYPE i.
SELECTION-SCREEN END OF BLOCK b3.
DATA:BEGIN OF itab OCCURS 0,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mard-werks,
lgort LIKE mard-lgort,
lgpbe LIKE mard-lgpbe,
charg LIKE mseg-charg,
bwart LIKE mseg-bwart,
budat LIKE mkpf-budat,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
kostl LIKE mseg-kostl,
aufnr LIKE mseg-aufnr,
rsnum LIKE mseg-rsnum,
checkbox TYPE c,
END OF itab.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
gw_fieldcat TYPE slis_fieldcat_alv,
gt_layout TYPE slis_layout_alv.
START-OF-SELECTION.
SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
msegmenge msegmeins msegkostl msegaufnr mseg~rsnum
INTO TABLE itab FROM
mseg JOIN mard ON mardmatnr EQ msegmatnr
JOIN mkpf ON msegmblnr EQ mkpfmblnr
WHERE mseg~matnr IN smatnr.
IF sy-subrc EQ 0.
SORT itab BY matnr.
PERFORM display_alv_output.
ENDIF.
*& Form display_alv_output
text
--> p1 text
<-- p2 text
FORM display_alv_output.
REFRESH gt_fieldcat.
gw_fieldcat-fieldname = 'MBLNR'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 1.
gw_fieldcat-seltext_m = 'material document'.
gw_fieldcat-key = 'x'.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'MATNR'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 2.
gw_fieldcat-seltext_m = 'material'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'WERKS'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 3.
gw_fieldcat-seltext_m = 'plant'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'LGORT'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 4.
gw_fieldcat-seltext_m = 'storage location'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'LGPBE'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 5.
gw_fieldcat-seltext_m = 'storage bin'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'CHARG'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 6.
gw_fieldcat-seltext_m = 'Batch number'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'BWART'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 7.
gw_fieldcat-seltext_m = 'Movement Type (Inventory Management)'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'BUDAT'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 8.
gw_fieldcat-seltext_m = 'Posting Date in the Document'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'MENGE'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 9.
gw_fieldcat-seltext_m = 'QUANTITY'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'MEINS'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 10.
gw_fieldcat-seltext_m = 'Basic unit of measure'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'KOSTL'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 11.
gw_fieldcat-seltext_m = 'Cost center'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'AUFNR'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 12.
gw_fieldcat-seltext_m = 'Order Number'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = 'RSNUM'.
gw_fieldcat-tabname = 'itab'.
gw_fieldcat-col_pos = 13.
gw_fieldcat-seltext_m = 'Number of Reservation / Depe'.
gw_fieldcat-key = ' '.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
gw_fieldcat-col_pos = 14.
gw_fieldcat-fieldname = 'CHECKBOX'.
gw_fieldcat-seltext_m = 'Compltd'.
gw_fieldcat-checkbox = 'X'.
gw_fieldcat-edit = 'X'.
APPEND gw_fieldcat TO gt_fieldcat.
CLEAR gw_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZREPORT'
IS_LAYOUT = gt_layout
IT_FIELDCAT = gt_fieldcat
TABLES
t_outtab = itab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " display_alv_output
this is mycode .
send me replay.Hi Lakshmi,
Can u explain briefly what is ur requirement. U mean to say that after clicking the checkbox in data base table or Screen?
Regards,
Jayaram... -
How to know who has created a particular record in the data base table
Hi All...
Can any one tell me how to track the information about who has entered the records in to the data base table....
Thanks in advance...You could check the Created By and Created On fields if your tables contains these fields.
OR
You could check the table DBTABLOG if table logging is enabled for the table
OR
You could check the Change document tables CDHDR and CDPOS.
-Kiran
Please mark useful answers -
How to stored data after clicking checkbox in data base table
REPORT ZT .
TYPE-pools: slis.
tables:mkpf,mseg,mard,COWB_COMP,ZTABLE.
Types:BEGIN OF tp_data,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mard-werks,
lgort LIKE mard-lgort,
lgpbe LIKE mard-lgpbe,
charg LIKE mseg-charg,
bwart LIKE mseg-bwart,
budat LIKE mkpf-budat,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
kostl LIKE mseg-kostl,
aufnr LIKE mseg-aufnr,
rsnum LIKE mseg-rsnum,
endkz like COWB_COMP-endkz,
END OF tp_data,
tp_tbl_data TYPE STANDARD TABLE OF tp_data.
MODIFIED*******************
DATA: WA TYPE TP_DATA.
MODIFIED*******************
*data: t_data like Y00_MM_ISSUE_DAT occurs 0 with header line.
Constants
Data objects (variable declarations and definitions)
Report data to be shown.
DATA: it_data TYPE STANDARD TABLE OF tp_data.
MODIFIED*******************
DATA : V_REPID LIKE SY-REPID.
MODIFIED*******************
Heading of the report.
DATA: t_heading TYPE slis_t_listheader.
*========================== Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
smatnr FOR mseg-matnr MODIF ID m2,
swerks FOR mard-werks MODIF ID m3,
slgort FOR mard-lgort MODIF ID m4,
slgpbe FOR mard-lgpbe MODIF ID m5,
scharg FOR mseg-charg MODIF ID m6,
sbwart FOR mseg-bwart MODIF ID m7,
skostl FOR mseg-kostl MODIF ID m8,
saufnr FOR mseg-aufnr MODIF ID m9,
srsnum FOR mseg-rsnum MODIF ID m10.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
pse RADIOBUTTON GROUP radi,
bps RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETER:layout TYPE i.
SELECTION-SCREEN END OF BLOCK b3.
MODIFIED*******************
INITIALIZATION.
V_REPID = sy-repid.
MODIFIED*******************
*=========================== Event Blocks
AT selection-SCREEN.
start-OF-selection.
PERFORM get_data USING it_data.
END-OF-selection.
PERFORM build_alv USING it_data t_heading.
*=========================== Subroutines
*& Form get_data
Gets the information to be shown in the report.
FORM get_data USING t_data TYPE tp_tbl_data.
SELECT msegmblnr msegmatnr mardwerks mardlgort mard~lgpbe
msegcharg msegbwart mkpf~budat
msegmenge msegmeins msegkostl msegaufnr mseg~rsnum
INTO CORRESPONDING FIELDS OF TABLE t_data
FROM mseg
JOIN mard ON mardmatnr EQ msegmatnr
JOIN mkpf ON msegmblnr EQ mkpfmblnr
WHERE mseg~matnr IN smatnr.
ENDFORM. " get_data
*& Form build_alv
Builds and display the ALV Grid.
FORM build_alv USING t_data TYPE tp_tbl_data
t_heading TYPE slis_t_listheader.
ALV required data objects.
DATA: w_title TYPE lvc_title,
w_comm TYPE slis_formname,
w_status TYPE slis_formname,
x_layout TYPE slis_layout_alv,
t_event TYPE slis_t_event,
t_fieldcat TYPE slis_t_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv.
REFRESH t_fieldcat.
REFRESH t_event.
REFRESH t_sort.
CLEAR x_layout.
CLEAR w_title.
Field Catalog
PERFORM set_fieldcat2 USING:
1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space
space space space space space space t_fieldcat ,
2 'MATNR' 'MATNR' 'MSEG' space space space space space space
space space space space space space t_fieldcat ,
3 'WERKS' 'WERKS' 'MARD' space space space space space space
space space space space space space t_fieldcat,
4 'LGORT' 'LGORT' 'MARD' space space space space space space
space space space space space space t_fieldcat ,
5 'LGPBE' 'LGPBE' 'MARD' space space space space space space
space space space space space space t_fieldcat ,
6 'CHARG' 'CHARG' 'MSEG' space space space space space space
space space space space space space t_fieldcat ,
7 'BWART' 'BWART' 'MSEG' space space space space space space
space space space space space space t_fieldcat,
8 'BUDAT' 'BUDAT' 'MKPF' space space space space space space
space space space space space space t_fieldcat,
9 'MENGE' 'MENGE' 'MSEG' space space space space space space
space space space space space space t_fieldcat,
10 'MEINS' 'MEINS' 'MSEG' space space space space space space
space space space space space space t_fieldcat,
11 'KOSTL' 'KOSTL' 'MSEG' space space space space space space
space space space space space space t_fieldcat,
12 'AUFNR' 'AUFNR' 'MSEG' space space space space space space
space space space space space space t_fieldcat,
13 'RSNUM' 'RSNUM' 'MSEG' space space space space space space
space space space space space space t_fieldcat,
14 'ENDKZ' 'ENDKZ' 'COWB_COMP' space space 'select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
Layout
x_layout-zebra = 'X'.
Top of page heading
PERFORM set_top_page_heading USING t_heading t_event.
Events
PERFORM set_events USING t_event.
GUI Status
w_status = ''.
User commands
w_comm = 'USER_COMMAND'.
Order
Example
PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
PERFORM set_order USING 'MBLNR' 'IT_DATA' 'X' space 'X' t_sort.
PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
Displays the ALV grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = V_REPID
it_fieldcat = t_fieldcat
is_layout = x_layout
it_sort = t_sort
i_callback_pf_status_set = w_status
i_callback_user_command = w_comm
i_save = 'X'
it_events = t_event
i_grid_title = w_title
TABLES
t_outtab = t_data
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. " build_alv.
*& Form set_top_page_heading
Creates the report headings.
FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
t_events TYPE slis_t_event.
DATA: x_heading TYPE slis_listheader,
x_event TYPE LINE OF slis_t_event.
Report title
CLEAR t_heading[].
CLEAR x_heading.
x_heading-typ = 'H'.
x_heading-info = 'Reporte Prueba'(001).
APPEND x_heading TO t_heading.
Program name
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Program: '.
x_heading-info = sy-repid.
APPEND x_heading TO t_heading.
User who is running the report
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'User: '.
x_heading-info = sy-uname.
APPEND x_heading TO t_heading.
Date of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Date: '.
WRITE sy-datum TO x_heading-info.
APPEND x_heading TO t_heading.
Time of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Time: '.
WRITE sy-uzeit TO x_heading-info.
APPEND x_heading TO t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-FORM = 'TOP_OF_PAGE'.
APPEND x_event TO t_events.
ENDFORM.
*& Form set_events
Sets the events for ALV.
The TOP_OF_PAGE event is alredy being registered in
the set_top_page_heading subroutine.
FORM set_events USING t_events TYPE slis_t_event.
DATA: x_event TYPE LINE OF slis_t_event.
Example
clear x_event.
x_event-name = .
x_event-form = .
append x_event to t_event.
ENDFORM.
*& Form set_order
Adds an entry to the order table.
FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
t_sort TYPE slis_t_sortinfo_alv.
DATA: x_sort TYPE slis_sortinfo_alv.
CLEAR x_sort.
x_sort-fieldname = p_fieldname.
x_sort-tabname = p_tabname.
x_sort-UP = p_up.
x_sort-down = p_down.
x_sort-subtot = p_subtot.
APPEND x_sort TO t_sort.
ENDFORM. "set_order
*& Form set_fieldcat2
Adds an entry to the field catalog.
FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname
p_ref_tabname
p_outputlen p_noout
p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
p_hotspot p_showasicon p_checkbox p_edit
p_dosum
t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-col_pos = p_colpos.
wa_fieldcat-no_out = p_noout.
wa_fieldcat-HOTSPOT = p_hotspot.
wa_fieldcat-CHECKBOX = p_checkbox.
wa_fieldcat-ICON = p_showasicon.
wa_fieldcat-do_sum = p_dosum.
Set reference fieldname, tablenam and rollname.
If p_ref_tabname is not given, the ref_fieldname given is a data
*element.
If p_ref_tabname is given, the ref_fieldname given is a field of a
*table. In case ref_fieldname is not given, it is copied from the
*fieldname.
IF p_ref_tabname IS INITIAL.
wa_fieldcat-rollname = p_ref_fieldname.
ELSE.
wa_fieldcat-ref_tabname = p_ref_tabname.
IF p_ref_fieldname EQ space.
wa_fieldcat-ref_fieldname = wa_fieldcat-fieldname.
ELSE.
wa_fieldcat-ref_fieldname = p_ref_fieldname.
ENDIF.
ENDIF.
Set output length.
IF NOT p_outputlen IS INITIAL.
wa_fieldcat-outputlen = p_outputlen.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
IF NOT p_seltext_l IS INITIAL.
wa_fieldcat-seltext_l = p_seltext_l.
ENDIF.
IF NOT p_seltext_s IS INITIAL.
wa_fieldcat-seltext_s = p_seltext_s.
ENDIF.
IF NOT p_reptext_ddic IS INITIAL.
wa_fieldcat-reptext_ddic = p_reptext_ddic.
ENDIF.
IF NOT p_ddictxt IS INITIAL.
wa_fieldcat-ddictxt = p_ddictxt.
ENDIF.
Set as editable or not.
IF NOT p_edit IS INITIAL.
wa_fieldcat-INPUT = 'X'.
wa_fieldcat-EDIT = 'X'.
ENDIF.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. "set_fieldcat2
*& Form top_of_page
Called on top_of_page ALV event.
Prints the heading.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'TRVPICTURE04'
it_list_commentary = t_heading.
ENDFORM. " alv_top_of_page
*& Form user_command
Called on user_command ALV event.
Executes custom commands.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
case sy-ucomm.
WHEN '&DATA_SAVE'.
LOOP AT IT_DATA INTO WA WHERE ENDKZ = 'X'.
IF WA-ENDKZ = 'X'.
*******MODIFIED*********************************
U DELETE THIS CODE N USER UR INSERT CODE TO CHECK
SY-MSGV1 = WA-MBLNR. " U CAN DELETE
SY-MSGV2 = WA-MATNR. " U CAN DELETE
MESSAGE ID 'BC_BOR' TYPE 'I' NUMBER '888' " U CAN DELETE
WITH SY-MSGV1 SY-MSGV2. " U CAN DELETE
*******MODIFIED*********************************
INSERT ZTABLE.
ENDIF.
endloop.
ENDCASE.
ENDFORM. "user_command
this is my code, database will stored in fields only.data is empty,
how to slove that one,send any sugestion.Hi Lakshmi,
Can u explain briefly what is ur requirement. U mean to say that after clicking the checkbox in data base table or Screen?
Regards,
Jayaram... -
How to modify a data base table ?
Hi,
i am working on a list output where if user is editing a field and that field need to be updated in the data base. table is a z table .
the table has 5 fields .
mandt key field
matnr key field
werks key field
charg key field
lgpla key field
usnam
edate
in the list output , the user will change the values in the lgpla field and that field need to be changed in the data base table.
i have used the stmt :
modify< table> from <internal table> ,
but a new record is added in the data base instead of overwriting the existing one.
but the record can be seen modified in the internal table.
kinldy let me know the method of updating or modifying the existing value in the data base.
thanks and regards,
vikram.Hi,
Its not possible to change Primary Key contents in the database.
it mention in documentation of MODIFY Statement,
a line is searched for in the database table that has the same content
in the primary key as the corresponding beginning part of the work area.
If such a line is not found,
a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found,
this line is overwritten according to the same rules as for the UPDATE statement
if you want insert the modified line first Delete from database,Then Use Modify Statement
Regards,
Raghava Channooru
Maybe you are looking for
-
Exchange 2007 on Windows 2008R2 with Windows 2012 DC
Hi All, I am going to update DC from Windows 2003 Sp2 to Windows 2012 R2 (Add a new Windows 2012 DC at first and turn off Windows 2003 DC after). Just think about our Exchange server, which is Exchange 2007 SP3 (08.03.0297.001) on Windows 2008R2 SP1.
-
Unable to check-in & check-out
Hi, I have subversion client 1.7 and OPA 10.2 installed on my system. The subversion has been detected automatically by OPM . Now the problem is that I have checked in a project into the repository. Now when I try to check out a file then the svn giv
-
Problem exporting large QT files in Premiere
I have Adobe Premiere (a recent edition - not sure if it's Pro but close) and I am trying to export a movie from my timeline into a Quicktime file. On smaller files (say, under 3 minutes) it works fine, no errors, and the QT files play fine. But anyt
-
How can I get the address bar to just display URLs?
With the newest update to Firefox when I type something in the address bar I get more search suggestions than URL suggestions. I only want URL suggestions and want to turn the search off completely. I've tried turning off the "keyword:enable" on the
-
How can i download flash player to my nook?
HOw can I download flash player to my nook?