Corresponding R/3 table.
Hi All,
I have a R/3 Quantity field thats populating another quantity field in BW. I think its getting the wrong numbers. How can go back to R/3 to check if the numbers match. I have the technical name of the R/3 field but not sure in which table its sitting. How can i find out which table its pulling the data from? wheni checked in the datasource in R/3 i dont see which table it belongs to. How to go abt it?
Thanks in Advance. Any help or pointer would be appreciated and fully rewarded.
Thanks,
Mav.
Hi thanks for the reply. I could get down till the function module. But where would i be able to search the tables associated with the FM/ Wheni click on the where used icon, it shows me programs,classes, BSP application, internet services etc. I want to see what is the table that is being used.
Thanks,
Mav
Similar Messages
-
Why we use INTO CORRESPONDING FIELDS OF TABLE
why we use INTO CORRESPONDING FIELDS OF TABLE
INTO CORRESPONDING FIELDS OF TABLE is transferring the value from select clause to itab where the field names are same.
suppose you have
data : begin of itab occurs 0,
matnr like mara-matnr,
menge like mseg-menge,
lgort like mard-lgort,
end of itab.
select matnr lgort into table from mard where....
it may give an error because you are not filling menge here or it may fetch the value in matnr and menge field.
but if you use INTO CORRESPONDING FIELDS OF TABLE then it will fetch the data to matnr and lgort field only.
INTO CORRESPONDING FIELDS OF TABLE is only matching by name not by datatype be careful.
regards
shiba dutta -
What is the corresponding option for " Table Display" in BI 7 Query Design
Hi Experts,
In 3.x Query Designer we have an Option of " Table Display" to arrange the charesterstics in the Coloums .
Please let me know the corresponding option in BI 7 Query Designer.
Thanks
Bhanuprakash.I think there is no Drill down Fesility in Report Designer. what is the option for a query with Drill down charecterstics.
-
Corresponding entry in table SRRELROLES for Idoc
Hi,
Can anybody please help me how to find the corresponding table entry in table SRRELROLES if I know the Idoc number created in inbound process in SAP R/3 system?
What should be the OBJKEY for the Idoc no?
Thanks & regards,
YogitaHi Yogita,
Check these posts, Which has been answered.
Re: Purchase order IDOC relationship
Re: Need help in Conversion
Regards,
Satish -
Highlighting corresponding rows in table with mouseover
I have a requirement where I need to highlight multiple rows that are logically grouped together in a table. I was thinking of accomplishing this by:
1. Add an invisible column to the table.
2. Set the column's StyleClass in the code to some indicator.
3. Add a client listener to the table/row?? of type mouseover to identify the row being hovered over.
4. In Javascript, select all the rows that have the same StyleClass as the row being hovered over and set their background color.
I am having trouble with step #3 because I am unable to add the client listener to a table/row to identify the row that is hovered over. Note that the user is not clicking on the row so I cannot use the "current row".
If there is no way to identify the row, is there any other way to highlight multiple rows on mouseover?
I am using JDeveloper 11.1.1.5.
Thanks.Hi Frank, I tried adding the clientListener to each cell renderer component but the problem I noticed with that was that the cell components do not always occupy the entire width of the column so the user has to hover over the cell which may be a tiny part of the cell.
I did however find an alternate solution using JQuery. So instead of adding the client listeners to each component, I added a JQuery .hover() function on document load. Below is the javascript that is loaded on the page load.
<af:resource type="javascript">
function initialize()
//the class name that will be looked at in the DOM and highlighted
var classToHighlight = "";
//TODO will need to use .live("hover") if using PPR on the page
$('.columnClass').hover(
function(data)
$($(this).attr('class').split(' ')).each(function()
if (this !== '')
if ( this.indexOf("bgHighlightClass") == 0 )
classToHighlight = this;
$("." + classToHighlight).css('background-color', 'orange');
function(data)
$("." + classToHighlight).css('background-color', 'white');
classToHighlight = "";
</af:resource>
<af:clientListener method="initialize" type="load"/> -
SELECT .... INTO CORRESPONDING - Internal table
How do everyone,
I have the following work areas and internal table defintion:
TYPES: BEGIN OF equi_rec,
equnr, " Registration
herst, " Make
typbz, " Model
zzdept, " Department
zzoperator, " Operator
zzregdate, " Registration Date
END OF equi_rec.
DATA: equi_wa TYPE equi_rec,
equi_tab TYPE TABLE OF equi_rec.
In the code:
SELECT *
INTO CORRESPONDING FIELDS OF TABLE equi_tab
FROM
equi.
The ABAP is falling over at runtime. I have since found out that if
I comment out the ZZREGDATE in the EQUI_REC above, the program works.
The ZZREGDATE is defined as a date in the dicionary.
Can anyone tell me why the program is falling over when I am trying to
move the date field??
Any help much apprectaied.
Thanks in advance
AndyHi,
Here is the answer ..
TYPES: BEGIN OF equi_rec,
equnr, " Registration
herst, " Make
typbz, " Model
zzdept, " Department
zzoperator, " Operator
zzregdate, " Registration Date
END OF equi_rec.
If you declare like above, then all the fields will have Charecter type and length is 1, so the EQUNR, HERST and all other fields is charecter type then it is storing the first charecter in this Internal table, but the ZZREGDATE is the date field and it will not store the first charecter from the date field, because if you use the MOVE-CORRESPONDING then you need to write the same type, so that it is giving the dump ..
after writing the TYPE for ZZREGDATE then the program will run properly, but all the fields will store only the first charecter from the table values,
you need to give the correct TYPE to all the fields from the data dictionary inorder to store the total value
Reward points for all the helpful answers
Regards
Sudheer -
Hai
Im a BW consultant. My client enters the vendor details data in XK03.
How can i know that in which R/3-tables vendor details are stored. I knew that LFAI.
But if i dont know the R/3-tables. And if i know only the Transaction Code in R/3. Then how can i know the corresponding R/3-table.
can anyone please tell me
i ll assing the points
kumarUse transaction <b>ST05</b> sql trace.
Jus swich on the trace for the transaction XK03 and run the transaction XK03.
After finishing the trasnaction.. go to st05 and click on deactivate..
then check the list..u will get the list of all R/3 tables used.
OR
run transaction XK03.. click on system>status->program
double click on the program.. then clcik find and write SELECT... -
What are the tables corresponding to sales order - parners
Hi Folks,
Can u pls let me know what are the corresponding tables n fileds for the va02->parners i.e sold to party, ship to party etc, buyer , bill to party and contact details , adress of these parners wil store.
Thanks in advance.
Regards
Rajeshhii i am sending u the full code thta i had designed for my sales order confirmation using sap script
TABLES: VBAK,
ADRC,
VBPA,
VBAP,
SPELL.
DATA: BEGIN OF TVBAK OCCURS 0,
VBELN LIKE VBAK-VBELN,
AUDAT LIKE VBAK-AUDAT,
KUNNR LIKE VBAK-KUNNR,
VKORG like VBAK-VKORG,
END OF TVBAK.
DATA: BEGIN OF TADRC OCCURS 0,
ADDRNUMBER LIKE ADRC-ADDRNUMBER,
NAME1 LIKE ADRC-NAME1,
NAME2 LIKE ADRC-NAME2,
CITY1 LIKE ADRC-CITY1,
POST_CODE1 LIKE ADRC-POST_CODE1,
COUNTRY LIKE ADRC-COUNTRY,
KUNNR LIKE VBPA-KUNNR,
VBELN LIKE VBPA-VBELN,
END OF TADRC.
DATA:BEGIN OF TVBPA OCCURS 0,
ADRNR LIKE VBPA-ADRNR,
KUNNR LIKE VBPA-KUNNR,
VBELN LIKE VBPA-VBELN,
END OF TVBPA.
DATA: BEGIN OF TVBAP OCCURS 0,
POSNR LIKE VBAP-POSNR,
VBELN LIKE VBAP-VBELN,
MATNR LIKE VBAP-MATNR,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE VBAP-KWMENG,
VRKME LIKE VBAP-VRKME,
NETWR LIKE VBAP-NETWR,
WAERK LIKE VBAP-WAERK,
END OF TVBAP.
DATA :W_VBELN LIKE VBAK-VBELN,
s_amount like vbap-netwr ,
amount_word LIKE SPELL.
selection-screen: begin of block b1.
select-options: s_vbeln for vbpa-vbeln no intervals no-extension.
selection-screen: end of block b1.
*AT SELECTION-SCREEN.
SELECT VBELN INTO W_VBELN FROM VBAK
WHERE VBELN IN S_VBELN.
*ENDSELECT.
START-OF-SELECTION.
SELECT VBELN AUDAT KUNNR VKORG FROM VBAK INTO CORRESPONDING
FIELDS OF
TABLE TVBAK WHERE VBELN IN
S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE I398(00) WITH 'NO DATA'.
ENDIF.
SELECT NAME1 NAME2 CITY1 POST_CODE1 COUNTRY FROM ADRC INTO
CORRESPONDING
FIELDS OF
TABLE TADRC.
IF SY-SUBRC <> 0.
MESSAGE I398(00) WITH 'NO DATA1'.
ENDIF.
SELECT ADRNR KUNNR VBELN FROM VBPA INTO CORRESPONDING
FIELDS OF
TABLE TVBPA WHERE PARVW = 'WE'.
IF SY-SUBRC <> 0.
MESSAGE I398(00) WITH 'NO DATA2'.
ENDIF.
SELECT VBELN POSNR MATNR ARKTX KWMENG VRKME NETWR WAERK FROM VBAP INTO
CORRESPONDING
FIELDS OF TABLE TVBAP WHERE VBELN IN
S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE I398(00) WITH 'NO DATA3'.
ENDIF.
LOOP AT TADRC.
READ TABLE TVBPA WITH KEY ADRNR = TADRC-ADDRNUMBER.
IF SY-SUBRC = 0.
MOVE TVBPA-KUNNR TO TADRC-KUNNR.
MOVE TVBPA-VBELN TO TADRC-VBELN.
MODIFY TADRC.
ENDIF.
ENDLOOP.
****reward if helpfull ****** -
What does Rs, RSR, RSBC correspond to in TOBJ Table
I have an abap program which has the following text.This ABAP program is used to test the authorisations present in the system
But pls help me understand of why the words RS, RSR, RSBC are included in the Select statement
select *
from TOBJ into corresponding fields of TABLE it_authobj
where OCLSS IN ('RS','RSR','RSBC').
if sy-subrc = 0.
LOOP AT IT_authobj INTO WA_authobj.Hello Balaji,
This is an ABAP issue not a basis issue. Anyways your report will be making use of select option where 'RS','RSR','RSBC' would be variable denoting them within the code. These three fields should show up in the selection screen of your report.
This line
select *
from TOBJ into corresponding fields of TABLE it_authobj
where OCLSS IN ('RS','RSR','RSBC').
means that you need to select those entries from table TOBJ into internal table it_authobj where the value of field OCLSS is equal to the values mentioned in the selection screen against the fields 'RS','RSR','RSBC'.
Regards.
Ruchit. -
Need help in using a Secondary Index of a GL Table
Hello ABAPers,
Good morning/afternoon!
I was wondering if anyone could give me a hand on this issue.
To give you a brief background, I need to retrieve Open and Cleared items in the last 24 hours, that is, from 11 am yesterday till 10:59:59 today. The criteria is to pull the information using Entry Date (CPUDT) and Entry Time (CPUTM) from BKPF and using BELNR, retrieve the postings in BSIS and BSAS. as you can see in the piece of code. However, this process takes soooooo long to run.
Below is the code snippet.
We use 46C and MS SQL database.
The index fields of BKPF~ZB2 are: MANDT, CPUDT and BLART.
The index fields of BSIS~Z01are: BUKRS, GJAHr, HKONT, PRCTR, GSBER
TYPES: BEGIN OF i_bseg,
bukrs LIKE bkpf-bukrs,
hkont LIKE bsis-hkont,
gjahr LIKE bkpf-gjahr,
belnr LIKE bkpf-belnr,
buzei LIKE bsis-buzei,
bldat LIKE bsis-bldat,
budat LIKE bsis-budat,
waers LIKE bsis-waers,
monat LIKE bsis-monat,
shkzg LIKE bsis-shkzg,
gsber LIKE bsis-gsber,
dmbtr LIKE bsis-dmbtr,
wrbtr LIKE bsis-wrbtr,
cpudt LIKE bkpf-cpudt,
cputm LIKE bkpf-cputm,
END OF i_bseg.
*Internal Tables
DATA:
i_bkpf TYPE TABLE OF bkpf,
i_bseg TYPE STANDARD TABLE OF i_bseg.
Select records from yesterday's entry date.
SELECT bukrs belnr gjahr monat budat cpudt cputm waers
FROM bkpf INTO CORRESPONDING FIELDS OF TABLE i_bkpf
WHERE ( cpudt = so_date2-low AND
cputm >= so_cputm-low AND
cputm <= so_cputm-high )
OR ( cpudt = so_date2-high AND
cputm >= so_time2-low AND
cputm <= so_time2-high )
%_HINTS MSSQLNT 'INDEX("BKPF" "BKPF~ZB2")'.
IF sy-subrc NE 0.
MESSAGE e006 WITH 'BKPF'.
ENDIF.
Select Open Items***
SELECT bukrs hkont gjahr belnr buzei budat bldat
waers monat shkzg gsber dmbtr wrbtr
FROM bsis
APPENDING CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_bkpf
WHERE bukrs = i_bkpf-bukrs
AND gjahr = i_bkpf-gjahr
AND hkont IN so_saknr
AND belnr = i_bkpf-belnr
%_HINTS MSSQLNT 'INDEX("BSIS" "BSIS~Z01")'.
Also get any cleared items ***
SELECT bukrs hkont gjahr belnr buzei budat bldat
waers monat shkzg gsber dmbtr wrbtr
FROM bsas
APPENDING CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_bkpf
WHERE bukrs IN so_bukrs
AND hkont IN so_saknr
AND gjahr = sp_gjahr
AND belnr = i_bkpf-belnr.
Many thanks,
RosemarieThanks for your response.
The date and time fields are defined in my selection screen and the default values pre-set in the INITIALIZATION, so the dates and times are already stored as a range.
The problem is why is the process taking so long. Is the syntax for the INDEX correct?
PARAMETERS:p_not RADIOBUTTON GROUP pass.
SELECT-OPTIONS:
so_date2 FOR bkpf-cpudt, " Entry Date
so_cputm FOR sy-uzeit, " Entry Time
so_time2 for sy-uzeit. " Entry Time 2
INITIALIZATION.
RANGES: so_time2 FOR sy-uzeit.
g_date = sy-datum - 1.
g_year = sy-datum+0(4).
sp_gjahr = g_year.
CONCATENATE sp_gjahr '0101' INTO g_from_date.
g_from_time = '110000'.
g_24_hour = '235959'.
g_time_diff = g_24_hour - g_from_time.
g_to_time = g_from_time + g_time_diff.
g_to_time2 = g_from_time - 1.
MOVE: 'I' TO so_cpudt-sign,
'BT' TO so_cpudt-option,
g_from_date TO so_cpudt-low,
sy-datum TO so_cpudt-high.
APPEND so_cpudt.
MOVE: 'I' TO so_date2-sign,
'BT' TO so_date2-option,
g_date TO so_date2-low,
sy-datum TO so_date2-high.
APPEND so_date2.
MOVE: 'I' TO so_cputm-sign,
'BT' TO so_cputm-option,
g_from_time TO so_cputm-low,
g_to_time TO so_cputm-high.
APPEND so_cputm.
MOVE: 'I' TO so_time2-sign,
'BT' TO so_time2-option,
'000000' TO so_time2-low,
g_to_time2 TO so_time2-high.
APPEND so_time2. -
How to populate data in dynamic internal table
Hi Expert,
fyi. My dynamic internal table field is created base on data selected. Eg. select table qpcd has 5 records. These 5 recods will become fieldname to my dynamic internal table. My dynamic internal table will be
...itab
01
02
03
04
05
The 5 records from qpcd is populated in another table call viqmel. I need to find the occurance of each code in viqmel and populate the number of occurance in itab in each of column. The final dynamic itab will be like this
table itab
01 02 03 04 05 -
> field name
2 0 1 0 1 -
> data
my source code like below
Report ZPLYGRND2.
TABLES: mara, makt.
TYPE-POOLS: slis, sydes.
DATA:it_fcat TYPE slis_t_fieldcat_alv,
is_fcat LIKE LINE OF it_fcat,
ls_layout TYPE slis_layout_alv.
DATA: it_fieldcat TYPE lvc_t_fcat,
is_fieldcat LIKE LINE OF it_fieldcat.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data,
ob_cont_alv TYPE REF TO cl_gui_custom_container,
ob_alv TYPE REF TO cl_gui_alv_grid,
vg_campos(255) TYPE c,
i_campos LIKE TABLE OF vg_campos,
vg_campo(30) TYPE c,
vg_tables(60) TYPE c.
types : begin of t_qpcd,
codegruppe like qpcd-codegruppe,
code like qpcd-code,
end of t_qpcd.
data:wa_qpcd type t_qpcd,
i_qpcd type standard table of t_qpcd initial size 0.
FIELD-SYMBOLS: <l_table> TYPE table,
<l_line> TYPE ANY,
<l_field> TYPE ANY.
select * into corresponding fields of wa_qpcd from qpcd
where katalogart = 'D'
and codegruppe = 'OOT01'.
append wa_qpcd to i_qpcd.
endselect.
loop at i_qpcd into wa_qpcd.
is_fcat-fieldname = wa_qpcd-code.
APPEND is_fcat TO it_fcat.
endloop.
LOOP AT it_fcat INTO is_fcat.
is_fieldcat-fieldname = is_fcat-fieldname.
is_fieldcat-ref_field = is_fcat-ref_fieldname.
is_fieldcat-ref_table = is_fcat-ref_tabname.
APPEND is_fieldcat TO it_fieldcat.
ENDLOOP.
*... Create the dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = new_table.
if sy-subrc = 0.
endif.
*... Create a new line
ASSIGN new_table->* TO <l_table>.
CREATE DATA new_line LIKE LINE OF <l_table>.
ASSIGN new_line->* TO <l_line>.
LOOP AT <l_table> INTO <l_line>.
ENDLOOP.hello dear i m giving u a code in this a dynamic table is made on the basis of table in database , and u can download this data correct it , see it, or even change it....and upload in tht table help full if u dont know the table name...in advance.
also the code to populate data in dynamic table is in this code like:
SELECT * FROM (MTABLE_N)
INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
look at the whole program .hope this solve ur problem thanks.
REPORT ZTESTA MESSAGE-ID ZIMM .
TYPES : DATA_OBJECT TYPE REF TO DATA.
DATA : MITAB TYPE REF TO DATA .
TYPE-POOLS : SLIS .
DATA : IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
WITH HEADER LINE .
DATA : IT_FIELDCATALOG TYPE LVC_T_FCAT .
DATA : WA_FIELDCATALOG TYPE LVC_S_FCAT .
DATA : I_STRUCTURE_NAME LIKE DD02L-TABNAME .
DATA : I_CALLBACK_PROGRAM LIKE SY-REPID .
DATA : DYN_LINE TYPE DATA_OBJECT .
FIELD-SYMBOLS : <FS_ITAB> TYPE STANDARD TABLE .
DATA : TABLE_NAME_IS_VALID TYPE C .
DATA : DYNAMIC_IT_INSTANTIATED TYPE C .
CONSTANTS BUTTONSELECTED TYPE C VALUE 'X' .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_TABL.
PARAMETERS : MTABLE_N LIKE RSRD1-TBMA_VAL
MATCHCODE OBJECT DD_DBTB_16 OBLIGATORY .
DATA CHECKTABLED.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_FILE.
PARAMETERS : MFILENAM LIKE RLGRAP-FILENAME .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_DOWN.
PARAMETERS : P_DOWNLD RADIOBUTTON GROUP GRP1
USER-COMMAND M_UCOMM .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_CHKF.
PARAMETERS : P_CHKFIL RADIOBUTTON GROUP GRP1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_UPLD.
PARAMETERS : P_UPLOAD RADIOBUTTON GROUP GRP1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_SHOW.
PARAMETERS : P_SHOW_T RADIOBUTTON GROUP GRP1 .
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN OUTPUT .
PERFORM CHECK_FILENAME .
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI'.
CHECKTABLED = MTABLE_N+0(1).
IF CHECKTABLED NE 'Z'.
MESSAGE I017.
LEAVE TO SCREEN 1000.
ENDIF.
IF SY-UNAME NE 'KAMESH.K'.
MESSAGE I023 WITH SY-UNAME.
LEAVE TO SCREEN 1000.
ENDIF.
ENDIF.
IF SY-UCOMM = 'PRIN'.
CHECKTABLED = MTABLE_N+0(1).
IF CHECKTABLED NE 'Z'.
MESSAGE I017.
LEAVE TO SCREEN 1000.
ENDIF.
IF SY-UNAME NE 'KAMESH.K'.
MESSAGE I023 WITH SY-UNAME.
LEAVE TO SCREEN 1000.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MFILENAM .
PERFORM F4_FOR_FILENAME .
INITIALIZATION .
T_TABL = 'Table Name' .
T_FILE = 'File Name' .
T_DOWN = 'Download Table' .
T_CHKF = 'Check File to Upload' .
T_UPLD = 'Upload File' .
T_SHOW = 'Show Table Contents' .
START-OF-SELECTION .
PERFORM CHECK_TABLE_NAME_IS_VALID .
END-OF-SELECTION .
IF TABLE_NAME_IS_VALID EQ ' ' .
MESSAGE I398(00) WITH 'INVALID TABLE NAME' .
ELSE .
PERFORM INSTANTIATE_DYNAMIC_INTERNAL_T .
CHECK DYNAMIC_IT_INSTANTIATED = 'X' .
CASE BUTTONSELECTED .
WHEN P_DOWNLD .
PERFORM SELECT_AND_DOWNLOAD .
WHEN P_CHKFIL .
PERFORM CHECK_FILE_TO_UPLOAD .
WHEN P_UPLOAD .
PERFORM UPLOAD_FROM_FILE .
WHEN P_SHOW_T .
PERFORM SHOW_CONTENTS .
ENDCASE .
ENDIF .
FORM CHECK_TABLE_NAME_IS_VALID.
DATA MCOUNT TYPE I .
TABLES DD02L .
CLEAR TABLE_NAME_IS_VALID .
SELECT COUNT(*) INTO MCOUNT FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'TABL'
AND OBJ_NAME = MTABLE_N .
IF MCOUNT EQ 1 .
CLEAR DD02L .
SELECT SINGLE * FROM DD02L WHERE TABNAME = MTABLE_N .
IF SY-SUBRC EQ 0.
IF DD02L-TABCLASS = 'TRANSP' .
TABLE_NAME_IS_VALID = 'X' .
ENDIF .
ENDIF.
ENDIF .
ENDFORM. " CHECK_TABLE_NAME_IS_VALID
FORM SELECT_AND_DOWNLOAD.
CLEAR : <FS_ITAB> .
SELECT * FROM (MTABLE_N)
INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
PERFORM CHECK_FILENAME.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = MFILENAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = <FS_ITAB>
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC EQ 0.
MESSAGE I398(00) WITH 'Table' MTABLE_N
'successfully downloaded to '
MFILENAM .
ENDIF.
ENDFORM. " SELECT_AND_DOWNLOAD
FORM UPLOAD_FROM_FILE.
DATA : ANS TYPE C .
DATA : LINES_OF_ITAB TYPE I .
DATA : MSY_SUBRC TYPE I .
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
TEXTLINE1 = 'Are you sure you wish to upload'
TEXTLINE2 = 'data from ASCII File to DB table '
TITEL = 'Confirmation of Data Upload'
IMPORTING
ANSWER = ANS.
IF ANS = 'J' .
PERFORM CHECK_FILENAME.
CLEAR MSY_SUBRC .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = MFILENAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = <FS_ITAB>
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
MSY_SUBRC = MSY_SUBRC + SY-SUBRC .
IF SY-SUBRC EQ 0.
DESCRIBE TABLE <FS_ITAB> LINES LINES_OF_ITAB .
IF LINES_OF_ITAB GT 0 .
MODIFY (MTABLE_N) FROM TABLE <FS_ITAB> .
MSY_SUBRC = MSY_SUBRC + SY-SUBRC .
ENDIF .
ENDIF.
IF MSY_SUBRC EQ 0 .
MESSAGE I398(00) WITH LINES_OF_ITAB
'Record(s) inserted in table'
MTABLE_N .
ELSE .
MESSAGE I398(00) WITH
'Errors occurred No Records inserted in table'
MTABLE_N .
ENDIF .
ENDIF .
ENDFORM. " UPLOAD_FROM_FILE
FORM F4_FOR_FILENAME.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_PATH = 'C:\'
MASK = ',.,..'
MODE = '0'
IMPORTING
FILENAME = MFILENAM
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
ENDFORM. " F4_FOR_FILENAME
FORM CHECK_FILENAME.
IF MFILENAM IS INITIAL
AND NOT ( MTABLE_N IS INITIAL )
AND P_SHOW_T NE BUTTONSELECTED.
CONCATENATE 'C:\'
MTABLE_N '.TXT' INTO MFILENAM.
ENDIF .
ENDFORM. " CHECK_FILENAME
FORM INSTANTIATE_DYNAMIC_INTERNAL_T.
CLEAR DYNAMIC_IT_INSTANTIATED .
I_STRUCTURE_NAME = MTABLE_N .
CLEAR IT_FIELDCAT[] .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = I_STRUCTURE_NAME
CHANGING
CT_FIELDCAT = IT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
LOOP AT IT_FIELDCAT .
CLEAR WA_FIELDCATALOG .
MOVE-CORRESPONDING IT_FIELDCAT TO WA_FIELDCATALOG .
WA_FIELDCATALOG-REF_FIELD = IT_FIELDCAT-FIELDNAME .
WA_FIELDCATALOG-REF_TABLE = MTABLE_N .
APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG .
ENDLOOP .
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FIELDCATALOG
IMPORTING
EP_TABLE = MITAB .
ASSIGN MITAB->* TO <FS_ITAB> .
DYNAMIC_IT_INSTANTIATED = 'X' .
ENDIF.
ENDFORM. " INSTANTIATE_DYNAMIC_INTERNAL_T
FORM SHOW_CONTENTS.
CLEAR : <FS_ITAB> .
SELECT * FROM (MTABLE_N)
INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
I_CALLBACK_PROGRAM = SY-REPID .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
IT_FIELDCAT = IT_FIELDCAT[]
TABLES
T_OUTTAB = <FS_ITAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " SHOW_CONTENTS
FORM CHECK_FILE_TO_UPLOAD.
PERFORM CHECK_FILENAME.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = MFILENAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = <FS_ITAB>
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC EQ 0.
I_CALLBACK_PROGRAM = SY-REPID .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
IT_FIELDCAT = IT_FIELDCAT[]
TABLES
T_OUTTAB = <FS_ITAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDIF .
ENDFORM. " CHECK_FILE_TO_UPLOAD
Message was edited by:
SAURABH SINGH
SENIOR EXECUTIVE
SAMSUNG INDIA ELECTRONICS LTD.,NOIDA -
HI CAN WE display a table in footer of ALV ,
i need table like structure dispaly data in footer ,
how can any one pls help me
THXHi,
yes we can,
normmall alv for header and footer
Program to Test ALV Display With Header & Footer.
*& Report ZRJR02 *
REPORT ZRJR02 .
*Table declaration.
TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
data: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
*Internal table declaration.
*DATA BEGIN OF IT_SORT OCCURS 5.
INCLUDE TYPE SLIS_SORTINFO_ALV.
*DATA END OF IT_SORT.
DATA:BEGIN OF ITAB OCCURS 0,
ZEMPNO LIKE ZEMP_MST-ZEMPNO,
ZEMPNAME LIKE ZEMP_MST-ZEMPNAME,
ZDEPTCD LIKE ZEMP_MST-ZDEPTCD,
ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
ZDESGCD LIKE ZEMP_MST-ZDESGCD,
ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
END OF ITAB.
REFRESH ITAB.CLEAR ITAB.
START-OF-SELECTION.
SELECT AZEMPNO AZEMPNAME AZDEPTCD BZDEPTNAME AZDESGCD CZDESGNAME
FROM ZEMP_MST AS A
INNER JOIN ZDEPT_MST AS B
ON AZDEPTCD EQ BZDEPTCD
INNER JOIN ZDESG_MST AS C
ON AZDESGCD EQ CZDESGCD
INTO CORRESPONDING FIELDS OF TABLE ITAB.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
*& Form LAYOUT
FORM LAYOUT .
PERFORM FCAT USING 'ZEMPNO' 'ITAB' '' 'Emp.No.' 'ZEMPNO' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZEMPNAME' 'ITAB' '' 'Emp. Name' 'ZEMPNAME' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTCD' 'ITAB' '' 'Dept.Code' 'ZDEPTCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
PERFORM FCAT USING 'ZDESGCD' 'ITAB' '' 'Desg.Code' 'ZDESGCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
PERFORM LSORT USING 'ZEMPNO' 'IDATA' ''.
PERFORM LSORT USING 'ZEMPNAME' 'IDATA' ''.
MOVE IT_SORT[] TO GT_SORT[].
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITAB.
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. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
*& Form LSORT
*FORM LSORT USING P_FIELD P_TABLE P_UP.
ADD 1 TO L_POS.
IT_SORT-SPOS = L_POS.
IT_SORT-FIELDNAME = P_FIELD.
IT_SORT-TABNAME = P_TABLE.
IT_SORT-UP = P_UP.
APPEND IT_SORT.
*ENDFORM. " LSORT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
FORM F_REPORT_HEADER_ALV.
CALL FUNCTION 'Z_YHEAD_PRINT'
EXPORTING
TITLE1 = 'XYZ Limited'
TITLE2 = 'Employee Master'
TITLE3 = 'Created on '
COLOR = 'X'
ENDFORM.
*& Form F_WRITE_SUMMARY
Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'
for table at footer...... use this code
Reuse_alv_events_get
Parameters:
I_list_type type(slis_list_type)
Et_event type slis_t_event
You can capture
slis_ev_item_data_expand type slis_formname value 'ITEM_DATA_EXPAND',
slis_ev_reprep_sel_modify type slis_formname value 'REPREP_SEL_MODIFY',
slis_ev_caller_exit_at_start type slis_formname value 'CALLER_EXIT',
slis_ev_user_command type slis_formname value 'USER_COMMAND',
slis_ev_top_of_page type slis_formname value 'TOP_OF_PAGE',
slis_ev_data_changed type slis_formname value 'DATA_CHANGED',
slis_ev_top_of_coverpage type slis_formname value 'TOP_OF_COVERPAGE',
slis_ev_end_of_coverpage type slis_formname value 'END_OF_COVERPAGE',
slis_ev_foreign_top_of_page type slis_formname
value 'FOREIGN_TOP_OF_PAGE',
slis_ev_foreign_end_of_page type slis_formname
value 'FOREIGN_END_OF_PAGE',
slis_ev_pf_status_set type slis_formname value 'PF_STATUS_SET',
slis_ev_list_modify type slis_formname value 'LIST_MODIFY',
slis_ev_top_of_list type slis_formname value 'TOP_OF_LIST',
slis_ev_end_of_page type slis_formname value 'END_OF_PAGE',
slis_ev_end_of_list type slis_formname value 'END_OF_LIST',
slis_ev_after_line_output type slis_formname value 'AFTER_LINE_OUTPUT',
slis_ev_before_line_output type slis_formname value
'BEFORE_LINE_OUTPUT',
slis_ev_subtotal_text type slis_formname value
'SUBTOTAL_TEXT',
slis_ev_context_menu type slis_formname value 'CONTEXT_MENU'.
thanks
shankar
reward me if usefull -
IMPORT Statement Issue (Internal Table)
Hi All,
I am using an IMPORT statement to get all the data from other report's internal table. Now whenever this (the other report's internal table) is changed (for field addition, etc), my report throws a dump. Hence, everytime I have to add these fields in my program as well.
Is there any way by which I can include the whole internal table of that report in my program just like
'INCLUDE STRUCTURE VBRK'.
Thanks in advanceHi, CHeck this code related to your problem..This will helpful to you...
I have done this program earlier..I hope it will helpful to u..
This programa calling the other program to import the data..
Check it out...
*" Tables declarations.................................................
TABLES:
spfli.
*" Type declarations...................................................
Type declaration of the structure to hold data from table SPFLI *
TYPES:
BEGIN OF type_s_spfli,
carrid LIKE spfli-carrid, " Carrier Id
connid LIKE spfli-connid, " Connection Number
cityfrom LIKE spfli-cityfrom, " City from
cityto LIKE spfli-cityto, " City to
airpfrom LIKE spfli-airpfrom, " Airport from
airpto LIKE spfli-airpto, " Airport to
countryfr LIKE spfli-countryfr, " Country from
countryto LIKE spfli-countryto, " Country to
END OF type_s_spfli.
Data Declaration...................................................*
Field String To Hold Flight Details Record from SPFLI *
DATA
fs_spfli TYPE type_s_spfli.
Data Declaration...................................................*
Internal Table To Hold Flight Details Records from SPFLI *
DATA
t_spfli LIKE STANDARD TABLE OF fs_spfli.
TYPES:
BEGIN OF types_s_itab,
carrid LIKE sflight-carrid, " Carrier id
connid LIKE sflight-connid, " Connection number
fldate LIKE sflight-fldate, " Flight date
END OF types_s_itab.
Data Declaration...................................................*
Field String To Hold Flight Details Record from SFLIGHT *
DATA
fs_itab TYPE types_s_itab.
Data Declaration...................................................*
Internal Table To Hold Flight Details Records from SFLIGHT *
DATA
t_itab LIKE STANDARD TABLE OF fs_itab.
*" Type declarations...................................................
Type declaration of the structure to hold data from table SBOOK *
TYPES:
BEGIN OF type_s_sbook,
carrid LIKE sbook-carrid, " Carrier Id
connid LIKE sbook-connid, " Connection Number
fldate LIKE sbook-fldate, " Flight date
bookid LIKE sbook-bookid, " Booking number
loccuram LIKE sbook-loccuram, " Local currency
loccurkey LIKE sbook-loccurkey,
order_date LIKE sbook-order_date, " Booking date
END OF type_s_sbook.
Data Declaration...................................................*
Field String To Hold Flight Details Record from BOOK *
DATA
fs_sbook TYPE type_s_sbook.
Data Declaration...................................................*
Internal Table To Hold Flight Details Records from SBOOK *
DATA
t_sbook LIKE STANDARD TABLE OF fs_sbook.
DATA
w_checkbox. " Checkbox
SELECT-OPTIONS:
s_carr FOR spfli-carrid. " Carrier id range
START-OF-SELECTION EVENT *
START-OF-SELECTION.
PERFORM selectq.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
SET PF-STATUS 'YH1314_030502'.
PERFORM display_basic.
AT USER-COMMAND.
PERFORM ucomm.
*& Form selectq
This subroutine retreive data from SPFLI table
There are no interface parameters to be passed to this subroutine.
FORM selectq .
SELECT carrid " Carrier id
connid " Connection number
cityfrom " City from
cityto " City to
airpfrom " Airport from
airpto " Airport to
countryfr " Country from
countryto " Country to
INTO CORRESPONDING FIELDS OF TABLE t_spfli
FROM spfli
WHERE carrid IN s_carr.
ENDFORM. " Selectq
*& Form display_basic
This subroutine displays data from internal table
There are no interface parameters to be passed to this subroutine.
FORM display_basic .
LOOP AT t_spfli INTO fs_spfli.
WRITE:
/ w_checkbox AS CHECKBOX,
fs_spfli-carrid,
fs_spfli-connid,
fs_spfli-cityfrom,
fs_spfli-cityto,
fs_spfli-airpfrom,
fs_spfli-airpto,
fs_spfli-countryfr,
fs_spfli-countryto.
ENDLOOP. " LOOP AT T-SPFLI INTO...
ENDFORM. " Display_basic
*& Form UCOMM
This subroutine for at user-command event
There are no interface parameters to be passed to this subroutine.
FORM ucomm .
RANGES :
r_carr FOR spfli-carrid,
r_conn FOR spfli-connid,
r_carrid FOR sflight-carrid,
r_connid FOR sflight-connid,
r_fldate FOR sflight-fldate.
CASE sy-ucomm.
WHEN 'DISPLAY'.
DATA:
lw_lines TYPE i,
lw_lineno TYPE i VALUE 3.
DESCRIBE TABLE t_spfli LINES lw_lines.
DO lw_lines TIMES.
READ LINE lw_lineno FIELD
VALUE w_checkbox INTO w_checkbox
fs_spfli-carrid INTO fs_spfli-carrid
fs_spfli-connid INTO fs_spfli-connid.
IF sy-subrc = 0.
IF w_checkbox = 'X'.
r_carr-sign = 'I'.
r_carr-option = 'EQ'.
r_carr-low = fs_spfli-carrid.
APPEND r_carr.
r_conn-sign = 'I'.
r_conn-option = 'EQ'.
r_conn-low = fs_spfli-connid.
APPEND r_conn.
ENDIF. " IF W_CHECKBOX = 'X'
ENDIF. " IF SY-SUBRC = 0
ADD 1 TO lw_lineno.
ENDDO. " DO LW_LINES TIMES
SUBMIT yh1314_030502_call
WITH s_carr IN r_carr
WITH s_conn IN r_conn
AND RETURN.
IMPORT t_itab FROM MEMORY ID 'YH1314'.
LOOP AT t_itab INTO fs_itab.
r_carrid-sign = 'I'.
r_carrid-option = 'EQ'.
r_carrid-low = fs_itab-carrid.
APPEND r_carrid.
r_connid-sign = 'I'.
r_connid-option = 'EQ'.
r_connid-low = fs_itab-connid.
APPEND r_connid.
r_fldate-sign = 'I'.
r_fldate-option = 'EQ'.
r_fldate-low = fs_itab-fldate.
APPEND r_fldate.
ENDLOOP. " LOOP AT T_ITAB INTO.....
SELECT carrid " Carriee Id
connid " Connection number
fldate " Flight date
bookid " Booking number
loccuram " Local Currency
order_date " Booking date
INTO CORRESPONDING FIELDS OF TABLE t_sbook
FROM sbook
WHERE carrid IN r_carrid AND
connid IN r_connid AND
fldate IN r_fldate.
IF SY-SUBRC NE 0.
MESSAGE 'NO RECORDS FOUND'(006) TYPE 'S'.
ENDIF. " IF SY-SUBRC NE 0
LOOP AT t_sbook INTO fs_sbook.
AT FIRST.
WRITE: /5 'Carrier Id'(001),
20 'Conn Id'(002),
35 'Flight date'(003),
50 'Book Id'(004),
65 'Local Currency'(005).
ENDAT. " AT FIRST
WRITE: /5 fs_sbook-carrid,
20 fs_sbook-connid,
35 fs_sbook-fldate,
50 fs_sbook-bookid,
65 fs_sbook-loccuram CURRENCY fs_sbook-loccurkey.
ENDLOOP. " LOOP AT T_SBOOK INTO.....
ENDCASE. " CASE SY-UCOMM
ENDFORM. " UCOMM
Regards
Kiran -
Find SAP table records given a list of tables
Dear all,
I have been given a list of table names that I require to provide a report a total record counts for these table.
given such codes I have can't proceed further as the field symbol that I use is invalid. Please advice how to complete this. Or perhaps any standard system reports to find the total record counts given a specified tables.
here's the code:
types : begin of w_dd02l,
TABNAME type TABNAME,
totalrec like sy-dbcnt,
END OF w_dd02l.
data : wa_dd02l type STANDARD TABLE OF w_dd02l with HEADER LINE.
data : wr_dd02l type w_dd02l.
data : totalrecord like sy-dbcnt.
field-SYMBOLS : <f1> type ANY.
p_tab is a selection field.
select tabname from dd02l into CORRESPONDING FIELDS OF TABLE wa_dd02l where tabname in p_tab.
loop at wa_dd02l into wr_dd02l.
assign wr_dd02l-tabname to <f1>.
select count(*) from <f1> into totalrecord.
wr_dd02l-totalrec = totalrecord.
write : wr_dd02l-tabname, wr_dd02l-totalrec.
ENDLOOP.
<f1> being a field symbol is not recognize as in ABAP dictionary. Here's where I can't proceed.. dear gurus please help.
Thanks and Regards,
AndrewPl. check, it's working
types : begin of w_dd02l,
TABNAME type TABNAME,
totalrec like sy-dbcnt,
END OF w_dd02l.
data : wa_dd02l type STANDARD TABLE OF w_dd02l with HEADER LINE.
data : wr_dd02l type w_dd02l.
data : totalrecord like sy-dbcnt.
field-SYMBOLS : <f1> type ANY.
PARAMETERS: p_tab like dd02l-tabname.
* p_tab is a selection field.
select tabname from dd02l
into CORRESPONDING FIELDS OF TABLE wa_dd02l
where tabname = p_tab.
loop at wa_dd02l into wr_dd02l.
assign wr_dd02l-tabname to <f1>.
select count(*) from (<f1>) into totalrecord. " use like (<f1>)
wr_dd02l-totalrec = totalrecord.
write : wr_dd02l-tabname, wr_dd02l-totalrec, <f1>.
endloop. -
Module pool - table control - update ztable
hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
pd: sorry for my bad english
this is my code:
TOP:
PROGRAM z_pp_lote_etiquetas MESSAGE-ID zz.
TABLES:zc2p_lote_etique,
zc2p_lider_modul.
DATA: ok_code LIKE sy-ucomm.
DATA save_ok LIKE sy-ucomm.
* internal table
DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
**************Workarea
DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
DATA: sel.
DATA: MARK.
DATA: init.
DATA: col TYPE scxtab_column.
DATA: lines TYPE i.
* Variable Declaration
DATA : flg, "Flag to set the change mode
ln TYPE i. "No. of records
* Table Control Declartion.
CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
**PROCESS BEFORE OUTPUT INCLUDE **
*& Include Z_PP_LOTE_ETIQUETAS_O01
*& Module set_status OUTPUT
* Setting the GUI status
MODULE status_0100 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
ENDMODULE. " set_status OUTPUT screen 100
* MODULE status_0101 OUTPUT
* Setting the GUI status
MODULE status_0101 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
* Data retreving
if init is INITIAL.
select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
zc2p_lider_crtl-lines = ln + 10.
init = 'X'.
endif.
ENDMODULE. "status_0101 OUTPUT
module change_sdyn_conn output.
* you can change the content of current table control line via
* sdyn_conn
READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
endmodule. " FILL_TABLE_CONTROL OUTPUT
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
*ENDIF.
* Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
PROCESS AFTER INPUT INCLUDE.
* MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'LIDM'.
CALL SCREEN 101.
WHEN 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
* MODULE USER_COMMAND_0101 INPUT
MODULE user_command_0101 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SORT'.
DATA: fldname(100),help(100).
READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
SPLIT col-screen-name AT '-' INTO help fldname.
SORT it_zc2p_lider_modul BY (fldname).
WHEN 'CHANGE'.
* Setting the flag to make the table control in editable mode[excluding
* primary key].
flg = 'Y'.
WHEN 'BACK'.
CALL SCREEN 100.
LEAVE SCREEN.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SAVE'.
MODIFY zc2p_lider_modul FROM it_zc2p_lider_modul.
COMMIT WORK.
ENDCASE.
ENDMODULE. "USER_COMMAND_0101 INPUT
* MODULE read_table_control INPUT
MODULE read_table_control INPUT.
* Check input values
IF mark = 'X' AND save_ok = 'DELETE'.
DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
ENDIF.
ENDMODULE. " READ_TABLE_CONTROL INPUT
Screen Flow Logic 100
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Screen Flow Logic 101.
PROCESS BEFORE OUTPUT.
MODULE status_0101.
LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
zc2p_lider_crtl.
* Dynamic screen modifications
MODULE set_screen_fields.
MODULE change_sdyn_conn.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_0101.
LOOP AT it_zc2p_lider_modul.
MODULE read_table_control.
ENDLOOP.
i hope somebody can help for what i missing here thanks>
Sanjeev Kumar wrote:
> Hello Edgar,
>
> Problem seems to be there in the flow logic of 101
>
>
> PROCESS BEFORE OUTPUT.
> MODULE status_0101.
> LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
> zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
> * Dynamic screen modifications
> MODULE set_screen_fields.
> MODULE change_sdyn_conn.
> ENDLOOP.
> *
> PROCESS AFTER INPUT.
> MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.
>
> LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
> MODULE read_table_control.
> ENDLOOP.
>
>
>
> With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
>
> Try these changes and I hope it will work.
>
> Thanks
> Sanjeev
i do the firts advice but the second one i get syntax error :
my code :
PROCESS AFTER INPUT.
LOOP at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0101.
error :
In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP
AT".
Maybe you are looking for
-
5.0.1 update won't let my iphone restore
I installed the iphone update and all went well until I came to the part where it asked me to restore my iphone. I have tried to restore my iphone 9 times now. here is what I have tried: 1. disable antivirus software 2. restart pc - numerous times 3
-
Only partial handwriting notes showing up when I email the document
I am editing a document using the free-draw tool. When I email the document, only parts of each "drawing" show up.
-
SMB sharing in Yosemite Server
Before I upgrade to Yosemite Server (from 3.2.2) I was wondering what are people's experiences with SMB file sharing in Yosemite Server, I see some changes had been made, is it working anywhere near reliably yet - in terms of file sharing between Mac
-
Question about installing/uninstalling if useless...
In my Add/Remove panel I have the following listed: J2SE Runtime Environment 5.0 Update 4 J2SE Runtime Environment 5.0 Update 6 Java(TM) SE Development Kit 6 Java(TM) SE Runtime Environment 6 I downloaded JDK 1.6.0 so I could compile and interpret wh
-
MBP suddenly slow/lagging - pls somebody skilled with EtreCheck tell me what's wrong?
I love ASC for hands-on advice to try oneself however this time I am in it too deep: My sons MBP suddenly became lagging and unresponsive/very very slow... ie. the swirl-thing comes up 1-2 secs AFTER clicking the apple-icon and the menu yet another 6