Help on Internal table checking
Hi All,
I need some advise on how to group the data in the internal table with sum up the total value for each group and display it in final internal table. Can anyone help on this. Thanks.
Internal table which holding the value as below
(1)indicator field: Only can be value 'A' or 'B'.
(2) Group_name field: values are not fixed to be old_student, new_student or graduated. It depend the values we extracted from table as it can be more.
Sample internal table:
Indicator , Group_name , Amount
A , Old_Student ,1
B ,New_Student ,2
A ,New_Student ,20
A ,Old_Student ,3
A ,Graduated ,1
Report need to be displayed are in below format with using ALV list.
Indicator fields - it's the sum up total amount from above internal table with the same group_name.
Group_name , Indicator A , Indicator B , Total
Old_student , 4 , 0 , 4
New_student ,20 , 2 ,20
Graduated ,1 , 0 ,1
Total: ,25 ,2 ,25
Moderator message: "spec dumping", please work yourself first on your requirement.
Edited by: Thomas Zloch on Jun 26, 2011 11:20 AM
use subtotal functionality in alv
Similar Messages
-
Input Help from Internal table.
Hi All,
I have created a screen with fields from an internal table and I can't access the Input help calendar for dates. I would also like to access the domain values that are linked to the original transparent table for two other fields on the screen (both from the internal table in the program) when I click on the input help in the field or press F4.
Relevant assistance will be rewarded.
Thanx in advance.HI
try like this
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
***********SELECTION SCREEN DESIGN***********************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
**********END OF SELECTION SCREEN DESIGN*****************
*****INITIALIZATION VENT TO ASIGN DEFAULT VALUES TO OTYPE
*INITIALIZATION.
S_OTYPE-LOW = 'D'.
S_OTYPE-SIGN = 'I'.
S_OTYPE-OPTION = 'EQ'.
APPEND S_OTYPE.
CLEAR S_OTYPE.
*************END OF EVENT INITIALIZATION*****************
*********VALIDATION FOR SCREEN FIELDS********************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'OBJID'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF. -
Help with Internal table - Urgent Please
I had an internal table declared as below:
DATA: BEGIN OF i_results OCCURS 0,
pernr like p0014-pernr,
begda like zhrccroll-begda, "Cost center roll out begin date
endda like zhrccroll-endda, "Cost center roll out end date
aedtm like p0014-aedtm,
uname like p0014-uname,
kostl like p0001-kostl,
ittype(7),
END OF i_results.
And my SQL to populate the table based on some other results:
select t1pernr t3begda t3endda t1aedtm t1uname t2kostl
appending corresponding fields of table i_results
from pa0014 as t1
inner join pa0001 as t2
on t1pernr = t2pernr
inner join zhrccroll as t3
on t2kostl = t3kostl
for all entries in i_it01
where t1~pernr = i_it01-pernr
and t2~kostl = i_it01-kostl
and t3~kostl = i_it01-kostl
and t3~syst = 'STAFF'
and t1~aedtm = p_date
and t1~uname in so_name.
Everything was working great and now user wants to see additional dates on the report so I have to add couple of dates to internal table but unfortunately they have same names (begda, endda), Now I need internal table like this:
DATA: BEGIN OF i_results OCCURS 0,
pernr like p0014-pernr,
begda like zhrccroll-begda, "Cost center roll out begin date
endda like zhrccroll-endda, "Cost center roll out end date
aedtm like p0014-aedtm,
uname like p0014-uname,
kostl like p0001-kostl,
begda like p0014-begda, "infotype begin date
endda like p0014-endda, "infotype end date
ittype(7),
END OF i_results.
I cannot have duplicate declarations in internal table and also my SQL would not work. The new SQL would be:
select t1pernr t3begda t3endda t1aedtm t1uname t2kostl
t1begda t1endda
appending corresponding fields of table i_results
from pa0014 as t1
inner join pa0001 as t2
on t1pernr = t2pernr
inner join zhrccroll as t3
on t2kostl = t3kostl
for all entries in i_it01
where t1~pernr = i_it01-pernr
and t2~kostl = i_it01-kostl
and t3~kostl = i_it01-kostl
and t3~syst = 'STAFF'
and t1~aedtm = p_date
and t1~uname in so_name.
This is not working either.
Could comeone please help me how to acheive the desired result. I am trying to get all the data in one shot, and that is why I have the SQL above. Any ideas you could provide would be greatly appreciated.
Thanks in advance.
MithunHI Mithun,
To add to vishnu do not use "appending corresponding fields of"..
1) if you are reading this data again and again then use
"appending table itab"
2) if it is triggered just once then use
"into table itab"
And also define ur itab as:
DATA: BEGIN OF i_results OCCURS 0,
pernr like p0014-pernr,
ccbegda like zhrccroll-begda, "Cost center roll out begin date
ccendda like zhrccroll-endda, "Cost center roll out end date
aedtm like p0014-aedtm,
uname like p0014-uname,
kostl like p0001-kostl,
begda like p0014-begda, "infotype begin date
endda like p0014-endda, "infotype end date
ittype(7),
END OF i_results.
and your select statement as:
select t1pernr t3begda as ccbegda t3endda as ccenda t1aedtm t1~uname
t2kostl t1begda t1~endda into table i_results
from pa0014 as t1
inner join pa0001 as t2
on t1pernr = t2pernr
inner join zhrccroll as t3
on t2kostl = t3kostl
for all entries in i_it01
where t1~pernr = i_it01-pernr
and t2~kostl = i_it01-kostl
and t3~kostl = i_it01-kostl
and t3~syst = 'STAFF'
and t1~aedtm = p_date
and t1~uname in so_name
I am sure you need to tweak and twist the above statements a bit..
Hope this helps..
BR
Rakesh
PS: Please close the thread if your problem is solved.. -
hi folks,
anybody who could help me in this aspect...
types: begin of structbdata,
bdate type jhtfp-fbuda,
predition type jhtfp-vavtyp,
adnumber type jhtfp-aubel,
adsize type jhamot-breite_s,
bunits type jhamot-HOEHE_S,
end of structbdata.
data bdata type standard table of structbdata with key adnumber initial
size 10.
select fbuda vavtyp aubel breite_ieh hoehe_i_eh from zzjhtfp INNER JOIN
jhamot ON zzjhtfpaubel = jhamotavm_nr INTO BDATA WHERE zzjhtfp~kunnr
= p_custid.
i have declared the internal table type -structbdata and declare internal table bdata to read the data from the query below.
error i am getting is internal table cannot be treated as a work area.
hence forth the results of the query is not getting stored in the internal table.
thanks in advance guys.
santhoshHi Santhosh,
If you are selecting the entries from the database table into your internal table in one single shot, then you have to use the INTO TABLE option as follows
SELECT fbuda vavtyp aubel breite_ieh hoehe_i_eh
FROM zzjhtfp INNER JOIN jhamot ON zzjhtfp~aubel = jhamot~avm_nr
INTO table bdata
WHERE zzjhtfp~kunnr = p_custid.
Now if you are not doing it this way, but you are in a SELECT, ENDSELECT loop, then you do need a workarea. You need to define your internal table WITH HEADER LINE or define another workarea like your internal table type and then move it to your internal table as follows
DATA: s_bdata TYPE structbdata.
SELECT fbuda vavtyp aubel breite_ieh hoehe_i_eh
FROM zzjhtfp INNER JOIN jhamot ON zzjhtfp~aubel = jhamot~avm_nr
INTO s_bdata
WHERE zzjhtfp~kunnr = p_custid.
*-- Do your processing, validations here
APPEND s_bdata to bdata.
CLEAR s_bdata.
ENDSELECT.
Hope this helps,
Srinivas -
Search help - Display only 500 entries at one time from Internal Table
Hi,
I have an internal table with 1000000 entries. And when I use F4IF_INT_TABLE_VALUE_REQUEST function module to display the search help with internal table, it gives me dump. Can somebody help me - how to display limited values when we process search help?
Thanks,
SheelHi Sheel
u have a variable callcontrol-maxrecords in search help exit to limit the number of records.. check my weblog for more help: https://wiki.sdn.sap.com/wiki/x/du0 -
Regarding reading multiple records into a single internal table..
hi experts,
Need your help, i have a requirement like this.
i will have a input file like this
D 123 Suresh 12/01/2008
E ven sha 5432
E ven sha 5432
D 153 Sachin 11/01/2008
E ven sha 5432
Now all i need to consider from D to E (i.e., before next D) as a single record and i need to preare a separate excel,
So that E records can be max 9. So we cant expect this will be always 2 or 3 or 4.
So how can i do this upload and process..
give some idea.
Thanks,
SureshHi,
Once you transfer the values from input file to internal table.
loop through all records of internal table .
check the first letter using offset
e.g if Itab-field+0(1) = 'D'
elseif Itab-field+0(1) = 'E'.
endif.
Populate the work area of internal table until you find the next 'D' once you find 'D' again ...append the work area to internal table......clear work area.
Regards,
Rahul -
SMARTFORM: How to print on document per row in an internal table
Hi.
I have created a SmatForm that is a one-page document to be printed once for every row in an itab I'm sending it via the Table Interface.
I hope I didn't waste my time designing this form but I created several Windows for each section (header, recipient address, summary of coverage, detail coverage information, disclaimer, etc.). I arbitrarily chose the header window as the "main" window (mainly because I couldn't find out what the difference between the different choices was). I've got the form laid out exactly how I want it.
If I test the SmartForm and pass in 2+ records via the test screen only the first one prints.
I thought about trying a LOOP but since you have to place the text within the loop that means all the Windows I have defined won't "get" any of the data.
I thought about looping in the driver ABAP program and just calling the SmartForm once per row but that seems horribly inefficient.
PLEASE HELP! Can I salvage what I've done already?Valter:
OK. I'm trying this and running into a snag.
In the Form Interface section I have a table interface parameter defined as this:
P_CERTIFICATES_IN TYPE ZBNTT_LIFECERTIFICATE
next I declared a variable named "IT_CERTIFICATES LIKE LINE OF P_CERTIFICATES_IN" in the "Global Definitions" section and on my LOOP element (under my new MAIN window) I have "[X] Internal Table" checked and
"P_CERTIFICATES_IN" "INTO" "IT_CERTIFICATES"
but the compiler says "Global Definitions Field "P_CERTIFICATES_IN" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . .".
Why can't the Smartform "see" P_CERTIFICATES_IN? -
Dynamic creation of internal table based on alv layout
Hi experts!!
I have the following request from my client:
I am displaying an alv report and i need to download it in txt format based on the columns showed in the current layout (i.e. if the user chooses to hide some columns, then they should not appear in the txt file ). In the alv i am using the Function Modules of the alv and not ABAP Objects.
I thought of dynamically creating the internal table, but i am not sure how to do it.
I also thaught of creating an internal table with only one field with the maximum length, but how can i check which fields are diplayed, and how can i get their values??
Please Help!!
Thank u in advance!!!
Please - no duplicate posts
Edited by: Rob Burbank on Feb 24, 2009 2:16 PMAfter call the above said function module you will get the exporting table for field catalog ie
call function 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
importing
es_layout = ls_slis_layo
et_fieldcat = lt_slis_fcat
if you check the lt_slis_fcat internal table if the field are hide in the layout by the user then in this internal table check for field NO_OUT will X.
Take the fields where NO_OUT ne X
then for creating dynamic internal table
field-symbols : <ptab> type standard table.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = lt_slis_fcat
importing
ep_table = i_content.
if sy-subrc = 0.
assign i_content->* to <ptab>.
else.
write: 'Error creating internal table'.
stop.
endif.
Here is the dynamic internal table
a® -
Problem with downloading the internal table onto the presentation server.
Hey folks,
I have a problem where in i am downloading one year of sales done by the company. I wrote a program to download the file onto the presentation server . The error occurs in the FM GUI_DOWNLOAD where if the file exceeds 105843504 bytes its giving me a dump saying that
When the program was running , it was established that more memory was needed than the operating system is able to safely to provide.
The current program has to be terminted because of the program already requested 105843504 bytes from the operating system with malloc when the operating system reported after further memory request that there was no more memory space available.
Could somebody provide an alternative soltuion for this.
Its really urgent as i can download the file with 70,000,000 bytes
Regards
RockHi Rock,
Please download the files on to Application Server, else as suggested by Ashish download into 2 or 3 files and merge them manually.
Declare same internal tables may be 5 times.
When you fill the internal table check for a counter and when you hit a certain number stop appending to it and start appending to the next.
After you are done so download all the internal tables.
I guess this would be a good way. I am not sure if there are any ther alternative good methods.
Hope this helps.
Shreekant -
How to read internal table other program (assign?)
Hello techies,
The problem >
I have 2 Sap standard programs A & B
I'm editing a userexit in program B but I need to read
data from program A that is also running.
While using the debugger, I can ask for the folowing
(A)internaltable
example : (SAPLMEPO)pot
this shows the content of internal table "pot" of the program "SAPLMEPO".
The question>
How can I copy the content of a table(ex. pot) in program "A"(ex. SAPLMEPO) to a internal table pot2 of program "B"?
Possible sollution (does not work in 5.0)
CODE SAMPLE *************
Fields **
data: w_name type char50,"help field
w_recpot like ekpo."help structure
Internal tables **
data: Begin of it_pot2 occurs 0.
include structure it_pot2.
data: End of it_pot2
field-symbols <fs_pot> type any table.
w_structure_name = '(SAPLMEPO)pot'.
assign (w_structure_name) to <fs_pot>.
loop at <fs_pot> into w_recpot.
it_pot2 = w_recpot.
append it_pot2
Endloop.
END CODE SAMPLE *************
Thanks in advance,
FrederikHi again,
1. Simple.
2. In your case, u should use
<b>[]</b>
DATA : myitab LIKE TABLE OF t001 WITH HEADER LINE.
DATA : w_struct_name(100) TYPE c.
BREAK-POINT.
FIELD-SYMBOLS <fs_pot> TYPE ANY TABLE.
<b> w_struct_name = '(ZAM_TEMP0)ITAB[]'.</b>
ASSIGN (w_struct_name) TO <fs_pot>.
3. No need to use Loop etc.
4. *----
In your case
CODE SAMPLE *************
Fields **
data: w_name type char50,"help field
w_recpot like ekpo."help structure
Internal tables **
data: Begin of it_pot2 occurs 0.
include structure it_pot2.
data: End of it_pot2
field-symbols <fs_pot> type any table.
w_structure_name = '<b>(SAPLMEPO)POT[]</b>'.
assign (w_structure_name) to <fs_pot>.
NOT REQUIRED
*loop at <fs_pot> into w_recpot.
*it_pot2 = w_recpot.
*append it_pot2
*Endloop.
END CODE SAMPLE *************
regards,
amit m. -
Issue with internal table in object oriented ABAP.
Hello Gurus,
I am having trouble defining internal table in Object oriented ABAP. for following:
DATA: BEGIN OF IT_TAB OCCURS 0.
INCLUDE STRUCTURE ZCUSTOM.
DATA tot_sum TYPE char40.
DATA END OF IT_TAB.
Can someone help ?
Regards,
Jainam.
Edited by: Jainam Shah on Feb 5, 2010 8:33 PM
Edited by: Jainam Shah on Feb 5, 2010 8:33 PM
Moderator message - Please post in the correct forum. You can easily find out for yourself by looking at SAP help for internal tables using OOP - thread locked
Edited by: Rob Burbank on Feb 5, 2010 2:49 PMNo, you can not declare internal table with header line in OO context. You have to declare the work are/header line separately
Example:
TYPES: BEGIN OF ty_it_tab.
INCLUDE STRUCTURE mara.
TYPES: tot_sum TYPE char40.
TYPES: END OF ty_it_tab.
DATA: it_tab TYPE STANDARD TABLE OF ty_it_tab.
DATA: wk_tab TYPE ty_it_tab.
LOOP AT it_tab INTO wk_tab.
ENDLOOP.
Edited by: Dean Q on Feb 5, 2010 8:50 PM -
Transfer IDOC File in a Internal Table
Hi all,
I need to Transfer IDOC File in a Internal Table.
Anybody have any idea how can I do this???
Regards,HI,
is the IDoc exist in SAP?if IDoc exist in SAP you can use one function module to read the idoc and store tha content in internal table.
IDOC_READ_COMPLETELY function module will read the specified idoc number.you can retrieve the control records ,status records and the data record of the idoc.for this you have to declare 3 internal tables (check the function modules for the type of inerna table).you can then loop the internal table and read the data.let us know if u have any problems
regards
shibu -
Error in uploading excel sheet data into internal table
Dear all,
i am facing problem when uploading data from excel. i used KD_GET_FILENAME_ON_F4.i select the file and pass on to ALSM_EXCEL_INTO_INTERNAL_TABLE.and i get the ERROR....
Illegal type when transferring an internal table to a FORM. this is my code .
types : begin of ty_mm01,
matnr like rmmg1-matnr,
mbrsh like rmmg1-mbrsh,
mtart like rmmg1-mtart,
maktx like makt-maktx,
meins like mara-meins,
matkl like mara-matkl,
bismt like mara-bismt,
spart like mara-spart,
mtpos like mara-mtpos_mara,
end of ty_mm01.
data : tt_mm01 type standard table of ty_mm01,
wa_mm01 like TT_MM01.
data : t_bdcdata like standard table of bdcdata,
t_bdcmsgcoll like standard table of bdcmsgcoll.
constants: begcol TYPE i value 1 ,
begrow TYPE i value 1,
endcol TYPE i value 100,
endrow TYPE i value 32000.
selection-screen : begin of block bdc with frame.
parameter : tfile like rlgrap-filename obligatory.
selection-screen : end of block bdc.
at selection-screen on value-request for tfile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = 'ZMM_MAT_MAS_BASIC_DATA'
DYNPRO_NUMBER = '1000'
FIELD_NAME = 'TFILE'
STATIC = 'X'
MASK = ',*.xls,'
CHANGING
FILE_NAME = tfile
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = tfile
I_BEGIN_COL = begcol
I_BEGIN_ROW = begrow
I_END_COL = endcol
I_END_ROW = endrow
TABLES
INTERN = tt_mm01
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks in advanceHi,
Check these FM : KCD_EXCEL_OLE_TO_INT_CONVERT
Report ZPSP_TEST.
data: bdc_DATA like bdcdata occurs 0 with header line,
mess_tab like bdcmsgcoll occurs 0 with header line.
DATA: BEGIN OF ITAB OCCURS 0 ,
tcnt TYPE i, "Table Counter &H0D
WERKS LIKE T001W-WERKS,
BNFPO LIKE EBAN-BNFPO,
MATNR LIKE MARA-MATNR,
MENGE LIKE EBAN-MENGE,
END OF ITAB.
start-of-selection.
PERFORM upload_data.
loop at itab.
perform bdc_dynpro using 'SAPMM06B' '0100'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BSART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-BSART'
'NB'.
perform bdc_field using 'RM06B-LPEIN'
'T'.
perform bdc_field using 'EBAN-WERKS'
ITAB-WERKS.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-EKGRP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM06B-BNFPO'
ITAB-BNFPO.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-MATNR(01)'
ITAB-MATNR.
perform bdc_field using 'EBAN-MENGE(01)'
ITAB-MENGE.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_010.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_011.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_012.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_013.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_014.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_015.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_016.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_017.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_018.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-BNFPO'
record-BNFPO_019.
*perform bdc_field using 'EBAN-MATNR(02)'
record-MATNR_02_020.
*perform bdc_field using 'EBAN-MENGE(02)'
record-MENGE_02_021.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'EBAN-MENGE'
ITAB-MENGE_023.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_024.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_025.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_026.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_027.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_028.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_029.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_030.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_031.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_032.
perform bdc_field using 'EBAN-TXZ01'
'BEARING 2"X2"'.
perform bdc_field using 'EBAN-MENGE'
'65'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 1,120.00'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-TXZ01'
'DRILLING PIPE 10"'.
perform bdc_field using 'EBAN-MENGE'
'75'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 0.53'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-BNFPO'
perform bdc_field using 'BDC_OKCODE'
'&H3DBU'.
*perform bdc_field using 'RM06B-BNFPO'
CALL TRANSACTION 'ME51' USING BDC_DATA MODE 'A'.
endLOOP.
FORM upload_data.
*local variable declaration
DATA : lv_index TYPE i,
l_count TYPE i.
*local constants declaration
CONSTANTS:
lc_start_col TYPE i VALUE '1' ,
lc_start_row TYPE i VALUE '2' ,
lc_end_col TYPE i VALUE '256' ,
lc_end_row TYPE i VALUE '65536'.
*local field symbol declaration
FIELD-SYMBOLS : <lf_s>.
*loacal internal table declaration
DATA : li_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
*refresh internal table for each loop
CLEAR: li_intern,
l_count .
REFRESH li_intern.
to upload the data in excel on the presentation server this function
module converts the data from excel file into an internal table
containing row no col no and value
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename &H3D 'Give file location here'
i_begin_col &H3D lc_start_col
i_begin_row &H3D lc_start_row
i_end_col &H3D lc_end_col
i_end_row &H3D lc_end_row
TABLES
intern &H3D li_intern
EXCEPTIONS
inconsistent_parameters &H3D 1
upload_ole &H3D 2.
checking for data in internal table
CHECK NOT li_intern[] IS INITIAL.
sorting internal table
SORT li_intern BY row col.
collecting data into an internal table
LOOP AT li_intern.
MOVE: li_intern-col TO lv_index.
lv_index &H3D lv_index + 1.
ASSIGN COMPONENT lv_index OF STRUCTURE itab TO <lf_s>.
MOVE : li_intern-value TO <lf_s>.
AT END OF row.
l_count &H3D l_count + 1.
itab &H3D l_count.
APPEND itab.
ENDAT. " at end of row
ENDLOOP. " loop at li_intern
Reg,
Siva
Edited by: Siva Prasad on Jun 1, 2009 8:41 AM
Edited by: Siva Prasad on Jun 1, 2009 4:25 PM -
To Find the type of field in the internal table.
I have internal table i_tab.
TYPES : BEGIN OF t_makt,
matnr TYPE matnr,
maktx TYPE maktx,
qty type mseg-menge,
show type char01,
END OF t_makt.
DATA : i_tab TYPE t_makt OCCURS 0 WITH HEADER LINE.
I want to know the type of the field of the i_tab at some stage in the program.
is there any piece of code or FM available to find the TYPE of the field of the internal table.Check out the following code
TYPES:
BEGIN OF my_struct,
comp_a type i,
comp_b type f,
END OF my_struct.
DATA:
my_data TYPE my_struct,
descr_ref TYPE ref to cl_abap_structdescr.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
START-OF-SELECTION.
descr_ref ?= cl_abap_typedescr=>describe_by_data( my_data ).
WRITE: / 'Typename :', descr_ref->absolute_name.
WRITE: / 'Kind :', descr_ref->type_kind.
WRITE: / 'Length :', descr_ref->length.
WRITE: / 'Decimals :', descr_ref->decimals.
WRITE: / 'Struct Kind :', descr_ref->struct_kind.
WRITE: / 'Components'.
WRITE: / 'Name Kind Length Decimals'.
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
WRITE: / <comp_wa>-name, <comp_wa>-type_kind,
<comp_wa>-length, <comp_wa>-decimals.
ENDLOOP. -
Trouble fetching record from Internal table
Hi all,
I am using a binary search read for retrieving data from an internal table, but i am not able to fetch a particular record even while it is present in the internal table.Check if you are sorting the table. When you are not sorting the table, the read fetch the next highest key field from the table e.g.
Suppose if you have an internal table with following keys:
12
9
13
2
22
the read will pick only 12,13 & 22 record.
Regards,
Prashant.
Maybe you are looking for
-
BPM Fault Message Exception error !
Hi here is what I am doing Sync webservice-->Sync webservice call using ccBPM. This is what I defined in the BPM 1.)Sync rec 2.)Block with Exception handler. 3.) Sync send inside the Block with Fault exception defined. I defined fault messages for th
-
Commerce server 3.2 tag library error
I have installed the following components on Solaris 2.7:- - Java1.3 - WebLogic5.1 - SP6 - Commerce Server 3.2 The commerce server seems to start fine except the following exception when the Create User button is clicked from the Admin screen. Any he
-
Brand new MPB crashing after welcome screen :/ ???
Hello, I bought a brand new MPB, took it out of the box yesterday hooked it on the AC, started it up, got the nice welcome video, went through the language settings, and then when i had to give in my name all **** broke lose. I got the beautiful blac
-
Hi, Does anyone knows BAPI FM for PO Change? Please let me know. Thanks, Parag
-
PSE 13 inability to validate serial number, thinks it's not connected to internet
I've installed Photoshop Element 13.1 (from download) on Windows 7 Home premium 64 bit OS. I've entered the serial number to activate it, Every time I go into the software it keeps saying I need to validate the serial number, but doesn't let me vali