2009 Mar 05 10:18 AM
Hi,
I have following definition:
TYPES: BEGIN OF ty_pos,
numbertype(29) TYPE c,
number(29) TYPE c,
END OF ty_pos.
DATA: gt_pos TYPE STANDARD TABLE OF ty_pos,
gs_pos LIKE LINE OF gt_pos.
TYPES: BEGIN OF ty_struc,
city(29) TYPE c,
country(29) TYPE c,
name(29) TYPE c,
pos LIKE gt_pos,
END OF ty_struc.
DATA: gt_tab TYPE STANDARD TABLE OF ty_struc,
gs_tab LIKE LINE OF gt_tab.
The problem is that the system don't know the fields when I say
gs_tab-pos-number = 'test'.
How should I write the syntax therefore?
2009 Mar 05 10:23 AM
Hi,
Check the code
TYPES : BEGIN OF t_gr,
wrbtr TYPE ekbe-wrbtr,
menge TYPE ekbe-menge,
bwart TYPE ekbe-bwart,
END OF t_gr.
DATA : i_gr TYPE TABLE OF t_gr.
*
TYPES : BEGIN OF t_ekbe,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
*llggr LIKE i_gr,*
END OF t_ekbe.
DATA : i_ekbe TYPE TABLE OF t_ekbe.
SELECT ebeln
ebelp
wrbtr
FROM ekbe
INTO TABLE i_ekbe1
FOR ALL ENTRIES IN i_data1
WHERE ebeln = i_data1-ebeln AND
ebelp = i_data1-ebelp AND
bewtp = c_e AND
( bwart = c_101 OR
bwart = c_102 OR
bwart = c_103 OR
bwart = c_104 ).
loop at i_ekbe1 into wa_ekbe1.
wa_ekbe = wa_ekbe1.
wa_gr-wrbtr = wa_ekbe-wrbtr
append wa_gr to i_gr.
on change of wa_ekbe1-ebeln.
INSERT LINES OF i_gr INTO wa_ekbe-llggr INDEX 1.
APPEND wa_ekbe TO i_ekbe.
endon.
edloop.the above code the ekbe table is having one move itab l_gr
l_gr is updated in each loop and and each change the i_ekbe is updated with one set of l_gr data as internal table line for i_ekbe.
Here u need to refer each table seperately.
parent table(EKKO) line has the child tables(EKPO).
regards,
Nandha
Hi,
Check the code
TYPES : BEGIN OF t_gr,
wrbtr TYPE ekbe-wrbtr,
menge TYPE ekbe-menge,
bwart TYPE ekbe-bwart,
END OF t_gr.
DATA : i_gr TYPE TABLE OF t_gr.
*
TYPES : BEGIN OF t_ekbe,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
*llggr LIKE i_gr,*
END OF t_ekbe.
DATA : i_ekbe TYPE TABLE OF t_ekbe.
SELECT ebeln
ebelp
wrbtr
FROM ekbe
INTO TABLE i_ekbe1
FOR ALL ENTRIES IN i_data1
WHERE ebeln = i_data1-ebeln AND
ebelp = i_data1-ebelp AND
bewtp = c_e AND
( bwart = c_101 OR
bwart = c_102 OR
bwart = c_103 OR
bwart = c_104 ).
loop at i_ekbe1 into wa_ekbe1.
wa_ekbe = wa_ekbe1.
wa_gr-wrbtr = wa_ekbe-wrbtr
append wa_gr to i_gr.
on change of wa_ekbe1-ebeln.
INSERT LINES OF i_gr INTO wa_ekbe-llggr INDEX 1.
APPEND wa_ekbe TO i_ekbe.
endon.
edloop.the above code the ekbe table is having one move itab l_gr
l_gr is updated in each loop and and each change the i_ekbe is updated with one set of l_gr data as internal table line for i_ekbe.
Here u need to refer each table seperately.
parent table(EKKO) line has the child tables(EKPO).
regards,
Nandha
2009 Mar 05 10:22 AM
2009 Mar 05 10:23 AM
Hi,
Check the code
TYPES : BEGIN OF t_gr,
wrbtr TYPE ekbe-wrbtr,
menge TYPE ekbe-menge,
bwart TYPE ekbe-bwart,
END OF t_gr.
DATA : i_gr TYPE TABLE OF t_gr.
*
TYPES : BEGIN OF t_ekbe,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
*llggr LIKE i_gr,*
END OF t_ekbe.
DATA : i_ekbe TYPE TABLE OF t_ekbe.
SELECT ebeln
ebelp
wrbtr
FROM ekbe
INTO TABLE i_ekbe1
FOR ALL ENTRIES IN i_data1
WHERE ebeln = i_data1-ebeln AND
ebelp = i_data1-ebelp AND
bewtp = c_e AND
( bwart = c_101 OR
bwart = c_102 OR
bwart = c_103 OR
bwart = c_104 ).
loop at i_ekbe1 into wa_ekbe1.
wa_ekbe = wa_ekbe1.
wa_gr-wrbtr = wa_ekbe-wrbtr
append wa_gr to i_gr.
on change of wa_ekbe1-ebeln.
INSERT LINES OF i_gr INTO wa_ekbe-llggr INDEX 1.
APPEND wa_ekbe TO i_ekbe.
endon.
edloop.the above code the ekbe table is having one move itab l_gr
l_gr is updated in each loop and and each change the i_ekbe is updated with one set of l_gr data as internal table line for i_ekbe.
Here u need to refer each table seperately.
parent table(EKKO) line has the child tables(EKPO).
regards,
Nandha
2009 Mar 05 10:33 AM
Hi Dude,
Use this..
TYPES: BEGIN OF ty_pos,
numbertype(29) TYPE c,
number(29) TYPE c,
END OF ty_pos.
data : gt_pos type ty_pos,
gs_pos like gt_pos .
TYPES: BEGIN OF ty_struc,
city(29) TYPE c,
country(29) TYPE c,
name(29) TYPE c,
pos like gs_pos,
END OF ty_struc.
data : gt_tab type ty_struc,
gs_tab like gt_tab.
break-point.
gs_tab-pos-number = 'test'.
write : gs_tab-pos-number.
2009 Mar 05 10:37 AM
Hi,
I am not understood why ur checking like gs_tab-pos-number = 'test'. Number field should be
gs_pos-number = 'test'.
Regards
Md.MahaboobKhan
2009 Mar 05 10:39 AM
number field is also in my structure gs_tab as I inlude it in the field pos
2009 Mar 05 10:41 AM
I cannot use this mentioned statement as I want that field pos in gt_tab is an internal table
TYPES: BEGIN OF ty_struc,
city(29) TYPE c,
country(29) TYPE c,
name(29) TYPE c,
pos like gs_pos,
END OF ty_struc.
with this statement pos is only a structure and not an internal table within an internal table
2009 Mar 05 10:48 AM
Hi,
Declare
Pos like gs_pos
TYPES: BEGIN OF ty_pos,
numbertype(29) TYPE c,
number(29) TYPE c,
END OF ty_pos.
DATA: gt_pos TYPE STANDARD TABLE OF ty_pos,
gs_pos LIKE LINE OF gt_pos.
TYPES: BEGIN OF ty_struc,
city(29) TYPE c,
country(29) TYPE c,
name(29) TYPE c,
pos LIKE gs_pos, " Change here
END OF ty_struc.
DATA: gt_tab TYPE STANDARD TABLE OF ty_struc,
gs_tab LIKE LINE OF gt_tab.
gs_tab-pos-number = 'test'.it works now.
thanks|
Mahesh
2009 Mar 05 10:59 AM
Hi,
Here work area gs_tab corresponds to the table gt_tab, which corresponds to the structure ty_struc and this structure doesnt contain POS_NUMBER.
define POS_NUMBER in strucute ty_struc than only wont get error.
Cheers,
Rudhir
2009 Mar 05 11:20 AM
2009 Mar 05 1:14 PM
is it not possible that I can define pos as an internal table within an internal table to read the several fields of pos like number?
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |