How to drop the contents on an internal table?
Dear all,
can some one suggest me the code to drop the content of an internal table.
VJ
Following are the different ways of DELETIONS from ITAB, DTAB and FILE:
DELETE FROM dbtab WHERE cond.
DELETE FROM (dbtabname) WHERE cond.
- DELETE dbtab.
DELETE *dbtab.
DELETE (dbtabname) ... .
- DELETE dbtab FROM TABLE itab.
DELETE (dbtabname) FROM TABLE itab.
- DELETE dbtab VERSION vers.
DELETE *dbtab VERSION vers.
Delete from an internal table
- DELETE itab.
- DELETE itab INDEX idx.
- DELETE itab FROM idx1 TO idx2.
- DELETE itab WHERE cond.
- DELETE ADJACENT DUPLICATES FROM itab.
Delete a program
- DELETE REPORT prog.
Delete text elements
- DELETE TEXTPOOL prog LANGUAGE lg.
Delete a data cluster from a database table
- DELETE FROM DATABASE dbtab(ar) ...ID key.
Delete a data cluster from the cross-transaction application buffer
- DELETE FROM SHARED BUFFER dbtab(ar) ...ID key.
Delete a file
- DELETE DATASET dsn.
Delete a screen
- DELETE DYNPRO f.
Thanks,
Santosh
Similar Messages
-
How to pass the contents of an internal table to the IDoc FIDCC2?
Hi,
I have an internal table. Using its contents, I have to create an Idoc and do GL posting.
I have to use FIDCC2 Idoc and the function module IDOC_INPUT_FIDCC2.
Can u please let me know how to pass the contents of the internal table into the idoc FIDCC2 and do the GL posting?
Regards,
Balaji. RHi balaji,
use function IDOC_INBOUND_FROM_FILE. This will do half the process.
Documentation is missing, but program RSEINB00 explains something,
also some links
[http://help.sap.com/saphelp_nw70/helpdata/EN/dc/6b7f1543d711d1893e0000e8323c4f/frameset.htm]
[RSEINB00 does not work in background]
[RSEINB00 flat file to idoc uploading in XI]
[Loading flat idoc via report RSEINB00 into integration server fails]
Hope it helps.
Regards,
Clemens -
The contents in a internal table
Hi Experts,
I have a doubt in filling the contents of an internal table with the database table fields reference.
For eg: There is an internal table like this:
data: begin of t_conditions occurs 0,
kschl like rv13a-kschl,
vkorg like komg-vkorg,
kunnr like komg-kunnr,
matnr like komg-matnr,
kbetr(15) type c,
datab(10) type c,
datbi(10) type c,
end of t_conditions.
in the above example, the "matnr" he has taken with the reference field "komg-matnr"..
Please look at the following internal table:
data: begin of t_material occurs 0,
matnr(18) type c,
matkl(9) type c,
bismt(18) type c,
end of t_material.
In the above 2 examples the declaration of "matnr" field is diffrent from one with the other.
in 1st eg., he has taken as: <b>matnr like komg-matnr</b>
where as in the 2nd eg: <b>matnr(18) type c,</b>
my question is: how can i know where to declare as in the 1st eg., and where to use like in the 2nd eg.,
Please clarify.
I greatly appreciate your help.
Thanks,Hi sey
If you see in the domain level both the DOMIAN's will be the same. So it doesn't matter. All the matnr will have a character type of size 18.
for the programmer reference they will using the table name in which they want to select the data.
i.e for the first ex. he will be selecting data from the KOMG table and in the second from the MARA table.
but both the Matnr type are same.
<b>there is a small change since the second ex doesn't use any table it is simply of type c. the difference is when you reference to any Data DICTIONARY object then it can contain certain conversion exits, etc. so it will apply for your reference data typr</b>
regards
kishore
Message was edited by: Harikishore Sreenivasulu -
Wirte the content of an internal table into a text file
Hello Experts,
how can I wirte the content of an internal table into a text file and putit on my local
desktop ?
Regards
ertasHi,
You can use the FM GUI_DOWNLOAD for this purpose.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'c:\testmmv.txt'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = LT_STR
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF SY-SUBRC <> 0.
Implement suitable error handling here
ENDIF.
With regards,
Vamsi -
How to compare the contents of two different tables
hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
example, i have a table named Main List and a table named New List.
The contents of the New List should be compared to the contents of the
Main List, to check if they are equal. I don't have any idea how to manipulate
this data. Hoping for your help. Thanks.it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections
-
How to log the messages in an internal table n display
Hello guys,
This is my first post in SDN.
I am uploading some data from application server. I am doing lot of varifications, based on that I have to display the messages.
So I asked not to use the write statements to display the messages but asked me to create an internal table and display the messages afterwards..
like I am using some BAPI to upload after the bapi call i have to log the result for each record into an internal table and show...
can anyone guide me how to do it?Thanks for your info Azad,
here I am posting my code... can u go through it once and lemme me whether i am in right track or not?
FORM FORM_POST_DATA.
IF X_POST = 'X'.
CALL FUNCTION 'BAPI_ACC_BILLING_POST'
EXPORTING
DOCUMENTHEADER = WA_DOCUMENTHEADER
CUSTOMERCPD = WA_CUSTOMERCPD
IMPORTING
OBJ_TYPE =
OBJ_KEY =
OBJ_SYS =
TABLES
ACCOUNTRECEIVABLE = IT_ACCOUNTRECEIVABLE
ACCOUNTGL = IT_ACCOUNTGL
ACCOUNTTAX = IT_ACCOUNTTAX
CRITERIA =
VALUEFIELD =
CURRENCYAMOUNT = IT_CURRENCYAMOUNT
RETURN = IT_RETURN
SALESORDER =
SALESAMOUNT =
EXTENSION1 = IT_EXTENSION1
LOOP AT IT_RETURN.
MOVE-CORRESPONDING IT_RETURN TO IT_MESSAGES.
ENDLOOP.
ENDIF.
WRITE: / 'Result of Post:'.
WRITE : / REF_TYPE,REF_KEY,REF_SYS.
PERFORM FORM_SHOW_MESSAGES.
ENDFORM. "FORM_POST_DATA
FORM FORM_SHOW_MESSAGES.
IF IT_RETURN[] IS INITIAL.
WRITE: / 'no messages'.
ELSE.
SKIP 1.
LOOP AT IT_RETURN.
WRITE: / IT_RETURN-TYPE,
(2) IT_RETURN-ID,
IT_RETURN-NUMBER,
(80) IT_RETURN-MESSAGE,
IT_RETURN-LOG_NO
IT_RETURN-LOG_MSG_NO
IT_RETURN-MESSAGE_V1
IT_RETURN-MESSAGE_V2
IT_RETURN-MESSAGE_V3
IT_RETURN-MESSAGE_V4
(20) IT_RETURN-PARAMETER,
(3) IT_RETURN-ROW,
IT_RETURN-FIELD.
IT_RETURN-SYSTEM
ENDLOOP.
ENDIF.
ULINE.
ENDFORM. " Show_messages
Nisha... -
How to delete the data inside a internal table?
I got a internal table name g_itab1.
currently my g_itab1 has a FNAME(50) component.
Inside my component there is ADMINO, EYEAR, FIRSTNAME, LASTNAME and CONTACT.
I want to clear away ADMINO, EYEAR, FIRSTNAME, LASTNAME and CONTACT inside my internal table.
How do i clear it? i have tried using CLEAR g_itab1.
It doesn't work.. the data are still inside.hi
DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.
Example to delete all of the lines between 5 and 36 in a table of names where the entry begins with one of the letters 'A' to 'C'.
DELETE itab FROM 5 TO 36 WHERE NAME CA 'ABC'.
reward if useful
regards
sree -
How to read the data from an internal table,when column names are known
Hi All
I have a specific requirement. I got an internal table with many fields (let it be my_tab). Some of the fieldnames (column names in internal table my_tab) are stored in separate internal table(let it be my_fields).
I need to store/read data corresponding to the fields (whose name is stored in my_fields) from my_tab.
I am able to build dynamic table (referred by field-symbol) with respect to the given field names in my_fields.
But i am unable to read the data corresponding to the fieldnames from my_tab.
Please provide me some pointer in this regard.
Regards
Swetabh ShuklaHI All
Thanks for the prompt response. I got solution for my question. Please check below thread. For quick reponse i posted my question in one more category. Thanks to all of you.
How to read internal table w.r.t. fieldnames stored in other table -
How to add the records of 2 internal table records into one file
hello experts,
My scenario is...
I am retrieving the data for the for the credit, debit and trailer records of the customer into 3 different internal tables and finally i have to append all those records into one file first debit records then credit records finally the trailer record.... how to do that can anyone give some idea plzzzzzzzzz..
Plz its bit urgent..
Thanks a lot for your anticipation
SRIHello,
Do like this.
" Assume u have three itab.
"Itab1 - debit
"Itab2 - credit
"Itab3 - Credit.
REPORT ZV_TEST_SERVER .
*PARAMETERS: P_FILE TYPE STRING."RLGRAP-FILENAME.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = P_FILE
* FILETYPE = 'ASC'
APPEND = 'X' " Check here
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = ITAB1
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = P_FILE
* FILETYPE = 'ASC'
APPEND = 'X' " Check here
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = ITAB2 " Check here
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = P_FILE
* FILETYPE = 'ASC'
APPEND = 'X' " Check here
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = ITAB3 " Check here
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
If useful reward.
Vasanth -
How to get the data in one internal table? with 3 different tables..
Hi,
i need to get the all the ff data to put in an internal table. I'm using these data to my ALV. Thanks
vkorg TYPE a005-vkorg,
vtweg TYPE a005-vtweg,
kschl TYPE a005-kschl,
kondm TYPE mvke-kondm,
matnr TYPE a005-matnr,
kdgrp TYPE knvv-kdgrp,
konda TYPE knvv-konda,
kunnr TYPE a005-kunnr,
datab TYPE a005-datab,hi,
try this
*& Report ZPROGRAM
REPORT ZPROGRAM.
table declaration.
tables : zemployee, zdepartment,zproject.
*type-pools declaration
type-pools : slis , icon.
type specification
types : begin of ty_emp,
empid type zempid,
empname type zempname,
empaddress type zempaddress,
city type zcity,
ponumber type zponumber,
detid type zdeptid,
end of ty_emp.
types : begin of ty_dept,
detid type zdeptid,
deptname type zdeptname,
designation type zdesignation,
projectid type zprojectid,
end of ty_dept.
types : begin of ty_project,
projectid type zprojectid,
technology type ztechnology,
clientname type zclientname,
end of ty_project.
types : begin of ty_final,
empid type zempid,
empname type zempname,
empaddress type zempaddress,
city type zcity,
ponumber type zponumber,
detid type zdeptid,
deptname type zdeptname,
designation type zdesignation,
projectid type zprojectid,
technology type ztechnology,
clientname type zclientname,
average type p decimals 2,
end of ty_final.
table type specification.
types : tt_emp type standard table of ty_emp,
tt_dept type standard table of ty_dept,
tt_project type standard table of ty_project,
tt_final type standard table of ty_final.
work area creation.
data : wa_emp type ty_emp,
wa_dept type ty_dept,
wa_project type ty_project,
wa_final type ty_final.
internal table declaration
data : itab_emp type tt_emp,
itab_dept type tt_dept,
itab_project type tt_project,
itab_final type tt_final.
layout declaration
data : gd_layout type slis_layout_alv.
assigning current program name.
data : gd_repid like sy-repid.
gd_repid = sy-repid.
fieldcatalog declaration.
data : d_fieldcat type slis_t_fieldcat_alv,
d_fieldcat_wa type slis_fieldcat_alv.
header declaration.
data : t_header type slis_t_listheader,
wa_header type slis_listheader,
linecount(10) type c,
line(10) type c.
selection-screen.
selection-screen : begin of block blk1 with frame title text-001.
select-options : s_empid for zemployee-empid.
parameters : p_dname like zdepartment-deptname.
parameters : p_proid like zproject-projectid.
selection-screen : begin of line.
parameters : p_rad1 radiobutton group r1.
selection-screen comment 3(10) text-002.
parameters : p_rad2 radiobutton group r1.
selection-screen comment 16(10) text-003.
selection-screen : end of line.
parameters : chk1 as checkbox.
selection-screen : end of block blk1.
end of selection screen.
start of selection.
select empid empname empaddress city ponumber detid from zemployee into corresponding fields of table itab_emp where empid in s_empid.
if not itab_emp is initial.
select detid deptname designation projectid from zdepartment into corresponding fields of table itab_dept for all entries in itab_emp where detid = itab_emp-detid .
if not itab_dept is initial.
select projectid technology clientname from zproject into corresponding fields of table itab_project for all entries in itab_dept where projectid = itab_dept-projectid.
endif.
endif.
*end of selection.
populating data into itab_final from itab_emp.
loop at itab_emp into wa_emp.
wa_final-empid = wa_emp-empid.
wa_final-empname = wa_emp-empname.
wa_final-empaddress = wa_emp-empaddress.
wa_final-ponumber = wa_emp-ponumber.
wa_final-city = wa_emp-city.
wa_final-detid = wa_emp-detid.
append wa_final to itab_final.
clear wa_final.
endloop.
*populating data into itab_final from itab_dept and itab_project
loop at itab_final into wa_final.
read table itab_dept into wa_dept with key detid = wa_final-detid.
if sy-subrc = 0.
wa_final-deptname = wa_dept-deptname.
wa_final-designation = wa_dept-designation.
wa_final-projectid = wa_dept-projectid.
modify itab_final from wa_final transporting deptname designation projectid .
endif.
read table itab_project into wa_project with key projectid = wa_final-projectid.
if sy-subrc = 0.
wa_final-technology = wa_project-technology.
wa_final-clientname = wa_project-clientname.
modify itab_final from wa_final transporting technology clientname.
endif.
endloop.
if p_rad1 = 'X' or chk1 = 'X'.
d_fieldcat_wa-fieldname = 'EMPID'.
d_fieldcat_wa-seltext_l = 'Employee Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 1.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'EMPNAME'.
d_fieldcat_wa-seltext_l = 'Employee Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 2.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'EMPADDRESS'.
d_fieldcat_wa-seltext_l = 'Employee Address'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 3.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CITY'.
d_fieldcat_wa-seltext_l = 'City'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 4.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PONUMBER'.
d_fieldcat_wa-seltext_l = 'Postal Number'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 5.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DETID'.
d_fieldcat_wa-seltext_l = 'Department Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DEPTNAME'.
d_fieldcat_wa-seltext_l = 'Department Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DESIGNATION'.
d_fieldcat_wa-seltext_l = 'Designation'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PROJECTID'.
d_fieldcat_wa-seltext_l = 'Project Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'TECHNOLOGY'.
d_fieldcat_wa-seltext_l = 'technology'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CLIENTNAME'.
d_fieldcat_wa-seltext_l = 'Client Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
endif.
if p_rad2 = 'X' or chk1 = 'X'.
refresh itab_emp.
d_fieldcat_wa-fieldname = 'DETID'.
d_fieldcat_wa-seltext_l = 'Department Id'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DEPTNAME'.
d_fieldcat_wa-seltext_l = 'Department Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DESIGNATION'.
d_fieldcat_wa-seltext_l = 'Designation'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PROJECTID'.
d_fieldcat_wa-seltext_l = 'Project Id'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'TECHNOLOGY'.
d_fieldcat_wa-seltext_l = 'technology'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CLIENTNAME'.
d_fieldcat_wa-seltext_l = 'Client Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
endif.
Grid display function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = gd_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'EMPLOYEE DETAILS'
I_GRID_SETTINGS =
IS_LAYOUT = gd_layout
IT_FIELDCAT = d_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_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
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab_final
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.
set pf_status for creating client specified icons.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'NEWSTATUS'.
endform.
populating data into header using top_of_page
form top_of_page.
wa_header-typ = 'H'.
wa_header-info = 'ALV REPORT'.
append wa_header to t_header.
clear wa_header.
wa_header-typ = 'S'.
wa_header-key = 'Date :'.
Concatenate sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) into wa_header-info.
append wa_header to t_header.
clear wa_header.
wa_header-typ = 'S'.
wa_header-key = 'Time :'.
Concatenate sy-Uzeit(2) '.'
sy-datum+2(2) '.'
sy-datum+4(2) into wa_header-info.
append wa_header to t_header.
clear wa_header.
describe table itab_final lines line.
wa_header-typ = 'A'.
linecount = line.
Concatenate 'Total number of records :' linecount into wa_header-info separated by space.
append wa_header to t_header.
clear wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = t_header
I_LOGO = 'VMCADMIN'
I_END_OF_LIST_GRID =
I_ALV_FORM =
endform.
*designing layout.
form gd_layout.
gd_layout-zebra = 'X'.
gd_layout-edit = 'X'.
gd_layout-no_hotspot = ''.
gd_layout-no_colhead = ''.
gd_layout-colwidth_optimize = 'X'.
endform.
Reward with points if helpful. -
REUSE_ALV_GRID_DISPLAY , how to pass the 'tick' button to internal table
hi all i have coded:
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
chk(1),
END OF itab.
SELECT vbeln
posnr
FROM vbap
UP TO 20 ROWS
INTO TABLE itab.
x_fieldcat-fieldname = 'CHK'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-checkbox = 'X'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = 'VBELN'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_layout-window_titlebar = 'Popup window'.
x_events-name = slis_ev_end_of_page.
x_events-form = 'END_OF_PAGE'.
APPEND x_events TO it_events.
CLEAR x_events .
x_events-name = slis_ev_top_of_page.
x_events-form = 'TOP_OF_PAGE'.
APPEND x_events TO it_events.
CLEAR x_events .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
i_callback_pf_status_set = 'STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
it_events = it_events
I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 50
I_SCREEN_END_LINE = 20
TABLES
t_outtab = itab
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.
itab-chk is a check button, after execute for the second time, i need to get this ticked button to perform upload transaction..how to pass the ticked button inside itab ?just loop at itab and pass X to chk
loop at itab into wa_itab.
wa_itab-chk = 'X'.
modify itab from wa_itab.
endloop. -
How to transport the content of a DDIC table with FM TRINT_REQUEST_CHOICE
Hi
I have created a table and added some data rows in the table.
I need to transport the added data rows of the table with FM TRINT_REQUEST_CHOICE.
How can I do it?
which type of request shall I use? workbench request or customizing request?
Thanks a lot!Hello Frank
Assuming that you have not defined your Z-table as Customizing table but as application table (-> see delivery class) then I think a workbench request will do the job.
However, you can do a quick smoke test:
Create a workbench request and enter the transport object entry R3TR TABU <name of z-table> manually. If the system allows this you are on the safe side.
Next enter key entry (e.g. 100* = all entries from client 100) and release the request.
If you can see the selected entries in the export log of the request then everything is ok.
Regards
Uwe -
How to move the contents of an itab from one class to another...
Hello Experts,
How can I move the contents of an internal table for a given class to another class.
I want to transfer the contents of my internal table lt_vbak to another class
which is lcl_get_docflow. Below is my code:
REPORT zsd_orderstage
NO STANDARD PAGE HEADING.
* Data Dictionary Table/s *
TABLES: vbak.
* Global Structure/s *
TYPES: BEGIN OF t_output,
salesgroup type vbak-vkgrp,
salesorder TYPE vbak-vbeln,
custcode TYPE vbak-kunnr,
shipto TYPE likp-kunnr,
creation_date TYPE vbak-erdat,
created_by TYPE vbak-ernam,
delorder TYPE likp-vbeln,
invnumber TYPE vbrk-vbeln,
END OF t_output.
* Global Internal Table/s *
DATA: gt_output TYPE STANDARD TABLE OF t_output.
* SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_kunnr TYPE vbak-kunnr OBLIGATORY.
SELECT-OPTIONS: s_group for vbak-vkgrp,
s_auart FOR vbak-auart,
s_erdat FOR vbak-erdat OBLIGATORY,
s_ernam FOR vbak-ernam.
SELECTION-SCREEN END OF BLOCK b1.
* CLASS lcl_main DEFINITION
CLASS lcl_main DEFINITION ABSTRACT.
PUBLIC SECTION.
TYPES: BEGIN OF t_vbak,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
ernam TYPE vbak-ernam,
auart TYPE vbak-auart,
kunnr TYPE vbak-kunnr,
vkgrp type vbak-vkgrp,
END OF t_vbak.
TYPES: BEGIN OF t_vbfa,
vbelv TYPE vbfa-vbelv,
vbeln TYPE vbfa-vbeln,
vbtyp_n TYPE vbfa-vbtyp_n,
END OF t_vbfa.
TYPES: BEGIN OF t_likp,
vbeln TYPE likp-vbeln,
kunnr TYPE likp-kunnr,
END OF t_likp.
TYPES: BEGIN OF t_vbrk,
vbeln TYPE vbrk-vbeln,
END OF t_vbrk.
DATA: gt_vbfa TYPE STANDARD TABLE OF t_vbfa,
gt_likp TYPE HASHED TABLE OF t_likp
WITH UNIQUE KEY vbeln,
gt_vbrk TYPE HASHED TABLE OF t_vbrk
WITH UNIQUE KEY vbeln,
gt_delivery TYPE STANDARD TABLE OF t_vbfa,
gt_invoice TYPE STANDARD TABLE OF t_vbfa.
ENDCLASS. "lcl_main DEFINITION
* CLASS lcl_get_so DEFINITION
CLASS lcl_get_so DEFINITION INHERITING FROM lcl_main.
PUBLIC SECTION.
DATA: lt_vbak TYPE STANDARD TABLE OF t_vbak.
METHODS: get_sales_orders
RETURNING
value(re_vbak) TYPE t_vbak.
ENDCLASS. "lcl_get_so DEFINITION
* CLASS lcl_get_so IMPLEMENTATION
CLASS lcl_get_so IMPLEMENTATION.
METHOD get_sales_orders.
SELECT vbeln erdat ernam auart kunnr vkgrp
FROM vbak
INTO TABLE lt_vbak
WHERE erdat IN s_erdat
AND ernam IN s_ernam
AND auart IN s_auart
AND kunnr = p_kunnr.
ENDMETHOD. "get_sales_orders
ENDCLASS. "lcl_get_so IMPLEMENTATION
* CLASS lcl_get_docflow DEFINITION
CLASS lcl_get_docflow DEFINITION INHERITING FROM lcl_main.
PUBLIC SECTION.
DATA: lt_vbfa TYPE STANDARD TABLE OF t_vbfa.
METHODS: get_subsequent_docs
IMPORTING
value(im_vbak) TYPE t_vbak
EXPORTING
ex_vbfa TYPE t_vbfa.
ENDCLASS. "get_docflow INHERITING FRO
* CLASS lcl_get_docflow IMPLEMENTATION
CLASS lcl_get_docflow IMPLEMENTATION.
METHOD get_subsequent_docs.
ENDMETHOD. "get_subsequent_docs
ENDCLASS. "get_docflow IMPLEMENTATION
* Global Internal Table/s *
START-OF-SELECTION.
DATA: o_get_so TYPE REF TO lcl_get_so,
o_get_docflow TYPE REF TO lcl_get_docflow.
CREATE OBJECT: o_get_so,
o_get_docflow.
CALL METHOD o_get_so->get_sales_orders.
What I want is to pass the records of lt_vbak to method get_subsequent_docs. How do I do this guys?Thank you and take care!.
-
How to clear the contents of table control
Hi All,
How to clear the contents that are present in a Table control. If there is any code Please Let me know.
I will assign full marks to the correct code.
Pradeep Kumar Kota.Hi
U need to clear the contenents of internal table used to store the record displayed by table control.
Every time the PBO is triggered the table control is automatically cleared, so you need only not to transfer any data from internal table to table control.
So you should show how your PBO if you want a right answer.
Max -
How to execute the content of varchar as query
Hi everyone!
I did a PL/SQL region in apex, in this region I did the query which is storaged in a variable; it was did it concatenate several times,
in the procedure I have several sentences.
I thought that the command 'execute immediate' would get a good result but it do not print the result.
declare
variable varchar2(1000);
begin
--sentences
--execute inmmediate( variable );
--return variable
end;
I only want to how to execute the content of varchar variable.
For example, suppose that the result of this procedure is
'SELECT SYSDATE FROM DUAL'
How and what do I must do for this query execute like a normal query that is in apex?
I expect your prompt reply.
Thank you for your help.
Best regardsErik,
Try dropping this into a PL/SQL region
DECLARE
v_result VARCHAR2(500);
BEGIN
SELECT SYSDATE
INTO v_result
FROM DUAL;
htp.prn(v_result);
END;
{code}
use the htp.prn command to write html you want to display. In this case we are just writing the date to the screen.
Good luck,
Tyson
Maybe you are looking for
-
Importing to Discussion Board Post from legacy source
Hi All, Im sure im not the first to wonder or ask this question but here it goes. We have recently moved out intranet to SharePoint 2013. We have rebuilt from the ground up using many of the out of box solutions as well as some third party apps and w
-
When installing Quicktime, I get the error message that says C:\Documents~1\Megan\Locals~1\Temp\IXP972.TMP\ cannot be found and that the old version cannot be removed. Ive tried finding this file, deleting temporary files and nothing works. Any sugge
-
Re: Open box deal was not as much of a deal as we were told
I just purchased a Lenovo Yoga2 Open box. The people at the store were completely uninformed about the item. They said it was a returned item and in original condition. When I pointed out some scratches on the laptop and onthe mouse pad, they said th
-
How to skip the job during 12.1.1 upgrade automatically
Hi All, We have completed our upgrade to R12.1.3 from 11.5.10.2 and during the upgrade process we have come across a worker failure for MSDOPDCODE.sql as below ERROR at line 1: ORA-33292: Insufficient permissions to access analytic workspace APPS.ODP
-
The App store stalls and crashes
I been trying since yesterday to do the following updates: the Safari 6.1, Remote Desktop Client update 3.7.0, Itunes 11.1.2 and the OSX Mavericks to no avail. Im using a Mac Mini 2011with OSX 10.8.5, Memory 8 Gb, HD 500 GB available 159.45, and I wa